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
00043 class SoHPGLVectorOutput : public SoVectorOutput
00044 {
00045
00046 public:
00047
00051 SoHPGLVectorOutput();
00052
00057 virtual ~SoHPGLVectorOutput();
00058 };
00059
00077 class SoVectorizeHPGLAction : public SoVectorizeAction {
00078
00079 SO_ACTION_HEADER(SoVectorizeHPGLAction);
00080
00081 public:
00082
00086 SoVectorizeHPGLAction();
00087
00091 virtual ~SoVectorizeHPGLAction();
00092
00096 SoHPGLVectorOutput *getHPGLVectorOutput() const;
00097
00098 #if 1 SoDEPRECATED
00101 SoHPGLVectorOutput *getOutput() const;
00102
00103 #endif
00105 private:
00106
00109 static void initClass();
00110 static void exitClass();
00111
00112 private:
00113 virtual void printPolyMark(const SbVec4f *points,
00114 int num_points,
00115 const SbColor *colors,
00116 SbBool color_flag,
00117 float size);
00118 #ifndef NO_TGS_OIV
00119 virtual void printPolyMark(const SbVec4f *points,
00120 int num_points,
00121 const SbColor *colors,
00122 SbBool color_flag,
00123 SoMarkerSet *markerSet);
00124 virtual void printImage(const SbVec4f &origin,
00125 const unsigned char *imagePixels,
00126 SbVec2s &sourceSize,
00127 SbVec2s &requestedSize,
00128 int numComponents,
00129 SoImage::HorAlignment horAlign,
00130 SoImage::VertAlignment vertAlign);
00131 #endif
00132 virtual void printPolyLine(const SbVec4f *points,
00133 int num_points,
00134 const SbColor *colors,
00135 SbBool color_flag,
00136 float thickness,
00137 u_short linePattern,
00138 int linePatternScaleFactor = 1);
00139 virtual void printPolygon(const SbVec4f *points,
00140 int num_points,
00141 const SbColor *colors,
00142 SbBool color_flag,
00143 const SbString &category,
00144 const SbString &name,
00145 const unsigned char *pattern);
00146 virtual void printText2(const SbVec4f point,
00147 const SbColor color,
00148 const SbString& font_name,
00149 float font_size,
00150 const SbString& string,
00151 int justif,
00152 float angle);
00153
00154
00155 virtual void printBorder();
00156 virtual void printBackground();
00157
00158 private:
00159
00160 virtual void writeHeader();
00161 virtual void writeFooter();
00162
00163
00164 virtual void setHardwareClip();
00165
00166
00167 SbBox2f getClippingLimits() const;
00168
00169 private:
00170
00171
00172 void assignColor(SbColor color, float linewidth, int *pen_color);
00173
00174
00175 int m_currentColor;
00176 EndLineStyle m_currentLineEndStyle;
00177 JoinLineStyle m_currentLineJoinsStyle;
00178 float m_currentMiterLimit;
00179 float m_currentThickness;
00180 u_short m_currentLinePattern;
00181 int m_currentPatternScaleFactor;
00182 float m_scaleFont;
00183 SbString m_fontname;
00184 int m_justification;
00185 float m_textAngle;
00186 };
00187
00188
00189
00190
00191 #endif //__SO_VECTORIZE_HPGL_ACTION_
00192
00193