Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (gl2ps_renderer_h)
00024 #define gl2ps_renderer_h 1
00025
00026 #include "gl-render.h"
00027 #include "gl2ps.h"
00028
00029 class
00030 OCTINTERP_API
00031 glps_renderer : public opengl_renderer
00032 {
00033 public:
00034 glps_renderer (const int _fid, const std::string& _term)
00035 : opengl_renderer () , fid (_fid), term (_term),
00036 fontsize (), fontname () { }
00037
00038 ~glps_renderer (void) { }
00039
00040 void draw (const graphics_object& go);
00041
00042 protected:
00043
00044 Matrix render_text (const std::string& txt,
00045 double x, double y, double z,
00046 int halign, int valign, double rotation = 0.0);
00047
00048
00049 void set_font (const base_properties& props);
00050
00051 void draw_text (const text::properties& props);
00052 void draw_pixels (GLsizei w, GLsizei h, GLenum format,
00053 GLenum type, const GLvoid *data);
00054
00055 void set_linestyle (const std::string& s, bool use_stipple)
00056 {
00057 opengl_renderer::set_linestyle (s, use_stipple);
00058 if (use_stipple)
00059 gl2psEnable (GL2PS_LINE_STIPPLE);
00060 else
00061 gl2psDisable (GL2PS_LINE_STIPPLE);
00062 }
00063
00064 void set_polygon_offset (bool on, double offset = 0.0)
00065 {
00066 opengl_renderer::set_polygon_offset (on, offset);
00067 if (on)
00068 gl2psEnable (GL2PS_POLYGON_OFFSET_FILL);
00069 else
00070 gl2psDisable (GL2PS_POLYGON_OFFSET_FILL);
00071 }
00072
00073 void set_linewidth (float w)
00074 {
00075 gl2psLineWidth (w);
00076 }
00077
00078 private:
00079 int alignment_to_mode (int ha, int va) const;
00080 int fid;
00081 caseless_str term;
00082 double fontsize;
00083 std::string fontname;
00084 };
00085
00086 #endif