CFx SDK Documentation  2020SP3
DbHatch.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 
25 
26 
27 #ifndef OD_DBHATCH_H
28 #define OD_DBHATCH_H
29 
30 #include "TD_PackPush.h"
31 
32 #include "DbEntity.h"
33 #include "Ge/GePoint2dArray.h"
34 #include "IntArray.h"
35 //#include "Ge/GeVoidPointerArray.h"
36 #include "CmColorArray.h"
37 #include "HatchPattern.h"
38 
39 #define HATCH_PATTERN_NAME_LENGTH 32
40 
41 
46 
47 
67 {
68 public:
70 
72 
74  {
75  kDefault = 0, // Not yet specified.
76  kExternal = 1, // Defined by external entities.
77  kPolyline = 2, // Defined by OdGe polyline.
78  kDerived = 4, // Derived from a picked point.
79  kTextbox = 8, // Defined by text.
80  kOutermost = 0x10, // Outermost loop.
81  kNotClosed = 0x20, // Open loop.
82  kSelfIntersecting = 0x40, // Self-intersecting loop.
83  kTextIsland = 0x80, // Text loop surrounded by an even number of loops.
84  kDuplicate = 0x100, // Duplicate loop.
85  kIsAnnotative = 0x200, // The bounding area is an annotative block.
86  kDoesNotSupportScale = 0x400, // The bounding type does not support scaling
87  kForceAnnoAllVisible = 0x800, // Forces all annotatives to be visible
88  kOrientToPaper = 0x1000, // Orients hatch loop to paper
89  kIsAnnotativeBlock = 0x2000 // Describes if the hatch is an annotative block.
90  };
91 
93  {
94  kNone = 0, // Skip this segment.
95  kLine = 1, // Linear.
96  kCirArc = 2, // Circular arc.
97  kEllArc = 3, // Elliptical arc.
98  kSpline = 4 // Spline curve.
99  };
100 
102  {
103  kUserDefined = 0, // User-defined hatch.
104  kPreDefined = 1, // Defined in acad.pat and acadiso.pat.
105  kCustomDefined = 2 // In its own PAT file.
106  };
107 
109  {
110  kNormal = 0, // Hatch toggles on each boundary.
111  kOuter = 1, // Hatch turns off after first inner loop.
112  kIgnore = 2 // Hatch ignores inner loop
113  };
114 
116  {
117  kHatchObject = 0, // Classic hatch
118  kGradientObject = 1 // Color gradient
119  };
120 
122  {
123  kPreDefinedGradient = 0, // Predefined gradient pattern.
124  kUserDefinedGradient = 1 // User-defined gradient pattern.
125  };
126 
133  double elevation() const;
134 
144  double elevation);
145 
150 
156  void setNormal(
157  const OdGeVector3d& normal);
158 
162  virtual bool isPlanar() const { return true; }
163 
185  OdGePlane& plane,
186  OdDb::Planarity& planarity) const;
187 
191  int numLoops() const;
192 
202  int loopIndex) const;
203 
213  void getLoopAt(
214  int loopIndex,
215  EdgeArray& edgePtrs) const;
216 
227  void getLoopAt(
228  int loopIndex,
229  OdGePoint2dArray& vertices,
230  OdGeDoubleArray& bulges) const;
231 
267  OdInt32 loopType,
268  const 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, const EdgeArray& edgePtrs);
363 
389  int loopIndex,
390  OdInt32 loopType,
391  const EdgeArray& edgePtrs);
392 
419  int loopIndex,
420  OdInt32 loopType,
421  const OdGePoint2dArray& vertices,
422  const OdGeDoubleArray& bulges);
423 
449  int loopIndex, OdInt32 loopType,
450  const OdDbObjectIdArray& dbObjIds);
451 
458  int loopIndex);
459 
467  bool associative() const;
468 
478  bool isAssociative);
479 
490  int loopIndex,
491  OdDbObjectIdArray& dbObjIds) const;
492 
502  OdDbObjectIdArray& dbObjIds) const;
503 
514  int loopIndex,
515  const OdDbObjectIdArray& dbObjIds);
516 
521 
537 
541  bool isSolidFill() const;
542 
543 
548 
570  const OdString& patName);
571 
597  const OdString& patName,
598  double angle,
599  double scale,
600  const OdHatchPattern& pat,
601  OdGePoint2d basePt = OdGePoint2d());
602 
609  double patternAngle() const;
610 
618  double angle);
619 
626  double patternSpace() const;
627 
637  double space);
638 
642  double patternScale() const;
643 
650  double scale);
651 
658  bool patternDouble() const;
659 
669  bool isDouble);
670 
675 
688  int lineIndex,
689  double& lineAngle,
690  double& baseX,
691  double& baseY,
692  double& offsetX,
693  double& offsetY,
694  OdGeDoubleArray& dashes) const;
695 
710 
727  OdDbHatch::HatchStyle hatchStyle);
728 
732  int numSeedPoints() const;
733 
740  unsigned seedIndex) const;
741 
749  unsigned seedIndex,
750  OdGePoint2d& point);
751 
757  void appendSeedPoint(const OdGePoint2d& point);
758 
764  void removeSeedPointAt(int seedPointIndex);
765 
769  double pixelSize() const;
770 
777  double pixelSize);
778 
797  OdDbDwgFiler* pFiler);
798 
814  virtual void dwgOutFields(
815  OdDbDwgFiler* pFiler) const;
816 
835  OdDbDxfFiler* pFiler);
836 
852  virtual void dxfOutFields(
853  OdDbDxfFiler* pFiler) const;
854 
856  void* pClsid) const;
857 
858  virtual bool subWorldDraw(
859  OdGiWorldDraw* pWd) const;
860 
861  virtual void subViewportDraw(
862  OdGiViewportDraw* pWd) const;
863 
865  const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
866 
868  const OdGeMatrix3d& xfm,
869  OdDbEntityPtr& pCopy) const ODRX_OVERRIDE;
870 
872  OdDb::DwgVersion ver,
873  OdDbObjectId& replaceId,
874  bool& exchangeXData);
875 
877  OdDbDatabase *pDb,
878  bool doSubents);
879 
888  bool bUnderestimateNumLines = false) const;
889 
896  int numHatchLines() const;
897 
906  int lineIndex,
907  OdGePoint2d& startPoint,
908  OdGePoint2d& endPoint) const;
909 
917  OdGePoint2dArray& startPoints,
918  OdGePoint2dArray& endPoints) const;
919 
921  OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE;
922 
923  virtual void modifiedGraphics(
924  const OdDbObject* pObject);
925 
926  /* virtual void subSwapIdWith(OdDbObjectId otherId, bool swapXdata = false, bool swapExtDict = false);
927  virtual void swapReferences(const OdDbIdMapping& idMap);*/
928 
929 
943 
959  OdDbHatch::HatchObjectType hatchObjectType);
960 
964  virtual bool isGradient() const;
965 
969  virtual bool isHatch() const;
970 
984 
989 
1007  OdDbHatch::GradientPatternType gradientType,
1008  const OdString& gradientName);
1009 
1016  double gradientAngle() const;
1017 
1026  void setGradientAngle(double angle);
1027 
1035  OdCmColorArray& colors,
1036  OdGeDoubleArray& values) const;
1037 
1055  OdUInt32 count,
1056  const OdCmColor* colors,
1057  const double* values);
1058 
1063 
1069  bool oneColorMode);
1070 
1080  double getShadeTintValue() const;
1081 
1091  double luminance);
1092 
1101  double gradientShift() const;
1102 
1113  void setGradientShift(double gradientShift);
1114 
1122  double value,
1123  OdCmColor& color) const;
1124 
1137  OdDbIdPair& idPair,
1138  OdDbObject* pOwnerObject ,
1139  OdDbIdMapping& ownerIdMap);
1140 
1141  void subClose();
1142 
1169  OdDbHatch::HatchPatternType patType,
1170  const OdString& patName,
1171  double angle,
1172  double scale,
1173  const OdHatchPattern& pat);
1174 
1175 
1180 
1181 
1186 
1192  void setOriginPoint(const OdGePoint2d& pt);
1193 
1198 
1199  virtual OdResult explodeGeometry(OdRxObjectPtrArray& entitySet) const;
1200 
1208  virtual OdResult getArea(double& area) const;
1209 
1211  const OdGePoint3d& pickPoint,const OdGeMatrix3d& xfm,
1212  OdDbFullSubentPathArray& subentPaths,
1213  const OdDbObjectIdArray* pEntAndInsertStack = 0) const;
1215  OdGsMarkerArray& gsMarkers) const;
1216  virtual OdDbEntityPtr subSubentPtr(const OdDbFullSubentPath& path) const;
1217 
1222 
1226  void setBackgroundColor(const OdCmColor& color);
1227 
1229 };
1234 
1236 
1237 #include "TD_PackPop.h"
1238 
1239 #endif /* OD_DBHATCH_H */
OdDbHatch::patternScale
double patternScale() const
OdDbHatch::setGradientOneColorMode
void setGradientOneColorMode(bool oneColorMode)
OdResult
OdResult
Definition: OdResult.h:29
OdGePlane
Definition: GePlane.h:45
OdGeVector3d
Definition: GeVector3d.h:54
OdString
Definition: OdString.h:95
OdDbDatabase
Definition: DbDatabase.h:421
OdDbHatch::loopTypeAt
OdInt32 loopTypeAt(int loopIndex) const
OdDbHatch::setElevation
void setElevation(double elevation)
OdDbHatch::setPatternScale
void setPatternScale(double scale)
OdDbHatch::getLoopAt
void getLoopAt(int loopIndex, EdgeArray &edgePtrs) const
OdDbHatch::getPlane
virtual OdResult getPlane(OdGePlane &plane, OdDb::Planarity &planarity) const
OdDbHatch::HatchLoopType
HatchLoopType
Definition: DbHatch.h:74
OdDbHatch::numHatchLines
int numHatchLines() const
OdDbHatch::appendSeedPoint
void appendSeedPoint(const OdGePoint2d &point)
OdDbHatch::backgroundColor
OdCmColor backgroundColor() const
OdDbHatch::setNormal
void setNormal(const OdGeVector3d &normal)
scale
scale
Definition: DimVarDefs.h:1684
OdDb::Planarity
Planarity
Definition: DbEntity.h:74
count
GLsizei GLsizei * count
Definition: gles2_ext.h:276
OdDbHatch::subSubentPtr
virtual OdDbEntityPtr subSubentPtr(const OdDbFullSubentPath &path) const
type
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
OdDbHatch::patternAngle
double patternAngle() const
OdDbHatch::setAssociative
void setAssociative(bool isAssociative)
OdDbHatch::hatchObjectType
OdDbHatch::HatchObjectType hatchObjectType() const
OdDbHatch::getAssocObjIdsAt
void getAssocObjIdsAt(int loopIndex, OdDbObjectIdArray &dbObjIds) const
OdDbObjectId
Definition: DbObjectId.h:99
kDefault
@ kDefault
Definition: BrEnums.h:102
OdDbHatch::elevation
double elevation() const
OdDbIdPair
Definition: DbIdMapping.h:60
OdDbHatch::dxfOutFields
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
OdDbHatch::setHatchObjectType
void setHatchObjectType(OdDbHatch::HatchObjectType hatchObjectType)
OdDbHatch::dxfInFields
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdDbHatch::HatchEdgeType
HatchEdgeType
Definition: DbHatch.h:93
OdDbFullSubentPath
Definition: DbSubentId.h:49
OdDbHatch::setOriginPoint
void setOriginPoint(const OdGePoint2d &pt)
OdDbHatch::getHatchLineDataAt
void getHatchLineDataAt(int lineIndex, OdGePoint2d &startPoint, OdGePoint2d &endPoint) const
OdDbHatch::isSolidFill
bool isSolidFill() const
OdArray
Definition: OdArray.h:591
TD_PackPop.h
IntArray.h
OdDbHatch::getHatchLinesData
void getHatchLinesData(OdGePoint2dArray &startPoints, OdGePoint2dArray &endPoints) const
OdGsMarker
ptrdiff_t OdGsMarker
Definition: OdPlatformSettings.h:889
OdDbHatch::appendLoop
void appendLoop(OdInt32 loopType, const OdDbObjectIdArray &dbObjIds)
OdDbHatch::appendToOwner
void appendToOwner(OdDbIdPair &idPair, OdDbObject *pOwnerObject, OdDbIdMapping &ownerIdMap)
OdDbHatch::getArea
virtual OdResult getArea(double &area) const
OdDbHatch::patternSpace
double patternSpace() const
OdDbHatch::setGradient
void setGradient(OdDbHatch::GradientPatternType gradientType, const OdString &gradientName)
OdDbHatch::removeSeedPointAt
void removeSeedPointAt(int seedPointIndex)
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdDbHatch::subGetTransformedCopy
virtual OdResult subGetTransformedCopy(const OdGeMatrix3d &xfm, OdDbEntityPtr &pCopy) const ODRX_OVERRIDE
OdDbHatch::gradientAngle
double gradientAngle() const
OdDbHatch::numLoops
int numLoops() const
OdPdfPublish::Lighting::kNone
@ kNone
Light mode is inherited from the annotation.
Definition: PdfPublishCommon.h:160
OdDb::DwgVersion
DwgVersion
Definition: OdaDefs.h:46
OdDbHatch::setPixelSize
void setPixelSize(double pixelSize)
OdDbHatch::evaluateGradientColorAt
void evaluateGradientColorAt(double value, OdCmColor &color) const
OdDbHatch::originPoint
OdGePoint2d originPoint() const
OdDbHatch::subSetDatabaseDefaults
void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents)
OdDbHatch::setBackgroundColor
void setBackgroundColor(const OdCmColor &color)
OdDbHatch::GradientPatternType
GradientPatternType
Definition: DbHatch.h:122
OdDbHatch::isHatch
virtual bool isHatch() const
OdDbHatch::getGradientOneColorMode
bool getGradientOneColorMode() const
OdDbHatch::getEcs
OdGeMatrix3d getEcs() const
OdDbHatch::numSeedPoints
int numSeedPoints() const
OdDbHatch::setShadeTintValue
void setShadeTintValue(double luminance)
OdDbHatch::getAssocObjIds
void getAssocObjIds(OdDbObjectIdArray &dbObjIds) const
OdDbHatch::insertLoopAt
void insertLoopAt(int loopIndex, OdInt32 loopType, const EdgeArray &edgePtrs)
OdDbHatch::gradientName
OdString gradientName() const
OdDbHatch::OdDbHatch
OdDbHatch()
OdDbHatch::associative
bool associative() const
EdgeArray
OdArray< OdGeCurve2d * > EdgeArray
Definition: DbHatch.h:45
OdSmartPtr< OdDbEntity >
OdGePoint3d
Definition: GePoint3d.h:55
OdDbHatch::subTransformBy
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm) ODRX_OVERRIDE
OdDbHatch::setRawPattern
void setRawPattern(OdDbHatch::HatchPatternType patType, const OdString &patName, double angle, double scale, const OdHatchPattern &pat)
DbEntity.h
OdDbHatch::subGetSubentPathsAtGsMarker
virtual OdResult subGetSubentPathsAtGsMarker(OdDb::SubentType type, OdGsMarker gsMark, const OdGePoint3d &pickPoint, const OdGeMatrix3d &xfm, OdDbFullSubentPathArray &subentPaths, const OdDbObjectIdArray *pEntAndInsertStack=0) const
OdDb::SubentType
SubentType
Definition: DbBaseSubentId.h:38
OdDbHatch::HatchObjectType
HatchObjectType
Definition: DbHatch.h:116
OdDbHatch::decomposeForSave
OdDbObjectPtr decomposeForSave(OdDb::DwgVersion ver, OdDbObjectId &replaceId, bool &exchangeXData)
OdInt32
int OdInt32
Definition: OdPlatformSettings.h:782
OdIfc::kOuter
@ kOuter
Definition: IfcAttributesEnum.h:729
OdDbHatch::getLoopAt
void getLoopAt(int loopIndex, OdGePoint2dArray &vertices, OdGeDoubleArray &bulges) const
OdDbHatch::removeAssocObjIds
void removeAssocObjIds()
OdDbHatch::insertLoopAt
void insertLoopAt(int loopIndex, OdInt32 loopType, const OdGePoint2dArray &vertices, const OdGeDoubleArray &bulges)
OdDbHatch::modifiedGraphics
virtual void modifiedGraphics(const OdDbObject *pObject)
OdDbHatch::ODDB_DECLARE_MEMBERS
ODDB_DECLARE_MEMBERS(OdDbHatch)
OdDbHatch::patternType
OdDbHatch::HatchPatternType patternType() const
OdDbHatch::removeLoopAt
void removeLoopAt(int loopIndex)
OdDbHatch::HatchStyle
HatchStyle
Definition: DbHatch.h:109
OdDbHatch::patternName
OdString patternName() const
OdDbHatch::subViewportDraw
virtual void subViewportDraw(OdGiViewportDraw *pWd) const
OdDbHatch::appendOrderedLoop
void appendOrderedLoop(OdInt32 loopType, const EdgeArray &edgePtrs)
OdDbHatchPtr
OdSmartPtr< OdDbHatch > OdDbHatchPtr
Definition: DbHatch.h:1233
OdDbHatch::setAssocObjIdsAt
void setAssocObjIdsAt(int loopIndex, const OdDbObjectIdArray &dbObjIds)
OdDbHatch::dwgOutFields
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdDbDxfFiler
Definition: DbFiler.h:194
OdDbHatch::dwgInFields
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
OdDbHatch::subWorldDraw
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
OdDbHatch::normal
OdGeVector3d normal() const
OdDbHatch::evaluateHatch
OdResult evaluateHatch(bool bUnderestimateNumLines=false) const
TD_PackPush.h
OdDbHatch
Definition: DbHatch.h:67
OdDbHatch::setSeedPointAt
void setSeedPointAt(unsigned seedIndex, OdGePoint2d &point)
GePoint2dArray.h
OdDbHatch::subClose
void subClose()
oddbCreateEdgesFromEntity
TOOLKIT_EXPORT EdgeArray oddbCreateEdgesFromEntity(const OdDbEntity *pEnt, const OdGePlane &hatchPlane)
OdDbHatch::setPatternDouble
void setPatternDouble(bool isDouble)
OdGiWorldDraw
Definition: GiWorldDraw.h:44
OdDbHatch::subGetGsMarkersAtSubentPath
virtual OdResult subGetGsMarkersAtSubentPath(const OdDbFullSubentPath &subPath, OdGsMarkerArray &gsMarkers) const
OdDbHatch::getPatternDefinitionAt
void getPatternDefinitionAt(int lineIndex, double &lineAngle, double &baseX, double &baseY, double &offsetX, double &offsetY, OdGeDoubleArray &dashes) const
OdDbHatch::setPatternAngle
void setPatternAngle(double angle)
OdDbHatch::setGradientAngle
void setGradientAngle(double angle)
OdDbEntity
Definition: DbEntity.h:90
OdDbHatch::getPattern
OdHatchPattern getPattern() const
OdDbHatch::setPattern
void setPattern(OdDbHatch::HatchPatternType patType, const OdString &patName, double angle, double scale, const OdHatchPattern &pat, OdGePoint2d basePt=OdGePoint2d())
OdDbHatch::getGradientColors
void getGradientColors(OdCmColorArray &colors, OdGeDoubleArray &values) const
OdDbHatch::setPatternSpace
void setPatternSpace(double space)
OdDbHatch::pixelSize
double pixelSize() const
OdDbHatch::insertLoopAt
void insertLoopAt(int loopIndex, OdInt32 loopType, const OdDbObjectIdArray &dbObjIds)
OdDbHatch::isGradient
virtual bool isGradient() const
OdDbHatch::getRawPattern
OdHatchPattern getRawPattern() const
OdDbHatch::numPatternDefinitions
int numPatternDefinitions() const
HatchPattern.h
value
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
OdDbHatch::setGradientShift
void setGradientShift(double gradientShift)
OdDbHatch::appendLoop
void appendLoop(OdInt32 loopType, const OdGePoint2dArray &vertices, const OdGeDoubleArray &bulges)
OdDbHatch::getSeedPointAt
const OdGePoint2d & getSeedPointAt(unsigned seedIndex) const
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
ODRX_OVERRIDE
#define ODRX_OVERRIDE
Definition: OdPlatformSettings.h:114
OdDbHatch::appendLoop
void appendLoop(OdInt32 loopType, const EdgeArray &edgePtrs)
OdDbHatch::gradientShift
double gradientShift() const
OdDbHatch::explodeGeometry
virtual OdResult explodeGeometry(OdRxObjectPtrArray &entitySet) const
OdDbHatch::patternDouble
bool patternDouble() const
OdDbHatch::isPlanar
virtual bool isPlanar() const
Definition: DbHatch.h:162
OdDbHatch::setHatchStyle
void setHatchStyle(OdDbHatch::HatchStyle hatchStyle)
OdCmColor
Definition: CmColor.h:59
OdDbHatch::HatchPatternType
HatchPatternType
Definition: DbHatch.h:102
OdDbHatch::subExplode
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const ODRX_OVERRIDE
OdDbHatch::setPattern
void setPattern(OdDbHatch::HatchPatternType patType, const OdString &patName)
OdDbHatch::getShadeTintValue
double getShadeTintValue() const
OdDbIdMapping
Definition: DbIdMapping.h:238
OdDbObject
Definition: DbObject.h:211
OdDbDwgFiler
Definition: DbFiler.h:1031
OdGiViewportDraw
Definition: GiViewportDraw.h:50
OdDbHatch::setGradientColors
void setGradientColors(OdUInt32 count, const OdCmColor *colors, const double *values)
OdDbHatch::subGetClassID
virtual OdResult subGetClassID(void *pClsid) const
OdDbHatch::gradientType
OdDbHatch::GradientPatternType gradientType() const
OdDbHatch::hatchStyle
OdDbHatch::HatchStyle hatchStyle() const
CmColorArray.h
OdGePoint2d
Definition: GePoint2d.h:60