From: Jonathan S. <jjs...@us...> - 2005-07-07 23:42:36
|
Update of /cvsroot/octaviz/octaviz/Scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16948 Added Files: vtk_blackonwhite.m vtk_colorbar.m Removed Files: vtk_scalarbar.m Log Message: rename scalarbar, new function to use white background --- vtk_scalarbar.m DELETED --- --- NEW FILE: vtk_blackonwhite.m --- ## Copyright (C) 2004 Dragan Tubic ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this file. If not, write to the Free Software Foundation, ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## -*- texinfo -*- ## @deftypefn {Function File} {} vtk_blackonwhite() ## Changes the background to be white with black axes and outline. To ## change the color of the background and axes to something else, please ## refer to the source code of this function. ## @end deftypefn ## Author: Jonathan Stickel function vtk_blackonwhite() f=vtk_figure(0); f.renderer.SetBackground(1,1,1) f.outline_actor.GetProperty.SetColor(0,0,0) f.axes.GetProperty.SetColor(0,0,0) f.axes.GetAxisTitleTextProperty.SetColor(0,0,0) f.axes.GetAxisTitleTextProperty.ShadowOff vtk_update(f); endfunction --- NEW FILE: vtk_colorbar.m --- ## Copyright (C) 2004 Dragan Tubic ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this file. If not, write to the Free Software Foundation, ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## -*- texinfo -*- ## @deftypefn {Function File} {} vtk_colorbar(@var{string}) ## Adds a color scalar bar to the side of a vtk figure. The input ## @var{string} will be the title of the scalar bar. If ## @var{string}="remove", the bar will be removed. This is a work ## in progress. It doesn't update automatically (although it can be ## called again), and only works on the last actor rendered. ## @end deftypefn ## @seealso{vtk_title,vtk_clear} ## Author: Jonathan Stickel function vtk_colorbar(string) f=vtk_figure(0); ## clear existing bar, if it exists nprops = f.renderer.GetProps.GetNumberOfItems; for i = 0:nprops-1; if ( f.renderer.GetProps.GetItemAsObject(i).IsA("vtkScalarBarActor") ) f.renderer.RemoveViewProp( f.renderer.GetProps.GetItemAsObject(i) ); break endif endfor if ( !strcmp(string, "remove") ) scalarBar = vtkScalarBarActor; for i = f.renderer.GetActors.GetNumberOfItems-1:-1:0; mapper = f.renderer.GetActors.GetItemAsObject(i).GetMapper; ## a test to see if this actor is a real object (might be corner points generated in vtk_axis) if ( mapper.GetInput.GetNumberOfPolys ) ## will be zero if an unintersting actor scalarBar.SetLookupTable( mapper.GetLookupTable ); break endif endfor scalarBar.SetTitle( string ); scalarBar.GetPositionCoordinate.SetCoordinateSystemToNormalizedViewport; scalarBar.GetPositionCoordinate.SetValue(0.85, 0.05); scalarBar.SetWidth(0.15); scalarBar.SetHeight(0.9); scalarBar.SetLabelFormat("%1.2g"); f.renderer.AddActor2D(scalarBar); ## shadow unnecessary, and doesn't export to vector format correctly scalarBar.GetTitleTextProperty.ShadowOff scalarBar.GetLabelTextProperty.ShadowOff endif vtk_update(f); endfunction |