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_PS_ACTION_
00025 #define __SO_VECTORIZE_PS_ACTION_
00026
00027 #include <HardCopy/SoVectorizeAction.h>
00028
00040 class SoPSVectorOutput : public SoVectorOutput {
00041
00042 public:
00043
00047 SoPSVectorOutput();
00048
00053 virtual ~SoPSVectorOutput();
00054
00058 void setColored(SbBool flag = TRUE)
00059 { m_color = flag; }
00060
00064 SbBool getColored() const
00065 { return m_color; }
00066
00068
00076 void setLevel(unsigned int level) ;
00077
00081 unsigned int getLevel() const
00082 { return m_langLevel ; }
00084
00086
00102 void setNumericAccuracyFactor(float factor)
00103 { m_numericAccuracyFactor = factor ; }
00110 float getNumericAccuracy() const
00111 { return m_numericAccuracyFactor ;}
00113
00114 private:
00115
00116 SbBool m_color;
00117 unsigned int m_langLevel ;
00118 float m_numericAccuracyFactor ;
00119
00120
00121 };
00122
00148 class SoVectorizePSAction : public SoVectorizeAction {
00149
00150 SO_ACTION_HEADER(SoVectorizePSAction);
00151
00152 public:
00153
00157 SoVectorizePSAction();
00158
00162 virtual ~SoVectorizePSAction();
00163
00167 SoPSVectorOutput *getPSVectorOutput() const;
00168
00169 private:
00173 static void initClass();
00174 static void exitClass();
00175
00176 private:
00177 virtual void printPolyMark(const SbVec4f *points,
00178 int num_points,
00179 const SbColor *colors,
00180 SbBool color_flag,
00181 float size);
00182 #ifndef NO_TGS_OIV
00183 virtual void printPolyMark(const SbVec4f *points,
00184 int num_points,
00185 const SbColor *colors,
00186 SbBool color_flag,
00187 SoMarkerSet *markerSet);
00188 virtual void printImage(const SbVec4f &origin,
00189 const unsigned char *imagePixels,
00190 SbVec2s &sourceSize,
00191 SbVec2s &requestedSize,
00192 int numComponents,
00193 SoImage::HorAlignment horAlign,
00194 SoImage::VertAlignment vertAlign);
00195 #endif
00196 virtual void printPolyLine(const SbVec4f *points,
00197 int num_points,
00198 const SbColor *colors,
00199 SbBool color_flag,
00200 float thickness,
00201 u_short linePattern,
00202 int linePatternScaleFactor = 1);
00203 virtual void printPolygon(const SbVec4f *points,
00204 int num_points,
00205 const SbColor *colors,
00206 SbBool color_flag,
00207 const SbString &category,
00208 const SbString &name,
00209 const unsigned char *pattern);
00210 virtual void printText2(const SbVec4f point,
00211 const SbColor color,
00212 const SbString& font_name,
00213 float font_size,
00214 const SbString& string,
00215 int justif,
00216 float angle);
00217
00218
00219 virtual void printBorder();
00220 virtual void printBackground();
00221
00222 private:
00223
00224 virtual void writeHeader();
00225 virtual void writeFooter();
00226
00227
00228 virtual void setHardwareClip();
00229
00230 private:
00231
00232 #ifndef NO_TGS_OIV
00233 void createBitmap(int markerIndex, const SbVec2s &size);
00234 SbBool isBitmapExist(int markerIndex);
00235 #endif
00236 void assignColor(SbColor color, float linewidth);
00237 void pcp079( char* buffer );
00238
00239 void writePixel(unsigned char pixel);
00240 void initWritePixel();
00241 void initDefaultCurrentValues();
00242
00243
00244 int m_numCreatedBitmaps;
00245 int m_createdBitmaps[1000];
00246 int m_currentBitmapIndex;
00247 SbVec3s m_currentColor;
00248 float m_currentPointSize;
00249 float m_currentThickness;
00250 u_short m_currentLinePattern;
00251 int m_currentPatternScaleFactor;
00252 float m_scaleFont;
00253 SbString m_fontname;
00254 int m_numWritenPixels;
00255 int m_currentPattableIndex;
00256 int m_nbPattableIndex;
00257 unsigned int m_langLevel ;
00258 SbBool m_gouraudShadingPossible ;
00259
00260 float m_scaleNumVal ;
00261
00262
00263 SbPList m_patternList;
00264 };
00265
00266
00267
00268
00269 #endif //__SO_VECTORIZE_PS_ACTION_
00270
00271