AcDbAssocEdgePersSubentId.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // CREATED BY: - Randy Kintzley 10/16/2008
  12. //
  13. // DESCRIPTION:
  14. //
  15. // AcDbAssocEdgePersSubentId concrete derived class.
  16. //
  17. //////////////////////////////////////////////////////////////////////////////
  18. #pragma once
  19. #include "acarray.h"
  20. #include "dbsubeid.h"
  21. #include "AcDbAssocPersSubentId.h"
  22. #pragma pack (push, 8)
  23. /// <summary>
  24. /// Concrete derived AcDbAssocPersSubentId class that is used to identify edge
  25. /// subentities by indices of its two end vertices, or generally, by two arbitrary
  26. /// index identifiers.
  27. /// </summary>
  28. ///
  29. class ACDB_PORT AcDbAssocEdgePersSubentId : public AcDbAssocPersSubentId
  30. {
  31. public:
  32. ACRX_DECLARE_MEMBERS(AcDbAssocEdgePersSubentId);
  33. AcDbAssocEdgePersSubentId();
  34. /// <summary>
  35. /// Constructor that creates an AcDbAssocEdgePersSubentId and initializes it
  36. /// by indices of the two edge vertices, or generally, by two arbitrary index
  37. /// identifiers.
  38. /// If either index is 0, it means "no index". Otherwise it is up to the
  39. /// client code to interpret the meaning of these two index identifiers.
  40. ///
  41. /// Polyline vertex subentities are identified by vertexIdentifier2 being 0.
  42. /// Polyline segment midpoint and segment arc center vertex subentities are
  43. /// identified by both vertexIdentifier1/2 being not 0 and by a special flag.
  44. /// </summary>
  45. /// <param name="vertexIdentifier1"> Identifier of the start vertex of the edge. </param>
  46. /// <param name="vertexIdentifier2"> Identifier of the end vertex of the edge. </param>
  47. ///
  48. explicit AcDbAssocEdgePersSubentId(int vertexIdentifier1,
  49. int vertexIdentifier2);
  50. explicit AcDbAssocEdgePersSubentId(int vertexIdentifier1,
  51. int vertexIdentifier2,
  52. bool isSegArcCenter,
  53. bool isSegMidpoint);
  54. /// <summary>
  55. /// Returns number 1 if not null or 0 if null.
  56. /// </summary>
  57. /// <param name="pEntity"> Not used. </param>
  58. /// <param name="pDatabase"> Not used. </param>
  59. /// <returns> Returns count 1 or 0. </returns>
  60. ///
  61. virtual int transientSubentCount(const AcDbEntity* pEntity, AcDbDatabase* pDatabase) const {
  62. UNREFERENCED_PARAMETER(pEntity);
  63. UNREFERENCED_PARAMETER(pDatabase);
  64. return !isNull() ? 1 : 0;
  65. }
  66. /// <summary> Returns AcDb::kEdgeSubentType or AcDb::kVertexSubentType. </summary>
  67. /// <param name="pEntity"> Not used. </param>
  68. /// <param name="pDatabase"> Not used. </param>
  69. /// <returns> AcDb::kEdgeSubentType or AcDb::kVertexSubentType. </returns>
  70. ///
  71. virtual AcDb::SubentType subentType(const AcDbEntity* pEntity, AcDbDatabase* pDatabase) const;
  72. /// <summary>
  73. /// Returns true iff the AcDbAssocEdgePersSubentId does not identify any subentity.
  74. /// </summary>
  75. /// <returns> True iff the AcDbAssocEdgePersSubentId does not identify any subentity. </returns>
  76. ///
  77. virtual bool isNull() const { return mIndex1 == 0; }
  78. /// <summary>
  79. /// Returns true iff this and the other AcDbAssocEdgePersSubentId reference
  80. /// exactly the same subentity of the same entity. It simply compares the
  81. /// stored indices.
  82. /// </summary>
  83. /// <param name="pEntity"> Not used. </param>
  84. /// <param name="pDatabase"> Not used. </param>
  85. /// <param name="pOther"> The other AcDbAssocEdgePersSubentId. </param>
  86. /// <returns> True iff this and the other AcDbAssocEdgePersSubentId are equal. </returns>
  87. ///
  88. virtual bool isEqualTo(const AcDbEntity* pEntity, AcDbDatabase* pDatabase, const AcDbAssocPersSubentId* pOther) const;
  89. /// <summary> The standard filing protocol. </summary>
  90. /// <param name="pFiler"> The filer to write the object data to. </param>
  91. /// <returns> Acad::ErrorStatus. </returns>
  92. ///
  93. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  94. /// <summary> The standard filing protocol. </summary>
  95. /// <param name="pFiler"> The filer to read the object data from. </param>
  96. /// <returns> Acad::ErrorStatus. </returns>
  97. ///
  98. virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* pFiler);
  99. /// <summary> The standard filing protocol. </summary>
  100. /// <param name="pFiler"> The filer to write the object data to. </param>
  101. /// <returns> Acad::ErrorStatus. </returns>
  102. ///
  103. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
  104. /// <summary> The standard filing protocol. </summary>
  105. /// <param name="pFiler"> The filer to read the object data from. </param>
  106. /// <returns> Acad::ErrorStatus. </returns>
  107. ///
  108. virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* pFiler);
  109. /// <summary> The standard protocol. </summary>
  110. /// <param name="pAuditInfo"> See the AcDbAuditInfo documentation. </param>
  111. /// <returns> Acad::ErrorStatus. </returns>
  112. ///
  113. virtual Acad::ErrorStatus audit(AcDbAuditInfo* pAuditInfo);
  114. /// <summary> Returns the value of the internal index1 data member. </summary>
  115. /// <returns> Value of the internal index1 data member. </returns>
  116. ///
  117. int index1() const;
  118. /// <summary> Returns the value of the internal index2 data member. </summary>
  119. /// <returns> Value of the internal index2 data member. </returns>
  120. ///
  121. int index2() const;
  122. /// <summary>
  123. /// Returns true if the AcDbAssocEdgePersSubentId identifies a vertex subentity
  124. /// that is the center of an arc polyline segment.
  125. /// </summary>
  126. ///
  127. bool isSegmentArcCenter() const;
  128. /// <summary>
  129. /// Returns true if the AcDbAssocEdgePersSubentId identifies a vertex subentity
  130. /// that is the midpoint of a polyline segment.
  131. /// </summary>
  132. ///
  133. bool isSegmentMidpoint () const;
  134. private:
  135. int mIndex1; // vertex 1
  136. int mIndex2; // vertex 2
  137. }; // class AcDbAssocEdgePersSubentId
  138. #pragma pack (pop)