dbhelix.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. //
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. //
  12. // DESCRIPTION: Exported class for Helix - AcDbHelix
  13. #ifndef ACDB_DBHELIX_H
  14. #define ACDB_DBHELIX_H
  15. #include "gegbl.h"
  16. #include "dbmain.h"
  17. #include "dbspline.h"
  18. #pragma pack (push, 8)
  19. ////////////////////////////////////////////////////////////////////////
  20. // class AcDbHelix
  21. ////////////////////////////////////////////////////////////////////////
  22. /// <summary>
  23. /// This class implements the AutoCAD helix entity.
  24. /// Objects of the AcDbHelix class contain an embedded AcDbSpline which is
  25. /// wrapped by the AcDbHelix in order to constrain it's behavior so that its
  26. /// basic shape is maintained.
  27. /// </summary>
  28. ///
  29. /// <remarks>
  30. /// AcDbHelix derives from AcDbSpline, but an attempt to modify the object by
  31. /// fit or nurbs data will return an error.
  32. /// </remarks>
  33. ///
  34. class AcDbHelix: public AcDbSpline
  35. {
  36. public:
  37. /// <summary>
  38. /// Special constrain type values.
  39. /// </summary>
  40. ///
  41. enum ConstrainType {
  42. /// <summary>
  43. /// Constrain turn height.
  44. /// </summary>
  45. ///
  46. kTurnHeight = 0,
  47. /// <summary>
  48. /// Constrain turns.
  49. /// </summary>
  50. ///
  51. kTurns = 1,
  52. /// <summary>
  53. /// Constrain height.
  54. /// </summary>
  55. ///
  56. kHeight = 2
  57. };
  58. public:
  59. ACDB_DECLARE_MEMBERS(AcDbHelix);
  60. /// <summary>
  61. /// Default constructor.
  62. /// </summary>
  63. AcDbHelix();
  64. /// <summary>
  65. /// Destructor.
  66. /// </summary>
  67. virtual ~AcDbHelix();
  68. /// <summary>
  69. /// Constructs the embedded spline data.
  70. /// </summary>
  71. /// <returns>
  72. /// Returns Acad::eOk if succssful.
  73. /// </returns>
  74. Acad::ErrorStatus createHelix();
  75. /// <summary>
  76. /// Axis point for the helix
  77. /// </summary>
  78. /// <returns>
  79. /// Returns the start point the axis for the helix
  80. /// </returns>
  81. virtual AcGePoint3d axisPoint() const;
  82. /// <summary>
  83. /// Sets the start point the axis for the helix
  84. /// </summary>
  85. /// <param name="axisPoint">
  86. /// The 3d point where the axis starts
  87. /// </param>
  88. /// <param name="bMoveStartPoint">
  89. /// Also relocate the start point by the same offset that the axis point
  90. /// moved.
  91. /// </param>
  92. /// <returns>
  93. /// Returns Acad::eOk if succssful.
  94. /// </returns>
  95. virtual Acad::ErrorStatus setAxisPoint(const AcGePoint3d &axisPoint,
  96. const bool bMoveStartPoint = true);
  97. /// <summary>
  98. /// Start point for the helix
  99. /// </summary>
  100. /// <returns>
  101. /// Returns the start point of the helix
  102. /// </returns>
  103. virtual AcGePoint3d startPoint() const;
  104. /// <summary>
  105. /// Sets the start point of the helix
  106. /// </summary>
  107. /// <param name="axisPoint">
  108. /// The 3d point where the helix starts
  109. /// </param>
  110. /// <returns>
  111. /// Returns Acad::eOk if succssful.
  112. /// </returns>
  113. virtual Acad::ErrorStatus setStartPoint(const AcGePoint3d &startPoint);
  114. /// <summary>
  115. /// Vector of the axis of the helix
  116. /// </summary>
  117. /// <returns>
  118. /// Returns the vector for the axis of the helix
  119. /// </returns>
  120. virtual AcGeVector3d axisVector() const;
  121. /// <summary>
  122. /// Sets the vector for the axis for the helix
  123. /// </summary>
  124. /// <param name="axisPoint">
  125. /// The 3d vector for the axis
  126. /// </param>
  127. /// <returns>
  128. /// Returns Acad::eOk if succssful.
  129. /// </returns>
  130. virtual Acad::ErrorStatus setAxisVector(const AcGeVector3d &axisVector);
  131. /// <summary>
  132. /// Height of the helix
  133. /// </summary>
  134. /// <returns>
  135. /// Returns the height of the helix
  136. /// </returns>
  137. virtual double height() const;
  138. /// <summary>
  139. /// Sets the height of the helix
  140. /// </summary>
  141. /// <param name="dHeigth">
  142. /// height for the helix entity
  143. /// </param>
  144. /// <returns>
  145. /// Returns Acad::eOk if succssful.
  146. /// </returns>
  147. /// <remarks>
  148. /// This will change the turnHeight property, keeping the number of turns
  149. /// constant
  150. /// </remarks>
  151. virtual Acad::ErrorStatus setHeight(double dHeight);
  152. /// <summary>
  153. /// Base radius of the helix
  154. /// </summary>
  155. /// <returns>
  156. /// Returns the base radius of the helix
  157. /// </returns>
  158. virtual double baseRadius() const;
  159. /// <summary>
  160. /// Sets the base radius of the helix
  161. /// </summary>
  162. /// <param name="dRadius">
  163. /// base radius for the helix entity
  164. /// </param>
  165. /// <returns>
  166. /// Returns Acad::eOk if succssful.
  167. /// </returns>
  168. virtual Acad::ErrorStatus setBaseRadius(double dRadius);
  169. /// <summary>
  170. /// Top radius of the helix
  171. /// </summary>
  172. /// <returns>
  173. /// Returns the top radius of the helix
  174. /// </returns>
  175. virtual double topRadius() const;
  176. /// <summary>
  177. /// Sets the top radius of the helix
  178. /// </summary>
  179. /// <param name="dRadius">
  180. /// top radius for the helix entity
  181. /// </param>
  182. /// <returns>
  183. /// Returns Acad::eOk if succssful.
  184. /// </returns>
  185. virtual Acad::ErrorStatus setTopRadius(double dRadius);
  186. /// <summary>
  187. /// Number of turns (revolutions) of the helix
  188. /// </summary>
  189. /// <returns>
  190. /// Returns the number of turns (revolutions)
  191. /// </returns>
  192. virtual double turns() const;
  193. /// <summary>
  194. /// Sets the number of turns (revolutions)
  195. /// </summary>
  196. /// <returns>
  197. /// Returns Acad::eOk if succssful.
  198. /// </returns>
  199. virtual Acad::ErrorStatus setTurns(double dTurns);
  200. /// <summary>
  201. /// Turn height (distance between threads)
  202. /// </summary>
  203. /// <returns>
  204. /// Returns the turn height (distance between threads)
  205. /// </returns>
  206. virtual double turnHeight() const;
  207. /// <summary>
  208. /// Sets the turn height (distance between threads)
  209. /// </summary>
  210. /// <returns>
  211. /// Returns Acad::eOk if succssful.
  212. /// </returns>
  213. virtual Acad::ErrorStatus setTurnHeight(double dTurnHeight);
  214. /// <summary>
  215. /// Twist of the helix (clockwise or counter-clockwise)
  216. /// </summary>
  217. /// <returns>
  218. /// Returns the twist of the helix (clockwise or counter-clockwise)
  219. /// </returns>
  220. virtual Adesk::Boolean twist() const;
  221. /// <summary>
  222. /// Sets the twist of the helix (clockwise or counter-clockwise)
  223. /// </summary>
  224. /// <returns>
  225. /// Returns Acad::eOk if succssful.
  226. /// </returns>
  227. virtual Acad::ErrorStatus setTwist(Adesk::Boolean bTwist);
  228. /// <summary>
  229. /// Constrain property of the helix
  230. /// </summary>
  231. /// <returns>
  232. /// Returns the constrain property of the helix
  233. /// </returns>
  234. virtual ConstrainType constrain() const;
  235. /// <summary>
  236. /// Sets the constrain property of the helix
  237. /// </summary>
  238. /// <returns>
  239. /// Returns Acad::eOk if succssful.
  240. /// </returns>
  241. virtual Acad::ErrorStatus setConstrain(ConstrainType constrain);
  242. /// <summary>
  243. /// Turn slope of the helix
  244. /// </summary>
  245. /// <returns>
  246. /// Returns the turn slope angle of the helix
  247. /// </returns>
  248. virtual double turnSlope() const;
  249. /// <summary>
  250. /// Total length of the helix
  251. /// </summary>
  252. /// <returns>
  253. /// Returns the total length of the helix
  254. /// </returns>
  255. virtual double totalLength() const;
  256. /// <summary>
  257. /// Reverses the parameterization of the curve
  258. /// The start becomes the end and visa versa
  259. /// </summary>
  260. virtual Acad::ErrorStatus reverseCurve();
  261. protected:
  262. /// <summary>
  263. /// Gets the corresponding COM wrapper class ID.
  264. /// </summary>
  265. /// <param name="pClsid">
  266. /// Output pointer to class ID
  267. /// </param>
  268. /// <returns>
  269. /// Returns Acad::eOk if succssful.
  270. /// </returns>
  271. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  272. };
  273. #pragma pack (pop)
  274. #endif