/////////////////////////////////////////////////////////////////////////////// // 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 _PRCCONTENTPRCBASE_INCLUDED_ #define _PRCCONTENTPRCBASE_INCLUDED_ #include "OdaCommon.h" #include "PrcAttributeData.h" #include "PrcName.h" #include "PrcObjectId.h" #include "Gi/GiDrawable.h" SMARTPTR(OdPrcBase) class OdPrcBaseImpl; class OdPrcProductOccurrence; /** \details Base class for representing PRC entities. */ class PRC_TOOLKIT OdPrcBase : public OdGiDrawable { protected: OdPrcBase(OdPrcBaseImpl *pImpl); protected: void writeInternal(OdPrcCompressedFiler *pStream); void readInternal(OdPrcCompressedFiler *pStream); public: //DOM-IGNORE-BEGIN ODPRC_DECLARE_MEMBERS_BASE_NOTYPE(OdPrcBase) //DOM-IGNORE-END /** \details Requests the type of the PRC entity. \returns An unsigned 32-bit integer value that contains the PRC entity type. */ virtual OdUInt32 prcType() const; /** \details Requests the current name of the PRC entity. \returns An object that represents the name of the PRC entity. \remarks The method returns the PRC entity name via a reference to an object; therefore, it can be used to set a new entity name. */ OdPrcName &name(); /** \details Requests the current name of the PRC entity. \returns A constant reference to an object that represents the name of the PRC entity. \remarks Call this method if you want to restrict modifications of the PRC entity name. */ const OdPrcName &name() const; /** \details Retrieves the current of the PRC entity. \returns The current of the PRC entity. \remarks The method returns via a reference; therefore, it can be used to set new attribute information and affect the PRC entity object. */ OdPrcAttributeData &attributeData(); /** \details Retrieves the current of the PRC entity. \returns A constant reference to the current object that contains attribute information. \remarks Call this method if you want to restrict modification to outside the PRC entity. */ const OdPrcAttributeData &attributeData() const; /** \details Destroys the instance of the PRC entity.*/ virtual ~OdPrcBase(); public: /** \details Checks whether the PRC entity is persistent. \returns The true value if the PRC entity is persistent; otherwise, the method returns false. */ virtual bool isPersistent() const; /** \details Retrieves the identifier of the PRC entity. \returns A raw pointer to the OdDbStub object that contains the PRC entity identifier. */ virtual OdDbStub* id() const; /** \details Assigns the specified OdGsCache object to the PRC entity. \param pGsNode [in] A raw pointer to the OdGsCache object to be assigned. */ virtual void setGsNode(OdGsCache* pGsNode); /** \details Retrieves the OdGsCache object currently assigned to the PRC entity. \returns A raw pointer to the OdGsCache object assigned to the PRC entity. */ virtual OdGsCache* gsNode() const; protected: virtual OdUInt32 subSetAttributes (OdGiDrawableTraits * traits) const; virtual bool subWorldDraw (OdGiWorldDraw * wd) const; virtual void subViewportDraw (OdGiViewportDraw * vd) const; }; SMARTPTR(OdPrcReferencedBase) /** \details A base class that implements a referenced PRC entity. */ class PRC_TOOLKIT OdPrcReferencedBase : public OdPrcBase { public: //DOM-IGNORE-BEGIN ODPRC_DECLARE_MEMBERS_NOTYPE_PRCBASE(OdPrcReferencedBase) //DOM-IGNORE-END /** \details Sets a new persistent CAD identifier value for the PRC object. \param CAD_persistent_identifier [in] A new value of the persistent ID to be set.*/ void setCADPersistentIdentifier(OdUInt32 CAD_persistent_identifier); /** \details Requests the current persistent CAD identifier of the PRC object. \returns An unsigned 32-bit integer value that contains the current persistent CAD identifier of the PRC object. */ OdUInt32 cadPersistentIdentifier() const; /** \details Sets a new CAD identifier value for the PRC object. \param CAD_identifier [in] A new value of CAD identifier to be set.*/ void setCADIdentifier(OdUInt32 CAD_identifier); /** \details Requests the current CAD identifier of the PRC object. \returns An unsigned 32-bit integer value that contains the current CAD identifier of the PRC object. */ OdUInt32 cadIdentifier() const; /** \details Requests the PRC . \returns The PRC . */ const OdPrcObjectId& objectId() const; /** \details Sets a new PRC . \param stub [in] A raw pointer to an OdDbStub object that is used to create a new PRC object identifier. */ void setObjectId (OdDbStub* stub); /** \details Requests the current for the PRC object. \returns A raw pointer to an OdDbStub object that represents the PRC object identifier. */ OdDbStub* id() const; /** \details Checks whether the PRC object is persistent. \returns The true value if the PRC object is persistent; otherwise, the method returns false. */ bool isPersistent() const; /** \details Requests an explicit unique name for the PRC entity. The explicit unique name can be referenced within PDF content or a JavaScript scenario. \param pPrcPO [in] A raw pointer to the that assembles the PRC entity. It must be NULL if the PRC entity is a itself (has the PRC_TYPE_ASM_ProductOccurence type). In other cases, it should not be NULL (if the PRC entity is not a ). \returns An OdString object that contains the explicit unique name of the PRC entity. If any error occurs, the method returns an empty string. \remarks The pPrcPO parameter is ignored for objects of OdPrcProductOccurrence class. */ OdString calculateUniqueName(const OdPrcProductOccurrence *pPrcPO) const; }; #endif // _PRCCONTENTPRCBASE_INCLUDED_