FreeMat

- Main Page
- Related Pages

vtkCGMWriter

Section: Visualization Toolkit IO Classes

# Usage

vtkCGMWriter writes CGM (Computer Graphics Metafile) output. CGM is a 2D graphics vector format typically used by large plotters. This writer can handle vertices, lines, polygons, and triangle strips in any combination. Colors are specified either 1) from cell scalars (assumed to be RGB or RGBA color specification), 2) from a specified color; or 3) randomly assigned colors.

Note: During output of the polygonal data, triangle strips are converted to triangles, and polylines to lines. Also, due to limitations in the CGM color model, only 256 colors are available to the color palette.

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

      obj = vtkCGMWriter

# Methods

The class vtkCGMWriter 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 vtkCGMWriter class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkCGMWriter = obj.NewInstance ()`
- `vtkCGMWriter = obj.SafeDownCast (vtkObject o)`
- `obj.SetViewport (vtkViewport )` - Specify a vtkViewport object to be used to transform the vtkPolyData points into 2D coordinates. By default (no vtkViewport specified), the point coordinates are generated by ignoring the z values. If a viewport is defined, then the points are transformed into viewport coordinates.
- `vtkViewport = obj.GetViewport ()` - Specify a vtkViewport object to be used to transform the vtkPolyData points into 2D coordinates. By default (no vtkViewport specified), the point coordinates are generated by ignoring the z values. If a viewport is defined, then the points are transformed into viewport coordinates.
- `obj.SetSort (int )` - Turn on/off the sorting of the cells via depth. If enabled, polygonal cells will be sorted from back to front, i.e., a Painter's algorithm sort.
- `int = obj.GetSort ()` - Turn on/off the sorting of the cells via depth. If enabled, polygonal cells will be sorted from back to front, i.e., a Painter's algorithm sort.
- `obj.SetResolution (int )` - Specify the resolution of the CGM file. This number is used to integerize the maximum coordinate range of the plot file.
- `int = obj.GetResolutionMinValue ()` - Specify the resolution of the CGM file. This number is used to integerize the maximum coordinate range of the plot file.
- `int = obj.GetResolutionMaxValue ()` - Specify the resolution of the CGM file. This number is used to integerize the maximum coordinate range of the plot file.
- `int = obj.GetResolution ()` - Specify the resolution of the CGM file. This number is used to integerize the maximum coordinate range of the plot file.
- `obj.SetColorMode (int )` - Control how output polydata is colored. By default (ColorModeToDefault), if per cell colors are defined (unsigned chars of 1-4 components), then the cells are colored with these values. (If point colors are defined and cell colors are not, you can use vtkPointDataToCellData to convert the point colors to cell colors.) Otherwise, by default, the cells are set to the specified color. If ColorModeToSpecifiedColor is set, then the primitives will all be set to this color. If ColorModeToRandomColors is set, each cell will be randomly assigned a color.
- `int = obj.GetColorMode ()` - Control how output polydata is colored. By default (ColorModeToDefault), if per cell colors are defined (unsigned chars of 1-4 components), then the cells are colored with these values. (If point colors are defined and cell colors are not, you can use vtkPointDataToCellData to convert the point colors to cell colors.) Otherwise, by default, the cells are set to the specified color. If ColorModeToSpecifiedColor is set, then the primitives will all be set to this color. If ColorModeToRandomColors is set, each cell will be randomly assigned a color.
- `obj.SetColorModeToDefault ()` - Control how output polydata is colored. By default (ColorModeToDefault), if per cell colors are defined (unsigned chars of 1-4 components), then the cells are colored with these values. (If point colors are defined and cell colors are not, you can use vtkPointDataToCellData to convert the point colors to cell colors.) Otherwise, by default, the cells are set to the specified color. If ColorModeToSpecifiedColor is set, then the primitives will all be set to this color. If ColorModeToRandomColors is set, each cell will be randomly assigned a color.
- `obj.SetColorModeToSpecifiedColor ()` - Control how output polydata is colored. By default (ColorModeToDefault), if per cell colors are defined (unsigned chars of 1-4 components), then the cells are colored with these values. (If point colors are defined and cell colors are not, you can use vtkPointDataToCellData to convert the point colors to cell colors.) Otherwise, by default, the cells are set to the specified color. If ColorModeToSpecifiedColor is set, then the primitives will all be set to this color. If ColorModeToRandomColors is set, each cell will be randomly assigned a color.
- `obj.SetColorModeToRandomColors ()` - Control how output polydata is colored. By default (ColorModeToDefault), if per cell colors are defined (unsigned chars of 1-4 components), then the cells are colored with these values. (If point colors are defined and cell colors are not, you can use vtkPointDataToCellData to convert the point colors to cell colors.) Otherwise, by default, the cells are set to the specified color. If ColorModeToSpecifiedColor is set, then the primitives will all be set to this color. If ColorModeToRandomColors is set, each cell will be randomly assigned a color.
- `obj.SetSpecifiedColor (float , float , float )` - Set/Get the specified color to color the polydata cells. This color is only used when the color mode is set to ColorModeToSpecifiedColor, or ColorModeToDefault is set and no cell colors are specified. The specified color is specified as RGB values ranging from (0,1). (Note: CGM will map this color to the closest color it supports.)
- `obj.SetSpecifiedColor (float a[3])` - Set/Get the specified color to color the polydata cells. This color is only used when the color mode is set to ColorModeToSpecifiedColor, or ColorModeToDefault is set and no cell colors are specified. The specified color is specified as RGB values ranging from (0,1). (Note: CGM will map this color to the closest color it supports.)
- `float = obj. GetSpecifiedColor ()` - Set/Get the specified color to color the polydata cells. This color is only used when the color mode is set to ColorModeToSpecifiedColor, or ColorModeToDefault is set and no cell colors are specified. The specified color is specified as RGB values ranging from (0,1). (Note: CGM will map this color to the closest color it supports.)