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
00041 class SoPSVectorOutput : public SoVectorOutput {
00042
00043 public:
00044
00048 SoPSVectorOutput();
00049
00054 virtual ~SoPSVectorOutput();
00055
00059 void setColored(SbBool flag = TRUE)
00060 { m_color = flag; }
00061
00065 SbBool getColored() const
00066 { return m_color; }
00067
00069
00077 void setLevel(unsigned int level) ;
00078
00082 unsigned int getLevel() const
00083 { return m_langLevel ; }
00085
00087
00103 void setNumericAccuracyFactor(float factor)
00104 { m_numericAccuracyFactor = factor ; }
00111 float getNumericAccuracy() const
00112 { return m_numericAccuracyFactor ;}
00114
00115 private:
00116
00117 SbBool m_color;
00118 unsigned int m_langLevel ;
00119 float m_numericAccuracyFactor ;
00120
00121
00122 };
00123
00150 class SoVectorizePSAction : public SoVectorizeAction {
00151
00152 SO_ACTION_HEADER(SoVectorizePSAction);
00153
00154 public:
00155
00159 SoVectorizePSAction();
00160
00164 virtual ~SoVectorizePSAction();
00165
00169 SoPSVectorOutput *getPSVectorOutput() const;
00170
00171 #if 1 SoDEPRECATED
00174 SoPSVectorOutput *getOutput() const;
00175
00176 #endif
00178 private:
00179
00182 static void initClass();
00183 static void exitClass();
00184
00185 private:
00186 virtual void printPolyMark(const SbVec4f *points,
00187 int num_points,
00188 const SbColor *colors,
00189 SbBool color_flag,
00190 float size);
00191 #ifndef NO_TGS_OIV
00192 virtual void printPolyMark(const SbVec4f *points,
00193 int num_points,
00194 const SbColor *colors,
00195 SbBool color_flag,
00196 SoMarkerSet *markerSet);
00197 virtual void printImage(const SbVec4f &origin,
00198 const unsigned char *imagePixels,
00199 SbVec2s &sourceSize,
00200 SbVec2s &requestedSize,
00201 int numComponents,
00202 SoImage::HorAlignment horAlign,
00203 SoImage::VertAlignment vertAlign);
00204 #endif
00205 virtual void printPolyLine(const SbVec4f *points,
00206 int num_points,
00207 const SbColor *colors,
00208 SbBool color_flag,
00209 float thickness,
00210 u_short linePattern,
00211 int linePatternScaleFactor = 1);
00212 virtual void printPolygon(const SbVec4f *points,
00213 int num_points,
00214 const SbColor *colors,
00215 SbBool color_flag,
00216 const SbString &category,
00217 const SbString &name,
00218 const unsigned char *pattern);
00219 virtual void printText2(const SbVec4f point,
00220 const SbColor color,
00221 const SbString& font_name,
00222 float font_size,
00223 const SbString& string,
00224 int justif,
00225 float angle);
00226
00227
00228 virtual void printBorder();
00229 virtual void printBackground();
00230
00231 private:
00232
00233 virtual void writeHeader();
00234 virtual void writeFooter();
00235
00236
00237 virtual void setHardwareClip();
00238
00239 private:
00240
00241 #ifndef NO_TGS_OIV
00242 void createBitmap(int markerIndex, const SbVec2s &size);
00243 SbBool isBitmapExist(int markerIndex);
00244 #endif
00245 void assignColor(SbColor color, float linewidth);
00246 void pcp079( char* buffer );
00247
00248 void writePixel(unsigned char pixel);
00249 void initWritePixel();
00250 void initDefaultCurrentValues();
00251
00252
00253 int m_numCreatedBitmaps;
00254 int m_createdBitmaps[1000];
00255 int m_currentBitmapIndex;
00256 SbVec3s m_currentColor;
00257 float m_currentPointSize;
00258 float m_currentThickness;
00259 u_short m_currentLinePattern;
00260 int m_currentPatternScaleFactor;
00261 float m_scaleFont;
00262 SbString m_fontname;
00263 int m_numWritenPixels;
00264 int m_currentPattableIndex;
00265 int m_nbPattableIndex;
00266 unsigned int m_langLevel ;
00267 SbBool m_gouraudShadingPossible ;
00268
00269 float m_scaleNumVal ;
00270
00271
00272 SbPList m_patternList;
00273 };
00274
00275
00276
00277
00278 #endif //__SO_VECTORIZE_PS_ACTION_
00279
00280