1 | #ifndef qwt3d_io_gl2ps_h__2004_05_07_01_16_begin_guarded_code
|
---|
2 | #define qwt3d_io_gl2ps_h__2004_05_07_01_16_begin_guarded_code
|
---|
3 |
|
---|
4 | #include <time.h>
|
---|
5 |
|
---|
6 | #if QT_VERSION < 0x040000
|
---|
7 | #include <qgl.h>
|
---|
8 | #else
|
---|
9 | #include <QtOpenGL/qgl.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | #include "qwt3d_types.h"
|
---|
13 | #include "qwt3d_io.h"
|
---|
14 |
|
---|
15 | namespace Qwt3D
|
---|
16 | {
|
---|
17 |
|
---|
18 | //! Provides EPS, PS, PDF and TeX output
|
---|
19 | /*!
|
---|
20 |
|
---|
21 | */
|
---|
22 | class QWT3D_EXPORT VectorWriter : public IO::Functor
|
---|
23 | {
|
---|
24 | friend class IO;
|
---|
25 |
|
---|
26 | public:
|
---|
27 | //! The possible output formats for the text parts of the scene
|
---|
28 | enum TEXTMODE
|
---|
29 | {
|
---|
30 | PIXEL, //!< All text will be converted to pixmaps
|
---|
31 | NATIVE, //!< Text output in the native output format
|
---|
32 | TEX //!< Text output in additional LaTeX file as an overlay
|
---|
33 | };
|
---|
34 | //! The possible behaviour for landscape settings
|
---|
35 | enum LANDSCAPEMODE
|
---|
36 | {
|
---|
37 | ON, //!< Landscape mode on
|
---|
38 | OFF, //!< Landscape mode off
|
---|
39 | AUTO //!< The output orientation depends on the plot widgets aspect ratio (default)
|
---|
40 | };
|
---|
41 |
|
---|
42 | //! The possible sorting types which are translated in gl2ps types
|
---|
43 | enum SORTMODE
|
---|
44 | {
|
---|
45 | NOSORT, //!< No sorting at all
|
---|
46 | SIMPLESORT, //!< A more simple (yet quicker) algorithm (default)
|
---|
47 | BSPSORT //!< BSP SORT (best and slow!)
|
---|
48 | };
|
---|
49 |
|
---|
50 | VectorWriter();
|
---|
51 |
|
---|
52 | void setLandscape(LANDSCAPEMODE val) {landscape_ = val;} //!< Sets landscape mode.
|
---|
53 | LANDSCAPEMODE landscape() const {return landscape_;} //!< Returns the current landscape mode
|
---|
54 |
|
---|
55 | void setTextMode(TEXTMODE val, QString fname = "");
|
---|
56 | TEXTMODE textMode() const {return textmode_;} //!< Return current text output mode.
|
---|
57 |
|
---|
58 |
|
---|
59 | //! Sets one of the SORTMODE sorting modes.
|
---|
60 | void setSortMode(SORTMODE val) {sortmode_ = val;}
|
---|
61 | SORTMODE sortMode() const {return sortmode_;} //!< Returns gl2ps sorting type.
|
---|
62 | //! Turns compressed output on or off (no effect if zlib support is not available)
|
---|
63 | void setCompressed(bool val);
|
---|
64 | //! Returns compression mode (always false if zlib support has not been set)
|
---|
65 | bool compressed() const {return compressed_;}
|
---|
66 |
|
---|
67 | bool setFormat(QString const& format);
|
---|
68 |
|
---|
69 | private:
|
---|
70 | IO::Functor* clone() const;
|
---|
71 | bool operator()(Plot3D* plot, QString const& fname);
|
---|
72 |
|
---|
73 | GLint gl2ps_format_;
|
---|
74 | bool formaterror_;
|
---|
75 | bool compressed_;
|
---|
76 | SORTMODE sortmode_;
|
---|
77 | LANDSCAPEMODE landscape_;
|
---|
78 | TEXTMODE textmode_;
|
---|
79 | QString texfname_;
|
---|
80 | };
|
---|
81 |
|
---|
82 | GLint setDeviceLineWidth(GLfloat val);
|
---|
83 | GLint setDevicePointSize(GLfloat val);
|
---|
84 | GLint drawDevicePixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
|
---|
85 | GLint drawDeviceText(const char* str, const char* fontname, int fontsize, Qwt3D::Triple pos, Qwt3D::RGBA rgba, Qwt3D::ANCHOR align, double gap);
|
---|
86 | void setDevicePolygonOffset(GLfloat factor, GLfloat units);
|
---|
87 |
|
---|
88 |
|
---|
89 | } // ns
|
---|
90 |
|
---|
91 | #endif /* include guarded */
|
---|