AcDbAssocPatchSurfaceActionBody.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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: Pei Zhan May 2009
  12. //
  13. //////////////////////////////////////////////////////////////////////////////
  14. #pragma once
  15. #include "dbgrip.h"
  16. #include "AcDbAssocPathBasedSurfaceActionBody.h"
  17. #pragma pack (push, 8)
  18. /// <summary>
  19. /// Action that sets the contents of AcDbSurface entity create by surface patch operation.
  20. /// a patch surface can be curve-based or subentity edge-based. For a curve-based patch surface
  21. /// no continuity or bulge information is necessary.
  22. /// The action can be fully associative or semi-associative. If fully associative, the resulting
  23. /// surface will always automatically regenerate when any input data is changed. If semi-associative,
  24. /// for subentity edge-based patch surface, when input surfaces are detached from the resulting surface,
  25. /// this action will be erased and the resulting surface will not regenerate and become a generic surface.
  26. /// for curve-based patch surface, when the original input curves are detached from the patch surface,
  27. /// the patch surface will use the cached geometry of the curves that was first used to create the patch
  28. /// surface to regenerate.
  29. /// </summary>
  30. ///
  31. class ACDB_PORT AcDbAssocPatchSurfaceActionBody : public AcDbAssocPathBasedSurfaceActionBody
  32. {
  33. public:
  34. ACRX_DECLARE_MEMBERS(AcDbAssocPatchSurfaceActionBody);
  35. /// <summary> Default constructor. </summary>
  36. /// <param name="createImpObject"> See AcDbAssocCreateImpObject explanation. </param>
  37. ///
  38. explicit AcDbAssocPatchSurfaceActionBody(AcDbAssocCreateImpObject createImpObject = kAcDbAssocCreateImpObject);
  39. /// <summary>
  40. /// Set constraint points of the resulting patch surface
  41. /// </summary>
  42. /// <param name="constraintPoints"> Array of constraint points. </param>
  43. /// <returns> Acad::ErrorStatus. </returns>
  44. ///
  45. Acad::ErrorStatus setConstraintPoints( const AcArray<AcDbVertexRef> & constraintPoints);
  46. /// <summary>
  47. /// Set constraint curves of the resulting patch surface
  48. /// </summary>
  49. /// <param name="constraintCurves"> Array of constraint curves. </param>
  50. /// <returns> Acad::ErrorStatus. </returns>
  51. ///
  52. Acad::ErrorStatus setConstraintCurves( const AcArray<AcDbEdgeRef> & constraintCurves );
  53. /// <summary><para>
  54. /// Set continuity of the resulting patch surface. It can be only used on patch surface created from edge subentity
  55. /// </para><para>
  56. /// the same parameter can be set through class AcDbAssocAction by calling method
  57. /// setValueParam with name "kContinuityParamName".
  58. /// </para></summary>
  59. /// <param name="continuity"> New value of the parameter. </param>
  60. /// <param name="expression"> Expression of the parameter, if the value is controlled by other parameters</param>
  61. /// <param name="evaluatorId"> The id of the expression evaluator that is used to parse the expression, if an expression is used. </param>
  62. /// <returns> Acad::ErrorStatus. </returns>
  63. ///
  64. Acad::ErrorStatus setContinuity(int continuity, const AcString& expression = AcString(),
  65. const AcString& evaluatorId = AcString());
  66. /// <summary><para>
  67. /// Get continuity of the resulting patch surface. It can be only used on patch surface created from edge subentity
  68. /// </para><para>
  69. /// the same parameter can be accessed through class AcDbAssocAction by calling method
  70. /// getValueParam with name "kContinuityParamName".
  71. /// </para></summary>
  72. /// <param name="expression"> Expression of the parameter, empty string if no expression is being used. </param>
  73. /// <param name="evaluatorId"> The id of the expression evaluator that is used to parse the expression, empty string if no expression is being used </param>
  74. /// <returns> Continuity of the resulting patch surface. </returns>
  75. ///
  76. int continuity(AcString& expression = dummyString(), AcString& evaluatorId = dummyString()) const;
  77. /// <summary>
  78. /// Get location of continuity grip point of the resulting patch surface
  79. /// </summary>
  80. /// <param name="gripPt"> Position of the continuity grip point. </param>
  81. /// <returns> Acad::ErrorStatus. </returns>
  82. ///
  83. Acad::ErrorStatus getContinuityGripPoint ( AcGePoint3d& gripPt) const;
  84. /// <summary><para>
  85. /// Set bulge factor the resulting patch surface. It can be only used on patch surface created from edge subentity
  86. /// </para><para>
  87. /// the same parameter can be set through class AcDbAssocAction by calling method
  88. /// setValueParam with name "kBulgeParamName".
  89. /// </para></summary>
  90. /// <param name="bulge"> New value of the parameter. Bulge must be positive or 0. </param>
  91. /// <param name="expression"> Expression of the parameter, if the value is controlled by other parameters</param>
  92. /// <param name="evaluatorId"> The id of the expression evaluator that is used to parse the expression, if an expression is used. </param>
  93. /// <returns> Acad::ErrorStatus. </returns>
  94. ///
  95. Acad::ErrorStatus setBulge(double bulge, const AcString& expression = AcString(),
  96. const AcString& evaluatorId = AcString());
  97. /// <summary><para>
  98. /// Get bulge factor of resulting patch surface. It can be only used on patch surface created from edge subentity
  99. /// </para><para>
  100. /// the same parameter can be accessed through class AcDbAssocAction by calling method
  101. /// getValueParam with name "kBulgeParamName".
  102. /// </para></summary>
  103. /// <param name="expression"> Expression of the parameter, empty string if no expression is being used. </param>
  104. /// <param name="evaluatorId"> The id of the expression evaluator that is used to parse the expression, empty string if no expression is being used </param>
  105. /// <returns> Bulge. </returns>
  106. ///
  107. double bulge(AcString& expression = dummyString(), AcString& evaluatorId = dummyString()) const;
  108. /// <summary>
  109. /// Create an instance of AcDbAssocPatchSurfaceActionBody, if the input is subentity edge
  110. /// with continuity and bulge info
  111. /// </summary>
  112. /// <param name="patchSurfaceId"> Resulting patch surface id. </param>
  113. /// <param name="profileCurves"> Array of input profiles. </param>
  114. /// <param name="constraintCurves"> Array of constraint curves. </param>
  115. /// <param name="constraintPoints"> Array of constraint points. </param>
  116. /// <param name="nContinuity"> Continuity of the patch surface. </param>
  117. /// <param name="dBulge"> Bulge of the patch surface. </param>
  118. /// <param name="createdActionId"> Id of created action. </param>
  119. /// <param name="bEnabled"> Specify if the action is fully associative. if True, the resulting surface will
  120. /// always automatically regenerate itself when any input surfaces are changed. If false, it will be
  121. /// semi-associative, which means when input surfaces are detached from the resulting surface, this
  122. /// action will be erased and the resulting surface will not regenerate and become a generic surface. </param>
  123. /// <returns> Acad::ErrorStatus. </returns>
  124. ///
  125. static Acad::ErrorStatus createInstance( const AcDbObjectId& patchSurfaceId,
  126. const AcArray<AcDbEdgeRef>& profileCurves,
  127. const AcArray<AcDbEdgeRef>& constraintCurves,
  128. const AcArray<AcDbVertexRef>&constraintPoints,
  129. int nContinuity,
  130. double dBulge,
  131. bool bEnabled,
  132. AcDbObjectId& createdActionId);
  133. /// <summary>
  134. /// Create an instance of AcDbAssocPatchSurfaceActionBody, if the input is AcDbCurve
  135. /// without continuity and bulge info
  136. /// </summary>
  137. /// <param name="patchSurfaceId"> Resulting patch surface id. </param>
  138. /// <param name="profileCurves"> Array of input profiles. </param>
  139. /// <param name="constraintCurves"> Array of constraint curves. </param>
  140. /// <param name="constraintPoints"> Array of constraint points. </param>
  141. /// <param name="createdActionId"> Id of created action. </param>
  142. /// <param name="bEnabled"> Specify if the action is fully associative. if True, the resulting surface will
  143. /// always automatically regenerate itself when any input surfaces are changed. If false, it will be
  144. /// semi-associative, which means when input curves are detached from the resulting surface,
  145. /// the resulting surface will regenerate based on saved geometry of curves that first time used to create the
  146. /// the patch surface. </param>
  147. /// <returns> Acad::ErrorStatus. </returns>
  148. ///
  149. static Acad::ErrorStatus createInstance( const AcDbObjectId& patchSurfaceId,
  150. const AcArray<AcDbEdgeRef>& profileCurves,
  151. const AcArray<AcDbEdgeRef>& constraintCurves,
  152. const AcArray<AcDbVertexRef>&constraintPoints,
  153. bool bEnabled,
  154. AcDbObjectId& createdActionId);
  155. }; // class AcDbAssocPatchSurfaceActionBody
  156. #pragma pack (pop)