/////////////////////////////////////////////////////////////////////////////// // 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 OdDbAssocPersSubentIdPE_INCLUDED_ #define OdDbAssocPersSubentIdPE_INCLUDED_ /*!DOM*/ #include "DbAssocPersSubentId.h" #include "Ge/GePoint3d.h" #include "Ge/GeCurve3d.h" #include "DbImpAssocGeomDependency.h" #include "DbAssocActionBody.h" #include "DbCompoundObjectId.h" #include "DbBody.h" #include DBENT_EXPORT OdModelerGeometryPtr getModelerGeometry(const OdDbEntity* pEnt); #include "TD_PackPush.h" /* struct OdDbAssocTransInfo { enum TransType { kGeneral = 0, kScaling, kRadius, kMajorRadius, kMinorRadius, kFixedRadius, kFixed, kFixWhenPossible, kNone, }; OdDbAssocTransInfo() : mRadius(-1.0), mTransType(kGeneral) {} TransType mTransType; OdGeMatrix3d mTrans; double mRadius; }; struct OdDbAssocSubentTransInfo : OdDbAssocTransInfo { OdDbSubentId mSubentId; }; */ /** \details Declares the rigidset type. */ enum RigidSetType { kNotRigidSet = 0, kScalableRigidSet, kNonScalableRigidSet }; /** \details Declares the axis type. */ enum AxisSubentIdx { kUndefinedAxis = 0, kMajorAxis, kMinorAxis }; #ifdef _MSC_VER #pragma warning (push) #pragma warning (disable : 4100) #endif /** \details This class provides the base protocol extension class that declares the protocol for obtaining a persistent subentity identifier from a transient subentity identifier. Library: Source code provided. */ class DBCONSTRAINTS_EXPORT OdDbAssocPersSubentIdPE : public OdRxObject { public: ODRX_DECLARE_MEMBERS(OdDbAssocPersSubentIdPE); OdDbAssocPersSubentIdPE() { } //OdDbAssocPersSubentIdPE() { m_assocGeomDependency = NULL; } /** \details Creates new persistent subentity identifier. */ virtual OdDbAssocPersSubentIdPtr createNewPersSubent(OdDbEntity* pEntity, const class OdDbCompoundObjectId& compId, const OdDbSubentId& subentId) { OdDbAssocSimplePersSubentIdPtr res = OdDbAssocSimplePersSubentId::createObject(); res->init(subentId); return res; } /** \details Returns the transient subent ID of the dependent-on entity corresponding to the internally held associated subentity. */ virtual OdResult getTransientSubentIds(const OdDbEntity* pEntity, const OdDbAssocPersSubentId* pPerSubentId, OdArray& subents) const = 0; /** \details Gets all subentity identifiers for a given subentity type. */ virtual OdResult getAllSubentities(const OdDbEntity* pEntity, OdDb::SubentType subentType, OdArray& allSubentIds) { return eNotImplemented; } /** \details Gets the vertex subentity identifier corresponding to the given edge subentity identifier. This protocol provides the query of relations between the edge and vertex subentities. */ virtual OdResult getEdgeVertexSubentities(const OdDbEntity* pEntity, const OdDbSubentId& edgeSubentId, OdDbSubentId& startVertexSubentId, OdDbSubentId& endVertexSubentId, OdArray& otherVertexSubentIds) { return eNotImplemented; } /** \details Gets the vertex subentity identifier corresponding to the given spline subentity identifier. This protocol provides the query of relations between the spline edge and vertex subentities. */ virtual OdResult getSplineEdgeVertexSubentities(const OdDbEntity* pEntity, const OdDbSubentId& edgeSubentId, OdDbSubentId& startVertexSubentId, OdDbSubentId& endVertexSubentId, OdArray& controlPointSubentIds, OdArray& fitPointSubentIds) { return eNotImplemented; } /** \details Gets the coordinates of a vertex subentity corresponding to the associated subentity ID. */ virtual OdResult getVertexSubentityGeometry(const OdDbEntity* pEntity, const OdDbSubentId& vertexSubentId, OdGePoint3d& vertexPosition) { return eNotImplemented; } /** \details Gets the curve of an edge subentity corresponding to the associated subentity ID. */ virtual OdResult getEdgeSubentityGeometry(const OdDbEntity* pEntity, const OdDbSubentId& edgeSubentId, OdGeCurve3d*& pEdgeCurve) { return eNotImplemented; } virtual OdResult getEdgeSubentityGeometry(const OdDbEntity* pEntity, const OdDbSubentId& edgeSubentId, const OdDbImpAssocGeomDependency* /*assocGeomDependency*/, OdGeCurve3d*& pEdgeCurve ) { return getEdgeSubentityGeometry(pEntity, edgeSubentId, pEdgeCurve); } /** \details Gets the axis of an entity corresponding to the associated subentity ID. \param pEntity [in] pointer to the entity. \param axisSubentId [in] identifier of axis subentity. \param axis [out] requested axis geometry. */ virtual OdResult getAxisSubentityGeometry(const OdDbEntity* pEntity, const OdDbSubentId& axisSubentId, OdGeVector3d& axis) { return eNotImplemented; } /** \details Sets the geometry of an axis subentity corresponding to the associated subentity ID. \param pEntity [in] pointer to the entity. \param axisSubentId [in] identifier of axis subentity. \param axis [in] new value. */ virtual OdResult setAxisSubentityGeometry(OdDbEntity* pEntity, const OdDbSubentId& axisSubentId, const OdGeVector3d& pNewAxis) { return eNotImplemented; } /** \details Gets the surface of a face subentity corresponding to the associated subentity ID. */ virtual OdResult getFaceSubentityGeometry(const OdDbEntity* pEntity, const OdDbSubentId& faceSubentId, OdGeSurface*& pFaceSurface) { return eNotImplemented; } /** \details Sets the coordinates of a vertex subentity corresponding to the associated subentity ID. */ virtual OdResult setVertexSubentityGeometry(OdDbEntity* pEntity, const OdDbSubentId& vertexSubentId, const OdGePoint3d& newVertexPosition) { return eNotImplemented; } /** \details Sets the curve of an edge subentity corresponding to the associated subentity ID. */ virtual OdResult setEdgeSubentityGeometry(OdDbEntity* pEntity, const OdDbSubentId& edgeSubentId, const OdGeCurve3d* pNewEdgeCurve) { return eNotImplemented; } /** \details Sets the surface of a face subentity corresponding to the associated subentity ID. */ virtual OdResult setFaceSubentityGeometry(OdDbEntity* pEntity, const OdDbSubentId& faceSubentId, const OdGeSurface* pNewFaceSurface) { return eNotImplemented; } /** \details Modifiers the geometry of a subentity. */ virtual OdResult setSubentityGeometry(OdDbEntity* pEntity, const OdDbSubentId& subentId, const OdDbEntity* pNewSubentityGeometry) { return eNotImplemented; } ///These methods are deprecated and should not be used. /* virtual OdResult getSubentTransFromStretchPoints(const OdDbEntity* pEntity, const OdDbIntArray& indices, const OdGeVector3d& offset, OdArray& aSubentTransInfos) const { return eNotImplemented; } virtual OdResult getSubentTransFromGripPoints(const OdDbEntity* pEntity, const OdDbIntArray& indices, const OdGeVector3d& offset, OdArray& aSubentTransInfos) const { return eNotImplemented; } virtual OdResult getSubentTransFromGripPoints(const OdDbEntity* pEntity, const OdDbVoidPtrArray& gripAppData, const OdGeVector3d& offset, OdArray& aSubentTransInfos) const { return eNotImplemented; } */ /** \details Obtains a transformation matrix for a given subentity within the block reference. */ virtual OdResult getSubentGeometryXform(const OdDbEntity* pEntity, const OdDbObjectIdArray& fullSubentPath, OdGeMatrix3d& trans) const { trans.setToIdentity(); return eOk; } /** \details Mirrors the specified persistent subentity identifier. This method modifies the identifier so that it identifies the same subentity in the mirrored entity as it identified before the entity was mirrored. */ virtual OdResult mirrorPersSubent(const OdDbEntity* pMirroredEntity, OdDbAssocPersSubentId& persSubentIdToMirror) { return eOk; } /** \details If the entity is a rigid set, this method returns kScalableRigidSet or kNonScalableRigidSet type. \remarks Returns kNotRigidSet in default implementation. */ virtual int getRigidSetState(const OdDbEntity* /*pEntity*/) { return kNotRigidSet; } /** \details Gets the transformation matrix of the rigid set entity. */ virtual OdResult getRigidSetTransform(const OdDbEntity* pEntity, OdGeMatrix3d& trans) { return eNotApplicable; } /** \details Gets the transformation matrix for the rigid set entity. */ virtual OdResult setRigidSetTransform(OdDbEntity* pEntity, const OdGeMatrix3d& trans) { return eNotApplicable; } //OdDbImpAssocGeomDependency* assocGeomDependency() const //{ // OdDbImpAssocGeomDependency* ret = m_assocGeomDependency; // return ret; //} // void setAssocGeomDependency(const OdDbImpAssocGeomDependency* assocGeomDependency) // { // m_assocGeomDependency = (OdDbImpAssocGeomDependency*)assocGeomDependency; // } //protected: // // OdDbImpAssocGeomDependency* m_assocGeomDependency; }; #ifdef _MSC_VER #pragma warning (pop) #endif typedef OdSmartPtr OdDbAssocPersSubentIdPEPtr; #include "TD_PackPop.h" #endif