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.