dbrevolvedsurf.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. //
  12. // DESCRIPTION:
  13. //
  14. // The AcDbRevolvedSurface class is the interface class for representing
  15. // ASM revolved surfaces.
  16. #pragma once
  17. #ifndef DBREVOLVEDSURF_H
  18. #define DBREVOLVEDSURF_H
  19. #include "dbsurf.h"
  20. #pragma pack(push, 8)
  21. class AcDbRevolvedSurface: public AcDbSurface
  22. {
  23. public:
  24. /// <summary>
  25. /// Default constructor.
  26. /// </summary>
  27. AcDbRevolvedSurface ();
  28. /// <summary>
  29. /// Destructor.
  30. /// </summary>
  31. virtual ~AcDbRevolvedSurface();
  32. ACDB_DECLARE_MEMBERS(AcDbRevolvedSurface);
  33. /// <summary>
  34. /// Creates a revolved surface from the given profile using the specified options.
  35. /// </summary>
  36. /// <param name="pRevEnt">
  37. /// Input profile to be revolved. This may be an entity such as a curve or
  38. /// surface or region.
  39. /// </param>
  40. /// <param name="axisPnt">
  41. /// Input point on the axis of revolution. This may be any point on the
  42. /// axis line.
  43. /// </param>
  44. /// <param name="axisDir">
  45. /// Input direction vector of the axis of revolution. This vector must not
  46. /// be zero-length.
  47. /// </param>
  48. /// <param name="revAngle">
  49. /// Input angle of revolution in radians.
  50. /// </param>
  51. /// <param name="startAngle">
  52. /// Input start angle in radians. The profile will be rotated about this angle
  53. /// before starting the revolve. If this angle is 0 then the profile will be
  54. /// revolved from its current position.
  55. /// </param>
  56. /// <param name="sweepOptions">
  57. /// Input sweep options.
  58. /// </param>
  59. /// <returns>
  60. /// eOk if successful.
  61. /// </returns>
  62. virtual Acad::ErrorStatus createRevolvedSurface ( AcDbEntity* pRevEnt,
  63. const AcGePoint3d& axisPnt, const AcGeVector3d& axisDir,
  64. double revAngle, double startAngle,
  65. AcDbRevolveOptions& revolveOptions );
  66. /// <summary>
  67. /// Returns the entity that was revolved.
  68. /// </summary>
  69. /// <returns>
  70. /// Copy of the entity that was revolved to create the surface. The caller
  71. /// should not delete this pointer or post it to the database.
  72. /// </returns>
  73. AcDbEntity* getRevolveEntity () const;
  74. /// <summary>
  75. /// Returns the data of the profile from which the surface was revolved.
  76. /// </summary>
  77. /// <returns>
  78. /// Profile data object. The caller is responsible for deleting this
  79. /// pointer if it is not NULL. If the surface was revolved from an edge
  80. /// of a surface or solid, then the returned profile object will only
  81. /// contain the edge subent data if the surface is associative.
  82. /// Otherwise it will only contain the curve that was extracted from the
  83. /// edge.
  84. /// </returns>
  85. ACDB_PORT AcDb3dProfile* revolveProfile () const;
  86. /// <summary>
  87. /// Returns point on the axis of revolution.
  88. /// </summary>
  89. /// <returns>
  90. /// Point on the axis of revolution.
  91. /// </returns>
  92. AcGePoint3d getAxisPnt () const;
  93. /// <summary>
  94. /// Set the point on the axis of revolution.
  95. /// </summary>
  96. /// <param name="pnt">
  97. /// Input point that the axis of revolution passes through.
  98. /// </param>
  99. /// <returns>
  100. /// eOk if successful.
  101. /// </returns>
  102. Acad::ErrorStatus setAxisPnt ( const AcGePoint3d& pnt );
  103. /// <summary>
  104. /// Returns direction vector of the axis of revolution.
  105. /// </summary>
  106. /// <returns>
  107. /// Direction vector of the axis of revolution.
  108. /// </returns>
  109. AcGeVector3d getAxisVec () const;
  110. /// <summary>
  111. /// Set the direction vector of the axis of revolution.
  112. /// </summary>
  113. /// <param name="vec">
  114. /// Input direction vector of the axis of revolution.
  115. /// This vector must not be zero-length.
  116. /// </param>
  117. /// <returns>
  118. /// eOk if successful.
  119. /// </returns>
  120. Acad::ErrorStatus setAxisVec ( const AcGeVector3d& vec );
  121. /// <summary>
  122. /// Returns the angle of revolution.
  123. /// </summary>
  124. /// <returns>
  125. /// Angle of revolution in radians.
  126. /// </returns>
  127. double getRevolveAngle () const;
  128. /// <summary>
  129. /// Set the angle of revolution.
  130. /// </summary>
  131. /// <param name="ang">
  132. /// Input angle of revolution in radians.
  133. /// </param>
  134. /// <returns>
  135. /// eOk if successful.
  136. /// </returns>
  137. Acad::ErrorStatus setRevolveAngle ( double ang );
  138. /// <summary>
  139. /// Returns the start angle. The original profile was rotated by this angle
  140. /// about the axis of revolution before starting the revolve.
  141. /// </summary>
  142. /// <returns>
  143. /// Start angle in radians.
  144. /// </returns>
  145. double getStartAngle () const;
  146. /// <summary>
  147. /// Gets the options that were used to create the surface.
  148. /// </summary>
  149. /// <param name="revolveOptions">
  150. /// Output options that were used to create the surface.
  151. /// </param>
  152. void getRevolveOptions ( AcDbRevolveOptions& revolveOptions ) const;
  153. /// <summary>
  154. /// Set the revolve options.
  155. /// </summary>
  156. /// <param name="revolveOptions">
  157. /// Input revolve options.
  158. /// </param>
  159. /// <returns>
  160. /// eOk if successful.
  161. /// </returns>
  162. Acad::ErrorStatus setRevolveOptions ( const AcDbRevolveOptions& revolveOptions );
  163. /// <summary>
  164. /// Set the axis of revolution, revolve angle, and options.
  165. /// </summary>
  166. /// <param name="axisPnt">
  167. /// Input point that the axis of revolution passes through.
  168. /// </param>
  169. /// <param name="axisVec">
  170. /// Input direction vector of the axis of revolution.
  171. /// This vector must not be zero-length.
  172. /// </param>
  173. /// <param name="revAngle">
  174. /// Input angle of revolution in radians.
  175. /// </param>
  176. /// <param name="revolveOptions">
  177. /// Input revolve options.
  178. /// </param>
  179. /// <returns>
  180. /// eOk if successful.
  181. /// </returns>
  182. Acad::ErrorStatus setRevolve ( const AcGePoint3d& axisPnt, const AcGeVector3d& axisVec,
  183. double revAngle, const AcDbRevolveOptions& revolveOptions );
  184. // AcDbObject methods
  185. virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
  186. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
  187. virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
  188. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;
  189. virtual bool isDependent() const;
  190. protected:
  191. // AcDbEntity methods
  192. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  193. };
  194. #pragma pack(pop)
  195. #endif // DBREVOLVEDSURF_H