output a printable file by capturing the contents of the view
group+OPort GDoutput_templ {
int type; /* used to specify unique virtual functions */
};
GDoutput_templ GDprt_output_templ {
string file;
int format;
int backgroundType;
int orientation;
int size;
float widthMM;
float heightMM;
int resolution;
float fromRatio;
method+notify_inst init = "GDprt_output_create";
method+notify_deinst delete = "GDprt_output_delete";
method+notify_val update = "GDprt_output_update";
};
GDprt_output_templ GDprt_output {
ptr+nonotify+nosave local_ptr;
};
group OutputPrintFuncs {
int type = 2;
func+virtual output_init = "GDprt_output_init";
func+virtual output_done = "GDprt_output_done";
};
GDprt_output DefaultPrtOutput {
type = 2;
file = "/tmp/express.ps";
format = 0;
backgroundType = 0;
orientation = 0;
size = 1;
widthMM = 160;
heightMM = 120;
resolution = 500;
};
macro PrintViewer<NEiconName="viewer"> {
UIrenderView &fromRenderView
GDview_templ &view_in
...
DefaultPrtOutput Output {
fromRatio => (fromWidth / fromHeight);
};
...
};
These objects define print output. GDoutput_templ defines the template for all objects that produce output from a view. GDprt_output_templ defines the template for print output. It adds the subobjects unique to print output and defines the instance, update, and delete methods. OutputPrintFuncs defines the virtual methods unique to print output that are called during the render process that produces the printable file. PrintViewer is a macro that is meant to be instanced. It contains a user interface that appears in the Module Panel provided by the DataViewer or ModuleStack (as appropriate).
PrintViewer captures the contents of the view and writes it to a file suitable for printing. The PrintViewer module works together with the print renderer which is based on the software renderer. A number of the software renderer's view and primitive routines have been replaced in the print renderer. The process of capturing the contents of a view for printing is:
All objects in 3D cameras are rendered to the normal frame buffer and Z buffer. When all 3D cameras have been rendered, the contents of the frame buffer are written to a file. The size/resolution of this file is specifiable but is limited based on the amount of memory that is available on your system. The frame buffer and Z buffer result in 6 bytes per pixel being allocated.
All objects in 2D cameras are then rendered and captured at device resolution. The ouput is appended to the file.
A UIrender_view. This is the parent window for the view.
A view. The contents of the input view are captured and written to the specified file.
string. This parameter specifies the name of the file to which the output is written. If you type in the name directly without using the file browser then be sure to press return when you have finished entering the string.
Integer. This parameter specifies the file format: 0 means Postscript level 1; 1 means Color Postscript; 2 means Postscript level 2; 3 means CGM binary; 4 means CGM clear text; and 5 means CGM character encoding. CGM stands for Computer Graphics Metafile and is an international standard file format for storing 2D grahpics.
When using PostScript, it is highly desirable to select PostScript Level 2 if it is supported by your printer, since it produces much smaller files when 3D graphics or images are included.
Integer. This parameter controls the background color: 0 means force white background; 1 means force black background; and 2 means keep background.
Force white is a special since it causes the default color (referered to as the antibackground color) in the Annotation and Graphing Kit to change from white to black.
Integer. This parameter controls the orientation of the output file: 0 means landscape; 1 means portrait.
Integer. This parameter controls the size of the output file: 0 means User(EPS); 1 means A(Letter); 2 means B; 3 means A4; and 4 means A3.
Float. These parameters control the width and height of the output file in millimeters. These values are only used when User(EPS) is selected.
Integer. This parameter controls the number of pixels in the X direction of the 3D frame buffer. It is recommended that you use a high value only when the creating the final picture. Also, you should consider not going beyond 1/2 of the X resolution of the output device, since the gain in image quality is minimal. When not using PostScript level 2, the output file can take a long time to print since there is no image compression.
Float. This parameter specifies the aspect ratio of the view from which to make the print. This is automatically calculated from the input view and need not be specified.