/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, 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-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #pragma once #include "DbAssocGlobal.h" #include "DynamicBlocks/DbBlockPostponedAction.h" #include #include #include /** \details This class implements the dynamic block association evaluation callback. It handles postponed operations for dynamic block constraint parameters. Library: Source code provided. */ class OdDbDynBlockAssocEvaluationCallback : public OdDbAssocEvaluationCallback { public: /** \details Constructor. Registers this callback with OdDbAssocManager. */ OdDbDynBlockAssocEvaluationCallback(); /** \details Destructor. Unregisters this callback from OdDbAssocManager. */ virtual ~OdDbDynBlockAssocEvaluationCallback(); /** \details Adds a postponed action to be executed during network evaluation. \param pAction [in] Smart pointer to postponed action to add. */ void addPostponedAction(OdDbBlockPostponedActionPtr pAction); /** \details Notification that all dependent actions have been marked to evaluate. \param pNetwork [in] Top-level network that is being evaluated. */ virtual void allDependentActionsMarkedToEvaluate(OdDbAssocNetwork* pNetwork) override; /** \details Notification that the action starts its evaluation. \param pAction [in] The action that is being evaluated. */ virtual void beginActionEvaluation(OdDbAssocAction* pAction) override; /** \details Notification that action evaluation has ended. \param pAction [in] The action that finished evaluation. */ virtual void endActionEvaluation(OdDbAssocAction* pAction) override; /** \details Notification that an error happened during action evaluation. \param pAction [in] The action that is being evaluated. \param errorStatus [in] Action evaluation error status. \param objectId [in] The failed object id. \param pObject [in] The failed object pointer. \param pErrorInfo [in] Additional info about the error. */ virtual void setActionEvaluationErrorStatus(OdDbAssocAction* pAction, OdResult errorStatus, const OdDbObjectId& objectId = OdDbObjectId::kNull, OdDbObject* pObject = NULL, void* pErrorInfo = NULL) override; /** \details Returns true when the evaluation should be canceled. \returns false (never cancel). */ virtual bool cancelActionEvaluation() override; /** \details Returns additional data for actions during evaluation. \returns nullptr (no additional data). */ virtual OdDbEvalContext* getAdditionalData() const override; /** \details Returns the transformation type that has been performed. \returns kNotSpecified. */ virtual OdDbAssocTransformationType getTransformationType() const override; private: // Storage for postponed actions std::vector m_postponedActions; }; // Global instance smart pointer (defined in .cpp file) extern std::unique_ptr g_pDynBlockAssocCallback; // Module initialization/cleanup functions void initializeDynBlockAssocCallback(); void uninitializeDynBlockAssocCallback();