CFx SDK Documentation  2020SP3
DbDimAssoc.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_DBDIMASSOC_H
28 #define OD_DBDIMASSOC_H
29 
30 #include "TD_PackPush.h"
31 
32 #include "DbSubentId.h"
33 #include "DbHandle.h"
34 #include "DbObject.h"
35 
36 class OdDbDwgFiler;
37 class OdDbDxfFiler;
38 class OdGePoint3d;
39 class OdDbIdMapping;
40 
41 
58 {
59 public:
65  OdHandleArray& xrefObjHandles();
66  const OdHandleArray& xrefObjHandles()const;
67 
73  void dwgIn(OdDbDwgFiler* pFiler);
74 
81  void dwgOut(OdDbDwgFiler* pFiler) const;
82 
89  void dxfOut(OdDbDxfFiler* pFiler, OdInt groupCodeOffset = 0) const;
90 private:
91  OdHandleArray m_XrefObjHandles;
92 };
93 
94 class OdDbOsnapPointRef;
95 class OdDbViewport;
100 //typedef OdArray<OdDbFullSubentPath> OdDbFullSubentPathArray;
101 
110 {
111 public:
113 
114  virtual OdResult evalPoint(OdGePoint3d& pnt_wcs) = 0;
115  virtual OdResult getEntities(OdDbFullSubentPathArray& ents, bool getLastPtRef = true) const = 0;
116  virtual bool isGeomErased() const = 0;
117  virtual bool isXrefObj(OdDbObjectIdArray& ids1, OdDbObjectIdArray& ids2, bool isMainObj = true) const = 0;
120 
121  virtual void dwgOutFields(OdDbDwgFiler* filer) const = 0;
122  virtual void dwgInFields(OdDbDwgFiler* filer) = 0;
123  virtual void dxfOutFields(OdDbDxfFiler* filer) const = 0;
124  virtual OdResult dxfInFields(OdDbDxfFiler* filer) = 0;
125 
126  virtual void updateDueToMirror(bool inMirror = false) = 0;
127 
131  static bool calcTransform(const OdDbObjectIdArray& ids, OdGeMatrix3d& A_Ecs2Wcs);
132 
136  static OdGeMatrix3d mswcsToPswcs(const OdDbViewport* pVPort);
137 /*
138  static OdResult dwgInFields(OdDbDwgFiler* filer, OdDbDatabase* pDb, OdDbPointRef*& pPointRef);
139  static OdResult dwgOutFields(OdDbDwgFiler* filer, OdDbDatabase* pDb, const OdDbPointRef* pPointRef);
140  static OdResult dxfInFields(OdDbDxfFiler* filer, OdDbDatabase* pDb, OdDbPointRef*& pPointRef);
141  static OdResult dxfOutFields(OdDbDxfFiler* filer, OdDbDatabase* pDb, const OdDbPointRef* pPointRef);
142  static OdDbEntityPtr subentPtr(const OdDbFullSubentPath& objPath, bool& isCloned, bool& reverseArc, bool& isStandAloneArc);
143  static OdGeMatrix3d wcsToDcsMatrix(const OdDbViewport* pVPort);
144 */
145 };
146 
152 {
153 public:
155 
157 
181  OdDb::OsnapMode osnapType() const;
205  void setOsnapType(OdDb::OsnapMode osnapMode);
206 
210  OdDbXrefFullSubentPath& mainEntity();
214  OdDbXrefFullSubentPath& intersectEntity();
215 
216  void getIdPath(OdDbFullSubentPath& idPath) const;
217  void setIdPath(const OdDbFullSubentPath& idPath);
218 
219  void getIntIdPath(OdDbFullSubentPath& intIdPath) const;
220  void setIntIdPath(const OdDbFullSubentPath& intIdPath);
221 
225  double nearPointParam() const;
226 
231  void setNearPointParam(double nearOsnap);
232 
236  OdGePoint3d point() const;
237  void setPoint(const OdGePoint3d& pt);
238 
242  const OdDbOsnapPointRef* lastPointRef() const;
243 
247  OdDbOsnapPointRef* lastPointRef();
248 
253  void setLastPointRef(OdDbOsnapPointRefPtr pOsnapPointRef);
254 
255  virtual bool isGeomErased() const;
256  virtual bool isXrefObj(OdDbObjectIdArray& ids1, OdDbObjectIdArray& ids2, bool isMainObj = true) const;
260  virtual OdResult getEntities(OdDbFullSubentPathArray& ents, bool getLastPtRef = true) const;
261  virtual void updateDueToMirror(bool inMirror = false);
262 
263  void getXrefHandles(OdHandleArray& xrefHandles) const;
264  void setXrefHandles(const OdHandleArray& xrefHandles);
265  void getXrefIntHandles(OdHandleArray& xrefHandles) const;
266  void setXrefIntHandles(const OdHandleArray& xrefHandles);
267 
273  void dwgInFields(OdDbDwgFiler* pFiler);
279  void dwgOutFields(OdDbDwgFiler* pFiler) const;
285  void dxfOutFields(OdDbDxfFiler* pFiler) const;
287 private:
288  OdDb::OsnapMode m_OsnapMode;
289  OdDbXrefFullSubentPath m_MainEntity;
290  OdDbXrefFullSubentPath m_IntersectEntity;
291  double m_dNearOsnap;
292  OdGePoint3d m_OsnapPoint;
293  OdDbOsnapPointRefPtr m_pLastPointRef;
294  bool m_bUpdateDueToMirror;
295 };
296 
305 {
306 public:
308 
310 
311  enum { kMaxPointRefs = 4 };
312 
313  enum PointType
314  {
315  kXline1Point = 0,
316  kXline2Point = 1,
317  kOriginPoint = 0,
318  kDefiningPoint = 1,
319  kXline1Start = 0,
320  kXline1End = 1,
321  kXline2Start = 2,
322  kXline2End = 3,
323  kVertexPoint = 2,
324  kChordPoint = 0,
325  kCenterPoint = 1,
326  kFarChordPoint = 1,
327  kOverrideCenterPoint = 2,
328  kAngLineStart = 2,
329  kJogPoint = 3,
330  kAngLineEnd = 3,
331  kLeaderPoint = 0
332  };
333 
335  {
336  kUnknown = 0,
337  kParallel = 1,
338  kPerpendicular = 2
339  };
340 
342  {
343  kFirstPointRef = (1<<0),
344  kSecondPointRef = (1<<1),
345  kThirdPointRef = (1<<2),
346  kFourthPointRef = (1<<3)
347  };
348 
350  virtual void dwgOutFields(OdDbDwgFiler* pFiler) const ODRX_OVERRIDE;
352  virtual void dxfOutFields(OdDbDxfFiler* pFiler) const ODRX_OVERRIDE;
353 
358 
363  void setDimObjId(const OdDbObjectId& dimId);
364 
369 
373  bool assocFlag(int pointIndex) const;
374 
375  void setAssocFlag(int assocFlag);
376  // Sets the index of point reference being used and establishes or clears the association flag.
377  void setAssocFlag(int pointIndex, bool flagValue);
378 
388  OdDbOsnapPointRefPtr pointRef(int pointIndex) const;
389 
396  void setPointRef(int pointIndex, OdDbOsnapPointRefPtr pOsnapPointRef);
397 
411 
425 
427  void addToDimensionReactor(bool isAdd = true);
428 
430  OdResult updateDimension(bool update = true, bool skipReactors = false);
431  void removeAssociativity(bool force = true);
432 
436  bool isTransSpatial() const;
441  void setTransSpatial(bool value);
442 
443 
444  OdResult post(OdDbObjectId dimId, OdDbObjectId& dimAssocId, bool isActive = true);
446  bool isAllGeomErased() const;
447 
448  virtual void modifiedGraphics(const OdDbObject* pObj) ODRX_OVERRIDE;
449  virtual void copied(const OdDbObject* pObj, const OdDbObject* pNewObj) ODRX_OVERRIDE;
450  virtual void erased(const OdDbObject *pObj, bool erasing = true) ODRX_OVERRIDE;
451  virtual void openedForModify(const OdDbObject* pObject) ODRX_OVERRIDE;
452 
453  virtual OdDbObjectPtr subWblockClone(OdDbIdMapping& idMap, OdDbObject* pOwner, bool bPrimary) const ODRX_OVERRIDE;
454  virtual OdDbObjectPtr subDeepClone(OdDbIdMapping& idMap, OdDbObject* pOwner, bool bPrimary) const ODRX_OVERRIDE;
455 
456 protected:
457  OdResult setPointRefReactor(int ptType, bool isAdd = true);
458 };
459 
464 
465 //
466 // Inlines
467 //
468 
469 inline
471 {
472  return m_XrefObjHandles;
473 }
474 
475 inline
477 {
478  return m_XrefObjHandles;
479 }
480 
481 inline
483 {
484  return m_OsnapMode;
485 }
486 
487 inline
489 {
490  m_OsnapMode = osnapMode;
491 }
492 
493 inline
495 {
496  return m_MainEntity;
497 }
498 
499 inline
501 {
502  return m_IntersectEntity;
503 }
504 
505 inline
507 {
508  return m_dNearOsnap;
509 }
510 
511 inline
513 {
514  m_dNearOsnap = nearOsnap;
515 }
516 
517 inline
519 {
520  return m_OsnapPoint;
521 }
522 inline
524 {
525  m_OsnapPoint = pt;
526 }
527 
528 inline
530 {
531  return m_pLastPointRef;
532 }
533 inline
535 {
536  return m_pLastPointRef;
537 }
538 
539 inline
541 {
542  m_pLastPointRef = pOsnapPointRef;
543 }
544 
545 #include "TD_PackPop.h"
546 
547 #endif // OD_DBDIMASSOC_H
548 
OdDbPointRef::isXrefObj
virtual bool isXrefObj(OdDbObjectIdArray &ids1, OdDbObjectIdArray &ids2, bool isMainObj=true) const =0
OdDbDimAssoc::ODDB_DECLARE_MEMBERS
ODDB_DECLARE_MEMBERS(OdDbDimAssoc)
OdDbDimAssoc::assocFlag
bool assocFlag(int pointIndex) const
OdResult
OdResult
Definition: OdResult.h:29
OdDbOsnapPointRef::getIntIdPath
void getIntIdPath(OdDbFullSubentPath &intIdPath) const
OdDbOsnapPointRefPtr
OdSmartPtr< OdDbOsnapPointRef > OdDbOsnapPointRefPtr
Definition: DbDimAssoc.h:95
OdDbDimAssoc::post
OdResult post(OdDbObjectId dimId, OdDbObjectId &dimAssocId, bool isActive=true)
OdDbOsnapPointRef::setOsnapType
void setOsnapType(OdDb::OsnapMode osnapMode)
Definition: DbDimAssoc.h:488
OdDbOsnapPointRef::intersectEntity
OdDbXrefFullSubentPath & intersectEntity()
Definition: DbDimAssoc.h:500
OdDbDimAssoc::isTransSpatial
bool isTransSpatial() const
OdDbPointRef::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdDbPointRef)
OdDbDimAssoc::removeAssociativity
void removeAssociativity(bool force=true)
DbObject.h
OdDbOsnapPointRef::lastPointRef
const OdDbOsnapPointRef * lastPointRef() const
Definition: DbDimAssoc.h:529
OdDbDimAssoc::removePointRef
OdResult removePointRef(int ptType)
OdDbPointRef
Definition: DbDimAssoc.h:110
OdDbXrefFullSubentPath::dwgIn
void dwgIn(OdDbDwgFiler *pFiler)
OdDbOsnapPointRef::mainEntity
OdDbXrefFullSubentPath & mainEntity()
Definition: DbDimAssoc.h:494
OdDbDimAssoc::setRotatedDimType
void setRotatedDimType(RotatedDimType dimType)
OdRxObject
Definition: RxObject.h:564
OdDbObjectId
Definition: DbObjectId.h:99
OdDbDimAssoc::setPointRef
void setPointRef(int pointIndex, OdDbOsnapPointRefPtr pOsnapPointRef)
OdDbDimAssoc::getDimAssocGeomIds
OdResult getDimAssocGeomIds(OdDbObjectIdArray &geomIds) const
OdDbDimAssoc::setAssocFlag
void setAssocFlag(int assocFlag)
OdDbOsnapPointRef::point
OdGePoint3d point() const
Definition: DbDimAssoc.h:518
OdDbOsnapPointRef::setNearPointParam
void setNearPointParam(double nearOsnap)
Definition: DbDimAssoc.h:512
OdDbDimAssoc::PointType
PointType
Definition: DbDimAssoc.h:314
OdDbFullSubentPath
Definition: DbSubentId.h:49
OdDbPointRef::mswcsToPswcs
static OdGeMatrix3d mswcsToPswcs(const OdDbViewport *pVPort)
OdDbOsnapPointRef::dxfOutFields
void dxfOutFields(OdDbDxfFiler *pFiler) const
OdDbDimAssoc::assocFlag
OdInt32 assocFlag() const
OdDbOsnapPointRef::setLastPointRef
void setLastPointRef(OdDbOsnapPointRefPtr pOsnapPointRef)
Definition: DbDimAssoc.h:540
OdDbDimAssoc::setDimObjId
void setDimObjId(const OdDbObjectId &dimId)
OdArray< OdDbHandle >
OdDbOsnapPointRef::setXrefIntHandles
void setXrefIntHandles(const OdHandleArray &xrefHandles)
TD_PackPop.h
OdDbDimAssoc::dxfOutFields
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const ODRX_OVERRIDE
kUnknown
@ kUnknown
Definition: DbManagerSubentData.h:39
OdDbOsnapPointRef::isGeomErased
virtual bool isGeomErased() const
OdDbPointRef::updateSubentPath
virtual OdResult updateSubentPath(OdDbIdMapping &idMap)=0
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdDbPointRef::dxfOutFields
virtual void dxfOutFields(OdDbDxfFiler *filer) const =0
OdDbDimAssoc::isAllGeomErased
bool isAllGeomErased() const
OdDbOsnapPointRef::getEntities
virtual OdResult getEntities(OdDbFullSubentPathArray &ents, bool getLastPtRef=true) const
OdSmartPtr< OdDbOsnapPointRef >
OdDbOsnapPointRef::updateSubentPath
virtual OdResult updateSubentPath(OdDbIdMapping &idMap)
OdDbPointRef::dwgInFields
virtual void dwgInFields(OdDbDwgFiler *filer)=0
OdDbOsnapPointRef::setIntIdPath
void setIntIdPath(const OdDbFullSubentPath &intIdPath)
OdGePoint3d
Definition: GePoint3d.h:55
OdDbOsnapPointRef
Definition: DbDimAssoc.h:152
OdInt32
int OdInt32
Definition: OdPlatformSettings.h:782
OdDbPointRef::updateXrefSubentPath
virtual OdResult updateXrefSubentPath()=0
OdDbXrefFullSubentPath::dwgOut
void dwgOut(OdDbDwgFiler *pFiler) const
OdDbXrefFullSubentPath::dxfOut
void dxfOut(OdDbDxfFiler *pFiler, OdInt groupCodeOffset=0) const
true
true
Definition: DimVarDefs.h:2046
OdDbDimAssoc::dwgOutFields
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const ODRX_OVERRIDE
OdDbDimAssoc::OdDbDimAssoc
OdDbDimAssoc()
OdDbDimAssoc::dimObjId
OdDbObjectId dimObjId() const
OdDbPointRef::dwgOutFields
virtual void dwgOutFields(OdDbDwgFiler *filer) const =0
OdDbDimAssoc::RotatedDimType
RotatedDimType
Definition: DbDimAssoc.h:335
OdDb::OsnapMode
OsnapMode
Definition: OdaDefs.h:478
DbHandle.h
OdDbOsnapPointRef::dxfInFields
OdResult dxfInFields(OdDbDxfFiler *filer)
OdDbOsnapPointRef::setXrefHandles
void setXrefHandles(const OdHandleArray &xrefHandles)
OdDbDimAssoc::modifiedGraphics
virtual void modifiedGraphics(const OdDbObject *pObj) ODRX_OVERRIDE
OdDbPointRef::evalPoint
virtual OdResult evalPoint(OdGePoint3d &pnt_wcs)=0
OdDbOsnapPointRef::updateXrefSubentPath
virtual OdResult updateXrefSubentPath()
OdDbDxfFiler
Definition: DbFiler.h:194
OdDbViewport
Definition: DbViewport.h:49
OdDbDimAssoc::setTransSpatial
void setTransSpatial(bool value)
OdDbDimAssoc::addToPointRefReactor
void addToPointRefReactor()
TD_PackPush.h
OdDbOsnapPointRef::dwgOutFields
void dwgOutFields(OdDbDwgFiler *pFiler) const
OdDbOsnapPointRef::getIdPath
void getIdPath(OdDbFullSubentPath &idPath) const
OdDbOsnapPointRef::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdDbOsnapPointRef)
OdDbOsnapPointRef::getXrefIntHandles
void getXrefIntHandles(OdHandleArray &xrefHandles) const
OdDbOsnapPointRef::dwgInFields
void dwgInFields(OdDbDwgFiler *pFiler)
OdDbPointRef::dxfInFields
virtual OdResult dxfInFields(OdDbDxfFiler *filer)=0
OdDbDimAssoc::erased
virtual void erased(const OdDbObject *pObj, bool erasing=true) ODRX_OVERRIDE
OdDbOsnapPointRef::nearPointParam
double nearPointParam() const
Definition: DbDimAssoc.h:506
OdDbOsnapPointRef::OdDbOsnapPointRef
OdDbOsnapPointRef()
OdDbOsnapPointRef::updateDueToMirror
virtual void updateDueToMirror(bool inMirror=false)
OdDbDimAssoc::dwgInFields
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler) ODRX_OVERRIDE
OdDbXrefFullSubentPath
Definition: DbDimAssoc.h:58
OdDbOsnapPointRef::isXrefObj
virtual bool isXrefObj(OdDbObjectIdArray &ids1, OdDbObjectIdArray &ids2, bool isMainObj=true) const
OdDbOsnapPointRef::osnapType
OdDb::OsnapMode osnapType() const
Definition: DbDimAssoc.h:482
OdDbPointRef::calcTransform
static bool calcTransform(const OdDbObjectIdArray &ids, OdGeMatrix3d &A_Ecs2Wcs)
OdDbDimAssoc::setAssocFlag
void setAssocFlag(int pointIndex, bool flagValue)
OdDbPointRef::getEntities
virtual OdResult getEntities(OdDbFullSubentPathArray &ents, bool getLastPtRef=true) const =0
value
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
OdDbDimAssoc::AssocFlags
AssocFlags
Definition: DbDimAssoc.h:342
OdDbOsnapPointRef::setIdPath
void setIdPath(const OdDbFullSubentPath &idPath)
OdDbPointRef::isGeomErased
virtual bool isGeomErased() const =0
OdDbDimAssoc::dxfInFields
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler) ODRX_OVERRIDE
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
ODRX_OVERRIDE
#define ODRX_OVERRIDE
Definition: OdPlatformSettings.h:114
OdDbDimAssoc::pointRef
OdDbOsnapPointRefPtr pointRef(int pointIndex) const
OdInt
int OdInt
Definition: OdPlatformSettings.h:757
OdDbDimAssoc::addToDimensionReactor
void addToDimensionReactor(bool isAdd=true)
DbSubentId.h
OdDbOsnapPointRef::evalPoint
virtual OdResult evalPoint(OdGePoint3d &pt)
OdDbOsnapPointRef::getXrefHandles
void getXrefHandles(OdHandleArray &xrefHandles) const
OdDbOsnapPointRef::setPoint
void setPoint(const OdGePoint3d &pt)
Definition: DbDimAssoc.h:523
OdDbDimAssoc::copied
virtual void copied(const OdDbObject *pObj, const OdDbObject *pNewObj) ODRX_OVERRIDE
OdDbIdMapping
Definition: DbIdMapping.h:238
OdDbObject
Definition: DbObject.h:211
OdDbDwgFiler
Definition: DbFiler.h:1031
OdDbXrefFullSubentPath::xrefObjHandles
OdHandleArray & xrefObjHandles()
Definition: DbDimAssoc.h:470
OdDbDimAssoc::rotatedDimType
RotatedDimType rotatedDimType() const
OdDbDimAssoc::updateDimension
OdResult updateDimension(bool update=true, bool skipReactors=false)
OdDbDimAssoc
Definition: DbDimAssoc.h:305
OdDbPointRef::updateDueToMirror
virtual void updateDueToMirror(bool inMirror=false)=0