[vtkusers] vtkRenderWindow in Carbon OS X VTK
    Gordon Kindlmann 
    gk at cs.utah.edu
       
    Fri May  9 18:42:46 EDT 2003
    
    
  
hi,
I have built VTK for OS X (10.2.5, gcc 3.1), using Carbon instead of
Cocoa (the defaults), which solves the problem I previously wrote
about.  The amended details for how I built are below.
Now, however, I do not have a fully functioning vtkRenderWindow.
There are two problems:
1) I am creating the vtkRenderWindow as follows:
  vtkRenderer ren
  vtkRenderWindow renWin
     renWin AddRenderer ren
  vtkRenderWindowInteractor iren
     iren SetRenderWindow renWin
For the full context, I'm using this program:
  <http://www.sci.utah.edu/~gk/tmp/simplestiso.tcl>
on this dataset:
  <http://www.sci.utah.edu/~gk/tmp/sphere-ascii.vtk>
invoked as:
  vtk simplestiso.tcl sphere-ascii.vtk
I can click inside the vtkRenderWindow, and I can enjoy the
ever-useful "joystick" interaction mode of spinning things around.
I would like to change to trackball mode, so I type "t".
But no; with every keypress I get:
  tkin == NULL, 274
  tkin == NULL, 274
and there is no change in the interaction mode.
What's going on?
2) Pre-version 4.2, you could enforce the trackball interaction style
from within the TCL script, so that you never had to press "t", with
the following incantation:
  vtkRenderer ren
  vtkRenderWindow renWin
     renWin AddRenderer ren
  vtkInteractorStyleTrackball style
     style SetTrackballModeToTrackball
  vtkRenderWindowInteractor iren
     iren SetRenderWindow renWin
     iren SetInteractorStyle style
With 4.2.2, however, I get warning messages about having to use
"vtkInteracterStyleSwitch".  I honestly can not figure out what
combination of vtkInteracterStyleSwitch, vtkInteracterObserver, etc.
is required to replicate the effect of the above pre-4.2 code.
Thanks for any help,
Gordon
1) got <http://www.cmake.org/files/cmake-1.6.6-darwin.tar.gz> and
following directions in README, putting binaries /usr/local, and made
sure that "which cmake" returned /usr/local/bin/cmake
2) got <ftp://public.kitware.com/pub/vtk/vtk4.2/VTK-4.2-LatestRelease.tar.gz>
and put it in ~/vtk.
3) cd ~/vtk
   mkdir build
   tar xzvf VTK-4.2-LatestRelease.tar.gz
   cd VTK-4.2.2
   ccmake
      changed CMAKE_INSTALL_PREFIX to /Users/gk/vtk/build
      changed VTK_WRAP_TCL to ON
      typed "c"
      typed "c"
      typed "g"
   make
4) An hour later...
Building object file vtkCocoaRenderWindowInteractorTcl.o...
Building object file vtkCocoaRenderWindowTcl.o...
Building static library /Users/gk/vtk/VTK-4.2.2/bin/libvtkRenderingTCL.a...
/Users/gk/vtk/VTK-4.2.2/Rendering/tkInternals: building default_target
Building dependencies. cmake.depends...
cmake.depends is up-to-date
/Users/gk/vtk/VTK-4.2.2/Rendering/tkInternals/tk84: building default_target
Building dependencies. cmake.depends...
cmake.depends is up-to-date
/Users/gk/vtk/VTK-4.2.2/Rendering/tkInternals/tk84OSX: building default_target
Building dependencies. cmake.depends...
cmake.depends is up-to-date
/Users/gk/vtk/VTK-4.2.2/Wrapping/Tcl: building default_target
Building dependencies. cmake.depends...
Building object file vtkTkAppInit.o...
Building executable /Users/gk/vtk/VTK-4.2.2/bin/vtk...
ld: /Users/gk/vtk/VTK-4.2.2/bin/libvtkpng.a(png.o) illegal reference to symbol: _crc32 defined in indirectly referenced dynamic library /usr/lib/libz.1.1.3.dylib
make[3]: *** [/Users/gk/vtk/VTK-4.2.2/bin/vtk] Error 1
make[2]: *** [default_target] Error 2
make[1]: *** [default_target_Wrapping_Tcl] Error 2
make: *** [default_target] Error 2
5) ccmake
      changed VTK_USE_SYSTEM_PNG to ON
      "c"
      it complained about PNG_blah_blah not found, "e"
      changed PNG_LIBRARY to /sw/lib/libpng.a
      changed PNG_PNG_INCLUDE_IDR /sw/include
      "c"
      "c"  (for good measure)
      "g"
   make
   make install
   cd ../build/bin
   setenv PATH ${PATH}:`pwd`
   cd
   which vtk
    
    
More information about the vtkusers
mailing list