The vectorized printing classes are for rendering to vector devices instead of raster devices.
More...
The vectorized printing classes are for rendering to vector devices instead of raster devices.
You can use this to e.g. generate scalable PostScript images for printing instead of raster images that will become pixellated when you scale them up.
The main API for HardCopy support in Coin is the abstract class
SoVectorizeAction.
SoVectorizeAction will extract geometry from an Inventor scene graph, and project the geometry onto a specified page. Since postscript and other vector based file formats do not support z-buffer or depth clipping, all geometry is rendered using a simple painter's algorithm (geometry is sorted based on distance to camera).
SoVectorizePSAction inherits
SoVectorizeAction, and will output a Postscript file.Texture-mapped polygons are not supported, since this is not supported by the vector file formats, at least it's not supported in Postscript. Gouraud shading is not supported in the Postscript language (at least not for V2.0), but an approximation is implemeting using an algorithm that divides the triangle into several small (flat-shaded) triangles. The gouraud shading quality (the number of sub-triangles) is controlled by an epsilon value. The gouraud shading function is written by Frederic Delhoume (delhoume (at) ilog.fr), and is free (public domain) software.Typical use of
SoVectorizePSAction is shown in the following piece of code:
return -1;
}
ps->
apply(viewer->getSceneManager()->getSceneGraph());
delete ps;
The SbColor class contains the red, green and blue components which make up a color value.
Definition SbColor.h:39
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:49
The SoVectorOutput class is used for setting vector output file.
Definition SoVectorOutput.h:43
virtual void closeFile(void)
Definition VectorOutput.cpp:110
virtual SbBool openFile(const char *filename)
Definition VectorOutput.cpp:94
virtual void apply(SoNode *node)
Definition VectorizeAction.cpp:240
virtual void setBackgroundColor(SbBool bg, const SbColor &col=SbColor(0.0f, 0.0f, 0.0f))
Definition VectorizeAction.cpp:394
virtual void beginPage(const SbVec2f &startpagepos, const SbVec2f &pagesize, DimensionUnit u=MM)
Definition VectorizeAction.cpp:266
virtual void endPage(void)
Definition VectorizeAction.cpp:296
virtual void setOrientation(Orientation o)
Definition VectorizeAction.cpp:371
virtual void calibrate(const SbViewportRegion &vp)
Definition VectorizeAction.cpp:360
The SoVectorizePSAction class is used for rendering to a Postscript file.
Definition SoVectorizePSAction.h:45
SoPSVectorOutput * getOutput(void) const
Definition VectorizePSAction.cpp:190
It is also possible to have several viewports and/or layers on a page. This is useful if your application has several layers of geometry, for instance some annotations in 2D on top of a 3D scene graph. To create several layers, the beginViewport() and endViewport() functions can be used.
- Since
- Coin 2.1
-
TGS provides HardCopy support as a separate extension for TGS Inventor.