CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbHatch.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 OD_DBHATCH_H
25#define OD_DBHATCH_H
26
27#include "TD_PackPush.h"
28
29#include "DbEntity.h"
30#include "Ge/GePoint2dArray.h"
31#include "IntArray.h"
32//#include "Ge/GeVoidPointerArray.h"
33#include "CmColorArray.h"
34#include "HatchPattern.h"
35#include "DwgDeclareMembers.h"
36#include "DbRegion.h"
37#include "UInt16Array.h"
38
39#define HATCH_PATTERN_NAME_LENGTH 32
40
41
46
47
65{
66public:
68
70
72 {
73 kDefault = 0, // Not yet specified.
74 kExternal = 1, // Defined by external entities.
75 kPolyline = 2, // Defined by OdGe polyline.
76 kDerived = 4, // Derived from a picked point.
77 kTextbox = 8, // Defined by text.
78 kOutermost = 0x10, // Outermost loop.
79 kNotClosed = 0x20, // Open loop.
80 kSelfIntersecting = 0x40, // Self-intersecting loop.
81 kTextIsland = 0x80, // Text loop surrounded by an even number of loops.
82 kDuplicate = 0x100, // Duplicate loop.
83 kIsAnnotative = 0x200, // The bounding area is an annotative block.
84 kDoesNotSupportScale = 0x400, // The bounding type does not support scaling
85 kForceAnnoAllVisible = 0x800, // Forces all annotatives to be visible
86 kOrientToPaper = 0x1000, // Orients hatch loop to paper
87 kIsAnnotativeBlock = 0x2000 // Describes if the hatch is an annotative block.
88 };
89
91 {
92 kNone = 0, // Skip this segment.
93 kLine = 1, // Linear.
94 kCirArc = 2, // Circular arc.
95 kEllArc = 3, // Elliptical arc.
96 kSpline = 4 // Spline curve.
97 };
98
100 {
101 kUserDefined = 0, // User-defined hatch.
102 kPreDefined = 1, // Defined in acad.pat and acadiso.pat.
103 kCustomDefined = 2 // In its own PAT file.
104 };
105
107 {
108 kNormal = 0, // Hatch toggles on each boundary.
109 kOuter = 1, // Hatch turns off after first inner loop.
110 kIgnore = 2 // Hatch ignores inner loop
111 };
112
114 {
115 kHatchObject = 0, // Classic hatch
116 kGradientObject = 1 // Color gradient
117 };
118
120 {
121 kPreDefinedGradient = 0, // Predefined gradient pattern.
122 kUserDefinedGradient = 1 // User-defined gradient pattern.
123 };
124
131 double elevation() const;
132
142 double elevation);
143
148
155 const OdGeVector3d& normal);
156
160 virtual bool isPlanar() const { return true; }
161
183 OdGePlane& plane,
184 OdDb::Planarity& planarity) const;
185
189 int numLoops() const;
190
200 int loopIndex) const;
201
212 int loopIndex,
213 EdgeArray& edgePtrs) const;
214
226 int loopIndex,
227 OdGePoint2dArray& vertices,
228 OdGeDoubleArray& bulges) const;
229
267 OdInt32 loopType,
268 EdgeArray& edgePtrs);
269
296 OdInt32 loopType,
297 const OdGePoint2dArray& vertices,
298 const OdGeDoubleArray& bulges);
299
325 OdInt32 loopType,
326 const OdDbObjectIdArray& dbObjIds);
327
362 void appendOrderedLoop(OdInt32 loopType, EdgeArray& edgePtrs);
363
391 int loopIndex,
392 OdInt32 loopType,
393 EdgeArray& edgePtrs);
394
423 int loopIndex,
424 OdInt32 loopType,
425 const OdGePoint2dArray& vertices,
426 const OdGeDoubleArray& bulges);
427
453 int loopIndex, OdInt32 loopType,
454 const OdDbObjectIdArray& dbObjIds);
455
462 int loopIndex);
463
471 bool associative() const;
472
482 bool isAssociative);
483
494 int loopIndex,
495 OdDbObjectIdArray& dbObjIds) const;
496
506 OdDbObjectIdArray& dbObjIds) const;
507
518 int loopIndex,
519 const OdDbObjectIdArray& dbObjIds);
520
525
541
545 bool isSolidFill() const;
546
547
552
574 const OdString& patName);
575
601 const OdString& patName,
602 double angle,
603 double scale,
604 const OdHatchPattern& pat,
605 OdGePoint2d originPoint = OdGePoint2d());
606
613 double patternAngle() const;
614
622 double angle);
623
630 double patternSpace() const;
631
641 double space);
642
646 double patternScale() const;
647
654 double scale);
655
662 bool patternDouble() const;
663
673 bool isDouble);
674
679
692 int lineIndex,
693 double& lineAngle,
694 double& baseX,
695 double& baseY,
696 double& offsetX,
697 double& offsetY,
698 OdGeDoubleArray& dashes) const;
699
708 void regeneratePattern(bool forceReload = true);
709
724
741 OdDbHatch::HatchStyle hatchStyle);
742
746 int numSeedPoints() const;
747
754 unsigned seedIndex) const;
755
763 unsigned seedIndex,
764 const OdGePoint2d& point);
765
771 void appendSeedPoint(const OdGePoint2d& point);
772
778 void removeSeedPointAt(int seedPointIndex);
779
783 double pixelSize() const;
784
791 double pixelSize);
792
811 OdDbDwgFiler* pFiler);
812
828 virtual void dwgOutFields(
829 OdDbDwgFiler* pFiler) const;
830
849 OdDbDxfFiler* pFiler);
850
866 virtual void dxfOutFields(
867 OdDbDxfFiler* pFiler) const;
868
870 void* pClsid) const;
871
872 virtual bool subWorldDraw(
873 OdGiWorldDraw* pWd) const;
874
875 virtual void subViewportDraw(
876 OdGiViewportDraw* pWd) const;
877
879 const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
880
882 const OdGeMatrix3d& xfm,
883 OdDbEntityPtr& pCopy) const ODRX_OVERRIDE;
884
887 OdDbObjectId& replaceId,
888 bool& exchangeXData);
889
891 OdDbDatabase *pDb,
892 bool doSubents);
893
902 bool bUnderestimateNumLines = false) const;
903
910 int numHatchLines() const;
911
920 int lineIndex,
921 OdGePoint2d& startPoint,
922 OdGePoint2d& endPoint) const;
923
931 OdGePoint2dArray& startPoints,
932 OdGePoint2dArray& endPoints) const;
933
935 OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE;
936
942 virtual void openedForModify(
943 const OdDbObject* pObject);
944
945 virtual void modifiedGraphics(
946 const OdDbObject* pObject);
947
948 /* virtual void subSwapIdWith(OdDbObjectId otherId, bool swapXdata = false, bool swapExtDict = false);
949 virtual void swapReferences(const OdDbIdMapping& idMap);*/
950
951
965
981 OdDbHatch::HatchObjectType hatchObjectType);
982
986 virtual bool isGradient() const;
987
991 virtual bool isHatch() const;
992
1006
1011
1029 OdDbHatch::GradientPatternType gradientType,
1030 const OdString& gradientName);
1031
1038 double gradientAngle() const;
1039
1048 void setGradientAngle(double angle);
1049
1057 OdCmColorArray& colors,
1058 OdGeDoubleArray& values) const;
1059
1077 OdUInt32 count,
1078 const OdCmColor* colors,
1079 const double* values);
1080
1085
1091 bool oneColorMode);
1092
1102 double getShadeTintValue() const;
1103
1113 double luminance);
1114
1123 double gradientShift() const;
1124
1135 void setGradientShift(double gradientShift);
1136
1144 double value,
1145 OdCmColor& color) const;
1146
1159 OdDbIdPair& idPair,
1160 OdDbObject* pOwnerObject ,
1161 OdDbIdMapping& ownerIdMap);
1162
1163 void subClose();
1164
1192 const OdString& patName,
1193 double angle,
1194 double scale,
1195 const OdHatchPattern& pat);
1196
1197
1202
1203
1208
1215
1220
1222
1230 virtual OdResult getArea(double& area) const;
1231
1239
1254 static OdResult makeClosedLoop(EdgeArray& edgePtrs, const OdDbObjectIdArray& dbObjIds, const OdGeTol& gapTolerance, const bool& isEdgeArrayConsistent);
1255
1268
1281
1293
1305
1314 void getMarkedModifiedLoops(OdUInt16Array& indicesMarkedLoops) const;
1315
1323
1345
1347 const OdGePoint3d& pickPoint,const OdGeMatrix3d& xfm,
1348 OdDbFullSubentPathArray& subentPaths,
1349 const OdDbObjectIdArray* pEntAndInsertStack = 0) const;
1351 OdGsMarkerArray& gsMarkers) const;
1353
1358
1362 void setBackgroundColor(const OdCmColor& color);
1363
1365};
1370
1371DBENT_EXPORT EdgeArray oddbCreateEdgesFromEntity(const OdDbEntity* pEnt, const OdGePlane& hatchPlane, const bool bLeadToXAxis = false);
1372
1373#include "TD_PackPop.h"
1374
1375#endif /* OD_DBHATCH_H */
@ kDefault
Definition: BrEnums.h:132
#define DBENT_EXPORT
Definition: DbExport.h:67
DBENT_EXPORT EdgeArray oddbCreateEdgesFromEntity(const OdDbEntity *pEnt, const OdGePlane &hatchPlane, const bool bLeadToXAxis=false)
OdSmartPtr< OdDbHatch > OdDbHatchPtr
Definition: DbHatch.h:1369
OdArray< OdGeCurve2d * > EdgeArray
Definition: DbHatch.h:45
scale
Definition: DimVarDefs.h:1684
ptrdiff_t OdGsMarker
unsigned int OdUInt32
unsigned short OdUInt16
int OdInt32
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
void regeneratePattern(bool forceReload=true)
virtual void subViewportDraw(OdGiViewportDraw *pWd) const
void insertLoopAt(int loopIndex, OdInt32 loopType, EdgeArray &edgePtrs)
double pixelSize() const
void getAssocObjIds(OdDbObjectIdArray &dbObjIds) const
OdResult markModifiedLoop(const OdDbHandle entityHandle)
void getLoopAt(int loopIndex, OdGePoint2dArray &vertices, OdGeDoubleArray &bulges) const
static OdResult makeClosedLoop(EdgeArray &edgePtrs, const OdDbObjectIdArray &dbObjIds, const OdGeTol &gapTolerance, const bool &isEdgeArrayConsistent)
OdResult setShadeTintValueAndColor2(double value)
void setElevation(double elevation)
double patternSpace() const
void evaluateGradientColorAt(double value, OdCmColor &color) const
void subClose()
bool associative() const
double patternScale() const
double getShadeTintValue() const
void setGradientOneColorMode(bool oneColorMode)
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
void appendLoop(OdInt32 loopType, const OdDbObjectIdArray &dbObjIds)
void setBackgroundColor(const OdCmColor &color)
void setOriginPoint(const OdGePoint2d &pt)
OdCmColor backgroundColor() const
OdDbObjectPtr decomposeForSave(OdDb::DwgVersion ver, OdDbObjectId &replaceId, bool &exchangeXData)
void setPattern(OdDbHatch::HatchPatternType patType, const OdString &patName)
virtual OdResult subGetTransformedCopy(const OdGeMatrix3d &xfm, OdDbEntityPtr &pCopy) const ODRX_OVERRIDE
bool isSolidFill() const
bool patternDouble() const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
double patternAngle() const
OdString gradientName() const
HatchPatternType
Definition: DbHatch.h:100
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm) ODRX_OVERRIDE
GradientPatternType
Definition: DbHatch.h:120
virtual OdDbEntityPtr subSubentPtr(const OdDbFullSubentPath &path) const
virtual OdResult subGetSubentPathsAtGsMarker(OdDb::SubentType type, OdGsMarker gsMark, const OdGePoint3d &pickPoint, const OdGeMatrix3d &xfm, OdDbFullSubentPathArray &subentPaths, const OdDbObjectIdArray *pEntAndInsertStack=0) const
OdInt32 loopTypeAt(int loopIndex) const
OdGeVector3d normal() const
OdGeMatrix3d getEcs() const
void clearMarkModifiedLoops()
double gradientAngle() const
void setNormal(const OdGeVector3d &normal)
DWGMAP_DECLARE_MEMBERS(OdDbHatch)
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdDbHatch::HatchPatternType patternType() const
OdResult updateMarkedLoops()
void setAssociative(bool isAssociative)
int numSeedPoints() const
void appendLoop(OdInt32 loopType, const OdGePoint2dArray &vertices, const OdGeDoubleArray &bulges)
void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents)
void appendSeedPoint(const OdGePoint2d &point)
virtual bool isGradient() const
void appendToOwner(OdDbIdPair &idPair, OdDbObject *pOwnerObject, OdDbIdMapping &ownerIdMap)
void removeLoopAt(int loopIndex)
void getLoopAt(int loopIndex, EdgeArray &edgePtrs) const
HatchLoopType
Definition: DbHatch.h:72
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
void removeSeedPointAt(int seedPointIndex)
virtual OdResult subGetGsMarkersAtSubentPath(const OdDbFullSubentPath &subPath, OdGsMarkerArray &gsMarkers) const
virtual OdResult subGetClassID(void *pClsid) const
void setHatchStyle(OdDbHatch::HatchStyle hatchStyle)
void setShadeTintValue(double luminance)
void getPatternDefinitionAt(int lineIndex, double &lineAngle, double &baseX, double &baseY, double &offsetX, double &offsetY, OdGeDoubleArray &dashes) const
virtual void modifiedGraphics(const OdDbObject *pObject)
double elevation() const
OdGePoint2d originPoint() const
void setPatternSpace(double space)
void setGradientAngle(double angle)
OdDbHatch::GradientPatternType gradientType() const
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const ODRX_OVERRIDE
void setPatternAngle(double angle)
int numPatternDefinitions() const
void setPatternScale(double scale)
void setSeedPointAt(unsigned seedIndex, const OdGePoint2d &point)
HatchEdgeType
Definition: DbHatch.h:91
int numHatchLines() const
void appendLoop(OdInt32 loopType, EdgeArray &edgePtrs)
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
void setPatternDouble(bool isDouble)
OdResult markModifiedLoop(const OdUInt16 loopIndex)
void getAssocObjIdsAt(int loopIndex, OdDbObjectIdArray &dbObjIds) const
void appendOrderedLoop(OdInt32 loopType, EdgeArray &edgePtrs)
void getMarkedModifiedLoops(OdUInt16Array &indicesMarkedLoops) const
void insertLoopAt(int loopIndex, OdInt32 loopType, const OdGePoint2dArray &vertices, const OdGeDoubleArray &bulges)
void setHatchObjectType(OdDbHatch::HatchObjectType hatchObjectType)
virtual OdResult explodeGeometry(OdRxObjectPtrArray &entitySet) const
double gradientShift() const
OdHatchPattern getRawPattern() const
OdResult evaluateHatch(bool bUnderestimateNumLines=false) const
void setPattern(OdDbHatch::HatchPatternType patType, const OdString &patName, double angle, double scale, const OdHatchPattern &pat, OdGePoint2d originPoint=OdGePoint2d())
virtual OdResult getArea(double &area) const
OdDbHatch::HatchObjectType hatchObjectType() const
virtual OdResult getPlane(OdGePlane &plane, OdDb::Planarity &planarity) const
bool getGradientOneColorMode() const
void insertLoopAt(int loopIndex, OdInt32 loopType, const OdDbObjectIdArray &dbObjIds)
void removeAssocObjIds()
OdResult unmarkModifiedLoop(const OdDbHandle entityHandle)
OdDbHatch::HatchStyle hatchStyle() const
virtual OdDbRegionPtr getRegionArea() const
OdString patternName() const
OdHatchPattern getPattern() const
int numLoops() const
void getHatchLineDataAt(int lineIndex, OdGePoint2d &startPoint, OdGePoint2d &endPoint) const
void setAssocObjIdsAt(int loopIndex, const OdDbObjectIdArray &dbObjIds)
void setGradient(OdDbHatch::GradientPatternType gradientType, const OdString &gradientName)
OdResult unmarkModifiedLoop(const OdUInt16 loopIndex)
void getHatchLinesData(OdGePoint2dArray &startPoints, OdGePoint2dArray &endPoints) const
void setGradientColors(OdUInt32 count, const OdCmColor *colors, const double *values)
void setRawPattern(OdDbHatch::HatchPatternType patType, const OdString &patName, double angle, double scale, const OdHatchPattern &pat)
HatchObjectType
Definition: DbHatch.h:114
void getGradientColors(OdCmColorArray &colors, OdGeDoubleArray &values) const
void setPixelSize(double pixelSize)
const OdGePoint2d & getSeedPointAt(unsigned seedIndex) const
virtual bool isPlanar() const
Definition: DbHatch.h:160
void setGradientShift(double gradientShift)
virtual void openedForModify(const OdDbObject *pObject)
virtual bool isHatch() const
Definition: GeTol.h:49
GLsizei GLsizei * count
Definition: gles2_ext.h:276
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
DwgVersion
Definition: OdaDefs.h:47
Planarity
Definition: DbEntity.h:74