(saveScreenVector filename sort options colornr)
Command to save the currently active Graph in a vector graphics format, which will be determined by the file extension.
The used library GL2PS supports six formats so far:
PS The output stream will be in PostScript format.
EPS The output stream will be in Encapsulated PostScript format.
PDF The output stream will be in Portable Document Format.
TEX The output will be a LATEX file containing only the text strings of the plot (cf. section 2.2), as well as an \includegraphics command including a graphic file having the same basename as filename.1
GL2PS_SVG (Experimental) The output stream will be in Scalar Vector Graphics format.
GL2PS_PGF (Experimental) The output stream will be in Portable LaTeX Graphics format.
sort Specifies the sorting algorithm, chosen among:
GL2PS_NO_SORT The primitives are not sorted, and are output in stream in the order they appear in the feedback buffer. This is sufficient for two-dimensional scenes.
GL2PS_SIMPLE_SORT The primitives are sorted according to their barycenter. This can be sufficient for simple three-dimensional scenes and/or when correctness is not crucial.
GL2PS_BSP_SORT The primitives are inserted in a Binary Space Partition (BSP) tree. The tree is then traversed back to front in a painter-like algorithm. This should be used whenever an accurate rendering of a three-dimensional scene is sought. Beware that this algorithm requires a lot more computational time (and memory) than the simple barycentric sort.
options Sets global plot options, chosen among (multiple options can be combined with the bitwise inclusive or symbol |):
GL2PS_NONE No option.
GL2PS_DRAW_BACKGROUND The background frame is drawn in the plot.
GL2PS_SIMPLE_LINE_OFFSET A small offset is added in the z-buffer to all the lines in the plot. This is a simplified version of the GL2PS_POLYGON_OFFSET_FILL functionality (cf. section 2.4), putting all the lines of the rendered image slightly in front of their actual position. This thus performs a simple anti-aliasing solution, e.g. for finiteelement-like meshes.
GL2PS_SILENT All the messages written by GL2PS on the error stream are suppressed.
GL2PS_BEST_ROOT The construction of the BSP tree is optimized by choosing the root primitives leading to the minimum number of splits.
GL2PS_NO_TEXT All the text strings are suppressed from the output stream. This is useful to produce the image part of a LATEX plot.
GL2PS_NO_PIXMAP All the pixmaps are suppressed from the output stream.
GL2PS_LANDSCAPE The plot is output in landscape orientation instead of portrait.
GL2PS_NO_PS3_SHADING (for PostScript output only) No use is made of the shfill PostScript level 3 operator. Using shfill enhances the plotting of smooth shaded primitives but can lead to problems when converting PostScript files into PDF files. See also options colornr below.
GL2PS_NO_BLENDING Blending (transparency) is disabled alltogether (regardless of the current GL_BLEND or GL2PS_BLEND status).
GL2PS_OCCLUSION_CULL All the hidden polygons are removed from the output, thus substantially reducing the size of the output file.
GL2PS_USE_CURRENT_VIEWPORT The current OpenGL viewport is used instead of viewport.
GL2PS_TIGHT_BOUNDING_BOX The viewport is ignored and the the plot is generated with a tight bounding box, i.e., a bounding box enclosing as tightly as possible all the OpenGL entities in the scene.
colornr (for PostScript output only) Controls the number of flat-shaded (sub-)triangles used to approximate a smooth-shaded triangle when the shfill operator is not supported by the system, or when the GL2PS_NO_PS3_SHADING option is set. The argument colornr specify the number of values used for interpolating the full range of red, green and blue color components; that is, a triangle is recursively subdivided until the color difference between two of its vertices is smaller that 1/nr for the red component, 1/ng for the green component and 1/nb for the blue component. If the arguments are set to zero, default values are used.
(saveScreenVector "test.pdf GL2PS_NO_SORT