mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Add IFC4X3_ADD2 schema
This commit is contained in:
@@ -185,6 +185,11 @@ namespace {
|
||||
GET_RELATINGOBJECT_IFC4_VARIANT(Ifc4x3_add1);
|
||||
CREATE_GET_DECOMPOSING_ENTITY(Ifc4x3_add1);
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
GET_RELATINGOBJECT_IFC4_VARIANT(Ifc4x3_add2);
|
||||
CREATE_GET_DECOMPOSING_ENTITY(Ifc4x3_add2);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Declares the schema-based IfcProduct check:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -584,6 +584,14 @@ Ifc4x3_add1::IfcStyledItem* create_styled_item(Ifc4x3_add1::IfcRepresentationIte
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
Ifc4x3_add2::IfcStyledItem* create_styled_item(Ifc4x3_add2::IfcRepresentationItem* item, Ifc4x3_add2::IfcPresentationStyle* style) {
|
||||
boost::shared_ptr<aggregate_of<Ifc4x3_add2::IfcPresentationStyle>> styles(new aggregate_of<Ifc4x3_add2::IfcPresentationStyle>());
|
||||
styles->push(style);
|
||||
return new Ifc4x3_add2::IfcStyledItem(item, styles, boost::none);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename Schema>
|
||||
void setSurfaceColour_2x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcRepresentation* rep, typename Schema::IfcPresentationStyleAssignment* style_assignment)
|
||||
{
|
||||
@@ -905,6 +913,33 @@ void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add1>& file, Ifc4x3_add1::IfcRep
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
Ifc4x3_add2::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_add2>& file, double r, double g, double b, double a)
|
||||
{
|
||||
return addStyleAssignment_4x3(file, r, g, b, a);
|
||||
}
|
||||
|
||||
Ifc4x3_add2::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcProductRepresentation* shape, double r, double g, double b, double a)
|
||||
{
|
||||
return setSurfaceColour_4x3(file, shape, r, g, b, a);
|
||||
}
|
||||
|
||||
Ifc4x3_add2::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcRepresentation* shape, double r, double g, double b, double a)
|
||||
{
|
||||
return setSurfaceColour_4x3(file, shape, r, g, b, a);
|
||||
}
|
||||
|
||||
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcProductRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style)
|
||||
{
|
||||
setSurfaceColour_4x3(file, shape, style);
|
||||
}
|
||||
|
||||
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style)
|
||||
{
|
||||
setSurfaceColour_4x3(file, shape, style);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename Schema>
|
||||
typename Schema::IfcProductDefinitionShape* IfcHierarchyHelper<Schema>::addMappedItem(
|
||||
typename Schema::IfcShapeRepresentation* rep,
|
||||
@@ -1036,3 +1071,6 @@ template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_tc1>;
|
||||
#ifdef HAS_SCHEMA_4x3_add1
|
||||
template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_add1>;
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_add2>;
|
||||
#endif
|
||||
|
||||
@@ -65,6 +65,9 @@
|
||||
#ifdef HAS_SCHEMA_4x3_add1
|
||||
#include "../ifcparse/Ifc4x3_add1.h"
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
#include "../ifcparse/Ifc4x3_add2.h"
|
||||
#endif
|
||||
|
||||
#include "../ifcparse/IfcFile.h"
|
||||
#include "../ifcparse/IfcWrite.h"
|
||||
@@ -313,6 +316,27 @@ namespace {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
Ifc4x3_add2::IfcObjectDefinition* get_parent_of_relation(Ifc4x3_add2::IfcRelContainedInSpatialStructure* t) {
|
||||
return t->RelatingStructure();
|
||||
}
|
||||
|
||||
aggregate_of_instance::ptr get_children_of_relation(Ifc4x3_add2::IfcRelContainedInSpatialStructure* t) {
|
||||
return t->RelatedElements()->generalize();
|
||||
}
|
||||
|
||||
aggregate_of_instance::ptr get_children_of_relation(Ifc4x3_add2::IfcRelAggregates* t) {
|
||||
return t->RelatedObjects()->generalize();
|
||||
}
|
||||
|
||||
void set_children_of_relation(Ifc4x3_add2::IfcRelContainedInSpatialStructure* t, aggregate_of_instance::ptr& cs) {
|
||||
t->setRelatedElements(cs->as<Ifc4x3_add2::IfcProduct>());
|
||||
}
|
||||
|
||||
void set_children_of_relation(Ifc4x3_add2::IfcRelAggregates* t, aggregate_of_instance::ptr& cs) {
|
||||
t->setRelatedObjects(cs->as<Ifc4x3_add2::IfcObjectDefinition>());
|
||||
}
|
||||
#endif
|
||||
|
||||
IfcUtil::IfcBaseClass* get_parent_of_relation(IfcUtil::IfcBaseClass* t) {
|
||||
return *t->data().getArgument(
|
||||
@@ -564,6 +588,14 @@ IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add1>& file, Ifc4x
|
||||
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add1>& file, Ifc4x3_add1::IfcRepresentation* shape, Ifc4x3_add1::IfcPresentationStyle* style);
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_add2>& file, double r, double g, double b, double a = 1.0);
|
||||
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);
|
||||
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);
|
||||
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcProductRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style);
|
||||
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style);
|
||||
#endif
|
||||
|
||||
/*
|
||||
template <>
|
||||
inline void IfcHierarchyHelper::addRelatedObject <typename Schema::IfcRelContainedInSpatialStructure> (typename Schema::IfcObjectDefinition* relating_structure,
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
#ifdef HAS_SCHEMA_4x3_add1
|
||||
#include "../ifcparse/Ifc4x3_add1.h"
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
#include "../ifcparse/Ifc4x3_add2.h"
|
||||
#endif
|
||||
|
||||
double IfcParse::IfcSIPrefixToValue(const std::string& v) {
|
||||
if ( v == "EXA" ) return 1.e18;
|
||||
@@ -133,6 +136,9 @@ template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3>(Ifc4x3::IfcNam
|
||||
#ifdef HAS_SCHEMA_4x3_add1
|
||||
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_add1>(Ifc4x3_add1::IfcNamedUnit* named_unit);
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_add2>(Ifc4x3_add2::IfcNamedUnit* named_unit);
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
@@ -169,5 +175,8 @@ template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_tc1>(typename I
|
||||
#ifdef HAS_SCHEMA_4x3_add1
|
||||
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_add1>(typename Ifc4x3_add1::IfcNamedUnit* named_unit);
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_add2>(typename Ifc4x3_add2::IfcNamedUnit* named_unit);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -124,6 +124,9 @@ void IfcParse::register_schema(schema_definition* s) {
|
||||
#ifdef HAS_SCHEMA_4x3_add1
|
||||
#include "../ifcparse/Ifc4x3_add1.h"
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
#include "../ifcparse/Ifc4x3_add2.h"
|
||||
#endif
|
||||
|
||||
const IfcParse::schema_definition* IfcParse::schema_by_name(const std::string& name) {
|
||||
// TODO: initialize automatically somehow
|
||||
@@ -160,6 +163,9 @@ const IfcParse::schema_definition* IfcParse::schema_by_name(const std::string& n
|
||||
#ifdef HAS_SCHEMA_4x3_add1
|
||||
Ifc4x3_add1::get_schema();
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
Ifc4x3_add2::get_schema();
|
||||
#endif
|
||||
|
||||
std::map<std::string, const IfcParse::schema_definition*>::const_iterator it = schemas.find(boost::to_upper_copy(name));
|
||||
if (it == schemas.end()) {
|
||||
@@ -217,6 +223,9 @@ void IfcParse::clear_schemas() {
|
||||
#ifdef HAS_SCHEMA_4x3_add1
|
||||
Ifc4x3_add1::clear_schema();
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
Ifc4x3_add2::clear_schema();
|
||||
#endif
|
||||
|
||||
// clear any remaining registered schemas
|
||||
// we pop schemas until map is empty, because map iteration is invalidated after each erasure
|
||||
|
||||
@@ -611,7 +611,12 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
|
||||
return helper_fn_create_shape<Ifc4x3_add1>(settings, instance, representation);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
if (schema_name == "IFC4X3_ADD2") {
|
||||
return helper_fn_create_shape<Ifc4x3_add2>(settings, instance, representation);
|
||||
}
|
||||
#endif
|
||||
|
||||
throw IfcParse::IfcException("No geometry support for " + schema_name);
|
||||
}
|
||||
%}
|
||||
|
||||
@@ -119,6 +119,10 @@
|
||||
#ifdef HAS_SCHEMA_4x3_add1
|
||||
#include "../ifcparse/Ifc4x3_add1.h"
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
#include "../ifcparse/Ifc4x3_add2.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "../ifcparse/IfcBaseClass.h"
|
||||
#include "../ifcparse/IfcFile.h"
|
||||
@@ -183,6 +187,9 @@
|
||||
#ifdef HAS_SCHEMA_4x3_add1
|
||||
#include "../ifcparse/Ifc4x3_add1.h"
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_add2
|
||||
#include "../ifcparse/Ifc4x3_add2.h"
|
||||
#endif
|
||||
|
||||
#include "../ifcparse/IfcBaseClass.h"
|
||||
#include "../ifcparse/IfcFile.h"
|
||||
|
||||
Reference in New Issue
Block a user