CFx SDK Documentation  2022 SP0
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 */
@ kDefault
Definition: BrEnums.h:102
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
TOOLKIT_EXPORT EdgeArray oddbCreateEdgesFromEntity(const OdDbEntity *pEnt, const OdGePlane &hatchPlane)
OdSmartPtr< OdDbHatch > OdDbHatchPtr
Definition: DbHatch.h:1233
OdArray< OdGeCurve2d * > EdgeArray
Definition: DbHatch.h:45
scale
Definition: DimVarDefs.h:1684
ptrdiff_t OdGsMarker
unsigned int OdUInt32
int OdInt32
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
virtual void subViewportDraw(OdGiViewportDraw *pWd) const
void appendOrderedLoop(OdInt32 loopType, const EdgeArray &edgePtrs)
double pixelSize() const
void setPattern(OdDbHatch::HatchPatternType patType, const OdString &patName, double angle, double scale, const OdHatchPattern &pat, OdGePoint2d basePt=OdGePoint2d())
void getAssocObjIds(OdDbObjectIdArray &dbObjIds) const
void getLoopAt(int loopIndex, OdGePoint2dArray &vertices, OdGeDoubleArray &bulges) const
void setElevation(double elevation)
void setSeedPointAt(unsigned seedIndex, OdGePoint2d &point)
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:102
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm) ODRX_OVERRIDE
GradientPatternType
Definition: DbHatch.h:122
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
double gradientAngle() const
void setNormal(const OdGeVector3d &normal)
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdDbHatch::HatchPatternType patternType() const
void insertLoopAt(int loopIndex, OdInt32 loopType, const EdgeArray &edgePtrs)
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:74
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
const OdGePoint2d & getSeedPointAt(unsigned seedIndex) 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 appendLoop(OdInt32 loopType, const EdgeArray &edgePtrs)
HatchEdgeType
Definition: DbHatch.h:93
int numHatchLines() const
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
ODDB_DECLARE_MEMBERS(OdDbHatch)
void setPatternDouble(bool isDouble)
void getAssocObjIdsAt(int loopIndex, OdDbObjectIdArray &dbObjIds) 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
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()
OdDbHatch::HatchStyle hatchStyle() 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)
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:116
void getGradientColors(OdCmColorArray &colors, OdGeDoubleArray &values) const
void setPixelSize(double pixelSize)
virtual bool isPlanar() const
Definition: DbHatch.h:162
void setGradientShift(double gradientShift)
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:46
Planarity
Definition: DbEntity.h:74
@ kNone
Light mode is inherited from the annotation.