CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbMLeader.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_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
37class OdDbAttribute;
39
47{
48public:
52 enum MoveType {
57
62
66 kMoveContentAndDoglegPoints
67 };
68
76 kNone = 0,
77
81 kArrowMark = 1,
82
86 kLeaderLineMark = kArrowMark + MAX_LEADERLINE_NUMBER,
87
91 kDoglegMark = kLeaderLineMark + MAX_LEADERLINE_NUMBER,
92
96 kMTextMark = kDoglegMark + MAX_LEADER_NUMBER,
97
101 kMTextUnderLineMark = kMTextMark + 1,
102
106 kToleranceMark = kMTextUnderLineMark + 1,
107
111 kBlockMark = kToleranceMark + 1,
112
116 kBlockAttribute = kBlockMark + 1
117 };
118
126 kLeaderLineType = 0,
127
131 kLeaderLineColor = 1,
132
136 kLeaderLineTypeId = 2,
137
141 kLeaderLineWeight = 3,
142
146 kEnableLanding = 4,
147
151 kLandingGap = 5,
152
156 kEnableDogleg = 6,
157
161 kDoglegLength = 7,
162
166 kArrowSymbolId = 8,
167
171 kArrowSize = 9,
172
176 kContentType = 10,
177
181 kTextStyleId = 11,
182
186 kTextLeftAttachmentType = 12,
187
191 kTextAngleType = 13,
192
196 kTextAlignmentType = 14,
197
201 kTextColor = 15,
202
206 kTextHeight = 16,
207
211 kEnableFrameText = 17,
212
216 kDefaultMText = 18,
217
221 kBlockId = 19,
222
226 kBlockColor = 20,
227
231 kBlockScale = 21,
232
236 kBlockRotation = 22,
237
241 kBlockConnectionType = 23,
242
246 kScale = 24,
247
251 kTextRightAttachmentType = 25,
252
256 kTextSwitchAlignmentType = 26,
257
261 kTextAttachmentDirection = 27,
262
266 kTextTopAttachmentType = 28,
267
271 kTextBottomAttachmentType = 29,
272
276 kExtendLeaderToText = 30,
277
281 kSize = kExtendLeaderToText + 1
282 };
283
284
286
288
290
291 virtual void dwgOutFields(OdDbDwgFiler* filer) const ODRX_OVERRIDE;
292
294
295 virtual void dxfOutFields(OdDbDxfFiler* filer) const ODRX_OVERRIDE;
296
297protected:
298 virtual bool subWorldDraw(OdGiWorldDraw* pWd) const ODRX_OVERRIDE;
299
301
303
305
318 const OdGePoint3d& pickPoint,const OdGeMatrix3d& xfm,
319 OdDbFullSubentPathArray& subentPaths,
320 const OdDbObjectIdArray* pEntAndInsertStack = 0) const ODRX_OVERRIDE;
321
329 virtual OdResult subGetGsMarkersAtSubentPath( const OdDbFullSubentPath& subPath,
330 OdGsMarkerArray& gsMarkers) const ODRX_OVERRIDE;
331
338 virtual OdResult subDeleteSubentPaths(const OdDbFullSubentPathArray& paths) ODRX_OVERRIDE;
339
346 virtual OdDbEntityPtr subSubentPtr(const OdDbFullSubentPath& path) const ODRX_OVERRIDE;
347
348 virtual void subClose() ODRX_OVERRIDE;
349
350 virtual OdResult subExplode(OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE;
351
352 virtual OdResult subGetGeomExtents(OdGeExtents3d& extents) const ODRX_OVERRIDE;
353
354 virtual OdResult subGetClassID(
355 void* pClsid) const ODRX_OVERRIDE;
356
357//#if 0
359//
360// virtual OdResult getGripEntityUCS(
361// const void* pGripAppData,
362// OdGeVector3d& normalVec,
363// OdGePoint3d& origin,
364// OdGeVector3d& xAxis) const;
365//
366// virtual void gripStatus(
367// const OdDb::GripStat status);
368//
370//#endif
371
372 virtual OdResult subGetTransformedCopy(
373 const OdGeMatrix3d& xform,
374 OdDbEntityPtr& pEnt) const;
375
376
377public:
384 void setOverride(
385 PropertyOverrideType propertyType,
386 bool isOverride = true);
387
396 bool isOverride(
397 PropertyOverrideType propertyType) const;
398
408 OdResult setScale(
409 double scale);
410
415 double scale() const;
416
426 OdResult getBlockAttributeValue(
427 OdDbObjectId attdefId,
428 OdDbAttributePtr& pAtt) const;
429
439 OdResult setBlockAttributeValue(
440 OdDbObjectId attdefId,
441 const OdDbAttribute* pAtt);
442
446 OdGePlane plane() const;
447
456 void setPlane(
457 const OdGePlane& plane);
458
459 OdGeVector3d normal() const;
460
471 OdResult moveMLeader(
472 const OdGeVector3d& vector,
473 MoveType moveType,
474 bool bAutoSwitchDogleg = true);
475
484 OdResult getContentGeomExtents(
485 OdGeExtents3d& extents) const;
486
487 // Deprecated (Instead, use the method getLeaderIndexes(...))
488 int numLeaders();
489
494 void getLeaderIndexes(
495 OdIntArray& leaderIndexes);
496
505 void addLeader(
506 int& leaderIndex);
507
516 void removeLeader(
517 int leaderIndex);
518
519 // Deprecated (Instead, use the method getLeaderLineIndexes(...))
520 int numLeaderLines();
521
526 void getLeaderLineIndexes(
527 OdIntArray& leaderLineIndexes);
528
535 OdResult addLeaderLine(
536 int leaderIndex,
537 int& leaderLineIndex);
538
548 OdResult addLeaderLine(
549 const OdGePoint3d& point,
550 int& leaderLineIndex);
551
560 void removeLeaderLine(
561 int leaderLineIndex);
562
569 OdResult addFirstVertex(
570 int leaderLineIndex, const OdGePoint3d& point);
571
580 OdResult removeFirstVertex(
581 int leaderLineIndex);
582
592 OdResult getFirstVertex(
593 int leaderLineIndex,
594 OdGePoint3d& point) const;
595
609 OdResult setFirstVertex(
610 int leaderLineIndex,
611 const OdGePoint3d& point);
612
622 OdResult addLastVertex(
623 int leaderLineIndex,
624 const OdGePoint3d& point);
625
634 OdResult removeLastVertex(
635 int leaderLineIndex);
636
646 OdResult getLastVertex(
647 int leaderLineIndex,
648 OdGePoint3d& point) const;
649
659 OdResult setLastVertex(
660 int leaderLineIndex,
661 const OdGePoint3d& point);
662
672 OdResult numVertices(
673 int leaderLineIndex,
674 int& num) const;
675
686 OdResult setVertex(
687 int leaderLineIndex,
688 int index,
689 const OdGePoint3d& point);
690
701 void getVertex(
702 int leaderLineIndex,
703 int index, OdGePoint3d& point) const;
704
711 void getLeaderIndex(
712 int leaderLineIndex,
713 int& leaderIndex);
714
721 void getLeaderLineIndexes(
722 int leaderIndex,
723 OdIntArray& leaderLineIndexes);
724
731 void setDoglegDirection(
732 int leaderIndex,
733 const OdGeVector3d& vector);
734
742 void getDoglegDirection(
743 int leaderIndex,
744 OdGeVector3d& vector);
745
755 void setLeaderLineType(
756 OdDbMLeaderStyle::LeaderType leaderLineType);
757
761 OdDbMLeaderStyle::LeaderType leaderLineType() const;
762
772 void setLeaderLineColor(
773 const OdCmColor& leaderLineColor);
774
778 OdCmColor leaderLineColor() const;
779
789 void setLeaderLineTypeId(
790 OdDbObjectId leaderLineTypeId);
791
795 OdDbObjectId leaderLineTypeId() const;
796
806 void setLeaderLineWeight(
807 OdDb::LineWeight leaderLineWeight);
808
812 OdDb::LineWeight leaderLineWeight() const;
813
823 void setLandingGap(
824 double landingGap);
825
829 double landingGap() const;
830
840 void setEnableLanding(
841 bool enableLanding);
842
846 bool enableLanding() const;
847
857 void setEnableDogleg(
858 bool enableDogleg);
859
863 bool enableDogleg() const;
864
875 void setDoglegLength(
876 int leaderIndex,
877 double dDoglegLength);
878
884 double doglegLength(
885 int leaderIndex );
886
887 //deprecated
888 OdResult setDoglegLength (double doglegLength);
889 //deprecated
890 double doglegLength () const;
891
902 void setArrowSymbolId(
903 OdDbObjectId arrowSymbolId);
904
908 OdDbObjectId arrowSymbolId() const;
909
919 void setArrowSize(
920 double arrowSize);
921
925 double arrowSize() const;
926
936 void setContentType(
937 OdDbMLeaderStyle::ContentType contentType);
938
942 OdDbMLeaderStyle::ContentType contentType() const;
943
953 void setTextStyleId(
954 OdDbObjectId textStyleId);
955
959 OdDbObjectId textStyleId() const;
960
971 void setTextAttachmentType(
972 OdDbMLeaderStyle::TextAttachmentType textAttachmentType,
973 OdDbMLeaderStyle::LeaderDirectionType leaderDirection);
974
980 OdDbMLeaderStyle::TextAttachmentType textAttachmentType(
981 OdDbMLeaderStyle::LeaderDirectionType leaderDirection) const;
982
992 void setTextAngleType(
993 OdDbMLeaderStyle::TextAngleType textAngleType);
994
998 OdDbMLeaderStyle::TextAngleType textAngleType() const;
999
1009 void setTextAlignmentType(
1010 OdDbMLeaderStyle::TextAlignmentType textAlignmentType);
1011
1015 OdDbMLeaderStyle::TextAlignmentType textAlignmentType() const;
1016
1026 void setTextColor(const OdCmColor& textColor);
1027
1031 OdCmColor textColor() const;
1032
1042 void setTextHeight(
1043 double textHeight);
1044
1048 double textHeight() const;
1049
1059 void setEnableFrameText(
1060 bool enableFrameText);
1061
1065 bool enableFrameText() const;
1066
1077 void setMText(
1078 const OdDbMText* pMText);
1079
1083 OdDbMTextPtr mtext() const;
1084
1094 void setBlockContentId(
1095 OdDbObjectId blockId);
1096
1100 OdDbObjectId blockContentId() const;
1101
1111 void setBlockColor(
1112 const OdCmColor& blockColor);
1113
1117 OdCmColor blockColor() const;
1118
1128 void setBlockScale(
1129 const OdGeScale3d& scale);
1130
1134 OdGeScale3d blockScale() const;
1135
1145 void setBlockRotation(
1146 double rotation);
1147
1151 double blockRotation() const;
1152
1163 void setBlockConnectionType(
1164 OdDbMLeaderStyle::BlockConnectionType blockConnectionType);
1165
1170 OdDbMLeaderStyle::BlockConnectionType blockConnectionType() const;
1171
1177 void setEnableAnnotationScale(
1178 bool enableAnnotationScale);
1179
1183 bool enableAnnotationScale() const;
1184
1190 void setMLeaderStyle(
1191 OdDbObjectId newStyleId);
1192
1196 OdDbObjectId MLeaderStyle();
1197
1206 OdResult getOverridedMLeaderStyle(
1207 OdDbMLeaderStyle& mleaderStyle);
1208
1217 OdResult setContextDataManager(
1218 void* pContextDataManager);
1219
1223 void* getContextDataManager() const;
1224
1230 void setBlockPosition(
1231 const OdGePoint3d& position);
1232
1238 void getBlockPosition(
1239 OdGePoint3d& position);
1240
1246 void setTextLocation(
1247 const OdGePoint3d& location);
1248
1254 void getTextLocation(
1256
1265 OdResult setToleranceLocation(
1266 const OdGePoint3d& location);
1267
1275 OdResult getToleranceLocation(
1276 OdGePoint3d& location) const;
1277
1287 void setArrowSymbolId(
1288 int leaderLineIndex,
1289 OdDbObjectId arrowSymbolId);
1290
1296 OdDbObjectId arrowSymbolId(
1297 int leaderLineIndex) const;
1298
1302 bool hasContent() const;
1303
1310 OdResult connectionPoint(
1311 const OdGeVector3d& vect,
1312 OdGePoint3d& point) const;
1313
1321 OdResult connectionPoint(
1322 const OdGeVector3d& vect,
1323 OdGePoint3d& point,
1324 OdDbMLeaderStyle::TextAttachmentDirection direction) const;
1325
1332 OdResult recomputeBreakPoints();
1333
1342 OdResult postMLeaderToDb(
1343 OdDbDatabase* pDb);
1344
1345 // dim associativity support
1346
1353 OdResult updateLeaderLinePosition();
1354
1363 OdResult removeLeaderLineRefAssoc(
1364 int leaderLineIndex) const;
1365
1374 OdResult updateContentScale(
1376
1377 virtual bool isPlanar() const ODRX_OVERRIDE;
1378 virtual OdResult getPlane(OdGePlane& plane, OdDb::Planarity& planarity) const ODRX_OVERRIDE;
1379
1385 void setTextAttachmentDirection(
1386 OdDbMLeaderStyle::TextAttachmentDirection direction);
1387
1391 OdDbMLeaderStyle::TextAttachmentDirection textAttachmentDirection() const;
1392
1397 {
1401 kOverrideLeaderType = 0,
1421 kOverrideArrowSymbolId
1423
1434 bool isOverride(int leaderLineIndex, LeaderLineOverrideType value);
1435
1447 int leaderLineIndex,
1448 OdDbMLeaderStyle::LeaderType leaderLineType);
1449
1456 int leaderLineIndex) const;
1457
1469 int leaderLineIndex,
1470 const OdCmColor& leaderLineColor);
1471
1478 int leaderLineIndex) const;
1479
1491 int leaderLineIndex,
1492 OdDbObjectId leaderLineTypeId);
1493
1500 int leaderLineIndex) const;
1501
1513 int leaderLineIndex,
1514 OdDb::LineWeight leaderLineWeight);
1515
1522 int leaderLineIndex) const;
1523
1535 int leaderLineIndex,
1536 double arrowSize);
1537
1544 int leaderLineIndex) const;
1545
1551 void setExtendLeaderToText(bool bSet);
1552
1557
1558 virtual void copyFrom(const OdRxObject* pSource);
1559protected:
1561 virtual void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents) ODRX_OVERRIDE;
1562 virtual OdDbObjectPtr subWblockClone(OdDbIdMapping& ownerIdMap, OdDbObject* pObj, bool bPrimary) const ODRX_OVERRIDE;
1563 virtual OdDbObjectPtr subDeepClone(OdDbIdMapping& ownerIdMap, OdDbObject* pObj, bool bPrimary) const ODRX_OVERRIDE;
1564
1565 virtual void modified(const OdDbObject* pObj) ODRX_OVERRIDE;
1566};
1567
1568DBDIM_EXPORT void fxMLeaderRecompute( OdDbMLeader* pMLeader ); //FELIX_CHANGE
1569
1574
1582{
1583public:
1585
1587};
1588
1593
1596
1598bool DBDIM_EXPORT OdDbMLeader_setAcadBehaviour(OdDbMLeader* pMLeader, OdUInt32 bug, bool bValue); // for tests only
1599
1602
1605
1608
1610//void DBENT_EXPORT OdDbObject_clearModified(OdDbObject* pObj); // for tests only
1611
1612#include "TD_PackPop.h"
1613
1614#endif // OD_MLEADER_H
1615
#define DBENT_EXPORT
Definition: DbExport.h:67
#define DBDIM_EXPORT
Definition: DbExport.h:72
OdSmartPtr< OdDbMLeader > OdDbMLeaderPtr
Definition: DbMLeader.h:1573
#define MAX_LEADERLINE_NUMBER
Definition: DbMLeader.h:35
OdUInt32 DBDIM_EXPORT OdDbMLeader_setRecomputeFlags(OdDbMLeader *pMLeader, OdUInt32 flags)
‍** { Secret } *‍/
OdSmartPtr< OdDbMLeaderRecomputePE > OdDbMLeaderRecomputePEPtr
Definition: DbMLeader.h:1592
void DBENT_EXPORT OdDbObject_clearDatabase(OdDbObject *pObj)
‍** { Secret } *‍/
void DBENT_EXPORT OdDbObject_setWorkingDatabase(OdDbObject *pObj, OdDbDatabase *pWrkDb)
‍** { Secret } *‍/
DBDIM_EXPORT void fxMLeaderRecompute(OdDbMLeader *pMLeader)
OdGePoint3d DBENT_EXPORT OdDbMLeader_getPtInternal(OdDbMLeader *pMLeader, OdUInt32 index=0)
‍** { Secret } *‍/
bool DBDIM_EXPORT OdDbMLeader_setAcadBehaviour(OdDbMLeader *pMLeader, OdUInt32 bug, bool bValue)
‍** { Secret } *‍/
#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:1397
@ kOverrideLineWeight
Definition: DbMLeader.h:1413
@ kOverrideLineTypeId
Definition: DbMLeader.h:1409
@ kOverrideLineColor
Definition: DbMLeader.h:1405
@ kOverrideArrowSize
Definition: DbMLeader.h:1417
@ kMoveAllExceptArrowHeaderPoints
Definition: DbMLeader.h:61
@ kMoveAllPoints
Definition: DbMLeader.h:56
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const ODRX_OVERRIDE
PropertyOverrideType
Definition: DbMLeader.h:122
virtual OdResult subMoveGripPointsAt(const OdIntArray &indices, const OdGeVector3d &offset)
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 void copyFrom(const OdRxObject *pSource)
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
LineWeight
Definition: OdaDefs.h:386