AcDbAssocActionBody.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  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: Jiri Kripac August 2007
  12. //
  13. // DESCRIPTION:
  14. //
  15. // AcDbAssocActionBody abstract base class for deriving custom action body
  16. // classes.
  17. //
  18. //////////////////////////////////////////////////////////////////////////////
  19. #pragma once
  20. #include "AcDbAssocAction.h"
  21. #include "dbEval.h"
  22. #include "AcValue.h"
  23. #pragma pack (push, 8)
  24. /// <summary> <para>
  25. /// Abstract base class for deriving custom action body classes that implement
  26. /// functionality of custom actions.
  27. /// </para> <para>
  28. /// An object of a class derived from the AcDbAssocActionBody class is always
  29. /// owned by a parent AcDbAssocAction object. The AcDbAssocAction object has
  30. /// an AcDbHardOwnershipId on it and the AcDbAssocActionBody::ownerId() of the
  31. /// object returns the AcDbObjectId of its parent AcDbAssocAction object.
  32. /// </para> <para>
  33. /// Therefore a custom action object (in the logical sense of the word "object")
  34. /// is always represented by a pair of physical AcDbObjects:
  35. ///
  36. /// - The parent action object of the AcDbAssocAction class (or possibly, but
  37. /// less commonly, of a derived class).
  38. /// - The action body object of a custom class derived from the
  39. /// AcDbAssocActionBody abstract base class.
  40. ///
  41. /// </para> <para>
  42. /// This factoring out of the functionality of the custom actions into separate
  43. /// classes derived from the AcDbAssocActionBody class, instead of deriving the
  44. /// custom action classes directly from the AcDbAssocAction class, allows
  45. /// better handling of the situations when the application code that implements
  46. /// the custom action behavior is not available. Only the custom object of the
  47. /// AcDbAssocActionBody-derived class will become a proxy, but its parent
  48. /// AcDbAssocAction object will always be available and the associative mechanism
  49. /// can still function to some extent.
  50. /// </para> <para>
  51. /// The abstract AcDbAssocActionBody base class defines a set of virtual methods
  52. /// named xxxxxxOverride() that correspond to methods named xxxxxx() in the parent
  53. /// AcDbAssocAction class. When a method xxxxxx() is called on the parent action
  54. /// object and the action object owns an action body object, the corresponding
  55. /// xxxxxxOverride() method on the action body object is called and it either
  56. /// supersedes or amends the default xxxxxx() implementation, depending on the
  57. /// particular method.
  58. /// </para> <para>
  59. /// If the action object does not own an action body object or if the action
  60. /// body object does not override the xxxxxxOverride() method, the default
  61. /// implementation in the parent action object is performed. Also, when the
  62. /// custom action body object becomes a proxy because its application code
  63. /// is not available, the parent action method just performs its default
  64. /// implementation.
  65. /// </para> <para>
  66. /// Custom action body classes derived from the AcDbAssocActionBody class
  67. /// implement their behavior by overriding the appropriate xxxxxxOverride()
  68. /// methods. Only the evaluateOverride() method must always be overridden in
  69. /// the custom classes. If not overridden, the other xxxxxxOverride() methods
  70. /// will do nothing and the default implementation in the parent AcDbAssocAction
  71. /// object will be performed. This may be the appropriate behavior in most cases.
  72. /// </para> <para>
  73. /// The custom action body classes also need to serialize their data. When
  74. /// serializing AcDbObjectIds of the AcDbAssocDependencies, these should be
  75. /// serialized as AcDbHardPointerIds, not as AcDbHardOwnershipIds, because the
  76. /// AcDbAssocDependencies are owned (in the AutoCAD database sense) by the
  77. /// parent AcDbAssocAction object, not by the custom action body object.
  78. /// </para> <para>
  79. /// Because each AcDbAssocActionBody object is owned by its parent
  80. /// AcDbAssocAction object, erasing the parent AcDbAssocAction object also
  81. /// erases the owned AcDbAssocActionBody object. There is no need to erase
  82. /// AcDbAssocActionBody objects explicitly.
  83. /// </para> </summary>
  84. ///
  85. class ACDB_PORT AcDbAssocActionBody : public AcDbObject
  86. {
  87. public:
  88. ACRX_DECLARE_MEMBERS(AcDbAssocActionBody);
  89. explicit AcDbAssocActionBody(AcDbAssocCreateImpObject createImpObject = kAcDbAssocCreateImpObject);
  90. virtual ~AcDbAssocActionBody();
  91. /// <summary>
  92. /// Returns AcDbObjectId of the parent AcDbAssocAction that owns this
  93. /// action body object.
  94. /// </summary>
  95. ///
  96. AcDbObjectId parentAction() const { return ownerId(); }
  97. /// <summary>
  98. /// Returns AcDbObjectId of the parent AcDbAssocAction that owns the given
  99. /// action body object.
  100. /// </summary>
  101. ///
  102. static AcDbObjectId parentAction(const AcDbObjectId& actionBodyId);
  103. // The following non-virtual methods are just shortcuts that just forward
  104. // to the parent AcDbAssocAction class, to save some typing for the
  105. // implementers of the derived custom action body classes
  106. /// <summary>
  107. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  108. /// owns this action body object.
  109. /// </summary>
  110. ///
  111. AcDbAssocStatus status() const;
  112. /// <summary>
  113. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  114. /// owns this action body object.
  115. /// </summary>
  116. ///
  117. Acad::ErrorStatus setStatus(AcDbAssocStatus newStatus,
  118. bool notifyOwningNetwork = true,
  119. bool setInOwnedActions = false) const;
  120. /// <summary>
  121. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  122. /// owns this action body object.
  123. /// </summary>
  124. ///
  125. AcDbObjectId owningNetwork() const;
  126. /// <summary>
  127. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  128. /// owns this action body object.
  129. /// </summary>
  130. ///
  131. Acad::ErrorStatus getDependencies(bool readDependenciesWanted,
  132. bool writeDependenciesWanted,
  133. AcDbObjectIdArray& dependencyIds) const;
  134. /// <summary>
  135. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  136. /// owns this action body object.
  137. /// </summary>
  138. ///
  139. Acad::ErrorStatus addDependency(const AcDbObjectId& dependencyId,
  140. bool setThisActionAsOwningAction = true) const;
  141. /// <summary>
  142. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  143. /// owns this action body object.
  144. /// </summary>
  145. ///
  146. Acad::ErrorStatus addDependency(AcRxClass* pDependencyClass,
  147. AcRxClass* pDependencyBodyClass,
  148. bool isReadDep,
  149. bool isWriteDep,
  150. int order,
  151. AcDbObjectId& dependencyId) const;
  152. /// <summary>
  153. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  154. /// owns this action body object.
  155. /// </summary>
  156. ///
  157. Acad::ErrorStatus removeDependency(const AcDbObjectId& dependencyId,
  158. bool alsoEraseIt) const;
  159. /// <summary>
  160. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  161. /// owns this action body object.
  162. /// </summary>
  163. ///
  164. Acad::ErrorStatus removeAllDependencies(bool alsoEraseThem) const;
  165. /// <summary>
  166. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  167. /// owns this action body object.
  168. /// </summary>
  169. ///
  170. Acad::ErrorStatus evaluateDependencies() const;
  171. /// <summary>
  172. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  173. /// owns this action body object.
  174. /// </summary>
  175. ///
  176. bool isActionEvaluationInProgress() const;
  177. /// <summary>
  178. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  179. /// owns this action body object.
  180. /// </summary>
  181. ///
  182. AcDbAssocEvaluationCallback* currentEvaluationCallback() const;
  183. /// <summary>
  184. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  185. /// owns this action body object.
  186. /// </summary>
  187. ///
  188. Acad::ErrorStatus removeAllParams(bool alsoEraseThem) const;
  189. /// <summary>
  190. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  191. /// owns this action body object.
  192. /// </summary>
  193. ///
  194. int paramCount() const;
  195. /// <summary>
  196. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  197. /// owns this action body object.
  198. /// </summary>
  199. ///
  200. const AcDbObjectIdArray& ownedParams() const;
  201. /// <summary>
  202. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  203. /// owns this action body object.
  204. /// </summary>
  205. ///
  206. Acad::ErrorStatus addParam(const AcDbObjectId& paramId, int& paramIndex) const;
  207. /// <summary>
  208. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  209. /// owns this action body object.
  210. /// </summary>
  211. ///
  212. Acad::ErrorStatus addParam(const AcString& paramName, AcRxClass* pParamClass, AcDbObjectId& paramId, int& paramIndex) const;
  213. /// <summary>
  214. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  215. /// owns this action body object.
  216. /// </summary>
  217. ///
  218. Acad::ErrorStatus removeParam(const AcDbObjectId& paramId, bool alsoEraseIt) const;
  219. /// <summary>
  220. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  221. /// owns this action body object.
  222. /// </summary>
  223. ///
  224. const AcDbObjectIdArray& paramsAtName(const AcString& paramName) const;
  225. /// <summary>
  226. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  227. /// owns this action body object.
  228. /// </summary>
  229. ///
  230. AcDbObjectId paramAtName(const AcString& paramName, int index = 0) const;
  231. /// <summary>
  232. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  233. /// owns this action body object.
  234. /// </summary>
  235. ///
  236. AcDbObjectId paramAtIndex(int paramIndex) const;
  237. /// <summary>
  238. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  239. /// owns this action body object.
  240. /// </summary>
  241. ///
  242. void ownedValueParamNames(AcArray<AcString>& paramNames) const;
  243. /// <summary>
  244. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  245. /// owns this action body object.
  246. /// </summary>
  247. ///
  248. Acad::ErrorStatus getValueParamArray(const AcString& paramName,
  249. AcArray<AcDbEvalVariant>& values,
  250. AcArray<AcString>& expressions,
  251. AcArray<AcString>& evaluatorIds) const;
  252. /// <summary>
  253. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  254. /// owns this action body object.
  255. /// </summary>
  256. ///
  257. Acad::ErrorStatus getValueParam(const AcString& paramName,
  258. AcDbEvalVariant& value,
  259. AcString& expression,
  260. AcString& evaluatorId,
  261. int valueIndex = 0) const;
  262. /// <summary>
  263. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  264. /// owns this action body object.
  265. /// </summary>
  266. ///
  267. Acad::ErrorStatus setValueParamArray(const AcString& paramName,
  268. const AcArray<AcDbEvalVariant>& values,
  269. const AcArray<AcString>& expressions,
  270. const AcArray<AcString>& evaluatorIds,
  271. AcArray<AcString>& errorMessages,
  272. bool silentMode) const;
  273. /// <summary>
  274. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  275. /// owns this action body object.
  276. /// </summary>
  277. ///
  278. Acad::ErrorStatus setValueParam(const AcString& paramName,
  279. const AcDbEvalVariant& value,
  280. const AcString& expression,
  281. const AcString& evaluatorId,
  282. AcString& errorMessage,
  283. bool silentMode,
  284. int valueIndex = 0) const;
  285. /// <summary>
  286. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  287. /// owns this action body object.
  288. /// </summary>
  289. ///
  290. AcValue::UnitType valueParamUnitType(const AcString& paramName) const;
  291. /// <summary>
  292. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  293. /// owns this action body object.
  294. /// </summary>
  295. ///
  296. Acad::ErrorStatus setValueParamUnitType(const AcString& paramName, AcValue::UnitType unitType) const;
  297. /// <summary>
  298. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  299. /// owns this action body object.
  300. /// </summary>
  301. ///
  302. Acad::ErrorStatus removeValueParam(const AcString& paramName) const;
  303. /// <summary>
  304. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  305. /// owns this action body object.
  306. /// </summary>
  307. ///
  308. Acad::ErrorStatus valueParamInputVariables(const AcString& paramName, AcDbObjectIdArray& variableIds) const;
  309. /// <summary>
  310. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  311. /// owns this action body object.
  312. /// </summary>
  313. ///
  314. Acad::ErrorStatus setValueParamControlledObjectDep(const AcString& paramName, const AcDbObjectId& controlledObjectDepId) const;
  315. /// <summary>
  316. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  317. /// owns this action body object.
  318. /// </summary>
  319. ///
  320. Acad::ErrorStatus updateValueParamControlledObject(const AcString& paramName) const;
  321. /// <summary>
  322. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  323. /// owns this action body object.
  324. /// </summary>
  325. ///
  326. Acad::ErrorStatus updateValueParamFromControlledObject(const AcString& paramName) const;
  327. /// <summary>
  328. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  329. /// owns this action body object.
  330. /// </summary>
  331. ///
  332. Acad::ErrorStatus updateAllObjectsControlledByValueParams() const;
  333. /// <summary>
  334. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  335. /// owns this action body object.
  336. /// </summary>
  337. ///
  338. Acad::ErrorStatus transformAllConstantGeometryParams(const AcGeMatrix3d& transform) const;
  339. /// <summary>
  340. /// Just a shortcut, calls the method on the parent AcDbAssocAction that
  341. /// owns this action body object.
  342. /// </summary>
  343. ///
  344. Acad::ErrorStatus scaleAllDistanceValueParams(double scaleFactor) const;
  345. /// <summary>
  346. /// Utility function that returns true if the action owns any dependency whose
  347. /// status is kErasedAssocStatus or whose dependent-on object cannot be
  348. /// opened. AcDbAssocValueDependencies are ignored.
  349. /// </summary>
  350. ///
  351. bool hasAnyErasedOrBrokenDependencies() const;
  352. /// <summary> <para>
  353. /// Utility function that creates AcDbAssocAction and AcDbAssocActionBody
  354. /// of the required class, makes the action own the action body and posts
  355. /// both to the database of the given objectId.
  356. /// </para> <para>
  357. /// It uses the objectId to find the network to add the newly created action
  358. /// to. If the objectId is of an AcDbAssocNetwork, this network is used.
  359. /// If the objectId is of an AcDbBlockTableRecord or of an entity owned by
  360. /// a AcDbBlockTableRecord, adds the newly created action to the network of
  361. /// the AcDbBlockTableRecord.
  362. /// </para> </summary>
  363. ///
  364. static Acad::ErrorStatus createActionAndActionBodyAndPostToDatabase(
  365. AcRxClass* pActionBodyClass,
  366. const AcDbObjectId& objectId,
  367. AcDbObjectId& createdActionId,
  368. AcDbObjectId& createdActionBodyId);
  369. /// <summary>
  370. /// Utility static method that returns all action bodies of all actions that
  371. /// have the requested type of dependencies on the given object. Notice that
  372. /// There may be no more than a single action that has a write-only dependency
  373. /// on the object, that is why the pWriteOnlyActionBodyId is a pointer to a
  374. /// single AcDbObjectId, not to an AcDbObjectIdArray. If any of the pointers
  375. /// are NULL, the type of action bodies are not returned.
  376. /// </summary>
  377. ///
  378. static Acad::ErrorStatus getActionBodiesOnObject(const AcDbObject* pObject,
  379. bool ignoreInternalActions,
  380. bool ignoreSuppressedActions,
  381. AcDbObjectId* pWriteOnlyActionBodyId,
  382. AcDbObjectIdArray* pReadWriteActionBodyIds,
  383. AcDbObjectIdArray* pReadOnlyActionBodyIds = NULL);
  384. public:
  385. // Virtual methods that can be overridden by the derived classes
  386. /// <summary>
  387. /// Called from the corresponding method of the parent AcDbAssocAction class
  388. /// that owns this action body object. This method has to be overridden and
  389. /// this is how the behavior of custom actions is implemented.
  390. /// </summary>
  391. ///
  392. virtual void evaluateOverride() = NULL;
  393. /// <summary>
  394. /// Called from the corresponding method of the parent AcDbAssocAction class
  395. /// that owns this action body object. It does not need to be overridden.
  396. /// </summary>
  397. ///
  398. virtual Acad::ErrorStatus getDependenciesOverride(bool readDependenciesWanted,
  399. bool writeDependenciesWanted,
  400. AcDbObjectIdArray& dependencyIds) const
  401. {
  402. UNREFERENCED_PARAMETER(readDependenciesWanted);
  403. UNREFERENCED_PARAMETER(writeDependenciesWanted);
  404. UNREFERENCED_PARAMETER(dependencyIds);
  405. return Acad::eNotImplemented;
  406. }
  407. /// <summary>
  408. /// Called from the corresponding method of the parent AcDbAssocAction class
  409. /// that owns this action body object. It does not need to be overridden.
  410. /// </summary>
  411. ///
  412. virtual Acad::ErrorStatus getDependentObjectsOverride(bool readDependenciesWanted,
  413. bool writeDependenciesWanted,
  414. AcDbObjectIdArray& objectIds) const
  415. {
  416. UNREFERENCED_PARAMETER(readDependenciesWanted);
  417. UNREFERENCED_PARAMETER(writeDependenciesWanted);
  418. UNREFERENCED_PARAMETER(objectIds);
  419. return Acad::eNotImplemented;
  420. }
  421. /// <summary>
  422. /// Called from the corresponding method of the parent AcDbAssocAction class
  423. /// that owns this action body object. It does not need to be overridden.
  424. /// </summary>
  425. ///
  426. virtual Acad::ErrorStatus removeAllDependenciesOverride(bool alsoEraseThem)
  427. {
  428. UNREFERENCED_PARAMETER(alsoEraseThem);
  429. return Acad::eNotImplemented;
  430. }
  431. /// <summary>
  432. /// Called from the corresponding method of the parent AcDbAssocAction class
  433. /// that owns this action body object. It does not need to be overridden.
  434. /// </summary>
  435. ///
  436. virtual Acad::ErrorStatus isOwnedDependencyOverride(const AcDbAssocDependency* pDependency,
  437. bool& isOwnedDependency) const
  438. {
  439. UNREFERENCED_PARAMETER(pDependency);
  440. UNREFERENCED_PARAMETER(isOwnedDependency);
  441. return Acad::eNotImplemented;
  442. }
  443. /// <summary>
  444. /// Called from the corresponding method of the parent AcDbAssocAction class
  445. /// that owns this action body object. It does not need to be overridden.
  446. /// </summary>
  447. ///
  448. virtual Acad::ErrorStatus isExternalDependencyOverride(const AcDbAssocDependency* pDependency,
  449. bool& isExternalDependency) const
  450. {
  451. UNREFERENCED_PARAMETER(pDependency);
  452. UNREFERENCED_PARAMETER(isExternalDependency);
  453. return Acad::eNotImplemented;
  454. }
  455. /// <summary>
  456. /// Called from the corresponding method of the parent AcDbAssocAction class
  457. /// that owns this action body object. It does not need to be overridden.
  458. /// </summary>
  459. ///
  460. virtual Acad::ErrorStatus hasDependencyCachedValueOverride(const AcDbAssocDependency* pDependency,
  461. bool& hasDepCachedValue) const
  462. {
  463. UNREFERENCED_PARAMETER(pDependency);
  464. UNREFERENCED_PARAMETER(hasDepCachedValue);
  465. return Acad::eNotImplemented;
  466. }
  467. /// <summary>
  468. /// Called from the corresponding method of the parent AcDbAssocAction class
  469. /// that owns this action body object. It does not need to be overridden.
  470. /// </summary>
  471. ///
  472. virtual Acad::ErrorStatus isRelevantDependencyChangeOverride(const AcDbAssocDependency* pDependency,
  473. bool& isRelevantDepChange) const
  474. {
  475. UNREFERENCED_PARAMETER(pDependency);
  476. UNREFERENCED_PARAMETER(isRelevantDepChange);
  477. return Acad::eNotImplemented;
  478. }
  479. /// <summary>
  480. /// Called from the corresponding method of the parent AcDbAssocAction class
  481. /// that owns this action body object. It does not need to be overridden.
  482. /// </summary>
  483. ///
  484. virtual Acad::ErrorStatus areDependenciesOnTheSameThingOverride(const AcDbAssocDependency* pDependency1,
  485. const AcDbAssocDependency* pDependency2,
  486. bool& areDependentOnSameThing) const
  487. {
  488. UNREFERENCED_PARAMETER(pDependency1);
  489. UNREFERENCED_PARAMETER(pDependency2);
  490. UNREFERENCED_PARAMETER(areDependentOnSameThing);
  491. return Acad::eNotImplemented;
  492. }
  493. /// <summary>
  494. /// Called from the corresponding method of the parent AcDbAssocAction class
  495. /// that owns this action body object. It does not need to be overridden.
  496. /// </summary>
  497. ///
  498. virtual Acad::ErrorStatus areDependenciesEqualOverride(const AcDbAssocDependency* pDependency1,
  499. const AcDbAssocDependency* pDependency2,
  500. bool& areEqual) const
  501. {
  502. UNREFERENCED_PARAMETER(pDependency1);
  503. UNREFERENCED_PARAMETER(pDependency2);
  504. UNREFERENCED_PARAMETER(areEqual);
  505. return Acad::eNotImplemented;
  506. }
  507. /// <summary>
  508. /// Called from the corresponding method of the parent AcDbAssocAction class
  509. /// that owns this action body object. It does not need to be overridden.
  510. /// </summary>
  511. ///
  512. virtual Acad::ErrorStatus evaluateDependencyOverride(AcDbAssocDependency* pDependency)
  513. {
  514. UNREFERENCED_PARAMETER(pDependency);
  515. return Acad::eNotImplemented;
  516. }
  517. /// <summary>
  518. /// Called from the corresponding method of the parent AcDbAssocAction class
  519. /// that owns this action body object. It does not need to be overridden.
  520. /// </summary>
  521. ///
  522. virtual Acad::ErrorStatus dependentObjectClonedOverride(const AcDbAssocDependency* pDependency,
  523. const AcDbObject* pDbObj,
  524. const AcDbObject* pNewObj)
  525. {
  526. UNREFERENCED_PARAMETER(pDependency);
  527. UNREFERENCED_PARAMETER(pDbObj);
  528. UNREFERENCED_PARAMETER(pNewObj);
  529. return Acad::eNotImplemented;
  530. }
  531. /// <summary>
  532. /// Called from the corresponding method of the parent AcDbAssocAction class
  533. /// that owns this action body object. It does not need to be overridden.
  534. /// </summary>
  535. ///
  536. virtual Acad::ErrorStatus addMoreObjectsToDeepCloneOverride(AcDbIdMapping& /*idMap*/,
  537. AcDbObjectIdArray& /*additionalObjectsToClone*/) const
  538. {
  539. return Acad::eNotImplemented;
  540. }
  541. /// <summary>
  542. /// Called from the corresponding method of the parent AcDbAssocAction class
  543. /// that owns this action body object. It does not need to be overridden.
  544. /// </summary>
  545. ///
  546. virtual Acad::ErrorStatus postProcessAfterDeepCloneOverride(AcDbIdMapping& /*idMap*/)
  547. {
  548. return Acad::eNotImplemented;
  549. }
  550. /// <summary>
  551. /// Called from the corresponding method of the parent AcDbAssocAction class
  552. /// that owns this action body object. It does not need to be overridden.
  553. /// </summary>
  554. ///
  555. virtual Acad::ErrorStatus postProcessAfterDeepCloneCancelOverride(AcDbIdMapping& /*idMap*/)
  556. {
  557. return Acad::eNotImplemented;
  558. }
  559. /// <summary>
  560. /// Called from the corresponding method of the parent AcDbAssocAction class
  561. /// that owns this action body object. It does not need to be overridden.
  562. /// </summary>
  563. ///
  564. virtual Acad::ErrorStatus ownedDependencyStatusChangedOverride(AcDbAssocDependency* pOwnedDependency,
  565. AcDbAssocStatus previousStatus)
  566. {
  567. UNREFERENCED_PARAMETER(pOwnedDependency);
  568. UNREFERENCED_PARAMETER(previousStatus);
  569. return Acad::eNotImplemented;
  570. }
  571. /// <summary>
  572. /// Called from the corresponding method of the parent AcDbAssocAction class
  573. /// that owns this action body object. It does not need to be overridden.
  574. /// </summary>
  575. ///
  576. virtual Acad::ErrorStatus isEqualToOverride(const AcDbAssocAction* pOtherAction, bool& isEqual) const
  577. {
  578. UNREFERENCED_PARAMETER(pOtherAction);
  579. UNREFERENCED_PARAMETER(isEqual);
  580. return Acad::eNotImplemented;
  581. }
  582. /// <summary>
  583. /// Called from the corresponding method of the parent AcDbAssocAction class
  584. /// that owns this action body object. It does not need to be overridden.
  585. /// </summary>
  586. ///
  587. virtual Acad::ErrorStatus evaluationPriorityOverride(AcDbAssocEvaluationPriority& priority) const
  588. {
  589. UNREFERENCED_PARAMETER(priority);
  590. return Acad::eNotImplemented;
  591. }
  592. /// <summary>
  593. /// Called from the corresponding method of the parent AcDbAssocAction class
  594. /// that owns this action body object. It does not need to be overridden.
  595. /// </summary>
  596. ///
  597. virtual Acad::ErrorStatus getDependentActionsToEvaluateOverride(AcDbActionsToEvaluateCallback* pActionsToEvaluateCallback) const
  598. {
  599. UNREFERENCED_PARAMETER(pActionsToEvaluateCallback);
  600. return Acad::eNotImplemented;
  601. }
  602. /// <summary>
  603. /// Called from the corresponding method of the parent AcDbAssocAction class
  604. /// that owns this action body object. It does not need to be overridden.
  605. /// </summary>
  606. ///
  607. virtual Acad::ErrorStatus transformActionByOverride(const AcGeMatrix3d&)
  608. { return Acad::eNotImplemented; }
  609. /// <summary>
  610. /// Called from the corresponding method of the parent AcDbAssocAction class
  611. /// that owns this action body object. It does not need to be overridden.
  612. /// </summary>
  613. ///
  614. virtual Acad::ErrorStatus dragStatusOverride(const AcDb::DragStat status)
  615. {
  616. UNREFERENCED_PARAMETER(status);
  617. return Acad::eNotImplemented;
  618. }
  619. /// <summary><para>
  620. /// This method may be overridden in derived action body clases.
  621. /// </para><para>
  622. /// The AcDbAssocAction::removeActionsControllingObject() method notifies all
  623. /// action bodies that have a write-dependency on the controlled object by
  624. /// calling this method. The individual action bodies then can do some work
  625. /// before they are detached from the controlled object, or can even not let
  626. /// themselves be detached.
  627. /// </para><para>
  628. /// It this method returns Acad::eOk, AcDbAssocAction::removeActionsControllingObject()
  629. /// will not detach the action from the controlled object, expecting the
  630. /// action body to do it by itself. If not overridden, this method returns
  631. /// Acad::eNotImplemented, indicating that AcDbAssocAction::removeActionsControllingObject()
  632. /// should detach the action from the controlled object.
  633. /// </para></summary>
  634. /// <param name="pControlledObject">
  635. /// An AcDbObject for which AcDbAssocAction::removeActionsControllingObject()
  636. /// is being called. This action body has a write-dependency on this object.
  637. /// </param>
  638. /// <returns> Acad::ErrorStatus. </returns>
  639. ///
  640. virtual Acad::ErrorStatus removeActionsControllingObjectOverride(AcDbObject* pControlledObject)
  641. {
  642. UNREFERENCED_PARAMETER(pControlledObject);
  643. return Acad::eNotImplemented;
  644. }
  645. /// <summary><para>
  646. /// Called from AcDbAssocManager::auditAssociativeData() after file open and possibly
  647. /// after some other scenarios when the associative data may need to be audited and fixed-up.
  648. /// At this time custom code may also initialize internal chaches that were not saved to dwg/dxf
  649. /// file, or do some other work.
  650. /// </para><para>
  651. /// The action body may request the parent action to be erased by setting kErasedAssocStatus
  652. /// to parentActionHandling output argument. Setting kChangedDirectlyAssocStatus to
  653. /// parentActionHandling will make the parent action evaluate after the audit of all
  654. /// actions has been completed.
  655. /// </para><para>
  656. /// An example of possible and inevitable inconsistencies is when the drawing was modified
  657. /// in an AutoCAD release that didn't have code for the action, the action body was a proxy
  658. /// and therefore didn't react to notifications and didn't evaluate.
  659. /// </para><para>
  660. /// Another example of possible and inevitable ininconsistencies are references to objects
  661. /// that are not in the database any more because their owning objects were erased, the
  662. /// drawing was then saved, and these objects with erased owners were not saved to
  663. /// database. No notifications happen about the erase of these objects because they were
  664. /// not actually erased, so the actions cannot know that these objects are not in the database
  665. /// any more and may still hold AcDbObjectIds of these "lazily-erased" objects.
  666. /// </para><para>
  667. /// Before auditAssociativeDataOverride() is called, the system performs overall
  668. /// checks and fixes for cases like a dependency depending on a non-existent object,
  669. /// checks proper links between network, action, action body, action parameters, and
  670. /// dependencies, etc., so that these general checks do not need to be performed by
  671. /// the custom code.
  672. /// </para></summary>
  673. ///
  674. virtual void auditAssociativeDataOverride(AcDbAssocStatus& parentActionHandling);
  675. /// <summary>
  676. /// General notification that the action body can receive. The information
  677. /// about the notification is passed in an AcDbAssocNotificationData object.
  678. /// </summary>
  679. /// <remarks> For internal use only. </remarks>
  680. /// <param name="pNotificationData">
  681. /// Pointer to an AcDbAssocNotificationData object. The action body should check
  682. /// the type of the AcDbAssocNotificationData object, cast it to that type,
  683. /// and obtain the notification information from it.
  684. /// </param>
  685. /// <returns> Acad::ErrorStatus. </returns>
  686. ///
  687. virtual Acad::ErrorStatus notificationOverride(class AcDbAssocNotificationData* pNotificationData);
  688. /// <summary>
  689. /// Using this method the action body reveals its AcDbStepIds and AcDbPersSubentIds
  690. /// to the AcDbAssocPersSubentManager.
  691. /// </summary>
  692. /// <remarks> For internal use only. </remarks>
  693. /// <param name="stepIds"> The array of returned AcDbPersStepIds. </param>
  694. /// <param name="persSubentIds"> The array of returned AcDbPersSubentIds. </param>
  695. ///
  696. virtual Acad::ErrorStatus collectPersSubentNamingDataOverride(AcDbPersStepIdArray& stepIds,
  697. AcDbPersSubentIdArray& persSubentIds) const;
  698. /// <summary>
  699. /// Using this method the action body asks the AcDbAssocPersSubentManager
  700. /// to remap its AcDbPersStepIds and PersSubentIds after the action body
  701. /// has been cloned.
  702. /// </summary>
  703. /// <remarks> For internal use only. </remarks>
  704. /// <param name="pCloner">
  705. /// AcDbAssocPersSubentManagerCloner that the action body uses to remap
  706. /// its AcDbPersStepIds and PersSubentIds.
  707. /// </param>
  708. //
  709. virtual Acad::ErrorStatus clonePersSubentNamingDataOverride(class AcDbAssocPersSubentManagerCloner* pCloner);
  710. }; // class AcDbAssocActionBody
  711. /// <summary>
  712. /// Just to be able to specify output AcString parameters by default value.
  713. /// </summary>
  714. ///
  715. ACDB_PORT AcString& dummyString();
  716. #pragma pack (pop)