Skip to content

Commit 94db9ec

Browse files
committed
Add IFC4X3_ADD2 schema
1 parent a47c57c commit 94db9ec

12 files changed

Lines changed: 94762 additions & 4 deletions

cmake/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ if(NOT SCHEMA_VERSIONS)
739739
# super arbitrarily try to keep size down at least a little bit
740740
set(SCHEMA_VERSIONS "2x3" "4")
741741
else()
742-
set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3_rc1" "4x3_rc2" "4x3_rc3" "4x3_rc4" "4x3" "4x3_tc1" "4x3_add1")
742+
set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3_rc1" "4x3_rc2" "4x3_rc3" "4x3_rc4" "4x3" "4x3_tc1" "4x3_add1" "4x3_add2")
743743
endif()
744744
endif()
745745

@@ -935,8 +935,6 @@ if(BUILD_CONVERT OR BUILD_IFCPYTHON)
935935
add_library(Serializers ${SERIALIZERS_FILES})
936936
set_target_properties(Serializers PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS" VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
937937

938-
message(STATUS "WITH_PROJ ${WITH_PROJ}")
939-
940938
if (WITH_PROJ)
941939
target_compile_definitions(Serializers PRIVATE "WITH_PROJ")
942940
if (PROJ_STATIC)

src/ifcgeom_schema_agnostic/Kernel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ namespace {
185185
GET_RELATINGOBJECT_IFC4_VARIANT(Ifc4x3_add1);
186186
CREATE_GET_DECOMPOSING_ENTITY(Ifc4x3_add1);
187187
#endif
188+
189+
#ifdef HAS_SCHEMA_4x3_add2
190+
GET_RELATINGOBJECT_IFC4_VARIANT(Ifc4x3_add2);
191+
CREATE_GET_DECOMPOSING_ENTITY(Ifc4x3_add2);
192+
#endif
188193
}
189194

190195
// Declares the schema-based IfcProduct check:

src/ifcparse/Ifc4x3_add2-definitions.h

Lines changed: 4096 additions & 0 deletions
Large diffs are not rendered by default.

src/ifcparse/Ifc4x3_add2-schema.cpp

Lines changed: 17085 additions & 0 deletions
Large diffs are not rendered by default.

src/ifcparse/Ifc4x3_add2.cpp

Lines changed: 23484 additions & 0 deletions
Large diffs are not rendered by default.

src/ifcparse/Ifc4x3_add2.h

Lines changed: 49990 additions & 0 deletions
Large diffs are not rendered by default.

src/ifcparse/IfcHierarchyHelper.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,14 @@ Ifc4x3_add1::IfcStyledItem* create_styled_item(Ifc4x3_add1::IfcRepresentationIte
584584
}
585585
#endif
586586

587+
#ifdef HAS_SCHEMA_4x3_add2
588+
Ifc4x3_add2::IfcStyledItem* create_styled_item(Ifc4x3_add2::IfcRepresentationItem* item, Ifc4x3_add2::IfcPresentationStyle* style) {
589+
boost::shared_ptr<aggregate_of<Ifc4x3_add2::IfcPresentationStyle>> styles(new aggregate_of<Ifc4x3_add2::IfcPresentationStyle>());
590+
styles->push(style);
591+
return new Ifc4x3_add2::IfcStyledItem(item, styles, boost::none);
592+
}
593+
#endif
594+
587595
template <typename Schema>
588596
void setSurfaceColour_2x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcRepresentation* rep, typename Schema::IfcPresentationStyleAssignment* style_assignment)
589597
{
@@ -905,6 +913,33 @@ void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add1>& file, Ifc4x3_add1::IfcRep
905913
}
906914
#endif
907915

916+
#ifdef HAS_SCHEMA_4x3_add2
917+
Ifc4x3_add2::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_add2>& file, double r, double g, double b, double a)
918+
{
919+
return addStyleAssignment_4x3(file, r, g, b, a);
920+
}
921+
922+
Ifc4x3_add2::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcProductRepresentation* shape, double r, double g, double b, double a)
923+
{
924+
return setSurfaceColour_4x3(file, shape, r, g, b, a);
925+
}
926+
927+
Ifc4x3_add2::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcRepresentation* shape, double r, double g, double b, double a)
928+
{
929+
return setSurfaceColour_4x3(file, shape, r, g, b, a);
930+
}
931+
932+
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcProductRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style)
933+
{
934+
setSurfaceColour_4x3(file, shape, style);
935+
}
936+
937+
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style)
938+
{
939+
setSurfaceColour_4x3(file, shape, style);
940+
}
941+
#endif
942+
908943
template <typename Schema>
909944
typename Schema::IfcProductDefinitionShape* IfcHierarchyHelper<Schema>::addMappedItem(
910945
typename Schema::IfcShapeRepresentation* rep,
@@ -1036,3 +1071,6 @@ template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_tc1>;
10361071
#ifdef HAS_SCHEMA_4x3_add1
10371072
template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_add1>;
10381073
#endif
1074+
#ifdef HAS_SCHEMA_4x3_add2
1075+
template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_add2>;
1076+
#endif

src/ifcparse/IfcHierarchyHelper.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@
6565
#ifdef HAS_SCHEMA_4x3_add1
6666
#include "../ifcparse/Ifc4x3_add1.h"
6767
#endif
68+
#ifdef HAS_SCHEMA_4x3_add2
69+
#include "../ifcparse/Ifc4x3_add2.h"
70+
#endif
6871

6972
#include "../ifcparse/IfcFile.h"
7073
#include "../ifcparse/IfcWrite.h"
@@ -313,6 +316,27 @@ namespace {
313316
}
314317
#endif
315318

319+
#ifdef HAS_SCHEMA_4x3_add2
320+
Ifc4x3_add2::IfcObjectDefinition* get_parent_of_relation(Ifc4x3_add2::IfcRelContainedInSpatialStructure* t) {
321+
return t->RelatingStructure();
322+
}
323+
324+
aggregate_of_instance::ptr get_children_of_relation(Ifc4x3_add2::IfcRelContainedInSpatialStructure* t) {
325+
return t->RelatedElements()->generalize();
326+
}
327+
328+
aggregate_of_instance::ptr get_children_of_relation(Ifc4x3_add2::IfcRelAggregates* t) {
329+
return t->RelatedObjects()->generalize();
330+
}
331+
332+
void set_children_of_relation(Ifc4x3_add2::IfcRelContainedInSpatialStructure* t, aggregate_of_instance::ptr& cs) {
333+
t->setRelatedElements(cs->as<Ifc4x3_add2::IfcProduct>());
334+
}
335+
336+
void set_children_of_relation(Ifc4x3_add2::IfcRelAggregates* t, aggregate_of_instance::ptr& cs) {
337+
t->setRelatedObjects(cs->as<Ifc4x3_add2::IfcObjectDefinition>());
338+
}
339+
#endif
316340

317341
IfcUtil::IfcBaseClass* get_parent_of_relation(IfcUtil::IfcBaseClass* t) {
318342
return *t->data().getArgument(
@@ -564,6 +588,14 @@ IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add1>& file, Ifc4x
564588
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add1>& file, Ifc4x3_add1::IfcRepresentation* shape, Ifc4x3_add1::IfcPresentationStyle* style);
565589
#endif
566590

591+
#ifdef HAS_SCHEMA_4x3_add2
592+
IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_add2>& file, double r, double g, double b, double a = 1.0);
593+
IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcProductRepresentation* shape, double r, double g, double b, double a = 1.0);
594+
IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcRepresentation* shape, double r, double g, double b, double a = 1.0);
595+
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcProductRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style);
596+
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style);
597+
#endif
598+
567599
/*
568600
template <>
569601
inline void IfcHierarchyHelper::addRelatedObject <typename Schema::IfcRelContainedInSpatialStructure> (typename Schema::IfcObjectDefinition* relating_structure,

src/ifcparse/IfcSIPrefix.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
#ifdef HAS_SCHEMA_4x3_add1
5353
#include "../ifcparse/Ifc4x3_add1.h"
5454
#endif
55+
#ifdef HAS_SCHEMA_4x3_add2
56+
#include "../ifcparse/Ifc4x3_add2.h"
57+
#endif
5558

5659
double IfcParse::IfcSIPrefixToValue(const std::string& v) {
5760
if ( v == "EXA" ) return 1.e18;
@@ -133,6 +136,9 @@ template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3>(Ifc4x3::IfcNam
133136
#ifdef HAS_SCHEMA_4x3_add1
134137
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_add1>(Ifc4x3_add1::IfcNamedUnit* named_unit);
135138
#endif
139+
#ifdef HAS_SCHEMA_4x3_add2
140+
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_add2>(Ifc4x3_add2::IfcNamedUnit* named_unit);
141+
#endif
136142

137143
#else
138144

@@ -169,5 +175,8 @@ template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_tc1>(typename I
169175
#ifdef HAS_SCHEMA_4x3_add1
170176
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_add1>(typename Ifc4x3_add1::IfcNamedUnit* named_unit);
171177
#endif
178+
#ifdef HAS_SCHEMA_4x3_add2
179+
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_add2>(typename Ifc4x3_add2::IfcNamedUnit* named_unit);
180+
#endif
172181

173182
#endif

src/ifcparse/IfcSchema.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ void IfcParse::register_schema(schema_definition* s) {
124124
#ifdef HAS_SCHEMA_4x3_add1
125125
#include "../ifcparse/Ifc4x3_add1.h"
126126
#endif
127+
#ifdef HAS_SCHEMA_4x3_add2
128+
#include "../ifcparse/Ifc4x3_add2.h"
129+
#endif
127130

128131
const IfcParse::schema_definition* IfcParse::schema_by_name(const std::string& name) {
129132
// TODO: initialize automatically somehow
@@ -160,6 +163,9 @@ const IfcParse::schema_definition* IfcParse::schema_by_name(const std::string& n
160163
#ifdef HAS_SCHEMA_4x3_add1
161164
Ifc4x3_add1::get_schema();
162165
#endif
166+
#ifdef HAS_SCHEMA_4x3_add2
167+
Ifc4x3_add2::get_schema();
168+
#endif
163169

164170
std::map<std::string, const IfcParse::schema_definition*>::const_iterator it = schemas.find(boost::to_upper_copy(name));
165171
if (it == schemas.end()) {
@@ -217,6 +223,9 @@ void IfcParse::clear_schemas() {
217223
#ifdef HAS_SCHEMA_4x3_add1
218224
Ifc4x3_add1::clear_schema();
219225
#endif
226+
#ifdef HAS_SCHEMA_4x3_add2
227+
Ifc4x3_add2::clear_schema();
228+
#endif
220229

221230
// clear any remaining registered schemas
222231
// we pop schemas until map is empty, because map iteration is invalidated after each erasure

0 commit comments

Comments
 (0)