FreeMat: vtkGL2PSExporter

FreeMat

- Main Page
- Related Pages

vtkGL2PSExporter

Section: Visualization Toolkit Rendering Classes

# Usage

vtkGL2PSExporter is a concrete subclass of vtkExporter that writes high quality vector PostScript (PS/EPS), PDF or SVG files by using GL2PS. GL2PS can be obtained at: http://www.geuz.org/gl2ps/. This can be very useful when one requires publication quality pictures. This class works best with simple 3D scenes and most 2D plots. Please note that GL2PS has its limitations since PostScript is not an ideal language to represent complex 3D scenes. However, this class does allow one to write mixed vector/raster files by using the Write3DPropsAsRasterImage ivar. Please do read the caveats section of this documentation.

By default vtkGL2PSExporter generates Encapsulated PostScript (EPS) output along with the text in portrait orientation with the background color of the window being drawn. The generated output is also compressed using zlib. The various other options are set to sensible defaults.

The output file format (FileFormat) can be either PostScript (PS), Encapsulated PostScript (EPS), PDF, SVG or TeX. The file extension is generated automatically depending on the FileFormat. The default is EPS. When TeX output is chosen, only the text strings in the plot are generated and put into a picture environment. One can turn on and off the text when generating PS/EPS/PDF/SVG files by using the Text boolean variable. By default the text is drawn. The background color of the renderwindow is drawn by default. To make the background white instead use the DrawBackgroundOff function. Landscape figures can be generated by using the LandscapeOn function. Portrait orientation is used by default. Several of the GL2PS options can be set. The names of the ivars for these options are similar to the ones that GL2PS provides. Compress, SimpleLineOffset, Silent, BestRoot, PS3Shading and OcclusionCull are similar to the options provided by GL2PS. Please read the function documentation or the GL2PS documentation for more details. The ivar Write3DPropsAsRasterImage allows one to generate mixed vector/raster images. All the 3D props in the scene will be written as a raster image and all 2D actors will be written as vector graphic primitives. This makes it possible to handle transparency and complex 3D scenes. This ivar is set to Off by default. When drawing lines and points the OpenGL point size and line width are multiplied by a factor in order to generate PostScript lines and points of the right size. The Get/SetGlobalPointSizeFactor and Get/SetGlobalLineWidthFactor let one customize this ratio. The default value is such that the PostScript output looks close to what is seen on screen.

To use this class you need to turn on VTK_USE_GL2PS when configuring VTK.

To create an instance of class vtkGL2PSExporter, simply invoke its constructor as follows

      obj = vtkGL2PSExporter

# Methods

The class vtkGL2PSExporter has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkGL2PSExporter class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkGL2PSExporter = obj.NewInstance ()`
- `vtkGL2PSExporter = obj.SafeDownCast (vtkObject o)`
- `obj.SetFilePrefix (string )` - Specify the prefix of the files to write out. The resulting filenames will have .ps or .eps or .tex appended to them depending on the other options chosen.
- `string = obj.GetFilePrefix ()` - Specify the prefix of the files to write out. The resulting filenames will have .ps or .eps or .tex appended to them depending on the other options chosen.
- `obj.SetFileFormat (int )` - Specify the format of file to write out. This can be one of: PS_FILE, EPS_FILE, PDF_FILE, TEX_FILE. Defaults to EPS_FILE. Depending on the option chosen it generates the appropriate file (with correct extension) when the Write function is called.
- `int = obj.GetFileFormatMinValue ()` - Specify the format of file to write out. This can be one of: PS_FILE, EPS_FILE, PDF_FILE, TEX_FILE. Defaults to EPS_FILE. Depending on the option chosen it generates the appropriate file (with correct extension) when the Write function is called.
- `int = obj.GetFileFormatMaxValue ()` - Specify the format of file to write out. This can be one of: PS_FILE, EPS_FILE, PDF_FILE, TEX_FILE. Defaults to EPS_FILE. Depending on the option chosen it generates the appropriate file (with correct extension) when the Write function is called.
- `int = obj.GetFileFormat ()` - Specify the format of file to write out. This can be one of: PS_FILE, EPS_FILE, PDF_FILE, TEX_FILE. Defaults to EPS_FILE. Depending on the option chosen it generates the appropriate file (with correct extension) when the Write function is called.
- `obj.SetFileFormatToPS ()` - Specify the format of file to write out. This can be one of: PS_FILE, EPS_FILE, PDF_FILE, TEX_FILE. Defaults to EPS_FILE. Depending on the option chosen it generates the appropriate file (with correct extension) when the Write function is called.
- `obj.SetFileFormatToEPS ()` - Specify the format of file to write out. This can be one of: PS_FILE, EPS_FILE, PDF_FILE, TEX_FILE. Defaults to EPS_FILE. Depending on the option chosen it generates the appropriate file (with correct extension) when the Write function is called.
- `obj.SetFileFormatToPDF ()` - Specify the format of file to write out. This can be one of: PS_FILE, EPS_FILE, PDF_FILE, TEX_FILE. Defaults to EPS_FILE. Depending on the option chosen it generates the appropriate file (with correct extension) when the Write function is called.
- `obj.SetFileFormatToTeX ()` - Specify the format of file to write out. This can be one of: PS_FILE, EPS_FILE, PDF_FILE, TEX_FILE. Defaults to EPS_FILE. Depending on the option chosen it generates the appropriate file (with correct extension) when the Write function is called.
- `obj.SetFileFormatToSVG ()` - Specify the format of file to write out. This can be one of: PS_FILE, EPS_FILE, PDF_FILE, TEX_FILE. Defaults to EPS_FILE. Depending on the option chosen it generates the appropriate file (with correct extension) when the Write function is called.
- `string = obj.GetFileFormatAsString ()` - Specify the format of file to write out. This can be one of: PS_FILE, EPS_FILE, PDF_FILE, TEX_FILE. Defaults to EPS_FILE. Depending on the option chosen it generates the appropriate file (with correct extension) when the Write function is called.
- `obj.SetSort (int )` - Set the the type of sorting algorithm to order primitives from back to front. Successive algorithms are more memory intensive. Simple is the default but BSP is perhaps the best.
- `int = obj.GetSortMinValue ()` - Set the the type of sorting algorithm to order primitives from back to front. Successive algorithms are more memory intensive. Simple is the default but BSP is perhaps the best.
- `int = obj.GetSortMaxValue ()` - Set the the type of sorting algorithm to order primitives from back to front. Successive algorithms are more memory intensive. Simple is the default but BSP is perhaps the best.
- `int = obj.GetSort ()` - Set the the type of sorting algorithm to order primitives from back to front. Successive algorithms are more memory intensive. Simple is the default but BSP is perhaps the best.
- `obj.SetSortToOff ()` - Set the the type of sorting algorithm to order primitives from back to front. Successive algorithms are more memory intensive. Simple is the default but BSP is perhaps the best.
- `obj.SetSortToSimple ()` - Set the the type of sorting algorithm to order primitives from back to front. Successive algorithms are more memory intensive. Simple is the default but BSP is perhaps the best.
- `obj.SetSortToBSP ()` - Set the the type of sorting algorithm to order primitives from back to front. Successive algorithms are more memory intensive. Simple is the default but BSP is perhaps the best.
- `string = obj.GetSortAsString ()` - Set the the type of sorting algorithm to order primitives from back to front. Successive algorithms are more memory intensive. Simple is the default but BSP is perhaps the best.
- `obj.SetCompress (int )` - Turn on/off compression when generating PostScript or PDF output. By default compression is on.
- `int = obj.GetCompress ()` - Turn on/off compression when generating PostScript or PDF output. By default compression is on.
- `obj.CompressOn ()` - Turn on/off compression when generating PostScript or PDF output. By default compression is on.
- `obj.CompressOff ()` - Turn on/off compression when generating PostScript or PDF output. By default compression is on.
- `obj.SetDrawBackground (int )` - Turn on/off drawing the background frame. If off the background is treated as white. By default the background is drawn.
- `int = obj.GetDrawBackground ()` - Turn on/off drawing the background frame. If off the background is treated as white. By default the background is drawn.
- `obj.DrawBackgroundOn ()` - Turn on/off drawing the background frame. If off the background is treated as white. By default the background is drawn.
- `obj.DrawBackgroundOff ()` - Turn on/off drawing the background frame. If off the background is treated as white. By default the background is drawn.
- `obj.SetSimpleLineOffset (int )` - Turn on/off the GL2PS_SIMPLE_LINE_OFFSET option. When enabled a small offset is added in the z-buffer to all the lines in the plot. This results in an anti-aliasing like solution. Defaults to on.
- `int = obj.GetSimpleLineOffset ()` - Turn on/off the GL2PS_SIMPLE_LINE_OFFSET option. When enabled a small offset is added in the z-buffer to all the lines in the plot. This results in an anti-aliasing like solution. Defaults to on.
- `obj.SimpleLineOffsetOn ()` - Turn on/off the GL2PS_SIMPLE_LINE_OFFSET option. When enabled a small offset is added in the z-buffer to all the lines in the plot. This results in an anti-aliasing like solution. Defaults to on.
- `obj.SimpleLineOffsetOff ()` - Turn on/off the GL2PS_SIMPLE_LINE_OFFSET option. When enabled a small offset is added in the z-buffer to all the lines in the plot. This results in an anti-aliasing like solution. Defaults to on.
- `obj.SetSilent (int )` - Turn on/off GL2PS messages sent to stderr (GL2PS_SILENT). When enabled GL2PS messages are suppressed. Defaults to off.
- `int = obj.GetSilent ()` - Turn on/off GL2PS messages sent to stderr (GL2PS_SILENT). When enabled GL2PS messages are suppressed. Defaults to off.
- `obj.SilentOn ()` - Turn on/off GL2PS messages sent to stderr (GL2PS_SILENT). When enabled GL2PS messages are suppressed. Defaults to off.
- `obj.SilentOff ()` - Turn on/off GL2PS messages sent to stderr (GL2PS_SILENT). When enabled GL2PS messages are suppressed. Defaults to off.
- `obj.SetBestRoot (int )` - Turn on/off the GL2PS_BEST_ROOT option. When enabled the construction of the BSP tree is optimized by choosing the root primitives leading to the minimum number of splits. Defaults to on.
- `int = obj.GetBestRoot ()` - Turn on/off the GL2PS_BEST_ROOT option. When enabled the construction of the BSP tree is optimized by choosing the root primitives leading to the minimum number of splits. Defaults to on.
- `obj.BestRootOn ()` - Turn on/off the GL2PS_BEST_ROOT option. When enabled the construction of the BSP tree is optimized by choosing the root primitives leading to the minimum number of splits. Defaults to on.
- `obj.BestRootOff ()` - Turn on/off the GL2PS_BEST_ROOT option. When enabled the construction of the BSP tree is optimized by choosing the root primitives leading to the minimum number of splits. Defaults to on.
- `obj.SetText (int )` - Turn on/off drawing the text. If on (default) the text is drawn. If the FileFormat is set to TeX output then a LaTeX picture is generated with the text strings. If off text output is suppressed.
- `int = obj.GetText ()` - Turn on/off drawing the text. If on (default) the text is drawn. If the FileFormat is set to TeX output then a LaTeX picture is generated with the text strings. If off text output is suppressed.
- `obj.TextOn ()` - Turn on/off drawing the text. If on (default) the text is drawn. If the FileFormat is set to TeX output then a LaTeX picture is generated with the text strings. If off text output is suppressed.
- `obj.TextOff ()` - Turn on/off drawing the text. If on (default) the text is drawn. If the FileFormat is set to TeX output then a LaTeX picture is generated with the text strings. If off text output is suppressed.
- `obj.SetLandscape (int )` - Turn on/off landscape orientation. If off (default) the orientation is set to portrait.
- `int = obj.GetLandscape ()` - Turn on/off landscape orientation. If off (default) the orientation is set to portrait.
- `obj.LandscapeOn ()` - Turn on/off landscape orientation. If off (default) the orientation is set to portrait.
- `obj.LandscapeOff ()` - Turn on/off landscape orientation. If off (default) the orientation is set to portrait.
- `obj.SetPS3Shading (int )` - Turn on/off the GL2PS_PS3_SHADING option. When enabled the shfill PostScript level 3 operator is used. Read the GL2PS documentation for more details. Defaults to on.
- `int = obj.GetPS3Shading ()` - Turn on/off the GL2PS_PS3_SHADING option. When enabled the shfill PostScript level 3 operator is used. Read the GL2PS documentation for more details. Defaults to on.
- `obj.PS3ShadingOn ()` - Turn on/off the GL2PS_PS3_SHADING option. When enabled the shfill PostScript level 3 operator is used. Read the GL2PS documentation for more details. Defaults to on.
- `obj.PS3ShadingOff ()` - Turn on/off the GL2PS_PS3_SHADING option. When enabled the shfill PostScript level 3 operator is used. Read the GL2PS documentation for more details. Defaults to on.
- `obj.SetOcclusionCull (int )` - Turn on/off culling of occluded polygons (GL2PS_OCCLUSION_CULL). When enabled hidden polygons are removed. This reduces file size considerably. Defaults to on.
- `int = obj.GetOcclusionCull ()` - Turn on/off culling of occluded polygons (GL2PS_OCCLUSION_CULL). When enabled hidden polygons are removed. This reduces file size considerably. Defaults to on.
- `obj.OcclusionCullOn ()` - Turn on/off culling of occluded polygons (GL2PS_OCCLUSION_CULL). When enabled hidden polygons are removed. This reduces file size considerably. Defaults to on.
- `obj.OcclusionCullOff ()` - Turn on/off culling of occluded polygons (GL2PS_OCCLUSION_CULL). When enabled hidden polygons are removed. This reduces file size considerably. Defaults to on.
- `obj.SetWrite3DPropsAsRasterImage (int )` - Turn on/off writing 3D props as raster images. 2D props are rendered using vector graphics primitives. If you have hi-res actors and are using transparency you probably need to turn this on. Defaults to Off.
- `int = obj.GetWrite3DPropsAsRasterImage ()` - Turn on/off writing 3D props as raster images. 2D props are rendered using vector graphics primitives. If you have hi-res actors and are using transparency you probably need to turn this on. Defaults to Off.
- `obj.Write3DPropsAsRasterImageOn ()` - Turn on/off writing 3D props as raster images. 2D props are rendered using vector graphics primitives. If you have hi-res actors and are using transparency you probably need to turn this on. Defaults to Off.
- `obj.Write3DPropsAsRasterImageOff ()` - Turn on/off writing 3D props as raster images. 2D props are rendered using vector graphics primitives. If you have hi-res actors and are using transparency you probably need to turn this on. Defaults to Off.