/////////////////////////////////////////////////////////////////////////////// // 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 "StaticRxObject.h" #include "DynamicBlocks/DbConstraintsInterfacePE.h" #include "DbAssocVariable.h" #include "DbAssocDependency.h" struct OdDbConstraintsInterfacePEImpl : OdStaticRxObject { static OdDbAssocVariablePtr findVariable(const OdString& name, OdDbObjectId blockId); OdResult getAssocVariableName(const OdDbObject* pObject, OdString& name) override; OdResult getAssocVariableValue(const OdDbObject* pObject, OdDbObjectId blockId, OdDbEvalVariant& value) override; OdResult setAssocVariableValue(const OdDbObject* pObject, OdDbObjectId blockId, const OdDbEvalVariant& value) override; OdResult setAssocVariableValue(const OdDbObject* pObject, const OdDbEvalVariant& value) override; OdResult setAssocVariableValue(const OdString& name, OdDbObjectId blockId, const OdDbEvalVariant& value) override; OdDbEvalVariant getAssocVariableValue(const OdDbObject* pObject) override; OdString getAssocVariableExpression(const OdDbObject* pObject) override; OdResult setAssocVariableExpression(const OdDbObject* pObject, const OdString& value) override; OdString getAssocVariableDescription(const OdDbObject* pObject) override; OdResult evaluateNetwork(const OdDbObjectId& blockId, OdDbEvalContext* pContext = 0) override; OdResult setAssocVariableDescription(const OdDbObject* pObject, const OdString& description) override; bool isVarExpressionConstant(const OdDbObject* pAssocVar) override; bool expressionReferencesStringVar(const OdDbObject* pAssocVar, const OdString& expression) override; bool isNameUniqueInNetwork(const OdDbObject* pAssocVar, const OdString& name) override; OdResult evaluateExpression(const OdDbObject* pObject, OdDbObjectIdArray& objectIds, OdDbEvalVariantArray& objectValues, OdDbEvalVariant* evaluatedExpressionValue, OdString* errorMessage = 0) override; OdResult evaluateExpression(const OdDbObject* pObject, OdDbEvalVariant* evaluatedExpressionValue, OdString* errorMessage = 0) const override; OdResult setAssocVariableName(const OdDbObject* pObject, const OdString& name) override; OdResult getDependencies(const OdDbObject* pObject, bool readDependenciesWanted, bool writeDependenciesWanted, OdDbObjectIdArray& dependencyIds) override; bool isAssocDependency(const OdDbObject* pObject) override; bool isAssocAction(const OdDbObject* pObject) override; OdResult getDependencyById(const OdDbObject* pAction, OdDbObjectId templateDependencyId, OdDbObjectPtr& pRuntimeDependency) override; OdResult getActionFromNetwork(const OdDbObject* pOriginalAction, OdDbObjectId templateBlockId, OdDbObjectPtr& pRuntimeAction) override; OdResult getDependencyFromNetwork(const OdDbObject* pOriginalDependency, OdDbObjectId templateBlockId, OdDbObjectId& runtimeDependencyId) override; OdResult getVariableNameAndExpression(const OdDbObject* pObject, OdString& name, OdString& expression) override; OdResult dependentOnObject(const OdDbObject* pObject, OdDbObjectId& dependentOnObjectId) override; OdResult getAssocVariable(const OdDbObject* pObject, OdDbObjectId& varId) override; OdResult getAssocVariable(const OdDbObject* pObject, OdDbObjectId blockId, OdDbObjectId& varId) override; OdResult isAssocVariableDependent(const OdDbObject* pObject, bool& bDependent) override; bool isAssocVariable(const OdDbObject* pObject) override; OdResult setVariableNameAndExpression(OdDbObject* pDependency, const OdString& name, const OdString& expression) override; OdResult evaluate(OdDbObject* pDependency) override; OdResult addBlockPostponedAction(OdDbBlockPostponedActionPtr pAction) override; OdResult setChangedStatus(const OdDbObjectId& dependencyId) override; OdResult getOwningNetwork(const OdDbObject* pObject, OdDbObjectId& networkId) override; OdResult getInstanceFromObject(const OdDbObject* pObject, OdDbObjectId& networkId, bool createIfDoesntExist) override; OdResult getNetworkActions(const OdDbObjectId& networkId, OdDbObjectIdArray& varIds) override; OdResult getDependencyBody(const OdDbObject* pDependency, OdDbObjectId& bodyId) override; OdResult setOwningBlockReference(const OdDbObject* pAssocAction, const OdDbObjectId& blockRefId) override; OdResult getAngularConstraintSegmentType(const OdDbObject* pAssocVar, bool& bCCW, bool& bAntiparallel) override; OdResult getAngularConstraintRefEnt(const OdDbObject* pAssocVar, const OdDbObjectId& blockId, OdDbObjectId& refEntId) override; /** \details Gets the angular constraint type from the dependency body. \param dependencyId [in] ID of the dependency object. \param constraintType [out] Resulting constraint type (4-7). \returns eOk on success, error code otherwise. */ OdResult getAngularConstraintType(const OdDbObjectId& dependencyId, int& constraintType); protected: OdResult getAssocVariableFromDep(const OdDbAssocDependency* pDep, OdDbObjectId& varId); OdDbObjectId getRuntimeBlockId(const OdDbObjectId& templateBlockId); };