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
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

QR Code: URL of current page
QR Code: URL of current page howto:python_qt_pyqt_vtk_no_macosx (generated for current page)