4.1.3. HardCopy Monitors

HardCopy also includes a set of “built-in” user interfaces for outputting your scene graph to a file, printer or plotter. Here is a complete list of these monitors:

Figure 4.3. HardCopy monitor classes


These monitors give your application an easy way to specify parameters relating to your PostScript, HPGL, or CGM output. For instance, this interface allows you to specify the size of your output, the number of pens of your plotter, the color of these pens, and more.

You can select which parameters you want the user to be able to access using setPrintFilter()method and specifying an inclusion mask and an exclusion mask. The appearance can also be changed using the setPresentation()method, same as with the MeshViz editors.

The scene graph part you want to print must also be specified using the setApply() method. You can specify a simple node, a path, or a list of paths.

[Warning]

You must include a camera in the scene graph passed to HardCopy in order to generate correct output. When the Open Inventor viewer automatically creates a camera (because none existed), this camera is not part of your application scene graph. So, if you only pass the application scene graph then the default view will be used. In general, it is safer to always pass the viewer’s scene graph. You can get the viewer’s scene graph, including the camera, as follows:

SoNode pVwrRoot = pViewer->getSceneManager()->getSceneGraph();

The following program (located in $OIVHOME/src/HardCopy/Mentor) creates a simple scene graph and then creates a monitor to output PostScript file:

Example 4.1. Use of HardCopy monitor