/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2019, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2019 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef DbImpAssocNetwork_INCLUDED_ #define DbImpAssocNetwork_INCLUDED_ /*!DOM*/ #include "DbConstraintsExports.h" #include "DbImpAssocAction.h" #include "TD_PackPush.h" /** \details This class represents the custom implementation of the network of associated actions. Library: Source code provided. */ class DBCONSTRAINTS_EXPORT OdDbImpAssocNetwork : public OdDbImpAssocAction { public: /** \details Constructor creates an instance of this class. */ explicit OdDbImpAssocNetwork(); /** \details Gets the evaluation callback set, or NULL if no action evaluation is in progress. */ OdDbObjectIdArray getActions() const; /** \details Gets internal array of the actions marked to be evaluated. */ OdDbObjectIdArray getActionsToEvaluate() const; /** \details Reports the actions, dependencies and objects that need to be evaluated. */ virtual void getDependentActionsToEvaluate(OdDbActionsToEvaluateCallback* pActionsToEvaluateCallback) const; /** \details Adds the associated action to be owned by this network using its ID. */ OdResult addAction(OdDbAssocNetwork* thisNetwork, const OdDbObjectId& actionId, bool alsoSetAsDatabaseOwner); /** \details Removes the associated action from this network using its ID. */ OdResult removeAction(OdDbAssocNetwork* thisNetwork, const OdDbObjectId& actionId, bool alsoEraseIt); #if 0 // TODO: Nothing complex but needs time /** \details Adds an array of associated actions to be owned by this network. */ OdResult addActions(const OdDbObjectIdArray& actionIds, bool alsoSetAsDatabaseOwner); /** \details Removes an array of associated actions from this network. */ OdResult removeAllActions(bool alsoEraseThem); #endif /** \details This method is called from the setStatus(..., true) method of the associated action and notifies the network owing the action that the status has just been changed. */ OdResult ownedActionStatusChanged(OdDbObject* pThisNetwork, OdDbAssocAction* pOwnedAction, OdDbAssocStatus previousStatus); /** \details Reads the .dwg file data of this object. \param pFiler [in] Filer object from which data are read. \remarks Returns the filer status. */ OdResult dwgInFields(OdDbAssocAction *pSelf, OdDbDwgFiler* pFiler); /** \details Writes the .dwg file data of this object. \param pFiler [in] Pointer to the filer to which data are written. */ virtual void dwgOutFields(OdDbDwgFiler* pFiler, OdDbObjectId objectId) const; /** \details Reads the .dxf file data of this object. \param pFiler [in] Filer object from which data are read. \remarks Returns the filer status. */ virtual OdResult dxfInFields(OdDbDxfFiler* pFiler, OdDbObjectId objectId); /** \details Writes the .dxf file data of this object. \param pFiler [in] Pointer to the filer to which data are written. */ virtual void dxfOutFields(OdDbDxfFiler* pFiler, OdDbObjectId objectId) const; /** \details Sets the status of the network of associated actions. */ OdResult setStatus(OdDbObject* pDbObject, OdDbAssocStatus newStatus, bool notifyOwningNetwork, bool setInOwnedActions); /** \details Evaluates the network of associated actions. */ virtual void evaluate(OdDbAssocAction *pAction, OdDbAssocEvaluationCallback* pEvaluationCallback); virtual void audit(OdDbObject* pObj, OdDbAuditInfo* pAuditInfo); virtual void appendToOwner(OdDbAssocAction* pThisAction, OdDbIdPair& idPair, OdDbObject* owner, OdDbIdMapping& idMap); virtual OdDbAssocEvaluationPriority evaluationPriority() const; private: /*!DOM*/ void auditEvaluationQueue(OdDbObject* pObj, OdDbAuditInfo* pAuditInfo); /*!DOM*/ OdDbObjectIdArray m_actions; /*!DOM*/ OdArray m_isOwnedAction; protected: /*!DOM*/ OdUInt32 m_maxChildActionIdx; /*!DOM*/ virtual void fixStatusConsistency(OdDbAssocAction* self); /*!DOM*/ bool m_fixStatusConsistency; friend void odaaFixStatusConsistencyOnce(OdDbAssocNetwork* action); friend void odaaEnableStatusConsistencyCheck(OdDbAssocNetwork* network, bool doIt); private: /*!DOM*/ OdDbObjectIdArray m_actionsToEvaluate; }; void odaaEnableStatusConsistencyCheck(OdDbAssocNetwork* network, bool doIt = true); void odaaFixStatusConsistencyOnce(OdDbAssocNetwork* action); #include "TD_PackPop.h" #endif