Menu

Suggested CMAKE_VARIABLES for VTK

Help
2006-11-30
2013-04-22
  • Troy Henderson

    Troy Henderson - 2006-11-30

    Can someone suggest a list of CMAKE_VARIABLES for VTK that will provide complete functionality in Octaviz?  I recently discovered that I needed

    -DVTK_USE_GL2PS:BOOL=ON

    in order to print to PS/PDF.  However, I've noted several other things (like turning the axis off) don't work.  Perhaps this is controlled by something in VTK that I don't have built in.

    I would appreciate a list of these options if they're available.

    Thanks!

     
    • Jonathan Boan

      Jonathan Boan - 2006-12-01

      G'day

      I believe the 'axis off' problem is to do with the fact that the 'vtk_axis.m' script is only for 3D axes. It uses the vtkCubeAxisActor2D class, as seen under fig.axes.

      When using vtk_plot.m for 2D graph plots it actually doesn't use fig.axes for drawing but a different vtk class vtkXYPlotActor embedded in the fig.renderer item list.
      So to have control of the 2D plotting try this

      hope that helps.
      Jonathan

      Note to adjust anything in the 2D plotter you should access the vtkXYPlotActor object.

      function vtk_XYaxisoff()

        ##Get the most current figure
        f=vtk_figure(0);
       
        ##Get the number of 'Actor's in the rendering scene
        nprops = f.renderer.GetViewProps().GetNumberOfItems();
        for i = 0:nprops-1
          ## Cycle through until you find the XY plotter -> vtkXYPlotActor
          if (f.renderer.GetViewProps().GetItemAsObject(i).IsA("vtkXYPlotActor"))
            ##Found the vtkXYPlotActor
            ##Reference to local variable for convenience
            xyplot = f.renderer.GetViewProps().GetItemAsObject(i);
           
            ##X Axis
            xaxis = xyplot.GetXAxisActor2D();
            xaxis.AxisVisibilityOff(); ##Axis line - Comment this line if you want to keep the line
            xaxis.LabelVisibilityOff();##Axis numbers
            xaxis.TickVisibilityOff(); ##Axis ticks for the numbers
            xaxis.TitleVisibilityOff();##Axis label 'X Axis'
           
            ##YAxis
            yaxis = xyplot.GetYAxisActor2D();
            yaxis.AxisVisibilityOff();
            yaxis.LabelVisibilityOff();
            yaxis.TickVisibilityOff();
            yaxis.TitleVisibilityOff();
         
            break # Only want to change the first vtkXYPlotActor
            ##Remove this if desired.
          endif
        endfor

        vtk_update(f);

      endfunction

       
    • Troy Henderson

      Troy Henderson - 2006-12-01

      Thanks for the reply.  Actually, it is a 3D figure.  It is generated by:

      octave:1> x=rand(1,10000);
      octave:2> y=rand(1,10000);
      octave:3> z=sin(pi*x).*sin(pi*y);
      octave:4> tri=delaunay(x,y);
      octave:5> vtk_trisurf(tri,x,y,z);

      After issuing:

      octave:6> vtk_axis(false)

      I get the following error(s):

      error: invalid vector index = 2
      error: evaluating argument list element number 1
      error: called from `vtk_axis:clipaxes' in file `/usr/share/octave/2.1.72/site/m/octaviz/vtk_axis.m'
      error: evaluating assignment expression near line 162, column 14
      error: evaluating for command near line 155, column 7
      error: evaluating if command near line 59, column 5
      error: evaluating for command near line 56, column 3
      error: called from `vtk_axis' in file `/usr/share/octave/2.1.72/site/m/octaviz/vtk_axis.m'

      I hope this helps for troubleshooting.

      Thanks!

       
    • Jonathan Stickel

      Try

      > help vtk_axis

      Then,

      > vtk_axis("off")

      ;-)  I try to provide useful help messages for the octaviz functions.  If you find something is missing or incorrect, please let us know, or even better, provide a patch.

      As for VTK cmake variables, I am currently using:

      DCMAKE_SKIP_RPATH:BOOL=YES
      DBUILD_SHARED_LIBS:BOOL=ON
      DVTK_USE_GL2PS:BOOL=ON
      DVTK_USE_SYSTEM_JPEG:BOOL=ON
      DVTK_USE_SYSTEM_PNG:BOOL=ON
      DVTK_USE_SYSTEM_TIFF:BOOL=ON
      DVTK_USE_SYSTEM_ZLIB:BOOL=ON
      DVTK_USE_SYSTEM_EXPAT:BOOL=ON
      DBUILD_TESTING:BOOL=OFF
      DVTK_USE_HYBRID:BOOL=ON

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.