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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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'
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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
;-) 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.
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!
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
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!
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