/////////////////////////////////////////////////////////////////////////////// // 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 _IFC_REPRESENTATIONMAP_H_ #define _IFC_REPRESENTATIONMAP_H_ #include "IfcCachedCompound.h" #include "IfcModelerGeometry/IfcModelerGeometry.h" #include "TD_PackPush.h" /** \details Contains declarations related to working with IFC files content. */ namespace OdIfc { class IFCGEOM_EXPORT OdDbBlockPE_for_IfcRepresentationMap : public OdDbBaseBlockPE { public: //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdDbBlockPE_for_IfcRepresentationMap); //DOM-IGNORE-END /** \details Determines whether a block reference has been added to a specified block. \param pBlock [in] A pointer to a block. \returns Returns true if a block reference has been added, otherwise returns false. */ virtual bool isBlockReferenceAdded(OdRxObject* pBlock) const override { return false; } /** \details Determines whether a specified block is an external reference. \param pBlock [in] A pointer to a block. \returns Returns true if the block is an external reference, otherwise returns false. */ bool isFromExternalReference(const OdRxObject* pBlock) const override { return false; } /** \details Returns a referenced database for a specified block. \param pBlock [in] A pointer to a block. */ OdDbBaseDatabase* xrefDatabase(const OdRxObject* pBlock) const override { return nullptr; } /** \details Returns a specified block's layout identifier. \param pBlock [in] A pointer to a block. */ OdDbStub* getLayoutId(const OdRxObject* pBlock) const override { return nullptr; } /** \details Returns true if and only if block is an anonymous block. \param pBlock [in] A pointer to a block. */ bool isAnonymous(const OdRxObject* pBlock) const override { return false; } /** \details Returns the name of block. \param pBlock [in] A pointer to a block. */ OdString getName(const OdRxObject* pBlock) const override { if (OdGiDrawablePtr drawable = OdGiDrawable::cast(pBlock)) { OdString blockName; OdUInt64 handle = static_cast(drawable->id()->getHandle()); blockName.format(L"Insertion_%llu", handle); return blockName; } return{}; } }; /** \details This template class is a specialization of the OdSmartPtr class for OdDbBaseBlockPE object pointers. */ typedef OdSmartPtr OdDbBlockPE_for_IfcRepresentationMapPtr; /** \details A base class that implements storing and handling data about an IfcRepresentationMap. An IfcRepresentationMap provides the mapping functionality to work with pairs of "container representation - representation item within container representation". */ class IFCGEOM_EXPORT OdIfcRepresentationMap : public OdIfcCachedCompound { ODRX_DECLARE_MEMBERS(OdIfcRepresentationMap); public: /** \details Retrieves a mapping origin translation for the mapped representation. \returns An OdGeMatrix3d object that contains mapping origin translation. */ const OdGeMatrix3d& mappingOrigin(); /** \details Retrieves an object identifier of the underlying OdIfcRepresentation instance. \returns An object identifier of the underlying OdIfcRepresentation instance. */ OdDAIObjectId mappedRepresentation(); virtual OdUInt32 subSetAttributes(OdGiDrawableTraits* pTraits) const override; /** \details Draws the representation map to the OdGiWorldDraw interface. \param pWd [in] A raw pointer to the object for the entity-level vectorization. \returns true if the representation map was successfully drawn; otherwise, the method returns false. */ virtual bool draw(OdGiWorldDraw* pWd) const; virtual bool subWorldDraw(OdGiWorldDraw* pWd) const override; /** \details Composes the representation map object. */ virtual void compose() override; private: OdGeMatrix3d m_mappingOrigin; OdResult getMappedItems(OdArray& openings, bool needCopy = false, bool needTransform = false); friend class OdIfcMappedItem; }; /** \details A data type that represents a smart pointer to an OdIfcRepresentationItem object. */ typedef OdSmartPtr OdIfcRepresentationMapPtr; } //namespace OdIfc #include "TD_PackPop.h" #endif // _IFC_REPRESENTATIONMAP_H_