AcDbAssocArrayCommonParameters.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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: Mei Jiayin March 2010
  12. //
  13. // DESCRIPTION:
  14. //
  15. //////////////////////////////////////////////////////////////////////////////
  16. #pragma once
  17. #include "AcDbAssocArrayParameters.h"
  18. #include "AcDbAssocActionBody.h"
  19. class AcDbImpAssocArrayCommonParameters;
  20. /// <summary>
  21. /// AcDbAssocArrayCommonParameters class provides interface to manipulate array
  22. /// parameters that are common to Rectangular, Path and Polar Array.
  23. /// Its derived classes implement logic for providing array item
  24. /// transforms as well as grip manipulation.
  25. /// </summary>
  26. ///
  27. class ACDB_PORT AcDbAssocArrayCommonParameters : public AcDbAssocArrayParameters
  28. {
  29. public:
  30. ACRX_DECLARE_MEMBERS(AcDbAssocArrayCommonParameters);
  31. /// <summary> Default destructor.</summary>
  32. ///
  33. virtual ~AcDbAssocArrayCommonParameters(void);
  34. /// <summary>
  35. /// Gets the level count of the array.
  36. /// If there is no expression for a particular param,
  37. /// expression string and the evaluatorId are empty strings.
  38. /// </summary>
  39. /// <param name="expression"> The returned expression. </param>
  40. /// <param name="evaluatorId"> The returned evaluatorId. </param>
  41. /// <returns> Returns level count. </returns>
  42. ///
  43. int levelCount(AcString& expression, AcString& evaluatorId) const;
  44. inline int levelCount() const
  45. {
  46. AcString expression, evaluatorId;
  47. return levelCount(expression, evaluatorId);
  48. }
  49. inline int levelCount(AcString& expression) const
  50. {
  51. AcString evaluatorId;
  52. return levelCount(expression, evaluatorId);
  53. }
  54. /// <summary>
  55. /// Gets the level spacing of the array.
  56. /// If there is no expression for a particular param,
  57. /// expression string and the evaluatorId are empty strings.
  58. /// </summary>
  59. /// <param name="expression"> The returned expression. </param>
  60. /// <param name="evaluatorId"> The returned evaluatorId. </param>
  61. /// <returns> Returns level spacing. </returns>
  62. ///
  63. double levelSpacing(AcString& expression, AcString& evaluatorId) const;
  64. inline double levelSpacing() const
  65. {
  66. AcString expression, evaluatorId;
  67. return levelSpacing(expression, evaluatorId);
  68. }
  69. inline double levelSpacing(AcString& expression) const
  70. {
  71. AcString evaluatorId;
  72. return levelSpacing(expression, evaluatorId);
  73. }
  74. /// <summary>
  75. /// Gets the row count of the array.
  76. /// If there is no expression for a particular param,
  77. /// expression string and the evaluatorId are empty strings.
  78. /// </summary>
  79. /// <param name="expression"> The returned expression. </param>
  80. /// <param name="evaluatorId"> The returned evaluatorId. </param>
  81. /// <returns> Returns row count. </returns>
  82. ///
  83. int rowCount(AcString& expression, AcString& evaluatorId) const;
  84. inline int rowCount() const
  85. {
  86. AcString expression, evaluatorId;
  87. return rowCount(expression, evaluatorId);
  88. }
  89. inline int rowCount(AcString& expression) const
  90. {
  91. AcString evaluatorId;
  92. return rowCount(expression, evaluatorId);
  93. }
  94. /// <summary>
  95. /// Gets the row elevation of the array.
  96. /// If there is no expression for a particular param,
  97. /// expression string and the evaluatorId are empty strings.
  98. /// </summary>
  99. /// <param name="expression"> The returned expression. </param>
  100. /// <param name="evaluatorId"> The returned evaluatorId. </param>
  101. /// <returns> Returns row elevation. </returns>
  102. ///
  103. double rowElevation(AcString& expression, AcString& evaluatorId ) const;
  104. inline double rowElevation() const
  105. {
  106. AcString expression, evaluatorId;
  107. return rowElevation(expression, evaluatorId);
  108. }
  109. inline double rowElevation(AcString& expression) const
  110. {
  111. AcString evaluatorId;
  112. return rowElevation(expression, evaluatorId);
  113. }
  114. /// <summary>
  115. /// Gets the row spacing of the array.
  116. /// If there is no expression for a particular param,
  117. /// expression string and the evaluatorId are empty strings.
  118. /// </summary>
  119. /// <param name="expression"> The returned expression. </param>
  120. /// <param name="evaluatorId"> The returned evaluatorId. </param>
  121. /// <returns> Returns row spacing. </returns>
  122. ///
  123. double rowSpacing(AcString& expression, AcString& evaluatorId) const;
  124. inline double rowSpacing() const
  125. {
  126. AcString expression, evaluatorId;
  127. return rowSpacing(expression, evaluatorId);
  128. }
  129. inline double rowSpacing(AcString& expression) const
  130. {
  131. AcString evaluatorId;
  132. return rowSpacing(expression, evaluatorId);
  133. }
  134. /// <summary>
  135. /// Sets the level count of the array.
  136. /// If there is no expression for the parameter, the expression string and
  137. /// the evaluatorId must be empty strings.
  138. /// </summary>
  139. /// <param name="nLevels"> The level count to set. </param>
  140. /// <param name="expression"> The expression to set. </param>
  141. /// <param name="evaluatorId"> The evaluatorId to set. </param>
  142. /// <param name="errorMessage"> The returned error message for the individual expression. </param>
  143. /// <returns> Acad::ErrorStatus. </returns>
  144. ///
  145. Acad::ErrorStatus setLevelCount(int nLevels, const AcString& expression = AcString(),
  146. const AcString& evaluatorId = AcString(), AcString& errorMessage = dummyString());
  147. /// <summary>
  148. /// Sets the level spacing of the array.
  149. /// If there is no expression for the parameter, the expression string and
  150. /// the evaluatorId must be empty strings.
  151. /// </summary>
  152. /// <param name="offset"> The level spacing to set. </param>
  153. /// <param name="expression"> The expression to set. </param>
  154. /// <param name="evaluatorId"> The evaluatorId to set. </param>
  155. /// <param name="errorMessage"> The returned error message for the individual expression. </param>
  156. /// <returns> Acad::ErrorStatus. </returns>
  157. ///
  158. Acad::ErrorStatus setLevelSpacing(double offset, const AcString& expression = AcString(),
  159. const AcString& evaluatorId = AcString(), AcString& errorMessage = dummyString());
  160. /// <summary>
  161. /// Sets the row count of the array.
  162. /// If there is no expression for the parameter, the expression string and
  163. /// the evaluatorId must be empty strings.
  164. /// </summary>
  165. /// <param name="nRows"> The row count to set. </param>
  166. /// <param name="expression"> The expression to set. </param>
  167. /// <param name="evaluatorId"> The evaluatorId to set. </param>
  168. /// <param name="errorMessage"> The returned error message for the individual expression. </param>
  169. /// <returns> Acad::ErrorStatus. </returns>
  170. ///
  171. Acad::ErrorStatus setRowCount(int nRows, const AcString& expression = AcString(),
  172. const AcString& evaluatorId = AcString(), AcString& errorMessage = dummyString());
  173. /// <summary>
  174. /// Sets the row elevation of the array.
  175. /// If there is no expression for the parameter, the expression string and
  176. /// the evaluatorId must be empty strings.
  177. /// </summary>
  178. /// <param name="elevation"> The row elevation to set. </param>
  179. /// <param name="expression"> The expression to set. </param>
  180. /// <param name="evaluatorId"> The evaluatorId to set. </param>
  181. /// <param name="errorMessage"> The returned error message for the individual expression. </param>
  182. /// <returns> Acad::ErrorStatus. </returns>
  183. ///
  184. Acad::ErrorStatus setRowElevation(double elevation, const AcString& expression = AcString(),
  185. const AcString& evaluatorId = AcString(), AcString& errorMessage = dummyString());
  186. /// <summary>
  187. /// Sets the row spacing of the array.
  188. /// If there is no expression for the parameter, the expression string and
  189. /// the evaluatorId must be empty strings.
  190. /// </summary>
  191. /// <param name="offset"> The row spacing to set. </param>
  192. /// <param name="expression"> The expression to set. </param>
  193. /// <param name="evaluatorId"> The evaluatorId to set. </param>
  194. /// <param name="errorMessage"> The returned error message for the individual expression. </param>
  195. /// <returns> Acad::ErrorStatus. </returns>
  196. ///
  197. Acad::ErrorStatus setRowSpacing(double offset, const AcString& expression = AcString(),
  198. const AcString& evaluatorId = AcString(), AcString& errorMessage = dummyString());
  199. /// <summary>
  200. /// Obtains array base plane geometry definition if there was any base
  201. /// plane information was set to the parameters. Base plane can be defined
  202. /// using normal vector or an AcDbFaceRef and base point vertex ref.
  203. /// </summary>
  204. /// <param name="basePoint"> The returned base point, default is origin.
  205. /// </param>
  206. /// <param name="normal"> The returned normal to the base plane at the
  207. /// base point. The default value is Z-Axis. </param>
  208. /// <param name="pFace"> The returned base plane geometry, if NULL is
  209. /// passed it won't return the face ref. If base plane was not set it
  210. /// will return empty face ref. </param>
  211. /// <returns> Acad::ErrorStatus </returns>
  212. ///
  213. Acad::ErrorStatus getBasePlane(AcDbVertexRef& basePoint,
  214. AcGeVector3d& normal, AcDbFaceRef* pFace = NULL) const;
  215. /// <summary>
  216. /// Sets array base plane geometry definition. Base plane is surface or
  217. /// plane information on which array is laid out.
  218. /// </summary>
  219. /// <param name="basePoint"> The input base point geometry. </param>
  220. /// <param name="normal"> The input normal to define the base plane.
  221. /// This parameter is ignored if pFace is provided. </param>
  222. /// <param name="pFace"> The input base plane geometry. If NULL is
  223. /// passed the base plane is defined based on input normal. </param>
  224. /// <returns> Acad::ErrorStatus </returns>
  225. ///
  226. Acad::ErrorStatus setBasePlane(const AcDbVertexRef& basePoint,
  227. const AcGeVector3d& normal, const AcDbFaceRef* pFace = NULL);
  228. /// <summary>
  229. /// Obtains canonical form of given item locator. The given locator may be
  230. /// counted wrt start or end, but the returned canonical form is always
  231. /// counted from start of the array pattern.
  232. /// </summary>
  233. /// <param name="locator"> The input item locator or spatial index. </param>
  234. /// <returns> Canonical form of input locator. </returns>
  235. ///
  236. virtual AcDbItemLocator getCanonicalForm(const AcDbItemLocator& locator) const;
  237. protected:
  238. friend class AcDbImpAssocArrayCommonParameters;
  239. explicit AcDbAssocArrayCommonParameters(AcDbImpAssocArrayCommonParameters* pSelf);
  240. };