mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-16 10:34:31 +00:00
Update schema references
This commit is contained in:
@@ -560,6 +560,14 @@ Ifc4x3_rc4::IfcStyledItem* create_styled_item(Ifc4x3_rc4::IfcRepresentationItem*
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
Ifc4x3::IfcStyledItem* create_styled_item(Ifc4x3::IfcRepresentationItem* item, Ifc4x3::IfcPresentationStyle* style) {
|
||||
boost::shared_ptr<aggregate_of<Ifc4x3::IfcPresentationStyle>> styles(new aggregate_of<Ifc4x3::IfcPresentationStyle>());
|
||||
styles->push(style);
|
||||
return new Ifc4x3::IfcStyledItem(item, styles, boost::none);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename Schema>
|
||||
void setSurfaceColour_2x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcRepresentation* rep, typename Schema::IfcPresentationStyleAssignment* style_assignment)
|
||||
{
|
||||
@@ -800,7 +808,32 @@ void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3_rc4::IfcRepre
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
Ifc4x3::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3>& file, double r, double g, double b, double a)
|
||||
{
|
||||
return addStyleAssignment_4x3(file, r, g, b, a);
|
||||
}
|
||||
|
||||
Ifc4x3::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3>& file, Ifc4x3::IfcProductRepresentation* shape, double r, double g, double b, double a)
|
||||
{
|
||||
return setSurfaceColour_4x3(file, shape, r, g, b, a);
|
||||
}
|
||||
|
||||
Ifc4x3::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3>& file, Ifc4x3::IfcRepresentation* shape, double r, double g, double b, double a)
|
||||
{
|
||||
return setSurfaceColour_4x3(file, shape, r, g, b, a);
|
||||
}
|
||||
|
||||
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3>& file, Ifc4x3::IfcProductRepresentation* shape, Ifc4x3::IfcPresentationStyle* style)
|
||||
{
|
||||
setSurfaceColour_4x3(file, shape, style);
|
||||
}
|
||||
|
||||
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3>& file, Ifc4x3::IfcRepresentation* shape, Ifc4x3::IfcPresentationStyle* style)
|
||||
{
|
||||
setSurfaceColour_4x3(file, shape, style);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename Schema>
|
||||
typename Schema::IfcProductDefinitionShape* IfcHierarchyHelper<Schema>::addMappedItem(
|
||||
@@ -923,4 +956,7 @@ template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_rc3>;
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3_rc4
|
||||
template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_rc4>;
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3>;
|
||||
#endif
|
||||
@@ -56,6 +56,9 @@
|
||||
#ifdef HAS_SCHEMA_4x3_rc4
|
||||
#include "../ifcparse/Ifc4x3_rc4.h"
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
#include "../ifcparse/Ifc4x3.h"
|
||||
#endif
|
||||
|
||||
#include "../ifcparse/IfcFile.h"
|
||||
#include "../ifcparse/IfcWrite.h"
|
||||
@@ -238,6 +241,28 @@ namespace {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
Ifc4x3::IfcObjectDefinition* get_parent_of_relation(Ifc4x3::IfcRelContainedInSpatialStructure* t) {
|
||||
return t->RelatingStructure();
|
||||
}
|
||||
|
||||
aggregate_of_instance::ptr get_children_of_relation(Ifc4x3::IfcRelContainedInSpatialStructure* t) {
|
||||
return t->RelatedElements()->generalize();
|
||||
}
|
||||
|
||||
aggregate_of_instance::ptr get_children_of_relation(Ifc4x3::IfcRelAggregates* t) {
|
||||
return t->RelatedObjects()->generalize();
|
||||
}
|
||||
|
||||
void set_children_of_relation(Ifc4x3::IfcRelContainedInSpatialStructure* t, aggregate_of_instance::ptr& cs) {
|
||||
t->setRelatedElements(cs->as<Ifc4x3::IfcProduct>());
|
||||
}
|
||||
|
||||
void set_children_of_relation(Ifc4x3::IfcRelAggregates* t, aggregate_of_instance::ptr& cs) {
|
||||
t->setRelatedObjects(cs->as<Ifc4x3::IfcObjectDefinition>());
|
||||
}
|
||||
#endif
|
||||
|
||||
IfcUtil::IfcBaseClass* get_parent_of_relation(IfcUtil::IfcBaseClass* t) {
|
||||
return *t->data().getArgument(
|
||||
t->declaration().as_entity()->attribute_index("RelatingObject")
|
||||
@@ -464,6 +489,14 @@ IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3
|
||||
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3_rc4::IfcRepresentation* shape, Ifc4x3_rc4::IfcPresentationStyle* style);
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
IFC_PARSE_API Ifc4x3::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3>& file, double r, double g, double b, double a = 1.0);
|
||||
IFC_PARSE_API Ifc4x3::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3>& file, Ifc4x3::IfcProductRepresentation* shape, double r, double g, double b, double a = 1.0);
|
||||
IFC_PARSE_API Ifc4x3::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3>& file, Ifc4x3::IfcRepresentation* shape, double r, double g, double b, double a = 1.0);
|
||||
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3>& file, Ifc4x3::IfcProductRepresentation* shape, Ifc4x3::IfcPresentationStyle* style);
|
||||
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3>& file, Ifc4x3::IfcRepresentation* shape, Ifc4x3::IfcPresentationStyle* style);
|
||||
#endif
|
||||
|
||||
/*
|
||||
template <>
|
||||
inline void IfcHierarchyHelper::addRelatedObject <typename Schema::IfcRelContainedInSpatialStructure> (typename Schema::IfcObjectDefinition* relating_structure,
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
#ifdef HAS_SCHEMA_4x3_rc4
|
||||
#include "../ifcparse/Ifc4x3_rc4.h"
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
#include "../ifcparse/Ifc4x3.h"
|
||||
#endif
|
||||
|
||||
double IfcParse::IfcSIPrefixToValue(const std::string& v) {
|
||||
if ( v == "EXA" ) return 1.e18;
|
||||
@@ -119,6 +122,9 @@ template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc3>(Ifc4x3_rc3
|
||||
#ifdef HAS_SCHEMA_4x3_rc4
|
||||
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc4>(Ifc4x3_rc4::IfcNamedUnit* named_unit);
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3>(Ifc4x3_rc4::IfcNamedUnit* named_unit);
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
@@ -146,5 +152,8 @@ template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc3>(typename I
|
||||
#ifdef HAS_SCHEMA_4x3_rc4
|
||||
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc4>(typename Ifc4x3_rc4::IfcNamedUnit* named_unit);
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3>(typename Ifc4x3::IfcNamedUnit* named_unit);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -116,6 +116,9 @@ void IfcParse::register_schema(schema_definition* s) {
|
||||
#ifdef HAS_SCHEMA_4x3_rc4
|
||||
#include "../ifcparse/Ifc4x3_rc4.h"
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
#include "../ifcparse/Ifc4x3.h"
|
||||
#endif
|
||||
|
||||
const IfcParse::schema_definition* IfcParse::schema_by_name(const std::string& name) {
|
||||
// TODO: initialize automatically somehow
|
||||
@@ -143,6 +146,9 @@ const IfcParse::schema_definition* IfcParse::schema_by_name(const std::string& n
|
||||
#ifdef HAS_SCHEMA_4x3_rc4
|
||||
Ifc4x3_rc4::get_schema();
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
Ifc4x3::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()) {
|
||||
@@ -191,6 +197,9 @@ void IfcParse::clear_schemas() {
|
||||
#ifdef HAS_SCHEMA_4x3_rc4
|
||||
Ifc4x3_rc4::clear_schema();
|
||||
#endif
|
||||
#ifdef HAS_SCHEMA_4x3
|
||||
Ifc4x3::clear_schema();
|
||||
#endif
|
||||
|
||||
// clear any remaining registered schemas
|
||||
// we pop schemas until map is empty, because map iteration is invalidated after each erasure
|
||||
|
||||
Reference in New Issue
Block a user