123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795 |
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright 2015 Autodesk, Inc. All rights reserved.
- //
- // Use of this software is subject to the terms of the Autodesk license
- // agreement provided at the time of installation or download, or which
- // otherwise accompanies this software in either electronic or hard copy form.
- //
- //////////////////////////////////////////////////////////////////////////////
- //
- // CREATED BY: Jiri Kripac August 2007
- //
- // DESCRIPTION:
- //
- // AcDbAssocActionBody abstract base class for deriving custom action body
- // classes.
- //
- //////////////////////////////////////////////////////////////////////////////
- #pragma once
- #include "AcDbAssocAction.h"
- #include "dbEval.h"
- #include "AcValue.h"
- #pragma pack (push, 8)
- /// <summary> <para>
- /// Abstract base class for deriving custom action body classes that implement
- /// functionality of custom actions.
- /// </para> <para>
- /// An object of a class derived from the AcDbAssocActionBody class is always
- /// owned by a parent AcDbAssocAction object. The AcDbAssocAction object has
- /// an AcDbHardOwnershipId on it and the AcDbAssocActionBody::ownerId() of the
- /// object returns the AcDbObjectId of its parent AcDbAssocAction object.
- /// </para> <para>
- /// Therefore a custom action object (in the logical sense of the word "object")
- /// is always represented by a pair of physical AcDbObjects:
- ///
- /// - The parent action object of the AcDbAssocAction class (or possibly, but
- /// less commonly, of a derived class).
- /// - The action body object of a custom class derived from the
- /// AcDbAssocActionBody abstract base class.
- ///
- /// </para> <para>
- /// This factoring out of the functionality of the custom actions into separate
- /// classes derived from the AcDbAssocActionBody class, instead of deriving the
- /// custom action classes directly from the AcDbAssocAction class, allows
- /// better handling of the situations when the application code that implements
- /// the custom action behavior is not available. Only the custom object of the
- /// AcDbAssocActionBody-derived class will become a proxy, but its parent
- /// AcDbAssocAction object will always be available and the associative mechanism
- /// can still function to some extent.
- /// </para> <para>
- /// The abstract AcDbAssocActionBody base class defines a set of virtual methods
- /// named xxxxxxOverride() that correspond to methods named xxxxxx() in the parent
- /// AcDbAssocAction class. When a method xxxxxx() is called on the parent action
- /// object and the action object owns an action body object, the corresponding
- /// xxxxxxOverride() method on the action body object is called and it either
- /// supersedes or amends the default xxxxxx() implementation, depending on the
- /// particular method.
- /// </para> <para>
- /// If the action object does not own an action body object or if the action
- /// body object does not override the xxxxxxOverride() method, the default
- /// implementation in the parent action object is performed. Also, when the
- /// custom action body object becomes a proxy because its application code
- /// is not available, the parent action method just performs its default
- /// implementation.
- /// </para> <para>
- /// Custom action body classes derived from the AcDbAssocActionBody class
- /// implement their behavior by overriding the appropriate xxxxxxOverride()
- /// methods. Only the evaluateOverride() method must always be overridden in
- /// the custom classes. If not overridden, the other xxxxxxOverride() methods
- /// will do nothing and the default implementation in the parent AcDbAssocAction
- /// object will be performed. This may be the appropriate behavior in most cases.
- /// </para> <para>
- /// The custom action body classes also need to serialize their data. When
- /// serializing AcDbObjectIds of the AcDbAssocDependencies, these should be
- /// serialized as AcDbHardPointerIds, not as AcDbHardOwnershipIds, because the
- /// AcDbAssocDependencies are owned (in the AutoCAD database sense) by the
- /// parent AcDbAssocAction object, not by the custom action body object.
- /// </para> <para>
- /// Because each AcDbAssocActionBody object is owned by its parent
- /// AcDbAssocAction object, erasing the parent AcDbAssocAction object also
- /// erases the owned AcDbAssocActionBody object. There is no need to erase
- /// AcDbAssocActionBody objects explicitly.
- /// </para> </summary>
- ///
- class ACDB_PORT AcDbAssocActionBody : public AcDbObject
- {
- public:
- ACRX_DECLARE_MEMBERS(AcDbAssocActionBody);
- explicit AcDbAssocActionBody(AcDbAssocCreateImpObject createImpObject = kAcDbAssocCreateImpObject);
- virtual ~AcDbAssocActionBody();
- /// <summary>
- /// Returns AcDbObjectId of the parent AcDbAssocAction that owns this
- /// action body object.
- /// </summary>
- ///
- AcDbObjectId parentAction() const { return ownerId(); }
- /// <summary>
- /// Returns AcDbObjectId of the parent AcDbAssocAction that owns the given
- /// action body object.
- /// </summary>
- ///
- static AcDbObjectId parentAction(const AcDbObjectId& actionBodyId);
- // The following non-virtual methods are just shortcuts that just forward
- // to the parent AcDbAssocAction class, to save some typing for the
- // implementers of the derived custom action body classes
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- AcDbAssocStatus status() const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus setStatus(AcDbAssocStatus newStatus,
- bool notifyOwningNetwork = true,
- bool setInOwnedActions = false) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- AcDbObjectId owningNetwork() const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus getDependencies(bool readDependenciesWanted,
- bool writeDependenciesWanted,
- AcDbObjectIdArray& dependencyIds) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus addDependency(const AcDbObjectId& dependencyId,
- bool setThisActionAsOwningAction = true) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus addDependency(AcRxClass* pDependencyClass,
- AcRxClass* pDependencyBodyClass,
- bool isReadDep,
- bool isWriteDep,
- int order,
- AcDbObjectId& dependencyId) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus removeDependency(const AcDbObjectId& dependencyId,
- bool alsoEraseIt) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus removeAllDependencies(bool alsoEraseThem) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus evaluateDependencies() const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- bool isActionEvaluationInProgress() const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- AcDbAssocEvaluationCallback* currentEvaluationCallback() const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus removeAllParams(bool alsoEraseThem) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- int paramCount() const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- const AcDbObjectIdArray& ownedParams() const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus addParam(const AcDbObjectId& paramId, int& paramIndex) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus addParam(const AcString& paramName, AcRxClass* pParamClass, AcDbObjectId& paramId, int& paramIndex) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus removeParam(const AcDbObjectId& paramId, bool alsoEraseIt) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- const AcDbObjectIdArray& paramsAtName(const AcString& paramName) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- AcDbObjectId paramAtName(const AcString& paramName, int index = 0) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- AcDbObjectId paramAtIndex(int paramIndex) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- void ownedValueParamNames(AcArray<AcString>& paramNames) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus getValueParamArray(const AcString& paramName,
- AcArray<AcDbEvalVariant>& values,
- AcArray<AcString>& expressions,
- AcArray<AcString>& evaluatorIds) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus getValueParam(const AcString& paramName,
- AcDbEvalVariant& value,
- AcString& expression,
- AcString& evaluatorId,
- int valueIndex = 0) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus setValueParamArray(const AcString& paramName,
- const AcArray<AcDbEvalVariant>& values,
- const AcArray<AcString>& expressions,
- const AcArray<AcString>& evaluatorIds,
- AcArray<AcString>& errorMessages,
- bool silentMode) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus setValueParam(const AcString& paramName,
- const AcDbEvalVariant& value,
- const AcString& expression,
- const AcString& evaluatorId,
- AcString& errorMessage,
- bool silentMode,
- int valueIndex = 0) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- AcValue::UnitType valueParamUnitType(const AcString& paramName) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus setValueParamUnitType(const AcString& paramName, AcValue::UnitType unitType) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus removeValueParam(const AcString& paramName) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus valueParamInputVariables(const AcString& paramName, AcDbObjectIdArray& variableIds) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus setValueParamControlledObjectDep(const AcString& paramName, const AcDbObjectId& controlledObjectDepId) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus updateValueParamControlledObject(const AcString& paramName) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus updateValueParamFromControlledObject(const AcString& paramName) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus updateAllObjectsControlledByValueParams() const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus transformAllConstantGeometryParams(const AcGeMatrix3d& transform) const;
- /// <summary>
- /// Just a shortcut, calls the method on the parent AcDbAssocAction that
- /// owns this action body object.
- /// </summary>
- ///
- Acad::ErrorStatus scaleAllDistanceValueParams(double scaleFactor) const;
- /// <summary>
- /// Utility function that returns true if the action owns any dependency whose
- /// status is kErasedAssocStatus or whose dependent-on object cannot be
- /// opened. AcDbAssocValueDependencies are ignored.
- /// </summary>
- ///
- bool hasAnyErasedOrBrokenDependencies() const;
- /// <summary> <para>
- /// Utility function that creates AcDbAssocAction and AcDbAssocActionBody
- /// of the required class, makes the action own the action body and posts
- /// both to the database of the given objectId.
- /// </para> <para>
- /// It uses the objectId to find the network to add the newly created action
- /// to. If the objectId is of an AcDbAssocNetwork, this network is used.
- /// If the objectId is of an AcDbBlockTableRecord or of an entity owned by
- /// a AcDbBlockTableRecord, adds the newly created action to the network of
- /// the AcDbBlockTableRecord.
- /// </para> </summary>
- ///
- static Acad::ErrorStatus createActionAndActionBodyAndPostToDatabase(
- AcRxClass* pActionBodyClass,
- const AcDbObjectId& objectId,
- AcDbObjectId& createdActionId,
- AcDbObjectId& createdActionBodyId);
- /// <summary>
- /// Utility static method that returns all action bodies of all actions that
- /// have the requested type of dependencies on the given object. Notice that
- /// There may be no more than a single action that has a write-only dependency
- /// on the object, that is why the pWriteOnlyActionBodyId is a pointer to a
- /// single AcDbObjectId, not to an AcDbObjectIdArray. If any of the pointers
- /// are NULL, the type of action bodies are not returned.
- /// </summary>
- ///
- static Acad::ErrorStatus getActionBodiesOnObject(const AcDbObject* pObject,
- bool ignoreInternalActions,
- bool ignoreSuppressedActions,
- AcDbObjectId* pWriteOnlyActionBodyId,
- AcDbObjectIdArray* pReadWriteActionBodyIds,
- AcDbObjectIdArray* pReadOnlyActionBodyIds = NULL);
- public:
-
- // Virtual methods that can be overridden by the derived classes
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. This method has to be overridden and
- /// this is how the behavior of custom actions is implemented.
- /// </summary>
- ///
- virtual void evaluateOverride() = NULL;
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus getDependenciesOverride(bool readDependenciesWanted,
- bool writeDependenciesWanted,
- AcDbObjectIdArray& dependencyIds) const
- {
- UNREFERENCED_PARAMETER(readDependenciesWanted);
- UNREFERENCED_PARAMETER(writeDependenciesWanted);
- UNREFERENCED_PARAMETER(dependencyIds);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus getDependentObjectsOverride(bool readDependenciesWanted,
- bool writeDependenciesWanted,
- AcDbObjectIdArray& objectIds) const
- {
- UNREFERENCED_PARAMETER(readDependenciesWanted);
- UNREFERENCED_PARAMETER(writeDependenciesWanted);
- UNREFERENCED_PARAMETER(objectIds);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus removeAllDependenciesOverride(bool alsoEraseThem)
- {
- UNREFERENCED_PARAMETER(alsoEraseThem);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus isOwnedDependencyOverride(const AcDbAssocDependency* pDependency,
- bool& isOwnedDependency) const
- {
- UNREFERENCED_PARAMETER(pDependency);
- UNREFERENCED_PARAMETER(isOwnedDependency);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus isExternalDependencyOverride(const AcDbAssocDependency* pDependency,
- bool& isExternalDependency) const
- {
- UNREFERENCED_PARAMETER(pDependency);
- UNREFERENCED_PARAMETER(isExternalDependency);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus hasDependencyCachedValueOverride(const AcDbAssocDependency* pDependency,
- bool& hasDepCachedValue) const
- {
- UNREFERENCED_PARAMETER(pDependency);
- UNREFERENCED_PARAMETER(hasDepCachedValue);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus isRelevantDependencyChangeOverride(const AcDbAssocDependency* pDependency,
- bool& isRelevantDepChange) const
- {
- UNREFERENCED_PARAMETER(pDependency);
- UNREFERENCED_PARAMETER(isRelevantDepChange);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus areDependenciesOnTheSameThingOverride(const AcDbAssocDependency* pDependency1,
- const AcDbAssocDependency* pDependency2,
- bool& areDependentOnSameThing) const
- {
- UNREFERENCED_PARAMETER(pDependency1);
- UNREFERENCED_PARAMETER(pDependency2);
- UNREFERENCED_PARAMETER(areDependentOnSameThing);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus areDependenciesEqualOverride(const AcDbAssocDependency* pDependency1,
- const AcDbAssocDependency* pDependency2,
- bool& areEqual) const
- {
- UNREFERENCED_PARAMETER(pDependency1);
- UNREFERENCED_PARAMETER(pDependency2);
- UNREFERENCED_PARAMETER(areEqual);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus evaluateDependencyOverride(AcDbAssocDependency* pDependency)
- {
- UNREFERENCED_PARAMETER(pDependency);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus dependentObjectClonedOverride(const AcDbAssocDependency* pDependency,
- const AcDbObject* pDbObj,
- const AcDbObject* pNewObj)
- {
- UNREFERENCED_PARAMETER(pDependency);
- UNREFERENCED_PARAMETER(pDbObj);
- UNREFERENCED_PARAMETER(pNewObj);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus addMoreObjectsToDeepCloneOverride(AcDbIdMapping& /*idMap*/,
- AcDbObjectIdArray& /*additionalObjectsToClone*/) const
- {
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus postProcessAfterDeepCloneOverride(AcDbIdMapping& /*idMap*/)
- {
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus postProcessAfterDeepCloneCancelOverride(AcDbIdMapping& /*idMap*/)
- {
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus ownedDependencyStatusChangedOverride(AcDbAssocDependency* pOwnedDependency,
- AcDbAssocStatus previousStatus)
- {
- UNREFERENCED_PARAMETER(pOwnedDependency);
- UNREFERENCED_PARAMETER(previousStatus);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus isEqualToOverride(const AcDbAssocAction* pOtherAction, bool& isEqual) const
- {
- UNREFERENCED_PARAMETER(pOtherAction);
- UNREFERENCED_PARAMETER(isEqual);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus evaluationPriorityOverride(AcDbAssocEvaluationPriority& priority) const
- {
- UNREFERENCED_PARAMETER(priority);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus getDependentActionsToEvaluateOverride(AcDbActionsToEvaluateCallback* pActionsToEvaluateCallback) const
- {
- UNREFERENCED_PARAMETER(pActionsToEvaluateCallback);
- return Acad::eNotImplemented;
- }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus transformActionByOverride(const AcGeMatrix3d&)
- { return Acad::eNotImplemented; }
- /// <summary>
- /// Called from the corresponding method of the parent AcDbAssocAction class
- /// that owns this action body object. It does not need to be overridden.
- /// </summary>
- ///
- virtual Acad::ErrorStatus dragStatusOverride(const AcDb::DragStat status)
- {
- UNREFERENCED_PARAMETER(status);
- return Acad::eNotImplemented;
- }
- /// <summary><para>
- /// This method may be overridden in derived action body clases.
- /// </para><para>
- /// The AcDbAssocAction::removeActionsControllingObject() method notifies all
- /// action bodies that have a write-dependency on the controlled object by
- /// calling this method. The individual action bodies then can do some work
- /// before they are detached from the controlled object, or can even not let
- /// themselves be detached.
- /// </para><para>
- /// It this method returns Acad::eOk, AcDbAssocAction::removeActionsControllingObject()
- /// will not detach the action from the controlled object, expecting the
- /// action body to do it by itself. If not overridden, this method returns
- /// Acad::eNotImplemented, indicating that AcDbAssocAction::removeActionsControllingObject()
- /// should detach the action from the controlled object.
- /// </para></summary>
- /// <param name="pControlledObject">
- /// An AcDbObject for which AcDbAssocAction::removeActionsControllingObject()
- /// is being called. This action body has a write-dependency on this object.
- /// </param>
- /// <returns> Acad::ErrorStatus. </returns>
- ///
- virtual Acad::ErrorStatus removeActionsControllingObjectOverride(AcDbObject* pControlledObject)
- {
- UNREFERENCED_PARAMETER(pControlledObject);
- return Acad::eNotImplemented;
- }
- /// <summary><para>
- /// Called from AcDbAssocManager::auditAssociativeData() after file open and possibly
- /// after some other scenarios when the associative data may need to be audited and fixed-up.
- /// At this time custom code may also initialize internal chaches that were not saved to dwg/dxf
- /// file, or do some other work.
- /// </para><para>
- /// The action body may request the parent action to be erased by setting kErasedAssocStatus
- /// to parentActionHandling output argument. Setting kChangedDirectlyAssocStatus to
- /// parentActionHandling will make the parent action evaluate after the audit of all
- /// actions has been completed.
- /// </para><para>
- /// An example of possible and inevitable inconsistencies is when the drawing was modified
- /// in an AutoCAD release that didn't have code for the action, the action body was a proxy
- /// and therefore didn't react to notifications and didn't evaluate.
- /// </para><para>
- /// Another example of possible and inevitable ininconsistencies are references to objects
- /// that are not in the database any more because their owning objects were erased, the
- /// drawing was then saved, and these objects with erased owners were not saved to
- /// database. No notifications happen about the erase of these objects because they were
- /// not actually erased, so the actions cannot know that these objects are not in the database
- /// any more and may still hold AcDbObjectIds of these "lazily-erased" objects.
- /// </para><para>
- /// Before auditAssociativeDataOverride() is called, the system performs overall
- /// checks and fixes for cases like a dependency depending on a non-existent object,
- /// checks proper links between network, action, action body, action parameters, and
- /// dependencies, etc., so that these general checks do not need to be performed by
- /// the custom code.
- /// </para></summary>
- ///
- virtual void auditAssociativeDataOverride(AcDbAssocStatus& parentActionHandling);
- /// <summary>
- /// General notification that the action body can receive. The information
- /// about the notification is passed in an AcDbAssocNotificationData object.
- /// </summary>
- /// <remarks> For internal use only. </remarks>
- /// <param name="pNotificationData">
- /// Pointer to an AcDbAssocNotificationData object. The action body should check
- /// the type of the AcDbAssocNotificationData object, cast it to that type,
- /// and obtain the notification information from it.
- /// </param>
- /// <returns> Acad::ErrorStatus. </returns>
- ///
- virtual Acad::ErrorStatus notificationOverride(class AcDbAssocNotificationData* pNotificationData);
- /// <summary>
- /// Using this method the action body reveals its AcDbStepIds and AcDbPersSubentIds
- /// to the AcDbAssocPersSubentManager.
- /// </summary>
- /// <remarks> For internal use only. </remarks>
- /// <param name="stepIds"> The array of returned AcDbPersStepIds. </param>
- /// <param name="persSubentIds"> The array of returned AcDbPersSubentIds. </param>
- ///
- virtual Acad::ErrorStatus collectPersSubentNamingDataOverride(AcDbPersStepIdArray& stepIds,
- AcDbPersSubentIdArray& persSubentIds) const;
- /// <summary>
- /// Using this method the action body asks the AcDbAssocPersSubentManager
- /// to remap its AcDbPersStepIds and PersSubentIds after the action body
- /// has been cloned.
- /// </summary>
- /// <remarks> For internal use only. </remarks>
- /// <param name="pCloner">
- /// AcDbAssocPersSubentManagerCloner that the action body uses to remap
- /// its AcDbPersStepIds and PersSubentIds.
- /// </param>
- //
- virtual Acad::ErrorStatus clonePersSubentNamingDataOverride(class AcDbAssocPersSubentManagerCloner* pCloner);
- }; // class AcDbAssocActionBody
- /// <summary>
- /// Just to be able to specify output AcString parameters by default value.
- /// </summary>
- ///
- ACDB_PORT AcString& dummyString();
- #pragma pack (pop)
|