Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoVectorizePSAction.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24#ifndef __SO_VECTORIZE_PS_ACTION_
25#define __SO_VECTORIZE_PS_ACTION_
26
27#include <HardCopy/SoVectorizeAction.h>
28
41
42 public:
43
48
54
58 void setColored(SbBool flag = TRUE)
59 { m_color = flag; }
60
65 { return m_color; }
66
68
76 void setLevel(unsigned int level) ;
77
81 unsigned int getLevel() const
82 { return m_langLevel ; }
84
86
102 void setNumericAccuracyFactor(float factor)
103 { m_numericAccuracyFactor = factor ; }
110 float getNumericAccuracy() const
111 { return m_numericAccuracyFactor ;}
113
114 private:
115
116 SbBool m_color;
117 unsigned int m_langLevel ;
118 float m_numericAccuracyFactor ;
119
120
121};
122
149
150 SO_ACTION_HEADER(SoVectorizePSAction);
151
152 public:
153
158
163
168
169private:
173 static void initClass();
174 static void exitClass();
175
176 private:
177 virtual void printPolyMark(const SbVec4f *points,
178 int num_points,
179 const SbColor *colors,
180 SbBool color_flag,
181 float size);
182#ifndef NO_TGS_OIV
183 virtual void printPolyMark(const SbVec4f *points,
184 int num_points,
185 const SbColor *colors,
186 SbBool color_flag,
187 SoMarkerSet *markerSet);
188 virtual void printImage(const SbVec4f &origin,
189 const unsigned char *imagePixels,
190 SbVec2s &sourceSize,
191 SbVec2s &requestedSize,
192 int numComponents,
193 SoImage::HorAlignment horAlign,
194 SoImage::VertAlignment vertAlign);
195#endif
196 virtual void printPolyLine(const SbVec4f *points,
197 int num_points,
198 const SbColor *colors,
199 SbBool color_flag,
200 float thickness,
201 u_short linePattern,
202 int linePatternScaleFactor = 1);
203 virtual void printPolygon(const SbVec4f *points,
204 int num_points,
205 const SbColor *colors,
206 SbBool color_flag,
207 const SbString &category,
208 const SbString &name,
209 const unsigned char *pattern);
210 virtual void printText2(const SbVec4f point,
211 const SbColor color,
212 const SbString& font_name,
213 float font_size,
214 const SbString& string,
215 int justif,
216 float angle);
217
218 // Print the border and the background
219 virtual void printBorder();
220 virtual void printBackground();
221
222 private:
223 // Write header and footer
224 virtual void writeHeader();
225 virtual void writeFooter();
226
227 // Set hardware clipping
228 virtual void setHardwareClip();
229
230 private:
231 // Miscellaneous methods
232#ifndef NO_TGS_OIV
233 void createBitmap(int markerIndex, const SbVec2s &size);
234 SbBool isBitmapExist(int markerIndex);
235#endif
236 void assignColor(SbColor color, float linewidth);
237 void pcp079( char* buffer );
238
239 void writePixel(unsigned char pixel);
240 void initWritePixel();
241 void initDefaultCurrentValues();
242
243 // data
244 int m_numCreatedBitmaps;
245 int m_createdBitmaps[1000];
246 int m_currentBitmapIndex;
247 SbVec3s m_currentColor;
248 float m_currentPointSize;
249 float m_currentThickness;
250 u_short m_currentLinePattern;
251 int m_currentPatternScaleFactor;
252 float m_scaleFont;
253 SbString m_fontname;
254 int m_numWritenPixels;
255 int m_currentPattableIndex;
256 int m_nbPattableIndex;
257 unsigned int m_langLevel ;
258 SbBool m_gouraudShadingPossible ;
259
260 float m_scaleNumVal ;
261
262 // For Pattern
263 SbPList m_patternList;
264};
265
266
267//*****************************************************************************
268
269#endif //__SO_VECTORIZE_PS_ACTION_
270
Color vector class.
Definition SbColor.h:82
List of generic (void *) pointers.
Definition SbPList.h:77
Class for smart character strings.
Definition SbString.h:202
2D vector class.
Definition SbVec.h:700
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D vector class.
Definition SbVec.h:1797
4D vector class.
Definition SbVec.h:2214
VertAlignment
Vertical alignment.
Definition SoImage.h:146
HorAlignment
Horizontal alignment.
Definition SoImage.h:130
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Extension of Poi...
<a href="IconLegend.html"><img src="extHC.gif" alt="HardCopy" border="0"></a> Class used to write ve...
void setNumericAccuracyFactor(float factor)
Sets the factor used to compute the accuracy of all real numeric values.
void setColored(SbBool flag=TRUE)
Sets the colored output flag.
unsigned int getLevel() const
Returns the PostScript language level.
virtual ~SoPSVectorOutput()
Destructor.
SbBool getColored() const
Gets the colored output flag.
float getNumericAccuracy() const
Returns the factor used to compute the accuracy of all real numeric values.
void setLevel(unsigned int level)
Sets the PostScript language level.
SoPSVectorOutput()
Constructor.
<a href="IconLegend.html"><img src="extHC.gif" alt="HardCopy" border="0"></a> Abstract class used to...
<a href="IconLegend.html"><img src="extHC.gif" alt="HardCopy" border="0"></a> Abstract class for vec...
<a href="IconLegend.html"><img src="extHC.gif" alt="HardCopy" border="0"></a> Realizes the vectoriza...
SoVectorizePSAction()
Constructor.
SoPSVectorOutput * getPSVectorOutput() const
Returns the SoPSVectorOutput instance in action.
virtual ~SoVectorizePSAction()
Destructor.
int SbBool
Boolean type.
Definition SbBase.h:87