/******************************************************************************** * * * This file is part of IfcOpenShell. * * * * IfcOpenShell is free software: you can redistribute it and/or modify * * it under the terms of the Lesser GNU General Public License as published by * * the Free Software Foundation, either version 3.0 of the License, or * * (at your option) any later version. * * * * IfcOpenShell is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * Lesser GNU General Public License for more details. * * * * You should have received a copy of the Lesser GNU General Public License * * along with this program. If not, see . * * * ********************************************************************************/ /******************************************************************************** * * * This class is a subclass of the regular IfcFile class that implements * * several convenience functions for creating geometrical representations and * * spatial containers. * * * ********************************************************************************/ #ifndef IFCHIERARCHYHELPER_H #define IFCHIERARCHYHELPER_H #include "ifc_parse_api.h" #include "IfcLogger.h" #include #ifdef HAS_SCHEMA_2x3 #include "Ifc2x3.h" #endif #ifdef HAS_SCHEMA_4 #include "Ifc4.h" #endif #ifdef HAS_SCHEMA_4x1 #include "Ifc4x1.h" #endif #ifdef HAS_SCHEMA_4x2 #include "Ifc4x2.h" #endif #ifdef HAS_SCHEMA_4x3_rc1 #include "Ifc4x3_rc1.h" #endif #ifdef HAS_SCHEMA_4x3_rc2 #include "Ifc4x3_rc2.h" #endif #ifdef HAS_SCHEMA_4x3_rc3 #include "Ifc4x3_rc3.h" #endif #ifdef HAS_SCHEMA_4x3_rc4 #include "Ifc4x3_rc4.h" #endif #ifdef HAS_SCHEMA_4x3 #include "Ifc4x3.h" #endif #ifdef HAS_SCHEMA_4x3_tc1 #include "Ifc4x3_tc1.h" #endif #ifdef HAS_SCHEMA_4x3_add1 #include "Ifc4x3_add1.h" #endif #ifdef HAS_SCHEMA_4x3_add2 #include "Ifc4x3_add2.h" #endif #include "IfcFile.h" #include "IfcGlobalId.h" #include "IfcWrite.h" namespace { #ifdef HAS_SCHEMA_2x3 Ifc2x3::IfcObjectDefinition get_parent_of_relation(const Ifc2x3::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc2x3::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc2x3::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc2x3::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc2x3::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4 Ifc4::IfcObjectDefinition get_parent_of_relation(const Ifc4::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4x1 Ifc4x1::IfcObjectDefinition get_parent_of_relation(const Ifc4x1::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4x1::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4x1::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4x1::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4x1::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4x2 Ifc4x2::IfcObjectDefinition get_parent_of_relation(const Ifc4x2::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4x2::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4x2::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4x2::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4x2::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4x3_rc1 Ifc4x3_rc1::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc1::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4x3_rc1::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4x3_rc1::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4x3_rc1::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4x3_rc1::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4x3_rc2 Ifc4x3_rc2::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc2::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4x3_rc2::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4x3_rc2::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4x3_rc2::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4x3_rc2::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4x3_rc3 Ifc4x3_rc3::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc3::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4x3_rc3::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4x3_rc3::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4x3_rc3::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4x3_rc3::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4x3_rc4 Ifc4x3_rc4::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc4::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4x3_rc4::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4x3_rc4::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4x3_rc4::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4x3_rc4::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4x3 Ifc4x3::IfcObjectDefinition get_parent_of_relation(const Ifc4x3::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4x3::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4x3::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4x3::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4x3::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4x3_tc1 Ifc4x3_tc1::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_tc1::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4x3_tc1::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4x3_tc1::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4x3_tc1::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4x3_tc1::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4x3_add1 Ifc4x3_add1::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_add1::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4x3_add1::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4x3_add1::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4x3_add1::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4x3_add1::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif #ifdef HAS_SCHEMA_4x3_add2 Ifc4x3_add2::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_add2::IfcRelContainedInSpatialStructure& t) { return t.RelatingStructure(); } std::vector get_children_of_relation(const Ifc4x3_add2::IfcRelContainedInSpatialStructure& t) { return cast_vector(t.RelatedElements()); } std::vector get_children_of_relation(const Ifc4x3_add2::IfcRelAggregates& t) { return cast_vector(t.RelatedObjects()); } std::vector get_children_of_relation(const Ifc4x3_add2::IfcRelNests& t) { return cast_vector(t.RelatedObjects()); } void set_children_of_relation(Ifc4x3_add2::IfcRelContainedInSpatialStructure& t, std::vector& cs) { t.setRelatedElements(cast_vector(cs)); } void set_children_of_relation(Ifc4x3_add2::IfcRelAggregates& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } void set_children_of_relation(Ifc4x3_add2::IfcRelNests& t, std::vector& cs) { t.setRelatedObjects(cast_vector(cs)); } #endif express::Base get_parent_of_relation(const express::Base& t) { return t.as().get("RelatingObject"); } std::vector get_children_of_relation(const express::Base& t) { return t.as().get("RelatedElements"); } void set_children_of_relation(express::Base& t, std::vector& cs) { return t.set_attribute_value("RelatedElements", cs); } } // namespace template class IFC_PARSE_API IfcHierarchyHelper : public IfcParse::IfcFile { public: IfcHierarchyHelper() : IfcParse::IfcFile(&Schema::get_schema()) {} template T addTriplet(double x, double y, double z) { auto t = create(); t.set_attribute_value(0, std::vector{x, y, z}); return t; } template T addDoublet(double x, double y) { auto t = create(); t.set_attribute_value(0, std::vector{x, y}); return t; } template T addValue(U v) { auto measure = create(); measure.set_attribute_value(0, v); return measure; } template T getSingle() { auto ts = instances_by_type(); if (ts.size() != 1) { return T{}; } return ts.front(); } typename Schema::IfcAxis2Placement3D addPlacement3d(double ox = 0.0, double oy = 0.0, double oz = 0.0, double zx = 0.0, double zy = 0.0, double zz = 1.0, double xx = 1.0, double xy = 0.0, double xz = 0.0); typename Schema::IfcAxis2Placement2D addPlacement2d(double ox = 0.0, double oy = 0.0, double xx = 1.0, double xy = 0.0); typename Schema::IfcLocalPlacement addLocalPlacement(typename Schema::IfcObjectPlacement parent = typename Schema::IfcObjectPlacement{}, double ox = 0.0, double oy = 0.0, double oz = 0.0, double zx = 0.0, double zy = 0.0, double zz = 1.0, double xx = 1.0, double xy = 0.0, double xz = 0.0); template void addRelatedObject(const typename Schema::IfcObjectDefinition& relating_object, const typename Schema::IfcObjectDefinition& related_object, typename Schema::IfcOwnerHistory owner_hist = typename Schema::IfcOwnerHistory{}) { if constexpr (std::is_same_v) { auto li = instances_by_type(); bool found = false; for (auto & rel : li) { if (rel.RelatingType() == relating_object) { auto objects = rel.RelatedObjects(); objects.push_back(addEntity(related_object).template as()); rel.setRelatedObjects(objects); found = true; break; } } if (!found) { if (!owner_hist) { owner_hist = getSingle(); } if (!owner_hist) { owner_hist = addOwnerHistory(); } std::vector related_objects = {related_object.template as()}; auto t = create(); t.setGlobalId(IfcParse::IfcGlobalId()); t.setOwnerHistory(owner_hist); t.setRelatedObjects(related_objects); t.setRelatingType(relating_object.template as()); } } else { auto li = instances_by_type(); bool found = false; for (auto& rel : li) { try { if (get_parent_of_relation(rel) == relating_object) { auto products = get_children_of_relation(rel); products.push_back(addEntity(related_object)); set_children_of_relation(rel, products); found = true; break; } } catch (std::exception& e) { Logger::Error(e); } catch (...) { Logger::Error("Unknown error in addRelatedObject()"); } } if (!found) { if (!owner_hist) { owner_hist = getSingle(); } if (!owner_hist) { owner_hist = addOwnerHistory(); } std::vector related_objects; related_objects.push_back(related_object); T t = create(); t.set_attribute_value(0, (std::string)IfcParse::IfcGlobalId()); t.set_attribute_value(1, owner_hist); int relating_index = 4; int related_index = 5; if (T::Class().name() == "IfcRelContainedInSpatialStructure" || std::is_base_of::value) { // some classes have attributes reversed. std::swap(relating_index, related_index); } t.set_attribute_value(relating_index, relating_object); t.set_attribute_value(related_index, related_objects); } } } typename Schema::IfcOwnerHistory addOwnerHistory(); typename Schema::IfcProject addProject(typename Schema::IfcOwnerHistory owner_hist = typename Schema::IfcOwnerHistory{}); void relatePlacements(typename Schema::IfcProduct parent, typename Schema::IfcProduct product); typename Schema::IfcSite addSite(typename Schema::IfcProject = typename Schema::IfcProject{}, typename Schema::IfcOwnerHistory = typename Schema::IfcOwnerHistory{}); typename Schema::IfcBuilding addBuilding(typename Schema::IfcSite site = typename Schema::IfcSite{}, typename Schema::IfcOwnerHistory owner_hist = typename Schema::IfcOwnerHistory{}); typename Schema::IfcBuildingStorey addBuildingStorey(typename Schema::IfcBuilding building = typename Schema::IfcBuilding{}, typename Schema::IfcOwnerHistory owner_hist = typename Schema::IfcOwnerHistory{}); typename Schema::IfcBuildingStorey addBuildingProduct(typename Schema::IfcProduct product, typename Schema::IfcBuildingStorey storey = typename Schema::IfcBuildingStorey{}, typename Schema::IfcOwnerHistory owner_hist = typename Schema::IfcOwnerHistory{}); void addExtrudedPolyline(typename Schema::IfcShapeRepresentation rep, const std::vector>& points, double h, typename Schema::IfcAxis2Placement2D place = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D place2 = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection dir = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); typename Schema::IfcProductDefinitionShape addExtrudedPolyline(const std::vector>& points, double h, typename Schema::IfcAxis2Placement2D place = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D place2 = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection dir = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); void addBox(typename Schema::IfcShapeRepresentation rep, double w, double d, double h, typename Schema::IfcAxis2Placement2D place = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D place2 = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection dir = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); typename Schema::IfcProductDefinitionShape addBox(double w, double d, double h, typename Schema::IfcAxis2Placement2D place = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D place2 = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection dir = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); void addAxis(typename Schema::IfcShapeRepresentation rep, double l, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); typename Schema::IfcProductDefinitionShape addAxisBox(double w, double d, double h, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); void clipRepresentation(typename Schema::IfcProductRepresentation shape, typename Schema::IfcAxis2Placement3D place, bool agree); void clipRepresentation(typename Schema::IfcRepresentation shape, typename Schema::IfcAxis2Placement3D place, bool agree); typename Schema::IfcProductDefinitionShape addMappedItem(typename Schema::IfcShapeRepresentation, typename Schema::IfcCartesianTransformationOperator3D transform = typename Schema::IfcCartesianTransformationOperator3D{}, typename Schema::IfcProductDefinitionShape def = typename Schema::IfcProductDefinitionShape{}); typename Schema::IfcProductDefinitionShape addMappedItem(std::vector&, typename Schema::IfcCartesianTransformationOperator3D transform = typename Schema::IfcCartesianTransformationOperator3D{}); typename Schema::IfcShapeRepresentation addEmptyRepresentation(const std::string& repid = "Body", const std::string& reptype = "SweptSolid"); typename Schema::IfcGeometricRepresentationContext getRepresentationContext(const std::string&); typename Schema::IfcGeometricRepresentationSubContext getRepresentationSubContext(const std::string& ident, const std::string& type); private: std::map contexts_; }; #ifdef HAS_SCHEMA_2x3 IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc2x3::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc2x3::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc2x3::IfcProductRepresentation& shape, const Ifc2x3::IfcPresentationStyleAssignment& style_assignment); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc2x3::IfcRepresentation& shape, const Ifc2x3::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4 IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc4::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc4::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4::IfcProductRepresentation& shape, const Ifc4::IfcPresentationStyleAssignment& style_assignment); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4::IfcRepresentation& shape, const Ifc4::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4x1 IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x1::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x1::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x1::IfcProductRepresentation& shape, const Ifc4x1::IfcPresentationStyleAssignment& style_assignment); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x1::IfcRepresentation& shape, const Ifc4x1::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4x2 IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x2::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x2::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x2::IfcProductRepresentation& shape, const Ifc4x2::IfcPresentationStyleAssignment& style_assignment); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x2::IfcRepresentation& shape, const Ifc4x2::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4x3_rc1 IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc1::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc1::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc1::IfcProductRepresentation& shape, const Ifc4x3_rc1::IfcPresentationStyleAssignment& style_assignment); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc1::IfcRepresentation& shape, const Ifc4x3_rc1::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4x3_rc2 IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc2::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc2::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc2::IfcProductRepresentation& shape, const Ifc4x3_rc2::IfcPresentationStyleAssignment& style_assignment); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc2::IfcRepresentation& shape, const Ifc4x3_rc2::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4x3_rc3 IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc3::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc3::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc3::IfcProductRepresentation& shape, const Ifc4x3_rc3::IfcPresentationStyle& style); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc3::IfcRepresentation& shape, const Ifc4x3_rc3::IfcPresentationStyle& style); #endif #ifdef HAS_SCHEMA_4x3_rc4 IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc4::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc4::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc4::IfcProductRepresentation& shape, const Ifc4x3_rc4::IfcPresentationStyle& style); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_rc4::IfcRepresentation& shape, const Ifc4x3_rc4::IfcPresentationStyle& style); #endif #ifdef HAS_SCHEMA_4x3 IFC_PARSE_API Ifc4x3::IfcPresentationStyle addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3::IfcProductRepresentation& shape, const Ifc4x3::IfcPresentationStyle& style); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3::IfcRepresentation& shape, const Ifc4x3::IfcPresentationStyle& style); #endif #ifdef HAS_SCHEMA_4x3_tc1 IFC_PARSE_API Ifc4x3_tc1::IfcPresentationStyle addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_tc1::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_tc1::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_tc1::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_tc1::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_tc1::IfcProductRepresentation& shape, const Ifc4x3_tc1::IfcPresentationStyle& style); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_tc1::IfcRepresentation& shape, const Ifc4x3_tc1::IfcPresentationStyle& style); #endif #ifdef HAS_SCHEMA_4x3_add1 IFC_PARSE_API Ifc4x3_add1::IfcPresentationStyle addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_add1::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_add1::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_add1::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_add1::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_add1::IfcProductRepresentation& shape, const Ifc4x3_add1::IfcPresentationStyle& style); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_add1::IfcRepresentation& shape, const Ifc4x3_add1::IfcPresentationStyle& style); #endif #ifdef HAS_SCHEMA_4x3_add2 IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle addStyleAssignment(IfcHierarchyHelper& file, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_add2::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_add2::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_add2::IfcProductRepresentation& shape, const Ifc4x3_add2::IfcPresentationStyle& style); IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper& file, const Ifc4x3_add2::IfcRepresentation& shape, const Ifc4x3_add2::IfcPresentationStyle& style); #endif #endif