/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// #ifndef DbAssocActionParam_INCLUDED_ #define DbAssocActionParam_INCLUDED_ /*!DOM*/ #include "DbAssocAction.h" #include "DbCompoundObjectId.h" #include "DbGeomRef.h" #include "PersSubentIdTypes.h" #include "TD_PackPush.h" class OdDbImpAssocActionParam; /** \details This class implements the action parameter. Library: Source code provided. */ class DBCONSTRAINTS_EXPORT OdDbAssocActionParam : public OdDbObject { public: ODRX_DECLARE_MEMBERS(OdDbAssocActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocActionParam(bool createImpObj = true); /** \details Destructor destroys an instance of this class. */ ~OdDbAssocActionParam(); /** \details Returns the parameter name. */ const OdString& name() const; /** \details Sets the parameter name. */ virtual OdResult setName(const OdString& newName); /** \details Makes empty the parameter. */ virtual OdResult makeParamEmpty(bool alsoEraseOwnedObjects); /** \details Makes constant the parameter. */ virtual OdResult makeParamConstant(); /** \details Applies the transformation matrix to the constraint geometry. */ virtual OdResult transformConstantGeometry(const OdGeMatrix3d& transform); /** \details Returns an object ID of the parent action. */ OdDbObjectId parentAction() const; /** \details Detaches the dependencies of this action. */ virtual OdResult detachDependencies(); /** \details Gets the dependencies of this action. */ OdResult getDependencies(bool readDependenciesWanted, bool writeDependenciesWanted, OdDbObjectIdArray& dependencyIds) const; /** \details Gets an array of IDs of the compound object for this action. */ OdResult getCompoundObjectIds(bool readDependenciesWanted, bool writeDependenciesWanted, OdArray& compoundObjectIds) const; /** \details Returns the current status of this action parameter. */ virtual OdDbAssocStatus status(bool alsoCheckDependencies) const; /** \details Sets the status for this action parameter. */ virtual OdResult setStatus(OdDbAssocStatus newStatus, bool notifyParentAction = true, bool setInOwnedParams = false); /** \details Audits the associative data callback. \param parentActionHandling [out] custom implementation may request parent action erasing by setting this parametr to kErasedAssocStatus or request parent action evaluation by setting it to kChangedDirectlyAssocStatus. \notes This callback function is called after drawing file open and may be overridden in custom implementation to handle broken associativity in some certain scenarious when the associative data may need to be audited and fixed. Custom code may also initialize internal cache that was not saved to drawing file, and/or do some other work at this time. System performs all overall general checks like a dependency depending on a non-existent object, checks that network, action, action body, action parameters and dependencies are properly linked between each-other, etc., so the custom code do not need to perform these general checks. An example of such scenario when associativity data need auditing is when dependent-on object was erased effectively and didn't send erase notification or notification from erased object was not processed because custom libriary was not loaded and this object was a proxy. Base implementation is empty. */ virtual void auditAssociativeData(OdDbAssocStatus& parentActionHandling); /** \details This function returns used step ids and perssubent ids if any. \param stepIds [in] OdDbAssocPersSubentManagerCloner object. \param subentIds [in] OdDbAssocPersSubentManagerCloner object. \remarks This callback is called after the IDs are translated in the target database. */ virtual void collectPersSubentNamingDataOverride(OdDbPersStepIdArray& stepIds, OdDbPersSubentIdArray& persSubentIds) const; /** \details This function notificates objects that PersSubentNamingData shold be cloned. \param apsmc [in] OdDbAssocPersSubentManagerCloner object. */ virtual void clonePersSubentNamingDataOverride(class OdDbAssocPersSubentManagerCloner* pCloner); /** \details Reads the .dwg file data of this object. \param pFiler [in] Filer object from which data are read. \remarks Returns the filer status. */ virtual OdResult dwgInFields(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) 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); /** \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) const; /** \details Gets the compounded object. */ OdResult getObject(OdDbCompoundObjectId& object) const; /** \details Gets the object. */ OdDbObjectId getObject() const; /** \details Deprecated. */ OdResult getObject(OdDbCompoundObjectId* object) const { return getObject(*object); } /** \details Sets the compounded object. */ OdResult setObject( //OdDbObjectId actionId, const OdDbCompoundObjectId& object, bool isReadDependency = true, bool isWriteDependency = false); /** \details Sets the compounded object. */ OdResult setObjectOnly(const OdDbCompoundObjectId& object, bool isReadDependency, // = true bool isWriteDependency // = false ); /** \details Deprecated. */ OdResult setObjectOnly(const OdDbCompoundObjectId* object, bool isReadDependency, // = true bool isWriteDependency // = false ) { return setObjectOnly(*object, isReadDependency, isWriteDependency); } /** \details Deprecated. */ OdResult setObject( //OdDbObjectId actionId, const OdDbCompoundObjectId* object, bool isReadDependency = true, bool isWriteDependency = false) { return setObject(*object, isReadDependency, isWriteDependency); } virtual OdStringArray compareWith(const OdDbObjectId paramIDToCompare, OdDb::DwgVersion filerVersion = OdDb::kDHL_CURRENT) const; protected: friend OdDbImpAssocActionParam; /*!DOM*/ OdDbImpAssocActionParam* m_pImpObj; }; /** \details The typified smart pointer. This template class is specialization of the OdSmartPtr class for the OdDbAssocActionParam class. \sa */ typedef OdSmartPtr OdDbAssocActionParamPtr; /** \details This class implements the body action parameter. Library: Source code provided. */ class DBCONSTRAINTS_EXPORT OdDbAssocAsmBodyActionParam : public OdDbAssocActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocAsmBodyActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocAsmBodyActionParam(bool createImpObj = true); /** \details Sets the body for this action. */ virtual OdResult setBody(const OdDbEntity* pAsmEntity, bool isReadDependency = true, bool isWriteDependency = false, int dependencyOrder = 0); /** \details Sets the body for this action. */ virtual OdResult setBody(OdDbObjectId asmEntityId, bool isReadDependency = true, bool isWriteDependency = false, int dependencyOrder = 0); /** \details Sets the body for this action. */ virtual OdResult setBody(void* pAsmBody, bool makeCopy); /** \details Returns the body or its duplicate from this action. */ virtual void* body(bool makeCopy) const; /** \details Gets an ID of the compounded object this action. */ OdResult getDependentOnCompoundObject(OdDbCompoundObjectId& compoundId) const; }; /** \details The typified smart pointer. This template class is specialization of the OdSmartPtr class for the OdDbAssocAsmBodyActionParam class. \sa */ typedef OdSmartPtr OdDbAssocAsmBodyActionParamPtr; /** \details This class implements the compounded action parameter. Library: Source code provided. */ class DBCONSTRAINTS_EXPORT OdDbAssocCompoundActionParam : public OdDbAssocActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocCompoundActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocCompoundActionParam(bool createImpObj = true); /** \details Removes all parameters and optionally erases them. \param alsoEraseIt [in] tells to erase removed parameters. */ OdResult removeAllParams(bool alsoEraseThem); /** \details Returns the number of parameters. */ int paramCount() const; /** \details Returns the object ID of owned parameters. */ const OdDbObjectIdArray& ownedParams() const; /** \details Adds a parameter using an object ID and index. */ OdResult addParam(const OdDbObjectId& paramId, int& paramIndex); /** \details Removes the parameter using its object ID and optional erases it. \param paramId [in] object ID of the parameter to remove. \param alsoEraseIt [in] tells to erase removed parameter. */ OdResult removeParam(const OdDbObjectId& paramId, bool alsoEraseIt); /** \details Returns an array of object ID of parameters using the parameter name. */ OdDbObjectIdArray paramsAtName(const OdString& paramName) const; /** \details Returns an object ID of the parameter using its name and index. */ OdDbObjectId paramAtName(const OdString& paramName, int index = 0) const; /** \details Returns an object ID of the parameter using its index. */ OdDbObjectId paramAtIndex(int paramIndex) const; /** \details Creates and adds a new parameter. */ OdResult addParam(const OdString& paramName, OdRxClass* pParamClass, OdDbObjectId& paramId, int& paramIndex); /*!DOM*/ OdDbObjectId anchorId() const; /** \details Returns the current status of this action parameter. */ virtual OdDbAssocStatus status(bool alsoCheckDependencies) const; /** \details Sets the status for this action parameter. */ virtual OdResult setStatus(OdDbAssocStatus newStatus, bool notifyParentAction = true, bool setInOwnedParams = false); }; /** \details The typified smart pointer. This template class is specialization of the OdSmartPtr class for the OdDbAssocCompoundActionParam class. \sa */ typedef OdSmartPtr OdDbAssocCompoundActionParamPtr; /** \details This class implements the edge action parameter. Library: Source code provided. */ class DBCONSTRAINTS_EXPORT OdDbAssocEdgeActionParam : public OdDbAssocActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocEdgeActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocEdgeActionParam(bool createImpObj = true); /** \details After loading from file, performs necessary actions which require accessing other Database objects. For example, processing round-trip data. */ virtual void composeForLoad(OdDb::SaveType format, OdDb::DwgVersion version, OdDbAuditInfo* pAuditInfo); /** \details Sets the edge reference. */ virtual OdResult setEdgeRef(const OdDbEdgeRef& edgeRef, bool isReadDependency = true, bool isWriteDependency = false, int dependencyOrder = 0); /** \details Gets the edge reference. */ virtual OdResult getEdgeRef(OdArray& edgeRefs) const; /** \details Sets the edge subentity geometry. */ virtual OdResult setEdgeSubentityGeometry(const OdGeCurve3d* pNewEdgeCurve); /** \details Gets an ID of the compounded object this action. */ OdResult getDependentOnCompoundObject(OdDbCompoundObjectId& compoundId) const; /** \details Gets the edge reference with evaluation */ virtual OdResult getEdgeRefEval(OdArray& edgeRefs); }; /** \details The typified smart pointer. This template class is specialization of the OdSmartPtr class for the OdDbAssocEdgeActionParam class. \sa */ typedef OdSmartPtr OdDbAssocEdgeActionParamPtr; /** \details This class implements the face action parameter. Library: Source code provided. */ class DBCONSTRAINTS_EXPORT OdDbAssocFaceActionParam : public OdDbAssocActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocFaceActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocFaceActionParam(bool createImpObj = true); /** \details Sets the face reference. */ virtual OdResult setFaceRef(const OdDbFaceRef& faceRef, bool isReadDependency = true, bool isWriteDependency = false, int dependencyOrder = 0); /** \details Gets the face reference. */ virtual OdResult getFaceRef(OdArray& faceRefs) const; /** \details Sets the face subentity geometry. */ virtual OdResult setFaceSubentityGeometry(const OdGeSurface* pNewFaceSurface); /** \details Gets an ID of the compounded object this action. */ OdResult getDependentOnCompoundObject(OdDbCompoundObjectId& compoundId) const; }; /** \details The typified smart pointer. This template class is specialization of the OdSmartPtr class for the OdDbAssocFaceActionParam class. \sa */ typedef OdSmartPtr OdDbAssocFaceActionParamPtr; /** \details This class implements the face action parameter. Library: Source code provided. */ class DBCONSTRAINTS_EXPORT OdDbAssocTrimmingBodyActionParam : public OdDbAssocFaceActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocTrimmingBodyActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocTrimmingBodyActionParam(bool createImpObj = true); }; /** \details The typified smart pointer. This template class is specialization of the OdSmartPtr class for the OdDbAssocFaceActionParam class. \sa */ typedef OdSmartPtr OdDbAssocTrimmingBodyActionParamPtr; /** \details This class implements the object action parameter. Library: Source code provided. */ class DBCONSTRAINTS_EXPORT OdDbAssocObjectActionParam : public OdDbAssocActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocObjectActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocObjectActionParam(bool createImpObj = true); /** \details Gets an ID of the object dependency. */ OdDbObjectId getSingleDependency() const; }; /** \details The typified smart pointer. This template class is specialization of the OdSmartPtr class for the OdDbAssocObjectActionParam class. \sa */ typedef OdSmartPtr OdDbAssocObjectActionParamPtr; /** \details This class implements the vertex action parameter. Library: Source code provided. */ class DBCONSTRAINTS_EXPORT OdDbAssocVertexActionParam : public OdDbAssocActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocVertexActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocVertexActionParam(bool createImpObj = true); /** \details Sets the vertex reference. */ virtual OdResult setVertexRef(const OdDbVertexRef& vertexRef, bool isReadDependency = true, bool isWriteDependency = false, int dependencyOrder = 0); /** \details Gets the vertex reference. */ OdResult getVertexRef(OdDbVertexRef& vertexRef) const; /** \details Gets an array of vertex references. */ virtual OdResult getVertexRef(OdArray& vertexRefs) const; /** \details Gets an array of vertex references with evaluation */ virtual OdResult getVertexRefEval(OdArray& vertexRefs); /** \details Sets the vertex subentity geometry. */ virtual OdResult setVertexSubentityGeometry(const OdGePoint3d& newPosition); /** \details Gets an ID of the compounded object this action. */ OdResult getDependentOnCompoundObject(OdDbCompoundObjectId& compoundId) const; }; /** \details The typified smart pointer. This template class is specialization of the OdSmartPtr class for the OdDbAssocVertexActionParam class. \sa */ typedef OdSmartPtr OdDbAssocVertexActionParamPtr; ///////////////////////////////////////////////////////////////////////////////////////////////////// /** \details */ class DBCONSTRAINTS_EXPORT OdDbAssocPointRefActionParam : public OdDbAssocCompoundActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocPointRefActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocPointRefActionParam(bool createImpObj = true); }; typedef OdSmartPtr OdDbAssocPointRefActionParamPtr; class OdDbOsnapPointRef; /** \details This template class is a specialization of the OdSmartPtr class for OdDbOsnapPointRef object pointers. */ typedef OdSmartPtr OdDbOsnapPointRefPtr; /** \details */ class DBCONSTRAINTS_EXPORT OdDbAssocOsnapPointRefActionParam : public OdDbAssocPointRefActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocOsnapPointRefActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocOsnapPointRefActionParam(bool createImpObj = true); /** \details Reads the .dwg file data of this object. \param pFiler [in] Filer object from which data are read. \remarks Returns the filer status. */ virtual OdResult dwgInFields(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) 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); /** \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) const; OdDb::OsnapMode osnapMode() const; double nearPointParam() const; void setOsnapMode(OdDb::OsnapMode mode); void setParam(double param); /** \details Returns param's settings in OSnap point ref form. */ OdDbOsnapPointRefPtr asOsnapPointRef() const; OdResult evaluatePointOverride(OdGePoint3d& evalPnt) const; static OdResult createInstanceAndPostToDatabase( const OdDbObjectId& bodyId, OdDb::OsnapMode osnapMode, const OdDbFullSubentPath& path, const OdGePoint3d& point, OdDbObjectId& paramId); }; typedef OdSmartPtr OdDbAssocOsnapPointRefActionParamPtr; /** \details */ class DBCONSTRAINTS_EXPORT OdDbAssocPathActionParam : public OdDbAssocCompoundActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocPathActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocPathActionParam(bool createImpObj = true); }; typedef OdSmartPtr OdDbAssocPathActionParamPtr; /** \details */ class DBCONSTRAINTS_EXPORT OdDbAssocTrimmingPathActionParam : public OdDbAssocPathActionParam { public: ODRX_DECLARE_MEMBERS(OdDbAssocTrimmingPathActionParam); /** \details Constructor creates an instance of this class. */ OdDbAssocTrimmingPathActionParam(bool createImpObj = true); }; typedef OdSmartPtr OdDbAssocTrimmingPathActionParamPtr; #include "TD_PackPop.h" #endif // DbAssocActionParam_INCLUDED_