dbextrudedsurf.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. //
  2. //
  3. //
  4. //
  5. //////////////////////////////////////////////////////////////////////////////
  6. //
  7. // Copyright 2015 Autodesk, Inc. All rights reserved.
  8. //
  9. // Use of this software is subject to the terms of the Autodesk license
  10. // agreement provided at the time of installation or download, or which
  11. // otherwise accompanies this software in either electronic or hard copy form.
  12. //
  13. //////////////////////////////////////////////////////////////////////////////
  14. //
  15. //
  16. // DESCRIPTION:
  17. //
  18. // The AcDbExtrudedSurface class is the interface class for representing
  19. // ASM extruded surfaces.
  20. #pragma once
  21. #ifndef DBEXTRUDEDSURF_H
  22. #define DBEXTRUDEDSURF_H
  23. #include "dbsurf.h"
  24. #pragma pack(push, 8)
  25. class AcDbExtrudedSurface: public AcDbSurface
  26. {
  27. public:
  28. /// <summary>
  29. /// Default constructor.
  30. /// </summary>
  31. AcDbExtrudedSurface ();
  32. /// <summary>
  33. /// Destructor.
  34. /// </summary>
  35. virtual ~AcDbExtrudedSurface();
  36. ACDB_DECLARE_MEMBERS(AcDbExtrudedSurface);
  37. /// <summary>
  38. /// Creates an extruded surface from the given profile using the specified options.
  39. /// </summary>
  40. /// <param name="pSweep">
  41. /// Input profile to be extruded. This may be an entity such as a curve or
  42. /// surface or region.
  43. /// </param>
  44. /// <param name="directionVec">
  45. /// Input vector that defines the direction and height of the extrusion.
  46. /// This vector must not be zero-length.
  47. /// </param>
  48. /// <param name="sweepOptions">
  49. /// Input sweep options.
  50. /// </param>
  51. /// <returns>
  52. /// eOk if successful.
  53. /// </returns>
  54. virtual Acad::ErrorStatus createExtrudedSurface ( AcDbEntity* pSweepEnt,
  55. const AcGeVector3d& directionVec, AcDbSweepOptions& sweepOptions );
  56. /// <summary>
  57. /// Returns the entity that was extruded.
  58. /// </summary>
  59. /// <returns>
  60. /// Copy of the entity that was extruded to create the surface. The caller
  61. /// should not delete this pointer or post it to the database.
  62. /// </returns>
  63. AcDbEntity* getSweepEntity () const;
  64. /// <summary>
  65. /// Returns the data of the profile from which the surface was extruded.
  66. /// </summary>
  67. /// <returns>
  68. /// Profile data object. The caller is responsible for deleting this
  69. /// pointer if it is not NULL. If the surface was extruded from an edge
  70. /// of a surface or solid, then the returned profile object will only
  71. /// contain the edge subent data if the surface is associative.
  72. /// Otherwise it will only contain the curve that was extracted from the
  73. /// edge.
  74. /// </returns>
  75. ACDB_PORT AcDb3dProfile* sweepProfile () const;
  76. /// <summary>
  77. /// Returns the extrusion vector.
  78. /// </summary>
  79. /// <returns>
  80. /// Vector in which the profile was extruded to create the surface.
  81. /// The extrusion height is equal to the length of this vector.
  82. /// </returns>
  83. AcGeVector3d getSweepVec () const;
  84. /// <summary>
  85. /// Set the extrusion vector of the surface.
  86. /// </summary>
  87. /// <param name="sweepVec">
  88. /// Input vector that defines the direction and length of the extrusion.
  89. /// </param>
  90. /// <returns>
  91. /// eOk if successful.
  92. /// </returns>
  93. Acad::ErrorStatus setSweepVec ( const AcGeVector3d& sweepVec );
  94. /// <summary>
  95. /// Returns the extrusion height.
  96. /// </summary>
  97. /// <returns>
  98. /// Extrusion height.
  99. /// </returns>
  100. double getHeight () const;
  101. /// <summary>
  102. /// Set the extrusion height.
  103. /// </summary>
  104. /// <param name="height">
  105. /// Input extrusion height.
  106. /// </param>
  107. /// <returns>
  108. /// eOk if successful.
  109. /// </returns>
  110. Acad::ErrorStatus setHeight ( double height );
  111. /// <summary>
  112. /// Gets the options that were used to create the surface.
  113. /// </summary>
  114. /// <param name="sweepOptions">
  115. /// Output options that were used to create the surface.
  116. /// </param>
  117. void getSweepOptions ( AcDbSweepOptions& sweepOptions ) const;
  118. /// <summary>
  119. /// Set the extrusion options.
  120. /// </summary>
  121. /// <param name="sweepOptions">
  122. /// Input sweep options.
  123. /// </param>
  124. /// <returns>
  125. /// eOk if successful.
  126. /// </returns>
  127. Acad::ErrorStatus setSweepOptions ( const AcDbSweepOptions& sweepOptions );
  128. /// <summary>
  129. /// Set the extrusion vector and options.
  130. /// </summary>
  131. /// <param name="sweepVec">
  132. /// Input vector that defines the direction and length of the extrusion.
  133. /// </param>
  134. /// <param name="sweepOptions">
  135. /// Input sweep options.
  136. /// </param>
  137. /// <returns>
  138. /// eOk if successful.
  139. /// </returns>
  140. Acad::ErrorStatus setExtrude ( const AcGeVector3d& sweepVec,
  141. const AcDbSweepOptions& sweepOptions );
  142. // AcDbObject methods
  143. virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
  144. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
  145. virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
  146. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;
  147. virtual bool isDependent () const;
  148. protected:
  149. // AcDbEntity methods
  150. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  151. };
  152. #pragma pack(pop)
  153. #endif // DBEXTRUDEDSURF_H