CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbMPolygon.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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
30class OdDbCircle;
31class OdDb2dPolyline;
32class OdDbPolyline;
33class OdDbMPolygonCrossing;
37
38const double OdDbMPolygonCrossingFuzz = 1E-6;
39
40#ifdef MPOLYGON_EXPORTS
41# define MPOLYGON_EXPORT OD_TOOLKIT_EXPORT
42#else
43# define MPOLYGON_EXPORT OD_TOOLKIT_IMPORT
44#endif
45
54public:
59
63 virtual ~OdDbMPolygon();
64
65 //DOM-IGNORE-BEGIN
67 //DOM-IGNORE-END
68
75
81 virtual OdDbHatchPtr hatch() const;
82
91 virtual double elevation() const;
92
102 virtual void setElevation(double elevation);
103
109 virtual OdGeVector3d normal() const;
110
116 virtual void setNormal(const OdGeVector3d& normal);
117
125 virtual OdResult evaluateHatch(bool bUnderestimateNumLines = false);
126
140
146 virtual OdString patternName() const;
147
167 const OdString& patName);
168
176 virtual double patternAngle() const;
177
184 virtual void setPatternAngle(double angle);
185
194 virtual double patternSpace() const;
195
205 virtual void setPatternSpace(double space);
206
212 virtual double patternScale() const;
213
219 virtual void setPatternScale(double scale);
220
229 virtual bool patternDouble() const;
230
240 virtual void setPatternDouble(bool isDouble);
241
247 virtual int numPatternDefinitions() const;
248
262 double& angle,
263 double& baseX,
264 double& baseY,
265 double& offsetX,
266 double& offsetY,
267 OdGeDoubleArray& dashes)
268 const;
269
278 void setGradientAngle(double angle);
279
290 void setGradientShift( float shiftValue );
291
297 void setGradientOneColorMode( bool oneColorMode );
298
316 void setGradientColors( unsigned int count,
317 const OdCmColor* colors,
318 const double* values );
319
337 const OdString& gradName);
338
344 virtual OdCmColor patternColor() const;
345
351 virtual void setPatternColor(const OdCmColor& pc);
352
361 virtual OdResult getArea(double& area, bool areaViaHatch = false) const;
362
369
384 bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
385
401 bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
402
418 bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
419
423 virtual int numMPolygonLoops() const;
424
436 virtual OdResult getMPolygonLoopAt(int loopIndex, OdGePoint2dArray& vertices,
437 OdGeDoubleArray& bulges) const;
438
451 const OdGeDoubleArray& bulges, bool excludeCrossing = true,
453
466 virtual OdResult insertMPolygonLoopAt(int loopIndex,
467 const OdGePoint2dArray& vertices, const OdGeDoubleArray& bulges,
468 bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
469
491 virtual OdResult replaceMPolygonLoopAt(int loopIndex,
492 const OdGePoint2dArray& vertices, const OdGeDoubleArray& bulges,
493 bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
494
495
515 virtual OdResult replaceMPolygonLoopAt(const OdIntArray& loopIndices,
516 const OdGePoint2dArrayArray& vertices, const OdArray<OdGeDoubleArray>& bulges, OdIntArray &rejectedLoop,
517 bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
518
535 virtual OdResult removeMPolygonLoopAt(int loopIndex);
536
540 enum loopDir {
542 kExterior = 0,
544 kInterior = 1,
546 kAnnotation = 2
547 };
548
557 virtual OdResult getLoopDirection(int lindex, OdDbMPolygon::loopDir& dir) const;
558
568
580 virtual bool isPointOnLoopBoundary(const OdGePoint3d& worldPt, int loop,
581 double tol = OdDbMPolygonCrossingFuzz) const;
582
595 virtual int isPointInsideMPolygon(const OdGePoint3d& worldPt, OdGeIntArray& loopsArray,
596 double tol = OdDbMPolygonCrossingFuzz) const;
597
608 virtual int getParentLoop(int curLoop) const;
609
621 virtual OdResult getMPolygonTree(OdDbMPolygonNode*& loopNode) const;
622
629 virtual void deleteMPolygonTree(OdDbMPolygonNode* loopNode) const;
630
646 virtual int getClosestLoopTo(const OdGePoint3d& worldPt) const;
647
655 virtual double getPerimeter() const;
656
672
684 virtual bool isBalanced() const;
685
699
719 OdIntArray &rejectedObjs,
720 bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
721
740 const OdArray<OdGeDoubleArray> &bulges, OdIntArray &rejectedObjs,
741 bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
742
743
756 virtual OdResult getChildLoops(int curLoop, OdGeIntArray& selectedLoopIndexes) const;
757
758
759 /* Not implemented
760
761
762
763
764
765
766
767
768
769
770
771 //virtual OdResult getLoopAtGsMarker(OdGsMarker gsMark, int &loop) const;
772 virtual int getParentLoop(int curLoop) const;
773 virtual int getClosestLoopTo(const OdGePoint3d& worldPt) const;
774
775 // Mpolyon loop crossing and inside methods.
776 //
777
778 virtual OdResult loopCrossesItself(bool& crosses, bool findAll,
779 OdDbMPolygonCrossingArray& crossingsArray,
780 const OdGePoint2dArray& vertexPts,
781 const OdGeDoubleArray& vertexBulges,
782 double tol = OdDbMPolygonCrossingFuzz) const;
783
784 virtual bool loopCrossesItself(const OdGePoint2dArray& vertexPts,
785 const OdGeDoubleArray& vertexBulges,
786 double tol = OdDbMPolygonCrossingFuzz) const;
787
788 virtual OdResult loopCrossesMPolygon(bool& crosses, bool findAll,
789 OdDbMPolygonCrossingArray& crossingsArray,
790 const OdGePoint2dArray& testVertexPts,
791 const OdGeDoubleArray& testVertexBulges,
792 double tol = OdDbMPolygonCrossingFuzz) const;
793
794 virtual bool selfCrosses(const OdGePoint2dArray& vertexPts,
795 const OdGeDoubleArray& vertexBulges,
796 double tol = OdDbMPolygonCrossingFuzz) const;
797
798 virtual bool includesTouchingLoops(double tol = OdDbMPolygonCrossingFuzz) const;
799
800 //virtual OdResult subGetClassID(void* pClsid) const;
801
802 virtual OdResult intersectWith(
803 const OdDbEntity* ent,
804 OdDb::Intersect intType,
805 OdGePoint3dArray& points,
806 OdGsMarker thisGsMarker = 0,
807 OdGsMarker otherGsMarker = 0)
808 const;
809
810 virtual OdResult intersectWith(
811 const OdDbEntity* ent,
812 OdDb::Intersect intType,
813 const OdGePlane& projPlane,
814 OdGePoint3dArray& points,
815 OdGsMarker thisGsMarker = 0,
816 OdGsMarker otherGsMarker = 0)
817 const;
818
819 virtual OdResult getOsnapPoints(
820 OdDb::OsnapMode osnapMode,
821 OdGsMarker gsSelectionMark,
822 const OdGePoint3d& pickPoint,
823 const OdGePoint3d& lastPoint,
824 const OdGeMatrix3d& viewXform,
825 OdGePoint3dArray& snapPoints,
826 OdDbIntArray& geomIds) const;
827
828 virtual OdResult getGripPoints(OdGePoint3dArray& gripPoints,
829 OdDbIntArray& osnapModes,
830 OdDbIntArray& geomIds) const;
831
832 virtual OdResult moveGripPointsAt(const OdDbIntArray& indices,
833 const OdGeVector3d& offset);
834
835 virtual OdResult getStretchPoints(OdGePoint3dArray& stretchPoints) const;
836
837 virtual OdResult moveStretchPointsAt( const OdDbIntArray& indices,
838 const OdGeVector3d& offset);
839
840 virtual OdResult createLoopsFromBoundaries (const OdDbObjectIdArray &ids,
841 OdIntArray &rejectedObjs,
842 bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
843
844 virtual OdResult createLoops (const OdGePoint2dArrayArray &vertices,
845 const OdArray<OdGeDoubleArray> &bulges, OdIntArray &rejectedObjs,
846 bool excludeCrossing = true, double tol = OdDbMPolygonCrossingFuzz);
847 */
848
849
856
863 OdRxObjectPtrArray& entitySet) const;
864
871 const OdGeMatrix3d& xfn );
872
892 OdDbDwgFiler* pFiler);
893
894 virtual void dwgOutFields(
895 OdDbDwgFiler* pFiler) const;
896
916 OdDbDxfFiler* pFiler);
917
918 virtual void dxfOutFields(
919 OdDbDxfFiler* pFiler) const;
920
921 virtual bool subWorldDraw(
922 OdGiWorldDraw* pWd) const;
923
943 OdDbDatabase* pDb,
944 bool doSubents);
945
956 virtual void saveAs(
957 OdGiWorldDraw* pWd,
958 OdDb::DwgVersion ver ) const;
959};
960
966
971//FELIX_CHANGE_BEGIN
972/*
973class OdDbMPolygonNode {
974*/
976public:
981
982public:
988 /*
989 OdInt32 mLoopIndex;
990 */
992};
993//FELIX_CHANGE_END
994inline
996 : mLoopIndex(-1), mParent(NULL)
997{
998}
999
1000#endif // _DBMPOLYGON_H_INCLUDED_
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
const double OdDbMPolygonCrossingFuzz
Definition: DbMPolygon.h:38
#define MPOLYGON_EXPORT
Definition: DbMPolygon.h:43
OdSmartPtr< OdDbMPolygon > OdDbMPolygonPtr
Definition: DbMPolygon.h:965
OdArray< OdGePoint2dArray > OdGePoint2dArrayArray
Definition: DbMPolygon.h:35
OdArray< OdDbMPolygonCrossing, OdPlainObjectsAllocator< OdDbMPolygonCrossing > > OdDbMPolygonCrossingArray
Definition: DbMPolygon.h:34
tol
Definition: DimVarDefs.h:2287
scale
Definition: DimVarDefs.h:1684
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
E
Definition: SysVarDefs.h:422
HatchPatternType
Definition: DbHatch.h:100
GradientPatternType
Definition: DbHatch.h:120
void setGradientOneColorMode(bool oneColorMode)
virtual OdResult subTransformBy(const OdGeMatrix3d &xfn)
virtual OdResult createLoops(const OdGePoint2dArrayArray &vertices, const OdArray< OdGeDoubleArray > &bulges, OdIntArray &rejectedObjs, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
virtual bool patternDouble() const
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
virtual OdResult getMPolygonLoopAt(int loopIndex, OdGePoint2dArray &vertices, OdGeDoubleArray &bulges) const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
virtual OdResult balanceDisplay()
virtual int numMPolygonLoops() const
virtual OdResult balanceTree()
virtual OdResult appendLoopFromBoundary(const OdDb2dPolyline *pPoly, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
virtual double patternScale() const
virtual OdResult getChildLoops(int curLoop, OdGeIntArray &selectedLoopIndexes) const
virtual int getClosestLoopTo(const OdGePoint3d &worldPt) const
virtual double elevation() const
virtual OdDbEntityPtr subSubentPtr(const OdDbFullSubentPath &path) const ODRX_OVERRIDE
virtual OdResult getArea(double &area, bool areaViaHatch=false) const
void setGradientAngle(double angle)
virtual OdDbHatchPtr hatch() const
virtual bool isPointOnLoopBoundary(const OdGePoint3d &worldPt, int loop, double tol=OdDbMPolygonCrossingFuzz) const
void setGradient(OdDbHatch::GradientPatternType gradType, const OdString &gradName)
virtual OdResult appendLoopFromBoundary(const OdDbPolyline *pPoly, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
virtual int getParentLoop(int curLoop) const
virtual void setPatternScale(double scale)
virtual OdResult getMPolygonTree(OdDbMPolygonNode *&loopNode) const
virtual OdResult replaceMPolygonLoopAt(const OdIntArray &loopIndices, const OdGePoint2dArrayArray &vertices, const OdArray< OdGeDoubleArray > &bulges, OdIntArray &rejectedLoop, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
virtual OdResult appendMPolygonLoop(const OdGePoint2dArray &vertices, const OdGeDoubleArray &bulges, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
virtual void setPatternAngle(double angle)
virtual int numPatternDefinitions() const
virtual OdResult createLoopsFromBoundaries(const OdDbObjectIdArray &ids, OdIntArray &rejectedObjs, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
virtual OdResult setLoopDirection(int lindex, OdDbMPolygon::loopDir dir)
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
virtual void setPatternColor(const OdCmColor &pc)
virtual void setElevation(double elevation)
void setGradientColors(unsigned int count, const OdCmColor *colors, const double *values)
virtual void getPatternDefinitionAt(int index, double &angle, double &baseX, double &baseY, double &offsetX, double &offsetY, OdGeDoubleArray &dashes) const
virtual OdGeVector3d normal() const
virtual void setPattern(OdDbHatch::HatchPatternType patType, const OdString &patName)
virtual void setPatternDouble(bool isDouble)
virtual OdResult appendLoopFromBoundary(const OdDbCircle *pCircle, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
virtual OdResult insertMPolygonLoopAt(int loopIndex, const OdGePoint2dArray &vertices, const OdGeDoubleArray &bulges, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
virtual OdResult removeMPolygonLoopAt(int loopIndex)
virtual OdResult replaceMPolygonLoopAt(int loopIndex, const OdGePoint2dArray &vertices, const OdGeDoubleArray &bulges, bool excludeCrossing=true, double tol=OdDbMPolygonCrossingFuzz)
virtual OdResult getLoopDirection(int lindex, OdDbMPolygon::loopDir &dir) const
virtual OdString patternName() const
virtual bool isBalanced() const
virtual double getPerimeter() const
virtual OdGeVector2d getOffsetVector() const
virtual double patternSpace() const
ODDB_DECLARE_MEMBERS(OdDbMPolygon)
virtual ~OdDbMPolygon()
virtual OdDbHatchPtr hatch()
virtual void deleteMPolygonTree(OdDbMPolygonNode *loopNode) const
virtual OdCmColor patternColor() const
virtual OdResult evaluateHatch(bool bUnderestimateNumLines=false)
virtual OdDbHatch::HatchPatternType patternType() const
virtual void setNormal(const OdGeVector3d &normal)
void setGradientShift(float shiftValue)
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
virtual double patternAngle() const
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const
virtual void saveAs(OdGiWorldDraw *pWd, OdDb::DwgVersion ver) const
virtual void setPatternSpace(double space)
virtual void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents)
virtual int isPointInsideMPolygon(const OdGePoint3d &worldPt, OdGeIntArray &loopsArray, double tol=OdDbMPolygonCrossingFuzz) const
OdDbMPolygonNode * mParent
Definition: DbMPolygon.h:984
OdArray< OdDbMPolygonNode * > mChildren
Definition: DbMPolygon.h:986
GLuint index
Definition: gles2_ext.h:265
GLsizei GLsizei * count
Definition: gles2_ext.h:276
DwgVersion
Definition: OdaDefs.h:47