CFx SDK Documentation  2023 SP0
DbMLeader.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 #ifndef OD_MLEADER_H
25 #define OD_MLEADER_H
26 
27 #include "TD_PackPush.h"
28 #include "DbMLeaderStyle.h"
29 #include "DbEntity.h"
30 #include "DbSubentId.h"
31 #include "DbAttribute.h"
32 #include "IntArray.h"
33 
34 #define MAX_LEADER_NUMBER 5000
35 #define MAX_LEADERLINE_NUMBER 5000
36 
37 class OdDbAttribute;
39 
49 {
50 public:
54  enum MoveType {
59 
64 
68  kMoveContentAndDoglegPoints
69  };
70 
74  enum gsMarkType {
78  kNone = 0,
79 
83  kArrowMark = 1,
84 
88  kLeaderLineMark = kArrowMark + MAX_LEADERLINE_NUMBER,
89 
93  kDoglegMark = kLeaderLineMark + MAX_LEADERLINE_NUMBER,
94 
98  kMTextMark = kDoglegMark + MAX_LEADER_NUMBER,
99 
103  kMTextUnderLineMark = kMTextMark + 1,
104 
108  kToleranceMark = kMTextUnderLineMark + 1,
109 
113  kBlockMark = kToleranceMark + 1,
114 
118  kBlockAttribute = kBlockMark + 1
119  };
120 
128  kLeaderLineType = 0,
129 
133  kLeaderLineColor = 1,
134 
138  kLeaderLineTypeId = 2,
139 
143  kLeaderLineWeight = 3,
144 
148  kEnableLanding = 4,
149 
153  kLandingGap = 5,
154 
158  kEnableDogleg = 6,
159 
163  kDoglegLength = 7,
164 
168  kArrowSymbolId = 8,
169 
173  kArrowSize = 9,
174 
178  kContentType = 10,
179 
183  kTextStyleId = 11,
184 
188  kTextLeftAttachmentType = 12,
189 
193  kTextAngleType = 13,
194 
198  kTextAlignmentType = 14,
199 
203  kTextColor = 15,
204 
208  kTextHeight = 16,
209 
213  kEnableFrameText = 17,
214 
218  kDefaultMText = 18,
219 
223  kBlockId = 19,
224 
228  kBlockColor = 20,
229 
233  kBlockScale = 21,
234 
238  kBlockRotation = 22,
239 
243  kBlockConnectionType = 23,
244 
248  kScale = 24,
249 
253  kTextRightAttachmentType = 25,
254 
258  kTextSwitchAlignmentType = 26,
259 
263  kTextAttachmentDirection = 27,
264 
268  kTextTopAttachmentType = 28,
269 
273  kTextBottomAttachmentType = 29,
274 
278  kExtendLeaderToText = 30,
279 
283  kSize = kExtendLeaderToText + 1
284  };
285 
286 
288 
290 
292 
293  virtual void dwgOutFields(OdDbDwgFiler* filer) const ODRX_OVERRIDE;
294 
296 
297  virtual void dxfOutFields(OdDbDxfFiler* filer) const ODRX_OVERRIDE;
298 
299 protected:
300  virtual bool subWorldDraw(OdGiWorldDraw* pWd) const ODRX_OVERRIDE;
301 
302  virtual void subViewportDraw(OdGiViewportDraw* mode) const ODRX_OVERRIDE;
303 
305 
306  virtual OdResult subMoveGripPointsAt(const OdIntArray& indices, const OdGeVector3d& offset);
307 
320  const OdGePoint3d& pickPoint,const OdGeMatrix3d& xfm,
321  OdDbFullSubentPathArray& subentPaths,
322  const OdDbObjectIdArray* pEntAndInsertStack = 0) const ODRX_OVERRIDE;
323 
331  virtual OdResult subGetGsMarkersAtSubentPath( const OdDbFullSubentPath& subPath,
332  OdGsMarkerArray& gsMarkers) const ODRX_OVERRIDE;
333 
340  virtual OdResult subDeleteSubentPaths(const OdDbFullSubentPathArray& paths) ODRX_OVERRIDE;
341 
348  virtual OdDbEntityPtr subSubentPtr(const OdDbFullSubentPath& path) const ODRX_OVERRIDE;
349 
350  virtual void subClose() ODRX_OVERRIDE;
351 
352  virtual OdResult subExplode(OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE;
353 
354  virtual OdResult subGetGeomExtents(OdGeExtents3d& extents) const ODRX_OVERRIDE;
355 
356  virtual OdResult subGetClassID(
357  void* pClsid) const ODRX_OVERRIDE;
358 
359 //#if 0
361 //
362 // virtual OdResult getGripEntityUCS(
363 // const void* pGripAppData,
364 // OdGeVector3d& normalVec,
365 // OdGePoint3d& origin,
366 // OdGeVector3d& xAxis) const;
367 //
368 // virtual void gripStatus(
369 // const OdDb::GripStat status);
370 //
372 //#endif
373 
374  virtual OdResult subGetTransformedCopy(
375  const OdGeMatrix3d& xform,
376  OdDbEntityPtr& pEnt) const;
377 
378 
379 public:
386  void setOverride(
387  PropertyOverrideType propertyType,
388  bool isOverride = true);
389 
398  bool isOverride(
399  PropertyOverrideType propertyType) const;
400 
410  OdResult setScale(
411  double scale);
412 
417  double scale() const;
418 
428  OdResult getBlockAttributeValue(
429  OdDbObjectId attdefId,
430  OdDbAttributePtr& pAtt) const;
431 
441  OdResult setBlockAttributeValue(
442  OdDbObjectId attdefId,
443  const OdDbAttribute* pAtt);
444 
448  OdGePlane plane() const;
449 
458  void setPlane(
459  const OdGePlane& plane);
460 
461  OdGeVector3d normal() const;
462 
473  OdResult moveMLeader(
474  const OdGeVector3d& vector,
475  MoveType moveType,
476  bool bAutoSwitchDogleg = true);
477 
486  OdResult getContentGeomExtents(
487  OdGeExtents3d& extents) const;
488 
493  void getLeaderIndexes(
494  OdIntArray& leaderIndexes);
495 
504  void addLeader(
505  int& leaderIndex);
506 
515  void removeLeader(
516  int leaderIndex);
517 
518 
523  void getLeaderLineIndexes(
524  OdIntArray& leaderLineIndexes);
525 
532  OdResult addLeaderLine(
533  int leaderIndex,
534  int& leaderLineIndex);
535 
545  OdResult addLeaderLine(
546  const OdGePoint3d& point,
547  int& leaderLineIndex);
548 
557  void removeLeaderLine(
558  int leaderLineIndex);
559 
566  OdResult addFirstVertex(
567  int leaderLineIndex, const OdGePoint3d& point);
568 
577  OdResult removeFirstVertex(
578  int leaderLineIndex);
579 
589  OdResult getFirstVertex(
590  int leaderLineIndex,
591  OdGePoint3d& point) const;
592 
606  OdResult setFirstVertex(
607  int leaderLineIndex,
608  const OdGePoint3d& point);
609 
619  OdResult addLastVertex(
620  int leaderLineIndex,
621  const OdGePoint3d& point);
622 
631  OdResult removeLastVertex(
632  int leaderLineIndex);
633 
643  OdResult getLastVertex(
644  int leaderLineIndex,
645  OdGePoint3d& point) const;
646 
656  OdResult setLastVertex(
657  int leaderLineIndex,
658  const OdGePoint3d& point);
659 
669  OdResult numVertices(
670  int leaderLineIndex,
671  int& num) const;
672 
683  OdResult setVertex(
684  int leaderLineIndex,
685  int index,
686  const OdGePoint3d& point);
687 
698  void getVertex(
699  int leaderLineIndex,
700  int index, OdGePoint3d& point);
701 
708  void getLeaderIndex(
709  int leaderLineIndex,
710  int& leaderIndex);
711 
718  void getLeaderLineIndexes(
719  int leaderIndex,
720  OdIntArray& leaderLineIndexes);
721 
728  void setDoglegDirection(
729  int leaderIndex,
730  const OdGeVector3d& vector);
731 
739  void getDoglegDirection(
740  int leaderIndex,
741  OdGeVector3d& vector);
742 
752  void setLeaderLineType(
753  OdDbMLeaderStyle::LeaderType leaderLineType);
754 
758  OdDbMLeaderStyle::LeaderType leaderLineType() const;
759 
769  void setLeaderLineColor(
770  const OdCmColor& leaderLineColor);
771 
775  OdCmColor leaderLineColor() const;
776 
786  void setLeaderLineTypeId(
787  OdDbObjectId leaderLineTypeId);
788 
792  OdDbObjectId leaderLineTypeId() const;
793 
803  void setLeaderLineWeight(
804  OdDb::LineWeight leaderLineWeight);
805 
809  OdDb::LineWeight leaderLineWeight() const;
810 
820  void setLandingGap(
821  double landingGap);
822 
826  double landingGap() const;
827 
837  void setEnableLanding(
838  bool enableLanding);
839 
843  bool enableLanding() const;
844 
854  void setEnableDogleg(
855  bool enableDogleg);
856 
860  bool enableDogleg() const;
861 
872  void setDoglegLength(
873  int leaderIndex,
874  double dDoglegLength);
875 
881  double doglegLength(
882  int leaderIndex );
883 
884  //deprecated
885  OdResult setDoglegLength (double doglegLength);
886  //deprecated
887  double doglegLength () const;
888 
899  void setArrowSymbolId(
900  OdDbObjectId arrowSymbolId);
901 
905  OdDbObjectId arrowSymbolId() const;
906 
916  void setArrowSize(
917  double arrowSize);
918 
922  double arrowSize() const;
923 
933  void setContentType(
934  OdDbMLeaderStyle::ContentType contentType);
935 
939  OdDbMLeaderStyle::ContentType contentType() const;
940 
950  void setTextStyleId(
951  OdDbObjectId textStyleId);
952 
956  OdDbObjectId textStyleId() const;
957 
968  void setTextAttachmentType(
969  OdDbMLeaderStyle::TextAttachmentType textAttachmentType,
970  OdDbMLeaderStyle::LeaderDirectionType leaderDirection);
971 
977  OdDbMLeaderStyle::TextAttachmentType textAttachmentType(
978  OdDbMLeaderStyle::LeaderDirectionType leaderDirection) const;
979 
989  void setTextAngleType(
990  OdDbMLeaderStyle::TextAngleType textAngleType);
991 
995  OdDbMLeaderStyle::TextAngleType textAngleType() const;
996 
1006  void setTextAlignmentType(
1007  OdDbMLeaderStyle::TextAlignmentType textAlignmentType);
1008 
1012  OdDbMLeaderStyle::TextAlignmentType textAlignmentType() const;
1013 
1023  void setTextColor(const OdCmColor& textColor);
1024 
1028  OdCmColor textColor() const;
1029 
1039  void setTextHeight(
1040  double textHeight);
1041 
1045  double textHeight() const;
1046 
1056  void setEnableFrameText(
1057  bool enableFrameText);
1058 
1062  bool enableFrameText() const;
1063 
1074  void setMText(
1075  const OdDbMText* pMText);
1076 
1080  OdDbMTextPtr mtext() const;
1081 
1091  void setBlockContentId(
1092  OdDbObjectId blockId);
1093 
1097  OdDbObjectId blockContentId() const;
1098 
1108  void setBlockColor(
1109  const OdCmColor& blockColor);
1110 
1114  OdCmColor blockColor() const;
1115 
1125  void setBlockScale(
1126  const OdGeScale3d& scale);
1127 
1131  OdGeScale3d blockScale() const;
1132 
1142  void setBlockRotation(
1143  double rotation);
1144 
1148  double blockRotation() const;
1149 
1160  void setBlockConnectionType(
1161  OdDbMLeaderStyle::BlockConnectionType blockConnectionType);
1162 
1167  OdDbMLeaderStyle::BlockConnectionType blockConnectionType() const;
1168 
1174  void setEnableAnnotationScale(
1175  bool enableAnnotationScale);
1176 
1180  bool enableAnnotationScale() const;
1181 
1187  void setMLeaderStyle(
1188  OdDbObjectId newStyleId);
1189 
1193  OdDbObjectId MLeaderStyle();
1194 
1203  OdResult getOverridedMLeaderStyle(
1204  OdDbMLeaderStyle& mleaderStyle);
1205 
1214  OdResult setContextDataManager(
1215  void* pContextDataManager);
1216 
1220  void* getContextDataManager() const;
1221 
1227  void setBlockPosition(
1228  const OdGePoint3d& position);
1229 
1235  void getBlockPosition(
1236  OdGePoint3d& position);
1237 
1243  void setTextLocation(
1244  const OdGePoint3d& location);
1245 
1251  void getTextLocation(
1253 
1262  OdResult setToleranceLocation(
1263  const OdGePoint3d& location);
1264 
1272  OdResult getToleranceLocation(
1273  OdGePoint3d& location) const;
1274 
1284  void setArrowSymbolId(
1285  int leaderLineIndex,
1286  OdDbObjectId arrowSymbolId);
1287 
1293  OdDbObjectId arrowSymbolId(
1294  int leaderLineIndex) const;
1295 
1299  bool hasContent() const;
1300 
1307  OdResult connectionPoint(
1308  const OdGeVector3d& vect,
1309  OdGePoint3d& point) const;
1310 
1318  OdResult connectionPoint(
1319  const OdGeVector3d& vect,
1320  OdGePoint3d& point,
1321  OdDbMLeaderStyle::TextAttachmentDirection direction) const;
1322 
1329  OdResult recomputeBreakPoints();
1330 
1339  OdResult postMLeaderToDb(
1340  OdDbDatabase* pDb);
1341 
1342  // dim associativity support
1343 
1350  OdResult updateLeaderLinePosition();
1351 
1360  OdResult removeLeaderLineRefAssoc(
1361  int leaderLineIndex) const;
1362 
1371  OdResult updateContentScale(
1372  OdDbMLeaderObjectContextData* pContext);
1373 
1374  virtual bool isPlanar() const ODRX_OVERRIDE;
1375  virtual OdResult getPlane(OdGePlane& plane, OdDb::Planarity& planarity) const ODRX_OVERRIDE;
1376 
1382  void setTextAttachmentDirection(
1383  OdDbMLeaderStyle::TextAttachmentDirection direction);
1384 
1388  OdDbMLeaderStyle::TextAttachmentDirection textAttachmentDirection() const;
1389 
1394  {
1398  kOverrideLeaderType = 0,
1418  kOverrideArrowSymbolId
1419  };
1420 
1431  bool isOverride(int leaderLineIndex, LeaderLineOverrideType value);
1432 
1444  int leaderLineIndex,
1445  OdDbMLeaderStyle::LeaderType leaderLineType);
1446 
1453  int leaderLineIndex) const;
1454 
1466  int leaderLineIndex,
1467  const OdCmColor& leaderLineColor);
1468 
1475  int leaderLineIndex) const;
1476 
1488  int leaderLineIndex,
1489  OdDbObjectId leaderLineTypeId);
1490 
1497  int leaderLineIndex) const;
1498 
1510  int leaderLineIndex,
1511  OdDb::LineWeight leaderLineWeight);
1512 
1519  int leaderLineIndex) const;
1520 
1532  int leaderLineIndex,
1533  double arrowSize);
1534 
1540  double arrowSize(
1541  int leaderLineIndex) const;
1542 
1548  void setExtendLeaderToText(bool bSet);
1549 
1553  bool extendLeaderToText() const;
1554 
1555  virtual void copyFrom( const OdRxObject* pSource ) ODRX_OVERRIDE; //FELIX_CHANGE
1556 
1557 protected:
1559  virtual void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents) ODRX_OVERRIDE;
1560  virtual OdDbObjectPtr subWblockClone(OdDbIdMapping& ownerIdMap, OdDbObject* pObj, bool bPrimary) const ODRX_OVERRIDE;
1561  virtual OdDbObjectPtr subDeepClone(OdDbIdMapping& ownerIdMap, OdDbObject* pObj, bool bPrimary) const ODRX_OVERRIDE;
1562 
1563  virtual void modified(const OdDbObject* pObj) ODRX_OVERRIDE;
1564 };
1565 
1566 TOOLKIT_EXPORT void fxMLeaderRecompute(OdDbMLeader* pMLeader); //FELIX_CHANGE
1567 
1572 
1582 {
1583 public:
1585 
1587 };
1588 
1593 
1596 
1597 #include "TD_PackPop.h"
1598 
1599 #endif // OD_MLEADER_H
1600 
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbMLeader > OdDbMLeaderPtr
Definition: DbMLeader.h:1571
#define MAX_LEADERLINE_NUMBER
Definition: DbMLeader.h:35
OdSmartPtr< OdDbMLeaderRecomputePE > OdDbMLeaderRecomputePEPtr
Definition: DbMLeader.h:1592
OdUInt32 TOOLKIT_EXPORT OdDbMLeader_setRecomputeFlags(OdDbMLeader *pMLeader, OdUInt32 flags)
‍** { Secret } *‍/
TOOLKIT_EXPORT void fxMLeaderRecompute(OdDbMLeader *pMLeader)
#define MAX_LEADER_NUMBER
Definition: DbMLeader.h:34
true
Definition: DimVarDefs.h:2046
scale
Definition: DimVarDefs.h:1684
ptrdiff_t OdGsMarker
unsigned int OdUInt32
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
OdCmColor leaderLineColor(int leaderLineIndex) const
OdDb::LineWeight leaderLineWeight(int leaderLineIndex) const
virtual OdResult dwgInFields(OdDbDwgFiler *filer) ODRX_OVERRIDE
virtual OdResult subGetSubentPathsAtGsMarker(OdDb::SubentType type, OdGsMarker gsMark, const OdGePoint3d &pickPoint, const OdGeMatrix3d &xfm, OdDbFullSubentPathArray &subentPaths, const OdDbObjectIdArray *pEntAndInsertStack=0) const ODRX_OVERRIDE
void setLeaderLineWeight(int leaderLineIndex, OdDb::LineWeight leaderLineWeight)
void setLeaderLineColor(int leaderLineIndex, const OdCmColor &leaderLineColor)
OdDbMLeaderStyle::LeaderType leaderLineType(int leaderLineIndex) const
ODDB_DECLARE_MEMBERS(OdDbMLeader)
virtual void dxfOutFields(OdDbDxfFiler *filer) const ODRX_OVERRIDE
LeaderLineOverrideType
Definition: DbMLeader.h:1394
@ kOverrideLineWeight
Definition: DbMLeader.h:1410
@ kOverrideLineTypeId
Definition: DbMLeader.h:1406
@ kOverrideLineColor
Definition: DbMLeader.h:1402
@ kOverrideArrowSize
Definition: DbMLeader.h:1414
@ kMoveAllExceptArrowHeaderPoints
Definition: DbMLeader.h:63
@ kMoveAllPoints
Definition: DbMLeader.h:58
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const ODRX_OVERRIDE
PropertyOverrideType
Definition: DbMLeader.h:124
virtual OdResult subMoveGripPointsAt(const OdIntArray &indices, const OdGeVector3d &offset)
virtual void copyFrom(const OdRxObject *pSource) ODRX_OVERRIDE
void setArrowSize(int leaderLineIndex, double arrowSize)
void setLeaderLineType(int leaderLineIndex, OdDbMLeaderStyle::LeaderType leaderLineType)
bool extendLeaderToText() const
virtual OdResult dxfInFields(OdDbDxfFiler *filer) ODRX_OVERRIDE
void setLeaderLineTypeId(int leaderLineIndex, OdDbObjectId leaderLineTypeId)
virtual OdDbObjectPtr subDeepClone(OdDbIdMapping &ownerIdMap, OdDbObject *pObj, bool bPrimary) const ODRX_OVERRIDE
virtual void modified(const OdDbObject *pObj) ODRX_OVERRIDE
bool isOverride(int leaderLineIndex, LeaderLineOverrideType value)
virtual void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents) ODRX_OVERRIDE
virtual void dwgOutFields(OdDbDwgFiler *filer) const ODRX_OVERRIDE
virtual OdDbObjectPtr subWblockClone(OdDbIdMapping &ownerIdMap, OdDbObject *pObj, bool bPrimary) const ODRX_OVERRIDE
virtual void subViewportDraw(OdGiViewportDraw *mode) const ODRX_OVERRIDE
virtual OdUInt32 subSetAttributes(OdGiDrawableTraits *pTraits) const ODRX_OVERRIDE
void setExtendLeaderToText(bool bSet)
virtual OdResult subTransformBy(const OdGeMatrix3d &xform) ODRX_OVERRIDE
OdDbObjectId leaderLineTypeId(int leaderLineIndex) const
double arrowSize(int leaderLineIndex) const
virtual OdResult recomputeBreakPoints(OdDbMLeader *pMLeader)=0
ODRX_DECLARE_MEMBERS(OdDbMLeaderRecomputePE)
GLuint index
Definition: gles2_ext.h:265
GLint location
Definition: gles2_ext.h:284
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLintptr offset
Definition: gles2_ext.h:183
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
Planarity
Definition: DbEntity.h:74
LineWeight
Definition: OdaDefs.h:384
@ kNone
Light mode is inherited from the annotation.