/////////////////////////////////////////////////////////////////////////////// // 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_MODEL_OPS_HELPER_H #define _IFC_MODEL_OPS_HELPER_H #include "IfcCore.h" #include "IfcModel.h" #include "IfcFile.h" #include "IfcModelFiller.h" #include "TD_PackPush.h" /** \details Subclass of OdIfcModelFiller that provides extended set of entity style processing. */ class IFCCORE_EXPORT IfcModelStyleFiller : public OdIfcModelFiller { public: /** \details Constructor for the IfcModelStyleFiller class. \param pModel [in] Pointer to an IFC model. */ IfcModelStyleFiller(OdIfcModel *pModel) : OdIfcModelFiller(pModel) {} /** \details Creates an instance of IfcPresentationLayerWithStyle within a model. \param name [in] OdString that determines layer name. \param assignedItems [in] OdArray collection ids of layered items, which are assigned to this layer . \param layerOn [in] TRUE indicates that the layer is set to 'On', FALSE that the layer is set to 'Off'. \param layerFrozen [in] TRUE indicates that the layer is set to 'Frozen', FALSE that the layer is set to 'Not frozen'. \param layerBlocked [in] TRUE indicates that the layer is set to 'Blocked', FALSE that the layer is set to 'Not blocked'. \param layerStyles [in] OdArray presentation styles to the layer to provide a default style for representation items. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createPresentationLayerWithStyle(const OdString & name, const OdArray& assignedItems, bool layerOn, bool layerFrozen, bool layerBlocked, const OdArray& layerStyles); /** \details Creates an instance of IfcStyledItem within a model based on colour surface shading. \param color [in] OdDAIObjectId db handle to existing colour entity. \param ifcRepresentationItemId [in] OdDAIObjectId db handle of geometric representation item to which the style is assigned. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createStyledItem(const OdDAIObjectId& color, const OdDAIObjectId & ifcRepresentationItemId); /** \details Creates an instance of IfcStyledItem within a model. \param itemId [in] OdDAIObjectId db handle of geometric representation item to which the style is assigned. \param styles [in] OdDAIObjectIds set of representation styles which are assigned, either to an geometric representation item, or to a material definition. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createStyledItem(const OdDAIObjectId & itemId, const OdDAIObjectIds & styles); /** \details Creates an instance of IfcSurfaceStyle within a model based on colour surface shading. \param colorId [in] OdDAIObjectId db handle to existing colour entity. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createSurfaceStyle(const OdDAIObjectId& colorId); /** \details Creates an instance of IfcSurfaceStyle within a model. \param side [in] OdAnsiString that determines side of the surface to apply the style. \param styles [in] OdArray collection of different surface styles. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createSurfaceStyle(const OdAnsiString & side, const OdArray& styles); /** \details Creates an instance of IfcSurfaceStyleShading within a model. \param colorId [in] OdDAIObjectId db handle to existing colour entity. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createSurfaceStyleShading(const OdDAIObjectId & colorId); /** \details Creates an instance of IfcPresentationStyleAssignment within a model. \param styles [in] OdArray set of presentation styles that are assigned to styled items. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createPresentationStyleAssignment(const OdArray& styles); /** \details Creates an instance of IfcPresentationStyleAssignment within a model based on colour surface shading. \param colorId [in] OdDAIObjectId db handle to existing colour entity. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createPresentationStyleAssignment(const OdDAIObjectId& colorId); /** \details Creates an instance of IfcStyledRepresentation within a model. \param contextOfItems [in] OdDAIObjectId db handle of representation context. \param items [in] OdDAIObjectIds set of geometric representation items. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createStyledRepresentation(const OdDAIObjectId& contextOfItems, const OdDAIObjectIds& items); /** \details Creates an instance of IfcPresentationLayerAssignment within a model based on items that are assigned to a single layer. \param name [in] OdString that determines layer name. \param assignedItems [in] OdArray collection ids of layered items, which are assigned to this layer. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createPresentationLayerAssignment(const OdString & name, const OdArray& assignedItems); /** \details Creates an instance of IfcPresentationLayerAssignment within a model based on specified type items that are assigned to a single layer. \param entityName [in] entity type that determines items assigned to the new layer. \param name [in] OdString that determines layer name. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createPresentationLayerAssignmentByEntityType(const char *entityName, const OdString & name); /** \details Creates an instance of IfcPresentationLayerWithStyle within a model based on specified type items that are assigned to a single layer. \param entityType [in] entity type that determines items assigned to the new layer. \param name [in] OdString that determines layer name. \param layerOn [in] TRUE indicates that the layer is set to 'On', FALSE that the layer is set to 'Off'. \param layerFrozen [in] TRUE indicates that the layer is set to 'Frozen', FALSE that the layer is set to 'Not frozen'. \param layerBlocked [in] TRUE indicates that the layer is set to 'Blocked', FALSE that the layer is set to 'Not blocked'. \param layerStyles [in] OdArray presentation styles to the layer to provide a default style for representation items. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createPresentationLayerWithStyleByEntityType(const char *entityType, const OdString & name, bool layerOn, bool layerFrozen, bool layerBlocked, const OdArray& layerStyles); }; /** \details Subclass of OdIfcModelFiller that provides extended set of building items geometry creation methods. */ class IFCCORE_EXPORT IfcModelGeometryFiller : public OdIfcModelFiller { public: /** \details Default constructor for the IfcModelGeometryFiller class. */ IfcModelGeometryFiller(OdIfcModel *pModel) : OdIfcModelFiller(pModel) {} /** \details Creates an instance of IfcRectangleProfileDef within a model. \param profileType [in] OdAnsiString that defines the type of geometry into which this profile definition shall be resolved. \param profileName [in] OdAnsiString that defines name of the profile type according to some standard profile table. \param position [in] OdDAIObjectId db handle of IfcAxis2Placement2D as position coordinate system of the parameterized profile definition. \param xDim [in] extent of the rectangle in the direction of the x-axis. \param yDim [in] extent of the rectangle in the direction of the y-axis. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createRectangleProfileDef(const OdAnsiString & profileType, const OdAnsiString & profileName, const OdDAIObjectId & position, double xDim, double yDim); /** \details Creates an instance of IfcArbitraryClosedProfileDef within a model. \param profileType [in] OdAnsiString that defines the type of geometry into which this profile definition shall be resolved. \param profileName [in] OdAnsiString that defines name of the profile type according to some standard profile table. \param outerCurve [in] OdDAIObjectId db handle of bounded IfcCurve curve, defining the outer boundaries of the arbitrary profile. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createArbitraryClosedProfileDef(const OdAnsiString & profileType, const OdAnsiString & profileName, const OdDAIObjectId & outerCurve); /** \details Creates an instance of IfcArbitraryProfileDefWithVoids within a model. \param profileType [in] OdAnsiString that defines the type of geometry into which this profile definition shall be resolved. \param profileName [in] OdAnsiString that defines name of the profile type according to some standard profile table. \param outerCurve [in] OdDAIObjectId db handle of bounded IfcCurve curve, defining the outer boundaries of the arbitrary profile. \param innerCurves [in] OdDAIObjectIds db handles of bounded IfcCurve curves, defining the inner boundaries of the arbitrary profile. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createArbitraryProfileDefWithVoids(const OdAnsiString & profileType, const OdAnsiString & profileName, const OdDAIObjectId & outerCurve, const OdDAIObjectIds & innerCurves); /** \details Creates an instance of IfcExtrudedAreaSolid within a model. \param sweptArea [in] OdDAIObjectId db handle the surface defining the area to be swept. \param position [in] OdDAIObjectId db handle of IfcAxis2Placement3D position coordinate system for the swept area. \param extrudedDirection [in] OdDAIObjectId db handle of direction in which the surface is to be swept. \param depth [in] the distance the surface is to be swept. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createExtrudedAreaSolid(const OdDAIObjectId & sweptArea, const OdDAIObjectId & position, const OdDAIObjectId & extrudedDirection, double depth); /** \details Creates an instance of IfcHalfSpaceSolid within a model. \param baseSurface [in] OdDAIObjectId db handle of surface defining side of half space. \param agreementFlag [in] Flag indicating whether the normal to the baseSurface points away from the material of the solid. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createHalfSpaceSolid(const OdDAIObjectId & baseSurface, bool agreementFlag); /** \details Creates an instance of IfcPolygonalBoundedHalfSpace within a model. \param baseSurface [in] OdDAIObjectId db handle of surface defining side of half space (must be IfcPlane). \param agreementFlag [in] Flag indicating whether the normal to the baseSurface points away from the material of the solid. \param position [in] OdDAIObjectId db handle of IfcAxis2Placement3D position coordinate system for the polygonal boundary. \param polygonalBoundary [in] OdDAIObjectId db handle of IfcBoundedCurve defining the boundary polygon. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createPolygonalBoundedHalfSpace(const OdDAIObjectId & baseSurface, bool agreementFlag, const OdDAIObjectId& position, const OdDAIObjectId & polygonalBoundary); /** \details Creates an instance of IfcClosedShell within a model. \param cfsFaces [in] OdDAIObjectIds set of faces arcwise connected along common edges or vertices. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createClosedShell(const OdDAIObjectIds & cfsFaces); /** \details Creates an instance of IfcPolyLoop within a model. \param ifcPointsIds [in] OdDAIObjectIds list of points defining the loop. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createPolyLoop(const OdDAIObjectIds & ifcPointsIds); /** \details Creates an instance of IfcFacetedBrep within a model. \param ifcOuterId [in] OdDAIObjectId db handle of closed shell defining the exterior boundary of the solid. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createFacetedBrep(const OdDAIObjectId & ifcOuterId); /** \details Creates an instance of IfcFaceOuterBound within a model. \param ifcLoopId [in] OdDAIObjectId db handle of the loop which will be used as a face boundary. \param bOrientation [in] indicates whether (TRUE) or not (FALSE) the loop has the same sense when used to bound the face as when first defined. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createFaceOuterBound(const OdDAIObjectId & ifcLoopId, bool bOrientation); /** \details Creates an instance of IfcFaceBound within a model. \param ifcLoopId [in] OdDAIObjectId db handle of the loop which will be used as a face boundary. \param bOrientation [in] OdDAIObjectId db handle of closed shell defining the exterior boundary of the solid. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createFaceBound(const OdDAIObjectId& ifcLoopId, bool bOrientation); /** \details Creates an instance of IfcFace within a model. \param ifcPointsIds [in] OdDAIObjectIds set of boundaries of the face. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createFace(const OdDAIObjectIds & ifcPointsIds); }; /** \details Subclass of OdIfcModelFiller that provides extended set of entity material processing). */ class IFCCORE_EXPORT IfcModelMaterialFiller : public OdIfcModelFiller { public: /** \details Default constructor for the IfcModelMaterialFiller class. \param pModel [in] Pointer to an IFC model. */ IfcModelMaterialFiller(OdIfcModel *pModel) : OdIfcModelFiller(pModel) {} /** \details Creates an instance of IfcMaterialLayerSetUsage within a model. \param ifcMaterailSet [in] OdDAIObjectId db handle of the IfcMaterialLayerSet set to which the usage is applied. \param ifcLayerSetDirection [in] OdAnsiString that defines orientation of the material layer set relative to element reference geometry. \param offsetFromReferenceLine [in] offset of the material layer set base line (MlsBase) from reference geometry (line or plane) of element. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createMaterialLayerSetUsage(const OdDAIObjectId ifcMaterailSet, const OdAnsiString& ifcLayerSetDirection, const double & offsetFromReferenceLine); /** \details Creates an instance of IfcMaterialLayer within a model. \param materialId [in] OdDAIObjectId db handle of the reference to the material from which the layer is constructed. \param layerThickness [in] the thickness of the material layer. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createMaterialLayer(const OdDAIObjectId & materialId, double layerThickness); /** \details Creates an instance of IfcMaterial within a model. \param name [in] OdString that determines name of the material.. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createMaterial(const OdString & name); /** \details Creates an instance of IfcMaterialLayerSet within a model. \param materialLayers [in] OdDAIObjectIds set of the layers from which the material layer set is composed. \param layerSetName [in] OdAnsiString that determines name by which the material layer set is known. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createMaterialLayerSet(const OdDAIObjectIds & materialLayers, const OdAnsiString & layerSetName); /** \details Creates an instance of IfcRelAssociatesMaterial within a model. \param relatedObjects [in] OdDAIObjectIds set of objects to which the material is associated. \param relatingMaterial [in] OdDAIObjectId db handle that determines material definition assigned to the elements. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createRelAssociatesMaterial(const OdDAIObjectIds & relatedObjects, const OdDAIObjectId relatingMaterial); /** \details Creates an instance of IfcMaterialList within a model. \param ifcMaterialIds [in] OdDAIObjectIds list of the materials used in a composition of substances. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createMaterialList(const OdDAIObjectIds & ifcMaterialIds); /** \details Creates an instance of IfcMaterialClassificationRelationship within a model. \param materialClassifications [in] OdArray set of the material classifications identifying the type of material. \param classifiedMaterialId [in] OdDAIObjectId db handle of material being classified. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createMaterialClassificationRelationShip(const OdArray& materialClassifications, const OdDAIObjectId & classifiedMaterialId); /** \details Creates an instance of IfcMaterialDefinitionRepresentation within a model. \param representations [in] OdDAIObjectIds list of representations (including shape representations). \param representedMaterial [in] OdDAIObjectId db handle of the material to which the representation applies. \returns A pointer to the created and appended to the model entity. */ OdIfc::OdIfcInstancePtr createMaterialDefinitionRepresentation(const OdDAIObjectIds & representations, const OdDAIObjectId & representedMaterial); protected: std::map m_geometricRepresentationContext; }; #include "TD_PackPop.h" #endif // _IFC_MODEL_OPS_HELPER_H