This is an old revision of the document!
Instalando o ambiente do mini-curso de VTK no MACOSX
- Instalar o Python 2.7.3
- Rodar script de setar variaveis de ambiente:
/Applications/Python\ 2.7/Update\ Shell\ Profile.command
- Verificar a versão (Precisa retornar “Python 2.7.3”):
python --version
- Instalar o NumPy 1.6.2
- Instalar Qt 4.8.2
- Instalar PyQt (p/ Python 2.7.3 e Qt 4.8.2)
- Compilar VTK 5.10.0
tar -xzvf vtk-5.10.0.tar.gz mkdir VTK_cmake cd VTK_cmake cmake ../VTK -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DVTK_USE_COCOA=ON -DVTK_USE_QT=ON -DVTK_WRAP_PYTHON=ON -DVTK_QT_USE_WEBKIT=OFF -DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/2.7/bin/python -DPYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib -DPYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 make -j4 sudo make install cd Wrapping/Python python setup.py install
- Salvar o exemplo (clicar no nome do arquivo, abaixo):
- u4e1.py
import vtk source = vtk.vtkConeSource() mapper = vtk.vtkDataSetMapper() mapper.SetInput(source.GetOutput()) actor = vtk.vtkActor() actor.SetMapper(mapper) renderer = vtk.vtkRenderer() renderer.AddActor(actor) window = vtk.vtkRenderWindow() window.AddRenderer(renderer) interactor = vtk.vtkRenderWindowInteractor() interactor.SetRenderWindow(window) interactor.Initialize() interactor.Start()
- Rodar o exemplo
python u4e1.py
- Instalar o Eclipse 4.2.1
- Instalar Plugin PyDev no Eclipse, conforme Instruções