CFx SDK Documentation  2020SP3
GiFastExtCalc.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef _ODGIFASTEXTCALC_INCLUDED_
25 #define _ODGIFASTEXTCALC_INCLUDED_
26 
27 #include "Gi/GiBaseVectorizer.h"
28 #include "Gi/GiTransformed.h"
29 #include "Gi/GiDummyGeometry.h"
30 #include "OdStack.h"
31 
32 #include "TD_PackPush.h"
33 
39 class OdGiFastExtCalcViewportDrawImpl : public OdGiDummyViewportDraw<OdGiDummyViewportGeometry<OdGiViewportDraw_> > { };
45 
54 {
55  typedef OdGeExtents3d Extents;
56  OdGeExtents3d m_worldExt;
57  OdStack<Extents> m_extStack;
58  OdGeExtents3d* m_pCurrExt;
59 
60  enum Flags
61  {
62  kSetExtentsCalledFlag = 1,
63  kDrawInvisiblesFlag = 2,
64  kDrawInvisiblesNestedFlag = 4,
65  kDrawingInitiatedFlag = 8,
66  kViewportDrawEnabledFlag = 16
67  };
68  OdUInt8 m_flags;
69 
70  void setSetExtentsCalled(bool bSet);
71 //FELIX_CHANGE_BEGIN
72 public:
73  bool isSetExtentsCalled() const;
74 //FELIX_CHANGE_END
75 
76  void setDrawingInitiated(bool bSet);
77  bool isDrawingInitiated() const;
78 
80  const OdGePoint3d& locExtMin,
81  const OdGePoint3d& locExtMax,
82  const OdGePoint3d& position,
83  const OdGeVector3d& normal,
84  const OdGeVector3d& direction);
85 protected:
87 
89 public:
90 
94  void resetExtents();
95 
100  void getExtents(OdGeExtents3d& extents) const;
101 
106  void setDrawInvisible(bool bSet);
107 
111  bool isDrawInvisible() const;
112 
117  void setDrawInvisibleNested(bool bSet);
118 
122  bool isDrawInvisibleNested() const;
123 
128  void resetFirstDrawFlag();
129 
134  void setViewportDrawEnabled(bool bSet);
135 
139  bool isViewportDrawEnabled() const;
140 
145 
150 
155 
160 
162  // OdGiCommonDraw Overrides
163 
164  bool regenAbort() const;
165  double deviation(const OdGiDeviationType deviationType, const OdGePoint3d& pointOnCurve) const;
167 
169  // OdGiGeometry Overrides
170 
171  void circle(const OdGePoint3d& center, double radius, const OdGeVector3d& normal);
172 
173  void circle(const OdGePoint3d& firstPoint, const OdGePoint3d& secondPoint, const OdGePoint3d& thirdPoint);
174 
175  void circularArc(const OdGePoint3d& center,
176  double radius,
177  const OdGeVector3d& normal,
178  const OdGeVector3d& startVector,
179  double sweepAngle,
180  OdGiArcType arcType = kOdGiArcSimple);
181 
182  void circularArc(const OdGePoint3d& firstPoint,
183  const OdGePoint3d& secondPoint,
184  const OdGePoint3d& thirdPoint,
185  OdGiArcType arcType = kOdGiArcSimple);
186 
187  void polyline(OdInt32 numVertices,
188  const OdGePoint3d* vertexList,
189  const OdGeVector3d* pNormal = 0,
190  OdGsMarker baseSubEntMarker = -1);
191 
192  void polygon(OdInt32 numVertices, const OdGePoint3d* vertexList);
193 
194  void pline(const OdGiPolyline& polyline, OdUInt32 fromIndex = 0, OdUInt32 numSegs = 0);
195 
196 
206  void shape(const OdGePoint3d& position,
207  const OdGeVector3d& normal, const OdGeVector3d& direction,
208  int shapeNumber, const OdGiTextStyle* pTextStyle);
209 
210  void text(const OdGePoint3d& position,
211  const OdGeVector3d& normal, const OdGeVector3d& direction,
212  double height, double width, double oblique, const OdString& msg);
213 
214  void text(const OdGePoint3d& position,
215  const OdGeVector3d& normal, const OdGeVector3d& direction,
216  const OdChar* msg, OdInt32 length, bool raw, const OdGiTextStyle* pTextStyle);
217 
218 
219  void xline(const OdGePoint3d& firstPoint, const OdGePoint3d& secondPoint);
220 
221  void ray(const OdGePoint3d& basePoint, const OdGePoint3d& throughPoint );
222 
223  void nurbs(const OdGeNurbCurve3d& nurbsCurve);
224 
225  void ellipArc(const OdGeEllipArc3d& ellipArc,
226  const OdGePoint3d* endPointsOverrides = 0,
227  OdGiArcType arcType = kOdGiArcSimple);
228 
229  void mesh(OdInt32 numRows,
230  OdInt32 numColumns,
231  const OdGePoint3d* vertexList,
232  const OdGiEdgeData* pEdgeData = 0,
233  const OdGiFaceData* pFaceData = 0,
234  const OdGiVertexData* pVertexData = 0);
235 
236  void shell(OdInt32 numVertices,
237  const OdGePoint3d* vertexList,
238  OdInt32 faceListSize,
239  const OdInt32* faceList,
240  const OdGiEdgeData* pEdgeData = 0,
241  const OdGiFaceData* pFaceData = 0,
242  const OdGiVertexData* pVertexData = 0);
243 
244  void worldLine(const OdGePoint3d points[2]);
245 
246  void image(const OdGiImageBGRA32& img,
247  const OdGePoint3d& origin,
248  const OdGeVector3d& uVec,
249  const OdGeVector3d& vVec,
251 
252  void edge(const OdGiEdge2dArray& edges);
253 
254  void polypoint(OdInt32 numPoints, const OdGePoint3d* vertexList, const OdCmEntityColor* pColors, const OdCmTransparency* pTransparency,
255  const OdGeVector3d* pNormals, const OdGsMarker* pSubEntMarkers, OdInt32 nPointSize);
256 
257  void rowOfDots(OdInt32 numPoints, const OdGePoint3d& startPoint, const OdGeVector3d& dirToNextPoint);
258 
259  void setExtents(const OdGePoint3d *newExtents);
260 
263 
266 
267  void draw(const OdGiDrawable* pDrawable);
268 };
269 
270 inline void OdGiFastExtCalc::setSetExtentsCalled(bool bSet)
271 {
272  SETBIT(m_flags, kSetExtentsCalledFlag, bSet);
273 }
274 
276 {
277  return GETBIT(m_flags, kSetExtentsCalledFlag);
278 }
279 
281 {
282  SETBIT(m_flags, kDrawingInitiatedFlag, bSet);
283 }
284 
286 {
287  return GETBIT(m_flags, kDrawingInitiatedFlag);
288 }
289 
290 inline void OdGiFastExtCalc::setDrawInvisible(bool bSet)
291 {
292  SETBIT(m_flags, kDrawInvisiblesFlag, bSet);
293 }
294 
296 {
297  return GETBIT(m_flags, kDrawInvisiblesFlag);
298 }
299 
301 {
302  SETBIT(m_flags, kDrawInvisiblesNestedFlag, bSet);
303 }
304 
306 {
307  return GETBIT(m_flags, kDrawInvisiblesNestedFlag);
308 }
309 
311 {
312  m_flags &= ~kDrawingInitiatedFlag;
313 }
314 
316 {
317  SETBIT(m_flags, kViewportDrawEnabledFlag, bSet);
318 }
319 
321 {
322  return GETBIT(m_flags, kViewportDrawEnabledFlag);
323 }
324 
325 #include "TD_PackPop.h"
326 
327 #endif // #ifndef _ODGIFASTEXTCALC_INCLUDED_
GETBIT
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
OdGiFastExtCalc
Definition: GiFastExtCalc.h:54
OdGiFastExtCalcBase
OdGiTransformed< OdGiJoinCommonDraw< OdGiWorldDrawImpl, OdGiFastExtCalcViewportDrawImpl > > OdGiFastExtCalcBase
Definition: GiFastExtCalc.h:44
OdGiFastExtCalc::getExtents
void getExtents(OdGeExtents3d &extents) const
OdGiFastExtCalc::isDrawInvisibleNested
bool isDrawInvisibleNested() const
Definition: GiFastExtCalc.h:305
OdGiFastExtCalc::polypoint
void polypoint(OdInt32 numPoints, const OdGePoint3d *vertexList, const OdCmEntityColor *pColors, const OdCmTransparency *pTransparency, const OdGeVector3d *pNormals, const OdGsMarker *pSubEntMarkers, OdInt32 nPointSize)
OdCmEntityColor
Definition: CmColorBase.h:68
OdGiFastExtCalc::circularArc
void circularArc(const OdGePoint3d &firstPoint, const OdGePoint3d &secondPoint, const OdGePoint3d &thirdPoint, OdGiArcType arcType=kOdGiArcSimple)
OdGeVector3d
Definition: GeVector3d.h:54
kOdGiArcSimple
@ kOdGiArcSimple
Definition: GiGeometry.h:684
OdString
Definition: OdString.h:95
OdGiFastExtCalc::xline
void xline(const OdGePoint3d &firstPoint, const OdGePoint3d &secondPoint)
OdGiFastExtCalc::setExtents
void setExtents(const OdGePoint3d *newExtents)
OdGiTransformed
Definition: GiTransformed.h:46
OdUInt8
unsigned char OdUInt8
Definition: OdPlatformSettings.h:759
OdGiFastExtCalc::setDrawInvisible
void setDrawInvisible(bool bSet)
Definition: GiFastExtCalc.h:290
OdGiFastExtCalc::pushClipBoundary
void pushClipBoundary(OdGiClipBoundary *pBoundary)
OdGiFastExtCalc::circle
void circle(const OdGePoint3d &firstPoint, const OdGePoint3d &secondPoint, const OdGePoint3d &thirdPoint)
OdGiFastExtCalc::edge
void edge(const OdGiEdge2dArray &edges)
OdCmTransparency
Definition: CmColorBase.h:1617
OdGiFastExtCalc::pline
void pline(const OdGiPolyline &polyline, OdUInt32 fromIndex=0, OdUInt32 numSegs=0)
OdGiFastExtCalc::circularArc
void circularArc(const OdGePoint3d &center, double radius, const OdGeVector3d &normal, const OdGeVector3d &startVector, double sweepAngle, OdGiArcType arcType=kOdGiArcSimple)
OdGiFastExtCalc::circle
void circle(const OdGePoint3d &center, double radius, const OdGeVector3d &normal)
OdGiDummyViewportDraw
Definition: GiDummyGeometry.h:856
OdGiFastExtCalc::setDrawingInitiated
void setDrawingInitiated(bool bSet)
Definition: GiFastExtCalc.h:280
SETBIT
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:497
OdGiFastExtCalc::ODRX_USING_HEAP_OPERATORS
ODRX_USING_HEAP_OPERATORS(OdGiFastExtCalcBase)
OdGiVertexData
Definition: GiGeometry.h:549
OdGiPolyline
Definition: GiPolyline.h:49
OdArray
Definition: OdArray.h:591
OdGiFastExtCalc::getViewportDraw
OdGiViewportDraw * getViewportDraw() const
TD_PackPop.h
OdGiFastExtCalc::OdGiFastExtCalc
OdGiFastExtCalc()
OdGiFastExtCalc::ray
void ray(const OdGePoint3d &basePoint, const OdGePoint3d &throughPoint)
OdGsMarker
ptrdiff_t OdGsMarker
Definition: OdPlatformSettings.h:889
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
ODGI_EXPORT
#define ODGI_EXPORT
Definition: GiExport.h:35
OdGiFastExtCalc::polygon
void polygon(OdInt32 numVertices, const OdGePoint3d *vertexList)
OdGiClipBoundary
Definition: GiClipBoundary.h:41
OdGiRasterImage::kTransparency8Bit
@ kTransparency8Bit
Definition: GiRasterImage.h:86
OdGiFastExtCalc::regenAbort
bool regenAbort() const
OdGiFastExtCalc::mesh
void mesh(OdInt32 numRows, OdInt32 numColumns, const OdGePoint3d *vertexList, const OdGiEdgeData *pEdgeData=0, const OdGiFaceData *pFaceData=0, const OdGiVertexData *pVertexData=0)
OdGiFastExtCalc::setViewportDrawEnabled
void setViewportDrawEnabled(bool bSet)
Definition: GiFastExtCalc.h:315
OdGiFastExtCalc::isDrawInvisible
bool isDrawInvisible() const
Definition: GiFastExtCalc.h:295
OdGiFaceData
Definition: GiGeometry.h:245
OdGiTextStyle
Definition: GiTextStyle.h:52
OdGeEllipArc3d
Definition: GeEllipArc3d.h:60
OdGePoint3d
Definition: GePoint3d.h:55
OdGiFastExtCalc::draw
void draw(const OdGiDrawable *pDrawable)
OdInt32
int OdInt32
Definition: OdPlatformSettings.h:782
OdGiFastExtCalc::resetFirstDrawFlag
void resetFirstDrawFlag()
Definition: GiFastExtCalc.h:310
OdGiArcType
OdGiArcType
Definition: GiGeometry.h:683
GiDummyGeometry.h
OdGiFastExtCalc::worldLine
void worldLine(const OdGePoint3d points[2])
OdGiFastExtCalc::addTextExtents
void addTextExtents(const OdGePoint3d &locExtMin, const OdGePoint3d &locExtMax, const OdGePoint3d &position, const OdGeVector3d &normal, const OdGeVector3d &direction)
OdGiFastExtCalc::ellipArc
void ellipArc(const OdGeEllipArc3d &ellipArc, const OdGePoint3d *endPointsOverrides=0, OdGiArcType arcType=kOdGiArcSimple)
OdGiDrawable
Definition: GiDrawable.h:49
OdGiFastExtCalc::pushModelTransform
void pushModelTransform(const OdGeMatrix3d &xfm)
OdChar
wchar_t OdChar
Definition: OdPlatformSettings.h:745
OdGiWorldGeometry
Definition: GiWorldGeometry.h:51
height
GLint GLenum GLsizei GLsizei height
Definition: gles2_ext.h:110
length
GLuint GLsizei GLsizei * length
Definition: gles2_ext.h:274
width
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
OdGiEdgeData
Definition: GiGeometry.h:67
OdGiFastExtCalc::getWorldGeometry
OdGiWorldGeometry * getWorldGeometry() const
OdGiFastExtCalc::isViewportDrawEnabled
bool isViewportDrawEnabled() const
Definition: GiFastExtCalc.h:320
OdGiFastExtCalc::popClipBoundary
void popClipBoundary()
TD_PackPush.h
OdGeNurbCurve3d
Definition: GeNurbCurve3d.h:49
OdGiFastExtCalc::isSetExtentsCalled
bool isSetExtentsCalled() const
Definition: GiFastExtCalc.h:275
OdGiViewportGeometry
Definition: GiViewportGeometry.h:117
OdGiFastExtCalc::resetExtents
void resetExtents()
OdStack
Definition: OdStack.h:56
OdGiImageBGRA32
Definition: GiImage.h:213
GiBaseVectorizer.h
OdGiFastExtCalc::image
void image(const OdGiImageBGRA32 &img, const OdGePoint3d &origin, const OdGeVector3d &uVec, const OdGeVector3d &vVec, OdGiRasterImage::TransparencyMode trpMode=OdGiRasterImage::kTransparency8Bit)
OdGiRasterImage::TransparencyMode
TransparencyMode
Definition: GiRasterImage.h:82
ODRX_ABSTRACT
#define ODRX_ABSTRACT
Definition: OdPlatformSettings.h:117
OdGiDeviationType
OdGiDeviationType
Definition: GiCommonDraw.h:64
OdGiWorldDraw
Definition: GiWorldDraw.h:44
OdGiFastExtCalc::getViewportGeometry
OdGiViewportGeometry * getViewportGeometry() const
OdGiFastExtCalc::shape
void shape(const OdGePoint3d &position, const OdGeVector3d &normal, const OdGeVector3d &direction, int shapeNumber, const OdGiTextStyle *pTextStyle)
OdGiFastExtCalc::setDrawInvisibleNested
void setDrawInvisibleNested(bool bSet)
Definition: GiFastExtCalc.h:300
OdGiFastExtCalc::popModelTransform
void popModelTransform()
OdGeExtents3d
Definition: GeExtents3d.h:45
OdGiFastExtCalc::deviation
double deviation(const OdGiDeviationType deviationType, const OdGePoint3d &pointOnCurve) const
OdGiFastExtCalc::text
void text(const OdGePoint3d &position, const OdGeVector3d &normal, const OdGeVector3d &direction, const OdChar *msg, OdInt32 length, bool raw, const OdGiTextStyle *pTextStyle)
OdGiFastExtCalc::rowOfDots
void rowOfDots(OdInt32 numPoints, const OdGePoint3d &startPoint, const OdGeVector3d &dirToNextPoint)
OdGiFastExtCalc::shell
void shell(OdInt32 numVertices, const OdGePoint3d *vertexList, OdInt32 faceListSize, const OdInt32 *faceList, const OdGiEdgeData *pEdgeData=0, const OdGiFaceData *pFaceData=0, const OdGiVertexData *pVertexData=0)
OdGiFastExtCalcViewportDrawImpl
Definition: GiFastExtCalc.h:39
OdGiFastExtCalc::getWorldDraw
OdGiWorldDraw * getWorldDraw() const
OdGiRegenType
OdGiRegenType
Definition: GiCommonDraw.h:50
OdGiFastExtCalc::regenType
OdGiRegenType regenType() const
OdGiFastExtCalc::nurbs
void nurbs(const OdGeNurbCurve3d &nurbsCurve)
OdGiFastExtCalc::isDrawingInitiated
bool isDrawingInitiated() const
Definition: GiFastExtCalc.h:285
OdGiFastExtCalc::polyline
void polyline(OdInt32 numVertices, const OdGePoint3d *vertexList, const OdGeVector3d *pNormal=0, OdGsMarker baseSubEntMarker=-1)
OdStack.h
OdGiViewportDraw
Definition: GiViewportDraw.h:50
OdGiFastExtCalc::text
void text(const OdGePoint3d &position, const OdGeVector3d &normal, const OdGeVector3d &direction, double height, double width, double oblique, const OdString &msg)
GiTransformed.h