CFx SDK Documentation  2023 SP0
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 
OdSmartPtr< OdDbOsnapPointRef > OdDbOsnapPointRefPtr
Definition: DbDimAssoc.h:95
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
true
Definition: DimVarDefs.h:2046
int OdInt
int OdInt32
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
bool assocFlag(int pointIndex) const
OdDbObjectId dimObjId() const
OdResult removePointRef(int ptType)
ODDB_DECLARE_MEMBERS(OdDbDimAssoc)
RotatedDimType rotatedDimType() const
void setAssocFlag(int assocFlag)
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const ODRX_OVERRIDE
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const ODRX_OVERRIDE
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler) ODRX_OVERRIDE
void setDimObjId(const OdDbObjectId &dimId)
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler) ODRX_OVERRIDE
OdDbOsnapPointRefPtr pointRef(int pointIndex) const
OdInt32 assocFlag() const
void setTransSpatial(bool value)
void addToPointRefReactor()
OdResult getDimAssocGeomIds(OdDbObjectIdArray &geomIds) const
void addToDimensionReactor(bool isAdd=true)
virtual void modifiedGraphics(const OdDbObject *pObj) ODRX_OVERRIDE
bool isTransSpatial() const
OdResult post(OdDbObjectId dimId, OdDbObjectId &dimAssocId, bool isActive=true)
OdResult updateDimension(bool update=true, bool skipReactors=false)
virtual void erased(const OdDbObject *pObj, bool erasing=true) ODRX_OVERRIDE
void setAssocFlag(int pointIndex, bool flagValue)
void removeAssociativity(bool force=true)
void setRotatedDimType(RotatedDimType dimType)
virtual void copied(const OdDbObject *pObj, const OdDbObject *pNewObj) ODRX_OVERRIDE
bool isAllGeomErased() const
void setPointRef(int pointIndex, OdDbOsnapPointRefPtr pOsnapPointRef)
void getIdPath(OdDbFullSubentPath &idPath) const
OdDb::OsnapMode osnapType() const
Definition: DbDimAssoc.h:482
OdResult dxfInFields(OdDbDxfFiler *filer)
OdGePoint3d point() const
Definition: DbDimAssoc.h:518
void getXrefIntHandles(OdHandleArray &xrefHandles) const
void getXrefHandles(OdHandleArray &xrefHandles) const
void setIdPath(const OdDbFullSubentPath &idPath)
virtual bool isXrefObj(OdDbObjectIdArray &ids1, OdDbObjectIdArray &ids2, bool isMainObj=true) const
void setIntIdPath(const OdDbFullSubentPath &intIdPath)
ODRX_DECLARE_MEMBERS(OdDbOsnapPointRef)
OdDbXrefFullSubentPath & mainEntity()
Definition: DbDimAssoc.h:494
void setXrefHandles(const OdHandleArray &xrefHandles)
void dxfOutFields(OdDbDxfFiler *pFiler) const
virtual void updateDueToMirror(bool inMirror=false)
void dwgInFields(OdDbDwgFiler *pFiler)
void getIntIdPath(OdDbFullSubentPath &intIdPath) const
virtual OdResult updateSubentPath(OdDbIdMapping &idMap)
virtual bool isGeomErased() const
virtual OdResult updateXrefSubentPath()
void setNearPointParam(double nearOsnap)
Definition: DbDimAssoc.h:512
void setOsnapType(OdDb::OsnapMode osnapMode)
Definition: DbDimAssoc.h:488
OdDbXrefFullSubentPath & intersectEntity()
Definition: DbDimAssoc.h:500
void setPoint(const OdGePoint3d &pt)
Definition: DbDimAssoc.h:523
void setLastPointRef(OdDbOsnapPointRefPtr pOsnapPointRef)
Definition: DbDimAssoc.h:540
double nearPointParam() const
Definition: DbDimAssoc.h:506
void setXrefIntHandles(const OdHandleArray &xrefHandles)
virtual OdResult evalPoint(OdGePoint3d &pt)
const OdDbOsnapPointRef * lastPointRef() const
Definition: DbDimAssoc.h:529
void dwgOutFields(OdDbDwgFiler *pFiler) const
virtual OdResult getEntities(OdDbFullSubentPathArray &ents, bool getLastPtRef=true) const
static bool calcTransform(const OdDbObjectIdArray &ids, OdGeMatrix3d &A_Ecs2Wcs)
virtual OdResult dxfInFields(OdDbDxfFiler *filer)=0
virtual bool isXrefObj(OdDbObjectIdArray &ids1, OdDbObjectIdArray &ids2, bool isMainObj=true) const =0
virtual OdResult updateSubentPath(OdDbIdMapping &idMap)=0
virtual void dwgOutFields(OdDbDwgFiler *filer) const =0
static OdGeMatrix3d mswcsToPswcs(const OdDbViewport *pVPort)
virtual OdResult updateXrefSubentPath()=0
virtual void updateDueToMirror(bool inMirror=false)=0
virtual void dwgInFields(OdDbDwgFiler *filer)=0
virtual OdResult evalPoint(OdGePoint3d &pnt_wcs)=0
ODRX_DECLARE_MEMBERS(OdDbPointRef)
virtual void dxfOutFields(OdDbDxfFiler *filer) const =0
virtual bool isGeomErased() const =0
virtual OdResult getEntities(OdDbFullSubentPathArray &ents, bool getLastPtRef=true) const =0
void dwgOut(OdDbDwgFiler *pFiler) const
OdHandleArray & xrefObjHandles()
Definition: DbDimAssoc.h:470
void dwgIn(OdDbDwgFiler *pFiler)
void dxfOut(OdDbDxfFiler *pFiler, OdInt groupCodeOffset=0) const
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
OsnapMode
Definition: OdaDefs.h:480