dblead.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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. #ifndef AD_DBLEAD_H
  12. #define AD_DBLEAD_H 1
  13. #include "dbmain.h"
  14. #include "dbcurve.h"
  15. #include "gescl3d.h"
  16. #include "gepnt2d.h"
  17. #include "geplane.h"
  18. #pragma pack(push, 8)
  19. class AcDbLeader: public AcDbCurve
  20. {
  21. public:
  22. AcDbLeader();
  23. ~AcDbLeader();
  24. ACDB_DECLARE_MEMBERS(AcDbLeader);
  25. DBCURVE_METHODS
  26. // Leader orientation.
  27. //
  28. virtual void setPlane (const AcGePlane&);
  29. virtual AcGeVector3d normal () const;
  30. // Vertex manipulation.
  31. //
  32. virtual int numVertices() const;
  33. virtual Adesk::Boolean appendVertex(const AcGePoint3d&);
  34. virtual void removeLastVertex ();
  35. virtual AcGePoint3d firstVertex() const;
  36. virtual AcGePoint3d lastVertex() const;
  37. virtual AcGePoint3d vertexAt(int) const;
  38. virtual Adesk::Boolean setVertexAt(int, const AcGePoint3d&);
  39. // Display characteristics.
  40. //
  41. virtual Adesk::Boolean hasArrowHead () const;
  42. virtual void enableArrowHead ();
  43. virtual void disableArrowHead ();
  44. ACDB_PORT void setHasArrowHead (Adesk::Boolean bEnable);
  45. virtual Adesk::Boolean hasHookLine () const;
  46. //
  47. virtual void setToSplineLeader ();
  48. virtual void setToStraightLeader();
  49. virtual Adesk::Boolean isSplined () const;
  50. ACDB_PORT void setSplined (Adesk::Boolean bSplined);
  51. //
  52. virtual AcDbHardPointerId dimensionStyle () const;
  53. virtual void setDimensionStyle (const AcDbHardPointerId&);
  54. Acad::ErrorStatus getDimstyleData(AcDbDimStyleTableRecord*& pRecord) const;
  55. Acad::ErrorStatus setDimstyleData(AcDbDimStyleTableRecord* pNewData);
  56. Acad::ErrorStatus setDimstyleData(AcDbObjectId newDataId);
  57. // Associativity support.
  58. //
  59. virtual Acad::ErrorStatus attachAnnotation (const AcDbObjectId& annoId);
  60. virtual Acad::ErrorStatus detachAnnotation ();
  61. virtual AcDbObjectId annotationObjId () const;
  62. ACDB_PORT Acad::ErrorStatus setAnnotationObjId(const AcDbObjectId& annoId);
  63. virtual Acad::ErrorStatus evaluateLeader ();
  64. //
  65. // Relation of leader endpoint to annotation:
  66. //
  67. virtual AcGeVector3d annotationOffset () const;
  68. virtual Acad::ErrorStatus setAnnotationOffset(const AcGeVector3d& offset);
  69. enum AnnoType {
  70. kMText = 0,
  71. kFcf,
  72. kBlockRef,
  73. kNoAnno
  74. };
  75. AnnoType annoType() const;
  76. double annoHeight() const;
  77. double annoWidth() const;
  78. // Dimension variable get methods in alphabetic order:
  79. //
  80. virtual double dimasz () const;
  81. virtual AcCmColor dimclrd () const;
  82. virtual double dimgap () const;
  83. virtual AcDb::LineWeight dimlwd () const;
  84. virtual AcDbObjectId dimldrblk() const;
  85. virtual bool dimsah () const;
  86. virtual double dimscale () const;
  87. virtual int dimtad () const;
  88. virtual AcDbObjectId dimtxsty () const;
  89. virtual double dimtxt () const;
  90. // Dimension variable set methods in alphabetic order:
  91. //
  92. virtual Acad::ErrorStatus setDimasz (double val);
  93. virtual Acad::ErrorStatus setDimclrd (AcCmColor& val);
  94. virtual Acad::ErrorStatus setDimgap (double val);
  95. virtual Acad::ErrorStatus setDimldrblk(AcDbObjectId val);
  96. virtual Acad::ErrorStatus setDimldrblk(const ACHAR * val);
  97. virtual Acad::ErrorStatus setDimlwd (AcDb::LineWeight v); // new to R15
  98. virtual Acad::ErrorStatus setDimsah (bool val);
  99. virtual Acad::ErrorStatus setDimscale (double val);
  100. virtual Acad::ErrorStatus setDimtad (int val);
  101. virtual Acad::ErrorStatus setDimtxsty (AcDbObjectId val);
  102. virtual Acad::ErrorStatus setDimtxt (double val);
  103. // Support for persistent reactor to annotation.
  104. //
  105. virtual void modified (const AcDbObject*);
  106. virtual void erased (const AcDbObject*,
  107. Adesk::Boolean = Adesk::kTrue);
  108. virtual void goodbye (const AcDbObject*);
  109. virtual void copied (const AcDbObject*,
  110. const AcDbObject*);
  111. // DEPRECATED METHODS!
  112. // These are supported but will be removed in future releases:
  113. //
  114. virtual void setDimVars ();
  115. virtual Acad::ErrorStatus setColorIndex (Adesk::UInt16,
  116. Adesk::Boolean doSubents = Adesk::kTrue);
  117. //
  118. // end DEPRECATED METHODS!
  119. protected:
  120. // Get corresponding COM wrapper class ID
  121. //
  122. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  123. };
  124. // These are methods of AcDbCurve that aren't implemented for AcDbLeader:
  125. //
  126. inline Adesk::Boolean AcDbLeader::isClosed() const
  127. {
  128. return Adesk::kFalse;
  129. }
  130. inline Adesk::Boolean AcDbLeader::isPeriodic() const
  131. {
  132. return Adesk::kFalse;
  133. }
  134. inline Adesk::Boolean AcDbLeader::isPlanar() const
  135. {
  136. return Adesk::kTrue;
  137. }
  138. inline Acad::ErrorStatus AcDbLeader::getStartParam(double& param) const
  139. {
  140. param = 0.0;
  141. return Acad::eOk;
  142. }
  143. inline Acad::ErrorStatus AcDbLeader::getOrthoProjectedCurve(const AcGePlane&,
  144. AcDbCurve*& ) const
  145. {
  146. return Acad::eNotApplicable;
  147. }
  148. inline Acad::ErrorStatus AcDbLeader::getProjectedCurve(const AcGePlane&,
  149. const AcGeVector3d&,
  150. AcDbCurve*&) const
  151. {
  152. return Acad::eNotApplicable;
  153. }
  154. inline Acad::ErrorStatus AcDbLeader::getOffsetCurves(double,
  155. AcDbVoidPtrArray&) const
  156. {
  157. return Acad::eNotApplicable;
  158. }
  159. inline Acad::ErrorStatus AcDbLeader::getSecondDeriv (double,
  160. AcGeVector3d& ) const
  161. {
  162. return Acad::eNotApplicable;
  163. }
  164. inline Acad::ErrorStatus AcDbLeader::getSecondDeriv (const AcGePoint3d&,
  165. AcGeVector3d& ) const
  166. {
  167. return Acad::eNotApplicable;
  168. }
  169. inline Acad::ErrorStatus AcDbLeader::getSplitCurves (const AcGeDoubleArray& ,
  170. AcDbVoidPtrArray& ) const
  171. {
  172. return Acad::eNotApplicable;
  173. }
  174. inline Acad::ErrorStatus AcDbLeader::getSplitCurves (const AcGePoint3dArray& ,
  175. AcDbVoidPtrArray& ) const
  176. {
  177. return Acad::eNotApplicable;
  178. }
  179. inline Acad::ErrorStatus AcDbLeader::extend(double)
  180. {
  181. return Acad::eNotApplicable;
  182. }
  183. inline Acad::ErrorStatus AcDbLeader::extend(Adesk::Boolean, const AcGePoint3d&)
  184. {
  185. return Acad::eNotApplicable;
  186. }
  187. inline Acad::ErrorStatus AcDbLeader::getArea(double&) const
  188. {
  189. return Acad::eNotApplicable;
  190. }
  191. #pragma pack(pop)
  192. #endif