/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// // OdIfcProduct.h: interface for the OdIfcProduct class. // /////////////////////////////////////////////////////////////////////////////// #ifndef _IFC_PRODUCT_H_ #define _IFC_PRODUCT_H_ #include "IfcObjectDefinition.h" #include "IfcRepresentation.h" #include "TD_PackPush.h" /** \details Contains declarations related to working with IFC file content. */ namespace OdIfc { class OdIfcGeometricRepresentationItem; SMARTPTR(OdIfcGeometricRepresentationItem) SMARTPTR(OdIfcRepresentationItem) /**\details A class that implements a high-level wrapper over the IfcProduct that is needed for generation and visualization of product geometry. */ class IFCGEOM_EXPORT OdIfcProduct : public OdIfcObjectDefinition { ODRX_DECLARE_MEMBERS(OdIfcProduct); public: /** \details Sets the values of the object's subentity traits, and returns the object's subentity traits to the calling subroutine. \param traits [in] A raw pointer to the OdGiDrawableTraits object to be set. \returns A set of flags represented with an unsigned 32-bit integer value. \remarks When re-implementing this method, use the "or" bit operation (|) for the return value of the parent class' subSetAttributes() method and any flags you have added. \sa OdGiDrawableTraits class documentation. */ OdUInt32 subSetAttributes(OdGiDrawableTraits * traits) const; /**\details Draws the graphical representation of the product object that is independent of any viewport contexts. \param wd [in] A raw pointer to the OdGiDrawable object that encapsulates parameters of viewport-independent vectorization. \returns true if the drawing was successful; otherwise, the method returns false. */ bool subWorldDraw(OdGiWorldDraw * wd) const override; /**\details Retrieves the current geometrical extents of the production object. \param ext [out] A placeholder for the current geometry extents object to be returned to a calling subroutine. \returns eOk if the current extents were successfully returned; otherwise, the method returns an appropriate error code. \remarks The method accepts an instance of the OdGeExtents3d class, fills it with the data about the model's extents, and returns it to a calling subroutine. */ OdResult getGeomExtents(OdGeExtents3d& ext) const; /** \details Composes the representation item object. */ void compose() override; /** \details Retrieves the shape representation of the product. \returns An object identifier of the product shape representation. */ OdDAIObjectId getRepresentation() const; /** \details Retrieves the product object's placement. \returns A matrix object that represents the product object's placement. */ OdGeMatrix3d getObjectPlacement() const; /** \details Retrieves geometric representation items of the product object. \returns An array of smart pointers to OdIfcGeometricRepresentationItem objects. */ OdIfcGeometricRepresentationItemPtrArray getGeometricRepresentationItems() const; /** \details Retrieves representation items of the product object. \returns An array of smart pointers to OdIfcRepresentationItem objects. \remarks This method extracts not only geometric representations, which allows access to nested IfcMappedItem instances. */ OdIfcRepresentationItemPtrArray getRepresentationItems() const; /** \details Sets the values of the compound object's style based on applied materials if they exists for current object. \param pWd [in] Pointer to the OdGiWorldDraw interface. \returns eOk if the current item were successfully styled with material relationships; otherwise, the method returns an appropriate error code. */ virtual OdResult setStyleSettings(OdGiWorldDraw* pWd) const; protected: OdDAIObjectIds m_blocksIds; OdDAIObjectIds m_attributesIds; }; SMARTPTR(OdIfcProduct) class OdDAIApplicationInstancesIterator : public OdRxIterator { public: OdDAIApplicationInstancesIterator() {} static OdSmartPtr createObject(const OdDAIObjectIds& objects) { OdSmartPtr pRes = OdRxObjectImpl::createObject(); pRes->m_objects = objects; pRes->start(); return pRes; } void start() { m_cur = 0; } bool done() const { return m_cur >= m_objects.size(); } bool next() { if (OdDAIApplicationInstancesIterator::done()) return false; ++m_cur; return !OdDAIApplicationInstancesIterator::done(); } OdRxObjectPtr object() const { return done() ? OdRxObjectPtr() : OdRxObject::cast(m_objects.at(m_cur).openObject()); } private: OdDAIObjectIds m_objects; OdDAIObjectIds::size_type m_cur{}; }; typedef OdSmartPtr OdDAIApplicationInstancesIteratorPtr; } #include "TD_PackPop.h" #endif // _IFC_PRODUCT_H_