00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __SO_VECTORIZE_HPGL_ACTION_
00025 #define __SO_VECTORIZE_HPGL_ACTION_
00026
00027 #include <HardCopy/SoVectorizeAction.h>
00028
00042 class SoHPGLVectorOutput : public SoVectorOutput
00043 {
00044
00045 public:
00046
00050 SoHPGLVectorOutput();
00051
00056 virtual ~SoHPGLVectorOutput();
00057 };
00058
00075 class SoVectorizeHPGLAction : public SoVectorizeAction {
00076
00077 SO_ACTION_HEADER(SoVectorizeHPGLAction);
00078
00079 public:
00080
00084 SoVectorizeHPGLAction();
00085
00089 virtual ~SoVectorizeHPGLAction();
00090
00094 SoHPGLVectorOutput *getHPGLVectorOutput() const;
00095
00096 private:
00100 static void initClass();
00101 static void exitClass();
00102
00103 private:
00104 virtual void printPolyMark(const SbVec4f *points,
00105 int num_points,
00106 const SbColor *colors,
00107 SbBool color_flag,
00108 float size);
00109 #ifndef NO_TGS_OIV
00110 virtual void printPolyMark(const SbVec4f *points,
00111 int num_points,
00112 const SbColor *colors,
00113 SbBool color_flag,
00114 SoMarkerSet *markerSet);
00115 virtual void printImage(const SbVec4f &origin,
00116 const unsigned char *imagePixels,
00117 SbVec2s &sourceSize,
00118 SbVec2s &requestedSize,
00119 int numComponents,
00120 SoImage::HorAlignment horAlign,
00121 SoImage::VertAlignment vertAlign);
00122 #endif
00123 virtual void printPolyLine(const SbVec4f *points,
00124 int num_points,
00125 const SbColor *colors,
00126 SbBool color_flag,
00127 float thickness,
00128 u_short linePattern,
00129 int linePatternScaleFactor = 1);
00130 virtual void printPolygon(const SbVec4f *points,
00131 int num_points,
00132 const SbColor *colors,
00133 SbBool color_flag,
00134 const SbString &category,
00135 const SbString &name,
00136 const unsigned char *pattern);
00137 virtual void printText2(const SbVec4f point,
00138 const SbColor color,
00139 const SbString& font_name,
00140 float font_size,
00141 const SbString& string,
00142 int justif,
00143 float angle);
00144
00145
00146 virtual void printBorder();
00147 virtual void printBackground();
00148
00149 private:
00150
00151 virtual void writeHeader();
00152 virtual void writeFooter();
00153
00154
00155 virtual void setHardwareClip();
00156
00157
00158 SbBox2f getClippingLimits() const;
00159
00160 private:
00161
00162
00163 void assignColor(SbColor color, float linewidth, int *pen_color);
00164
00165
00166 int m_currentColor;
00167 EndLineStyle m_currentLineEndStyle;
00168 JoinLineStyle m_currentLineJoinsStyle;
00169 float m_currentMiterLimit;
00170 float m_currentThickness;
00171 u_short m_currentLinePattern;
00172 int m_currentPatternScaleFactor;
00173 float m_scaleFont;
00174 SbString m_fontname;
00175 int m_justification;
00176 float m_textAngle;
00177 };
00178
00179
00180
00181
00182 #endif //__SO_VECTORIZE_HPGL_ACTION_
00183
00184