CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
DbHatch.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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
329 OdInt32 loopType,
330 const OdDbObjectIdArray& dbObjIds,
331 const bool bCheckLoop = false);
332
367 void appendOrderedLoop(OdInt32 loopType, EdgeArray& edgePtrs);
368
396 int loopIndex,
397 OdInt32 loopType,
398 EdgeArray& edgePtrs);
399
428 int loopIndex,
429 OdInt32 loopType,
430 const OdGePoint2dArray& vertices,
431 const OdGeDoubleArray& bulges);
432
463 int loopIndex, OdInt32 loopType,
464 const OdDbObjectIdArray& dbObjIds,
465 const bool bCheckLoop = false);
466
473 int loopIndex);
474
482 bool associative() const;
483
493 bool isAssociative);
494
505 int loopIndex,
506 OdDbObjectIdArray& dbObjIds) const;
507
517 OdDbObjectIdArray& dbObjIds) const;
518
529 int loopIndex,
530 const OdDbObjectIdArray& dbObjIds);
531
536
552
556 bool isSolidFill() const;
557
558
563
585 const OdString& patName);
586
612 const OdString& patName,
613 double angle,
614 double scale,
615 const OdHatchPattern& pat,
617
624 double patternAngle() const;
625
633 double angle);
634
641 double patternSpace() const;
642
652 double space);
653
657 double patternScale() const;
658
665 double scale);
666
673 bool patternDouble() const;
674
684 bool isDouble);
685
690
703 int lineIndex,
704 double& lineAngle,
705 double& baseX,
706 double& baseY,
707 double& offsetX,
708 double& offsetY,
709 OdGeDoubleArray& dashes) const;
710
719 void regeneratePattern(bool forceReload = true);
720
735
753
757 int numSeedPoints() const;
758
765 unsigned seedIndex) const;
766
774 unsigned seedIndex,
775 const OdGePoint2d& point);
776
782 void appendSeedPoint(const OdGePoint2d& point);
783
789 void removeSeedPointAt(int seedPointIndex);
790
794 double pixelSize() const;
795
802 double pixelSize);
803
822 OdDbDwgFiler* pFiler);
823
839 virtual void dwgOutFields(
840 OdDbDwgFiler* pFiler) const;
841
860 OdDbDxfFiler* pFiler);
861
877 virtual void dxfOutFields(
878 OdDbDxfFiler* pFiler) const;
879
881 void* pClsid) const;
882
883 virtual bool subWorldDraw(
884 OdGiWorldDraw* pWd) const;
885
886 virtual void subViewportDraw(
887 OdGiViewportDraw* pWd) const;
888
890 const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
891
893 const OdGeMatrix3d& xfm,
894 OdDbEntityPtr& pCopy) const ODRX_OVERRIDE;
895
898 OdDbObjectId& replaceId,
899 bool& exchangeXData);
900
902 OdDbDatabase *pDb,
903 bool doSubents);
904
913 bool bUnderestimateNumLines = false) const;
914
921 int numHatchLines() const;
922
931 int lineIndex,
932 OdGePoint2d& startPoint,
933 OdGePoint2d& endPoint) const;
934
942 OdGePoint2dArray& startPoints,
943 OdGePoint2dArray& endPoints) const;
944
946 OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE;
947
953 virtual void openedForModify(
954 const OdDbObject* pObject);
955
956 virtual void modifiedGraphics(
957 const OdDbObject* pObject);
958
959 /* virtual void subSwapIdWith(OdDbObjectId otherId, bool swapXdata = false, bool swapExtDict = false);
960 virtual void swapReferences(const OdDbIdMapping& idMap);*/
961
962
976
993
997 virtual bool isGradient() const;
998
1002 virtual bool isHatch() const;
1003
1017
1022
1041 const OdString& gradientName);
1042
1049 double gradientAngle() const;
1050
1059 void setGradientAngle(double angle);
1060
1068 OdCmColorArray& colors,
1069 OdGeDoubleArray& values) const;
1070
1088 OdUInt32 count,
1089 const OdCmColor* colors,
1090 const double* values);
1091
1096
1102 bool oneColorMode);
1103
1113 double getShadeTintValue() const;
1114
1124 double luminance);
1125
1134 double gradientShift() const;
1135
1147
1155 double value,
1156 OdCmColor& color) const;
1157
1170 OdDbIdPair& idPair,
1171 OdDbObject* pOwnerObject ,
1172 OdDbIdMapping& ownerIdMap);
1173
1174 void subClose();
1175
1203 const OdString& patName,
1204 double angle,
1205 double scale,
1206 const OdHatchPattern& pat);
1207
1208
1213
1214
1219
1226
1231
1233
1241 virtual OdResult getArea(double& area) const;
1242
1250
1265 static OdResult makeClosedLoop(EdgeArray& edgePtrs, const OdDbObjectIdArray& dbObjIds, const OdGeTol& gapTolerance, const bool& isEdgeArrayConsistent);
1266
1279
1292
1304
1316
1325 void getMarkedModifiedLoops(OdUInt16Array& indicesMarkedLoops) const;
1326
1334
1356
1358 const OdGePoint3d& pickPoint,const OdGeMatrix3d& xfm,
1359 OdDbFullSubentPathArray& subentPaths,
1360 const OdDbObjectIdArray* pEntAndInsertStack = 0) const;
1362 OdGsMarkerArray& gsMarkers) const;
1364
1369
1374
1376};
1377
1395DBENT_EXPORT OdResult oddbAppendLoopFromPickPoint(OdDbDatabase *pDb, OdDbHatch* pHatch, const OdGePoint3d& pickPoint, const OdGePlane& hatchPlane, const bool useInnerRegions);
1396
1397DBENT_EXPORT EdgeArray oddbCreateEdgesFromEntity(const OdDbEntity* pEnt, const OdGePlane& hatchPlane, const bool bLeadToXAxis = false);
1398
1399#include "TD_PackPop.h"
1400
1401#endif /* OD_DBHATCH_H */
OdArray< OdCmColor > OdCmColorArray
OdSmartPtr< OdDbEntity > OdDbEntityPtr
Definition DbEntity.h:51
#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:1380
OdArray< OdGeCurve2d * > EdgeArray
Definition DbHatch.h:45
DBENT_EXPORT OdResult oddbAppendLoopFromPickPoint(OdDbDatabase *pDb, OdDbHatch *pHatch, const OdGePoint3d &pickPoint, const OdGePlane &hatchPlane, const bool useInnerRegions)
OdSmartPtr< OdDbObject > OdDbObjectPtr
Definition DbObject.h:1750
OdSmartPtr< OdDbRegion > OdDbRegionPtr
Definition DbRegion.h:434
OdArray< OdDbFullSubentPath > OdDbFullSubentPathArray
Definition DbSubentId.h:169
scale
OdArray< double, OdMemoryAllocator< double > > OdGeDoubleArray
OdArray< OdGePoint2d, OdMemoryAllocator< OdGePoint2d > > OdGePoint2dArray
Definition GeGbl.h:45
OdArray< OdGsMarker, OdMemoryAllocator< OdGsMarker > > OdGsMarkerArray
OdArray< OdHatchPatternLine > OdHatchPattern
OdArray< OdDbObjectId, OdClrMemAllocator< OdDbObjectId > > OdDbObjectIdArray
Definition IdArrays.h:53
ptrdiff_t OdGsMarker
unsigned int OdUInt32
unsigned short OdUInt16
int OdInt32
#define ODRX_OVERRIDE
OdResult
Definition OdResult.h:29
OdArray< OdRxObjectPtr > OdRxObjectPtrArray
Definition RxObject.h:1196
OdArray< OdUInt16, OdMemoryAllocator< OdUInt16 > > OdUInt16Array
Definition UInt16Array.h:34
OdCmColor color() const
void regeneratePattern(bool forceReload=true)
virtual void subViewportDraw(OdGiViewportDraw *pWd) const
void insertLoopAt(int loopIndex, OdInt32 loopType, EdgeArray &edgePtrs)
double pixelSize() const
void appendLoop(OdInt32 loopType, const OdDbObjectIdArray &dbObjIds, const bool bCheckLoop=false)
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 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
@ kUserDefined
Definition DbHatch.h:101
@ kPreDefined
Definition DbHatch.h:102
@ kCustomDefined
Definition DbHatch.h:103
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm) ODRX_OVERRIDE
GradientPatternType
Definition DbHatch.h:120
@ kUserDefinedGradient
Definition DbHatch.h:122
@ kPreDefinedGradient
Definition DbHatch.h:121
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
@ kIsAnnotativeBlock
Definition DbHatch.h:87
@ kSelfIntersecting
Definition DbHatch.h:80
@ kDuplicate
Definition DbHatch.h:82
@ kDefault
Definition DbHatch.h:73
@ kNotClosed
Definition DbHatch.h:79
@ kPolyline
Definition DbHatch.h:75
@ kDoesNotSupportScale
Definition DbHatch.h:84
@ kTextIsland
Definition DbHatch.h:81
@ kOrientToPaper
Definition DbHatch.h:86
@ kDerived
Definition DbHatch.h:76
@ kExternal
Definition DbHatch.h:74
@ kIsAnnotative
Definition DbHatch.h:83
@ kForceAnnoAllVisible
Definition DbHatch.h:85
@ kOutermost
Definition DbHatch.h:78
@ kTextbox
Definition DbHatch.h:77
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 insertLoopAt(int loopIndex, OdInt32 loopType, const OdDbObjectIdArray &dbObjIds, const bool bCheckLoop=false)
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
@ kSpline
Definition DbHatch.h:96
@ kCirArc
Definition DbHatch.h:94
@ kEllArc
Definition DbHatch.h:95
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 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
@ kHatchObject
Definition DbHatch.h:115
@ kGradientObject
Definition DbHatch.h:116
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
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