dbBreakData.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. //
  2. //
  3. //
  4. //////////////////////////////////////////////////////////////////////////////
  5. //
  6. // Copyright 2015 Autodesk, Inc. All rights reserved.
  7. //
  8. // Use of this software is subject to the terms of the Autodesk license
  9. // agreement provided at the time of installation or download, or which
  10. // otherwise accompanies this software in either electronic or hard copy form.
  11. //
  12. //////////////////////////////////////////////////////////////////////////////
  13. //
  14. #pragma once
  15. #include "dbmain.h"
  16. #pragma pack (push, 8)
  17. class AcDbBreakPointRef;
  18. class AcDbBreakData : public AcDbObject
  19. {
  20. public:
  21. ACDB_DECLARE_MEMBERS(AcDbBreakData);
  22. AcDbBreakData();
  23. virtual ~AcDbBreakData();
  24. AcDbObjectId dimObjId() const;
  25. Acad::ErrorStatus setDimObjId(const AcDbObjectId& dimId);
  26. Acad::ErrorStatus addBreakPointRef(AcDbBreakPointRef* ptRef);
  27. Acad::ErrorStatus getBreakPointRef(int lineIndex,
  28. AcArray<AcDbBreakPointRef*>& ptRefs) const;
  29. Acad::ErrorStatus getBreakPointRef(AcArray<AcDbBreakPointRef*>& ptRefs) const;
  30. Acad::ErrorStatus deleteAllBreakPointRefs();
  31. Acad::ErrorStatus removeAssociativity(bool force = true);
  32. Acad::ErrorStatus postToDb(AcDbObjectId& breakObjId);
  33. Acad::ErrorStatus eraseFromDb(void);
  34. //********************************************************************
  35. // Overridden methods from AcDbObject
  36. //********************************************************************
  37. //
  38. virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
  39. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
  40. virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler*);
  41. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler*) const;
  42. virtual void modifiedGraphics(const AcDbEntity* pEnt);
  43. //********************************************************************
  44. // APIs for Internal use only
  45. //********************************************************************
  46. //
  47. Acad::ErrorStatus updateAssociativity(const AcDbObjectIdArray& ids, int cmdType);
  48. };
  49. class AcDbBreakPointRef : public AcDbObject
  50. {
  51. public:
  52. ACDB_DECLARE_MEMBERS(AcDbBreakPointRef);
  53. enum BreakPointType {
  54. kDynamic = 0,
  55. kStatic = 1,
  56. kStatic2Point = 2
  57. };
  58. AcDbBreakPointRef();
  59. virtual ~AcDbBreakPointRef();
  60. AcDbBreakPointRef::BreakPointType pointType() const;
  61. Acad::ErrorStatus setPointType(AcDbBreakPointRef::BreakPointType newVal);
  62. Adesk::Int32 lineIndex() const;
  63. Acad::ErrorStatus setLineIndex(Adesk::Int32 index);
  64. AcGePoint3d breakPoint() const;
  65. Acad::ErrorStatus setBreakPoint(const AcGePoint3d& pt);
  66. AcGePoint3d breakPoint2() const;
  67. Acad::ErrorStatus setBreakPoint2(const AcGePoint3d& pt);
  68. Acad::ErrorStatus getBreakPointId(AcDbFullSubentPath& idPath) const;
  69. Acad::ErrorStatus setBreakPointId(const AcDbFullSubentPath& idPath);
  70. AcDbEntity *subentPtr() const;
  71. Acad::ErrorStatus intersectWith(const AcDbEntity* pEnt,
  72. AcGePoint3dArray& points,
  73. AcGePoint3dArray& textBoxPts);
  74. //********************************************************************
  75. // Overridden methods from AcDbObject
  76. //********************************************************************
  77. //
  78. virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
  79. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
  80. virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler*);
  81. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler*) const;
  82. };
  83. //************************************************************************
  84. // Global API functions
  85. //************************************************************************
  86. //
  87. Acad::ErrorStatus acdbGetBreakSubentIndex(AcDbEntity* pEnt,
  88. const AcGePoint3d& pickPt,
  89. const AcGeVector3d& viewDir,
  90. int& subentIndex,
  91. AcGePoint3d& ptOnEnt,
  92. const AcGeTol& tol = AcGeContext::gTol);
  93. #pragma pack (pop)