CFx SDK Documentation  2020SP3
DbMPolygon.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 _DBMPOLYGON_H_INCLUDED_
25 #define _DBMPOLYGON_H_INCLUDED_
26 
27 #include "DbHatch.h"
28 
29 class OdDbCircle;
30 class OdDb2dPolyline;
31 class OdDbPolyline;
32 class OdDbMPolygonCrossing;
34 class OdDbMPolygonNode;
35 
36 const double OdDbMPolygonCrossingFuzz = 1E-6;
37 
47 public:
49  virtual ~OdDbMPolygon();
50 
52 
53  virtual OdDbHatchPtr hatch();
54 
55  virtual double elevation() const;
56  virtual void setElevation(double elevation);
57 
58  virtual OdGeVector3d normal() const;
59  virtual void setNormal(const OdGeVector3d& normal);
60 
61  virtual OdResult evaluateHatch(bool bUnderestimateNumLines = false);
62 
64 
65  virtual const OdString& patternName() const;
66 
68  const OdString& patName);
69 
70  virtual double patternAngle() const;
71  virtual void setPatternAngle(double angle);
72 
73  virtual double patternSpace() const;
74  virtual void setPatternSpace(double space);
75 
76  virtual double patternScale() const;
77  virtual void setPatternScale(double scale);
78 
79  virtual bool patternDouble() const;
80  virtual void setPatternDouble(bool isDouble);
81 
82  virtual int numPatternDefinitions() const;
83  virtual void getPatternDefinitionAt(int index,
84  double& angle,
85  double& baseX,
86  double& baseY,
87  double& offsetX,
88  double& offsetY,
89  OdGeDoubleArray& dashes)
90  const;
91 
92  void setGradientAngle(double angle);
93  void setGradientShift( float shiftValue );
94  void setGradientOneColorMode( bool oneColorMode );
95  void setGradientColors( unsigned int count,
96  const OdCmColor* colors,
97  const double* values );
99  const OdString& gradName);
100 
101 
102  virtual OdCmColor patternColor() const;
103  virtual void setPatternColor(const OdCmColor& pc);
104 
112  virtual OdResult getArea(double& area) const;
113 
114  virtual OdGeVector2d getOffsetVector() const;
115 
117  bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
119  bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
121  bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
122 
126  virtual int numMPolygonLoops() const;
127 
128  virtual OdResult getMPolygonLoopAt(int loopIndex, OdGePoint2dArray& vertices,
129  OdGeDoubleArray& bulges) const;
130 
132  const OdGeDoubleArray& bulges, bool excludeCrossing = true,
133  double tol = OdDbMPolygonCrossingFuzz);
134 
135  virtual OdResult insertMPolygonLoopAt(int loopIndex,
136  const OdGePoint2dArray& vertices, const OdGeDoubleArray& bulges,
137  bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
138 
139  virtual OdResult removeMPolygonLoopAt(int loopIndex);
140 
144  enum loopDir {
145  kExterior = 0, // Loop direction is counter-clockwise
146  kInterior = 1, // Loop direction is clockwise
147  kAnnotation = 2 // Text
148  };
149 
157  virtual OdResult getLoopDirection(int lindex, OdDbMPolygon::loopDir& dir) const;
158 
167 
168  virtual bool isPointOnLoopBoundary(const OdGePoint3d& worldPt, int loop,
169  double tol = OdDbMPolygonCrossingFuzz) const;
170  virtual int isPointInsideMPolygon(const OdGePoint3d& worldPt, OdGeIntArray& loopsArray,
171  double tol = OdDbMPolygonCrossingFuzz) const;
172 
173  //FELIX_CHANGE_BEGIN
174  double getPerimeter() const;
175  int getClosestLoopTo( const OdGePoint3d& worldPt ) const;
177  OdIntArray &rejectedObjs,
178  bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz );
180  const OdArray<OdGeDoubleArray> &bulges, OdIntArray &rejectedObjs,
181  bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz );
182  //FELIX_CHANGE_END
183 
184 //FELIX_CHANGE_BEGIN
185 // from 21.1
195  int getParentLoop(int curLoop) const;
196 //FELIX_CHANGE_END
197  /* Not implemented
198 
199 
200  virtual OdResult getMPolygonTree(OdDbMPolygonNode*& loopNode) const;
201  virtual void deleteMPolygonTree(OdDbMPolygonNode* loopNode) const;
202 
203  virtual double getPerimeter() const;
204  virtual bool isBalanced() const;
205 
206  virtual OdResult balanceTree();
207  virtual OdResult balanceDisplay();
208 
209  //virtual OdResult getLoopAtGsMarker(OdGsMarker gsMark, int &loop) const;
210  virtual void getChildLoops(int curLoop, OdGeIntArray& selectedLoopIndexes) const;
211  virtual int getParentLoop(int curLoop) const;
212  virtual int getClosestLoopTo(const OdGePoint3d& worldPt) const;
213 
214  // Mpolyon loop crossing and inside methods.
215  //
216 
217  virtual OdResult loopCrossesItself(bool& crosses, bool findAll,
218  OdDbMPolygonCrossingArray& crossingsArray,
219  const OdGePoint2dArray& vertexPts,
220  const OdGeDoubleArray& vertexBulges,
221  double tol = OdDbMPolygonCrossingFuzz) const;
222 
223  virtual bool loopCrossesItself(const OdGePoint2dArray& vertexPts,
224  const OdGeDoubleArray& vertexBulges,
225  double tol = OdDbMPolygonCrossingFuzz) const;
226 
227  virtual OdResult loopCrossesMPolygon(bool& crosses, bool findAll,
228  OdDbMPolygonCrossingArray& crossingsArray,
229  const OdGePoint2dArray& testVertexPts,
230  const OdGeDoubleArray& testVertexBulges,
231  double tol = OdDbMPolygonCrossingFuzz) const;
232 
233  virtual bool selfCrosses(const OdGePoint2dArray& vertexPts,
234  const OdGeDoubleArray& vertexBulges,
235  double tol = OdDbMPolygonCrossingFuzz) const;
236 
237  virtual bool includesTouchingLoops(double tol = OdDbMPolygonCrossingFuzz) const;
238 
239  //virtual OdResult subGetClassID(void* pClsid) const;
240 
241  virtual OdResult intersectWith(
242  const OdDbEntity* ent,
243  OdDb::Intersect intType,
244  OdGePoint3dArray& points,
245  OdGsMarker thisGsMarker = 0,
246  OdGsMarker otherGsMarker = 0)
247  const;
248 
249  virtual OdResult intersectWith(
250  const OdDbEntity* ent,
251  OdDb::Intersect intType,
252  const OdGePlane& projPlane,
253  OdGePoint3dArray& points,
254  OdGsMarker thisGsMarker = 0,
255  OdGsMarker otherGsMarker = 0)
256  const;
257 
258  virtual OdResult getOsnapPoints(
259  OdDb::OsnapMode osnapMode,
260  OdGsMarker gsSelectionMark,
261  const OdGePoint3d& pickPoint,
262  const OdGePoint3d& lastPoint,
263  const OdGeMatrix3d& viewXform,
264  OdGePoint3dArray& snapPoints,
265  OdDbIntArray& geomIds) const;
266 
267  virtual OdResult getGripPoints(OdGePoint3dArray& gripPoints,
268  OdDbIntArray& osnapModes,
269  OdDbIntArray& geomIds) const;
270 
271  virtual OdResult moveGripPointsAt(const OdDbIntArray& indices,
272  const OdGeVector3d& offset);
273 
274  virtual OdResult getStretchPoints(OdGePoint3dArray& stretchPoints) const;
275 
276  virtual OdResult moveStretchPointsAt( const OdDbIntArray& indices,
277  const OdGeVector3d& offset);
278 
279  virtual OdResult createLoopsFromBoundaries (const OdDbObjectIdArray &ids,
280  OdIntArray &rejectedObjs,
281  bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
282 
283  virtual OdResult createLoops (const OdGePoint2dArrayArray &vertices,
284  const OdArray<OdGeDoubleArray> &bulges, OdIntArray &rejectedObjs,
285  bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
286  */
288  OdRxObjectPtrArray& entitySet) const;
289 
291  const OdGeMatrix3d& xfn );
292 
294  OdDbDwgFiler* pFiler);
295 
296  virtual void dwgOutFields(
297  OdDbDwgFiler* pFiler) const;
298 
300  OdDbDxfFiler* pFiler);
301 
302  virtual void dxfOutFields(
303  OdDbDxfFiler* pFiler) const;
304 
305  virtual bool subWorldDraw(
306  OdGiWorldDraw* pWd) const;
307 
309  OdDbDatabase* pDb,
310  bool doSubents);
311 
312  virtual void saveAs(
313  OdGiWorldDraw* pWd,
314  OdDb::DwgVersion ver ) const;
315 };
316 
318 
319 //FELIX_CHANGE_BEGIN
321 public:
323 public:
327 };
328 //FELIX_CHANGE_END
329 
330 #endif // _DBMPOLYGON_H_INCLUDED_
OdDbMPolygon::setPatternSpace
virtual void setPatternSpace(double space)
OdResult
OdResult
Definition: OdResult.h:29
OdDbMPolygon::patternAngle
virtual double patternAngle() const
OdDbMPolygon::getOffsetVector
virtual OdGeVector2d getOffsetVector() const
OdGeVector3d
Definition: GeVector3d.h:54
OdString
Definition: OdString.h:95
OdDbMPolygon::setPatternAngle
virtual void setPatternAngle(double angle)
OdDbDatabase
Definition: DbDatabase.h:421
OdDbMPolygon::subSetDatabaseDefaults
virtual void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents)
OdDbMPolygonNode
Definition: DbMPolygon.h:320
scale
scale
Definition: DimVarDefs.h:1684
tol
tol
Definition: DimVarDefs.h:2287
OdDbMPolygon::patternName
virtual const OdString & patternName() const
OdDbMPolygon::hatch
virtual OdDbHatchPtr hatch()
count
GLsizei GLsizei * count
Definition: gles2_ext.h:276
OdDbMPolygon::appendLoopFromBoundary
virtual OdResult appendLoopFromBoundary(const OdDbCircle *pCircle, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
OdDbPolyline
Definition: DbPolyline.h:63
OdDbMPolygon::insertMPolygonLoopAt
virtual OdResult insertMPolygonLoopAt(int loopIndex, const OdGePoint2dArray &vertices, const OdGeDoubleArray &bulges, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
OdDbMPolygon::appendLoopFromBoundary
virtual OdResult appendLoopFromBoundary(const OdDb2dPolyline *pPoly, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
OdDbMPolygon::OdDbMPolygon
OdDbMPolygon()
OdDbMPolygon::setGradientShift
void setGradientShift(float shiftValue)
E
E
Definition: SysVarDefs.h:422
OdArray
Definition: OdArray.h:591
OdDbMPolygon::getLoopDirection
virtual OdResult getLoopDirection(int lindex, OdDbMPolygon::loopDir &dir) const
OdDbMPolygon::isPointOnLoopBoundary
virtual bool isPointOnLoopBoundary(const OdGePoint3d &worldPt, int loop, double tol=OdDbMPolygonCrossingFuzz) const
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdDbMPolygon::dwgOutFields
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdDbMPolygon::setPatternDouble
virtual void setPatternDouble(bool isDouble)
OdDbMPolygon
Definition: DbMPolygon.h:46
index
GLuint index
Definition: gles2_ext.h:265
OdDbMPolygon::createLoopsFromBoundaries
OdResult createLoopsFromBoundaries(const OdDbObjectIdArray &ids, OdIntArray &rejectedObjs, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
OdDbMPolygon::setPatternScale
virtual void setPatternScale(double scale)
OdDb::DwgVersion
DwgVersion
Definition: OdaDefs.h:46
OdDbMPolygon::setGradientAngle
void setGradientAngle(double angle)
DbHatch.h
OdDbHatch::GradientPatternType
GradientPatternType
Definition: DbHatch.h:122
OdDbMPolygon::patternColor
virtual OdCmColor patternColor() const
OdDbMPolygonNode::mLoopIndex
int mLoopIndex
Definition: DbMPolygon.h:326
OdSmartPtr
Definition: SmartPtr.h:58
OdGePoint3d
Definition: GePoint3d.h:55
OdDbMPolygon::setPatternColor
virtual void setPatternColor(const OdCmColor &pc)
OdDbMPolygon::subWorldDraw
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
OdDbMPolygon::patternScale
virtual double patternScale() const
OdDbMPolygon::isPointInsideMPolygon
virtual int isPointInsideMPolygon(const OdGePoint3d &worldPt, OdGeIntArray &loopsArray, double tol=OdDbMPolygonCrossingFuzz) const
OdDbMPolygon::removeMPolygonLoopAt
virtual OdResult removeMPolygonLoopAt(int loopIndex)
OdDbMPolygon::patternDouble
virtual bool patternDouble() const
OdDbMPolygon::getParentLoop
int getParentLoop(int curLoop) const
OdDbMPolygon::getMPolygonLoopAt
virtual OdResult getMPolygonLoopAt(int loopIndex, OdGePoint2dArray &vertices, OdGeDoubleArray &bulges) const
OdDbMPolygon::numMPolygonLoops
virtual int numMPolygonLoops() const
OdDbMPolygon::dwgInFields
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
OdDbMPolygon::elevation
virtual double elevation() const
OdDbDxfFiler
Definition: DbFiler.h:194
OdGeVector2d
Definition: GeVector2d.h:51
OdDbMPolygon::setGradientOneColorMode
void setGradientOneColorMode(bool oneColorMode)
OdDbMPolygonNode::mChildren
OdArray< OdDbMPolygonNode * > mChildren
Definition: DbMPolygon.h:325
OdDbMPolygon::getArea
virtual OdResult getArea(double &area) const
OdDbMPolygon::loopDir
loopDir
Definition: DbMPolygon.h:144
OdDbMPolygon::evaluateHatch
virtual OdResult evaluateHatch(bool bUnderestimateNumLines=false)
OdGiWorldDraw
Definition: GiWorldDraw.h:44
OdDb2dPolyline
Definition: Db2dPolyline.h:68
OdDbEntity
Definition: DbEntity.h:90
OdDbMPolygon::setGradientColors
void setGradientColors(unsigned int count, const OdCmColor *colors, const double *values)
OdDbMPolygon::setGradient
void setGradient(OdDbHatch::GradientPatternType gradType, const OdString &gradName)
OdDbMPolygonNode::OdDbMPolygonNode
OdDbMPolygonNode()
OdDbMPolygon::setLoopDirection
virtual OdResult setLoopDirection(int lindex, OdDbMPolygon::loopDir dir)
OdDbMPolygon::getPerimeter
double getPerimeter() const
OdDbMPolygonPtr
OdSmartPtr< OdDbMPolygon > OdDbMPolygonPtr
Definition: DbMPolygon.h:317
OdDbMPolygon::~OdDbMPolygon
virtual ~OdDbMPolygon()
OdDbMPolygon::dxfInFields
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdDbMPolygon::getPatternDefinitionAt
virtual void getPatternDefinitionAt(int index, double &angle, double &baseX, double &baseY, double &offsetX, double &offsetY, OdGeDoubleArray &dashes) const
OdDbMPolygon::appendMPolygonLoop
virtual OdResult appendMPolygonLoop(const OdGePoint2dArray &vertices, const OdGeDoubleArray &bulges, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
OdDbMPolygon::setNormal
virtual void setNormal(const OdGeVector3d &normal)
OdDbMPolygon::subTransformBy
virtual OdResult subTransformBy(const OdGeMatrix3d &xfn)
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdDbMPolygon::subExplode
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const
OdDbMPolygon::getClosestLoopTo
int getClosestLoopTo(const OdGePoint3d &worldPt) const
OdDbMPolygon::saveAs
virtual void saveAs(OdGiWorldDraw *pWd, OdDb::DwgVersion ver) const
OdDbMPolygon::ODDB_DECLARE_MEMBERS
ODDB_DECLARE_MEMBERS(OdDbMPolygon)
OdDbMPolygon::normal
virtual OdGeVector3d normal() const
OdDbMPolygon::patternSpace
virtual double patternSpace() const
OdDbMPolygonCrossingFuzz
const double OdDbMPolygonCrossingFuzz
Definition: DbMPolygon.h:36
OdDbMPolygon::dxfOutFields
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
OdDbMPolygon::appendLoopFromBoundary
virtual OdResult appendLoopFromBoundary(const OdDbPolyline *pPoly, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
OdCmColor
Definition: CmColor.h:59
OdDbHatch::HatchPatternType
HatchPatternType
Definition: DbHatch.h:102
OdDbMPolygonCrossingArray
OdArray< OdDbMPolygonCrossing, OdPlainObjectsAllocator< OdDbMPolygonCrossing > > OdDbMPolygonCrossingArray
Definition: DbMPolygon.h:32
OdDbMPolygon::patternType
virtual OdDbHatch::HatchPatternType patternType() const
OdDbMPolygon::setElevation
virtual void setElevation(double elevation)
OdDbDwgFiler
Definition: DbFiler.h:1031
OdDbCircle
Definition: DbCircle.h:55
OdDbMPolygon::numPatternDefinitions
virtual int numPatternDefinitions() const
OdDbMPolygon::setPattern
virtual void setPattern(OdDbHatch::HatchPatternType patType, const OdString &patName)
OdDbMPolygon::createLoops
OdResult createLoops(const OdArray< OdGePoint2dArray > &vertices, const OdArray< OdGeDoubleArray > &bulges, OdIntArray &rejectedObjs, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
OdDbMPolygonNode::mParent
OdDbMPolygonNode * mParent
Definition: DbMPolygon.h:324