dbAnnotativeObjectPE.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. // dbAnnotativeObjectPE.H
  13. //
  14. // DESCRIPTION: Protocol extension base classes
  15. // AcDbAnnotativeObjectPE
  16. // AcDbPaperOrientationPE
  17. //
  18. #pragma once
  19. #include "acdb.h"
  20. #include "dbmain.h"
  21. class AcDbViewport;
  22. #pragma pack (push, 8)
  23. /// <summary>
  24. /// This protocol extension interface must be implemented for any object
  25. /// which supports annotation scaling.
  26. /// </summary>
  27. ///
  28. class AcDbAnnotativeObjectPE : public AcRxObject
  29. {
  30. public:
  31. ACRX_DECLARE_MEMBERS(AcDbAnnotativeObjectPE);
  32. /// <summary>
  33. /// Determines whether the object is annotative.
  34. /// </summary>
  35. ///
  36. /// <param name="pObject">
  37. /// A pointer to the AcDbObject supporting annotation scaling.
  38. /// </param>
  39. ///
  40. /// <returns>
  41. /// Returns true if the object is annotative, otherwise it returns
  42. /// false.
  43. /// </returns>
  44. ///
  45. virtual bool annotative(AcDbObject* pObject) const = 0;
  46. /// <summary>
  47. /// Sets the annotative property of an object.
  48. /// </summary>
  49. ///
  50. /// <param name="pObject">
  51. /// The AcDbObject to set the property on.
  52. /// </param>
  53. ///
  54. /// <param name="bAnnotative">
  55. /// The new value for the annotative property.
  56. /// </param>
  57. ///
  58. /// <returns>
  59. /// Returns Acad::eOk if successful.
  60. /// </returns>
  61. ///
  62. virtual Acad::ErrorStatus setAnnotative( AcDbObject* pObject,
  63. const bool bAnnotative ) = 0;
  64. /// <summary>
  65. /// Sets the annotative property of an object from its (optionally)
  66. /// associated style.
  67. /// </summary>
  68. ///
  69. /// <param name="pObject">
  70. /// A pointer to the AcDbObject to the set the annotative property on.
  71. /// </param>
  72. ///
  73. /// <param name="bUpdated">
  74. /// Set to "true" on successful return if the annotative property
  75. /// of the object changed.
  76. /// </param>
  77. ///
  78. /// <returns>
  79. /// Returns Acad::eOk if successful.
  80. /// </returns>
  81. ///
  82. /// <remarks>
  83. /// Some annotative objects can be associated with styles which also have
  84. /// annotative properties. For example, a text object references an
  85. /// associated style. This method can be used to update the annotative
  86. /// property of an object with an associated style so that the object has
  87. /// the same value for the property as its associated style.
  88. /// </remarks>
  89. ///
  90. virtual Acad::ErrorStatus setFromStyle(AcDbObject* pObject,
  91. bool& bUpdated) = 0;
  92. /// <summary>
  93. /// Whether to ignore the ANNOALLVISIBLE system variable and
  94. /// force this object to display regardless of the current
  95. /// annotation scale.
  96. /// </summary>
  97. ///
  98. /// <param name="pObject">
  99. /// A pointer to the AcDbObject from which to read the property.
  100. /// </param>
  101. ///
  102. /// <returns>
  103. /// Returns true if the object is forced to be visible in all
  104. /// annotation scales.
  105. /// </returns>
  106. ///
  107. virtual bool forceAnnoAllVisible(AcDbObject* pObj) const {
  108. UNREFERENCED_PARAMETER(pObj);
  109. return false;
  110. }
  111. /// <summary>
  112. /// Whether to ignore the ANNOALLVISIBLE system variable and
  113. /// force this object to display regardless of the current
  114. /// annotation scale.
  115. /// </summary>
  116. ///
  117. /// <param name="pObject">
  118. /// A pointer to the AcDbObject on which to the set the property.
  119. /// </param>
  120. ///
  121. /// <param name="bForce>
  122. /// True to ignore the ANNOALLVISIBLE system variable and be visible
  123. /// in all annotation scales.
  124. /// </param>
  125. ///
  126. /// <returns>
  127. /// Returns Acad::eOk if successful.
  128. /// </returns>
  129. ///
  130. /// <remarks>
  131. /// Only objects of type AcDbEntity are required to implement this
  132. /// function when they implement the protocol extension.
  133. /// </remarks>
  134. virtual Acad::ErrorStatus setForceAnnoAllVisible(AcDbObject* pObj,
  135. bool bForce) const
  136. {
  137. UNREFERENCED_PARAMETER(pObj);
  138. UNREFERENCED_PARAMETER(bForce);
  139. return Acad::eNotImplemented;
  140. }
  141. /// <summary>
  142. /// Resets any scale dependent object properties to the default
  143. /// values.
  144. /// </summary>
  145. ///
  146. /// <param name="pObject">
  147. /// A pointer to the object to reset.
  148. /// </param>
  149. ///
  150. /// <returns>
  151. /// Returns Acad::eOk if successful.
  152. /// </returns>
  153. ///
  154. /// <remarks>
  155. /// Objects implement this function to support AutoCAD's ANNORESET command.
  156. /// Objects may implement properties which are scale dependent, for example
  157. /// the position or rotation of the object. Objects that wish to support
  158. /// the ANNORESET command should provide an implementation of this method
  159. /// which resets all scale-dependent properties to match the properties of
  160. /// the current scale (or of a default scale, determined by the object, if
  161. /// the object doesn't support the current scale).
  162. /// </remarks>
  163. virtual Acad::ErrorStatus resetScaleDependentProperties (
  164. AcDbObject* pObject)
  165. {
  166. UNREFERENCED_PARAMETER(pObject);
  167. return Acad::eNotImplemented;
  168. }
  169. };
  170. /// <summary>
  171. /// This protocol extension interface can optionally be implemented by objects
  172. /// which support "paper orientation" behavior.
  173. /// </summary>
  174. ///
  175. class AcDbPaperOrientationPE : public AcRxObject
  176. {
  177. public:
  178. ACRX_DECLARE_MEMBERS(AcDbPaperOrientationPE);
  179. /// <summary>
  180. /// Retrieves the current value of the paper orientation property on
  181. /// an annotative object.
  182. /// </summary>
  183. ///
  184. /// <param name="pObject">
  185. /// A pointer to the annotative object supporting paper orientation.
  186. /// </param>
  187. ///
  188. /// <returns>
  189. /// Returns true if the object is currently oriented with the paper.
  190. /// </returns>
  191. ///
  192. virtual bool paperOrientation(AcDbObject* pObject) const = 0;
  193. /// <summary>
  194. /// Sets the current value of the paper orientation property
  195. /// on an annotative object.
  196. /// </summary>
  197. ///
  198. /// <param name="pObject">
  199. /// A pointer to the annotative object supporting paper orientation.
  200. /// </param>
  201. ///
  202. /// <param name="bPaperOrientation">
  203. /// The new value for the paper orientation property.
  204. /// </param>
  205. ///
  206. /// <returns>
  207. /// Returns Acad::eOk if successful.
  208. /// </returns>
  209. ///
  210. virtual Acad::ErrorStatus setPaperOrientation(
  211. AcDbObject* pObject,
  212. const bool bPaperOrientation ) = 0;
  213. /// <summary>
  214. /// Transforms the object to align it to the paper-space viewport
  215. /// if the object supports the paper orientation property.
  216. /// </summary>
  217. ///
  218. /// <param name="pObject">
  219. /// A pointer to the annotative object supporting paper orientation.
  220. /// </param>
  221. ///
  222. /// <param name="pVport">
  223. /// A pointer to the viewport in which the object is to be displayed.
  224. /// </param>
  225. ///
  226. /// <returns>
  227. /// Returns Acad::eOk if successful, or eNotImplemented if the object
  228. /// does not have the paper orientation property.
  229. /// </returns>
  230. ///
  231. virtual Acad::ErrorStatus applyPaperOrientationTransform (
  232. AcDbObject* pObject,
  233. const AcDbViewport *pVport ) const
  234. {
  235. UNREFERENCED_PARAMETER(pObject);
  236. UNREFERENCED_PARAMETER(pVport);
  237. return Acad::eNotImplemented;
  238. }
  239. };
  240. #pragma pack (pop)