Adds support for 4x3 rc3 and rc4 for IfcParser library

This commit is contained in:
Rick Brice
2021-07-03 21:42:37 -07:00
committed by Thomas Krijnen
parent a73178fe3e
commit c02f270993
18 changed files with 196750 additions and 76 deletions
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
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
+329 -39
View File
@@ -403,55 +403,93 @@ void IfcHierarchyHelper<Schema>::clipRepresentation(typename Schema::IfcRepresen
}
template <typename Schema>
typename Schema::IfcPresentationStyleAssignment* IfcHierarchyHelper<Schema>::addStyleAssignment(double r, double g, double b, double a) {
typename Schema::IfcColourRgb* colour = new typename Schema::IfcColourRgb(boost::none, r, g, b);
typename Schema::IfcSurfaceStyleRendering* rendering = a == 1.0
? new typename Schema::IfcSurfaceStyleRendering(colour, boost::none, 0, 0, 0, 0,
0, 0, Schema::IfcReflectanceMethodEnum::IfcReflectanceMethod_FLAT)
: new typename Schema::IfcSurfaceStyleRendering(colour, 1.0-a, 0, 0, 0, 0,
0, 0, Schema::IfcReflectanceMethodEnum::IfcReflectanceMethod_FLAT);
typename Schema::IfcSurfaceStyle* getSurfaceStyle(IfcHierarchyHelper<Schema>& file, double r, double g, double b, double a = 1.0)
{
typename Schema::IfcColourRgb* colour = new typename Schema::IfcColourRgb(boost::none, r, g, b);
typename Schema::IfcSurfaceStyleRendering* rendering = a == 1.0
? new typename Schema::IfcSurfaceStyleRendering(colour, boost::none, 0, 0, 0, 0,
0, 0, Schema::IfcReflectanceMethodEnum::IfcReflectanceMethod_FLAT)
: new typename Schema::IfcSurfaceStyleRendering(colour, 1.0 - a, 0, 0, 0, 0,
0, 0, Schema::IfcReflectanceMethodEnum::IfcReflectanceMethod_FLAT);
IfcEntityList::ptr styles(new IfcEntityList());
styles->push(rendering);
typename Schema::IfcSurfaceStyle* surface_style = new typename Schema::IfcSurfaceStyle(
boost::none, Schema::IfcSurfaceSide::IfcSurfaceSide_BOTH, styles);
IfcEntityList::ptr surface_styles(new IfcEntityList());
surface_styles->push(surface_style);
typename Schema::IfcPresentationStyleAssignment* style_assignment =
new typename Schema::IfcPresentationStyleAssignment(surface_styles);
addEntity(colour);
addEntity(rendering);
addEntity(surface_style);
addEntity(style_assignment);
return style_assignment;
IfcEntityList::ptr styles(new IfcEntityList());
styles->push(rendering);
typename Schema::IfcSurfaceStyle* surface_style = new typename Schema::IfcSurfaceStyle(
boost::none, Schema::IfcSurfaceSide::IfcSurfaceSide_BOTH, styles);
file.addEntity(colour);
file.addEntity(rendering);
file.addEntity(surface_style);
return surface_style;
}
template<typename Schema>
typename Schema::IfcPresentationStyleAssignment* addStyleAssignment_2x3(IfcHierarchyHelper<Schema>& file, double r, double g, double b, double a = 1.0)
{
auto surface_style = getSurfaceStyle<Schema>(file, r, g, b, a);
IfcEntityList::ptr surface_styles(new IfcEntityList());
surface_styles->push(surface_style);
typename Schema::IfcPresentationStyleAssignment* style_assignment =
new typename Schema::IfcPresentationStyleAssignment(surface_styles);
file.addEntity(style_assignment);
return style_assignment;
}
template<typename Schema>
typename Schema::IfcPresentationStyle* addStyleAssignment_4x3(IfcHierarchyHelper<Schema>& file, double r, double g, double b, double a = 1.0)
{
return getSurfaceStyle<Schema>(file, r, g, b, a);
}
template <typename Schema>
typename Schema::IfcPresentationStyleAssignment* IfcHierarchyHelper<Schema>::setSurfaceColour(
typename Schema::IfcProductRepresentation* shape, double r, double g, double b, double a)
typename Schema::IfcPresentationStyleAssignment* setSurfaceColour_2x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcProductRepresentation* shape, double r, double g, double b, double a)
{
typename Schema::IfcPresentationStyleAssignment* style_assignment = addStyleAssignment(r, g, b, a);
setSurfaceColour(shape, style_assignment);
return style_assignment;
typename Schema::IfcPresentationStyleAssignment* style_assignment = addStyleAssignment_2x3(file, r, g, b, a);
setSurfaceColour_2x3(file, shape, style_assignment);
return style_assignment;
}
template <typename Schema>
typename Schema::IfcPresentationStyleAssignment* IfcHierarchyHelper<Schema>::setSurfaceColour(
typename Schema::IfcRepresentation* shape, double r, double g, double b, double a)
typename Schema::IfcPresentationStyle* setSurfaceColour_4x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcProductRepresentation* shape, double r, double g, double b, double a)
{
typename Schema::IfcPresentationStyleAssignment* style_assignment = addStyleAssignment(r, g, b, a);
setSurfaceColour(shape, style_assignment);
return style_assignment;
typename Schema::IfcPresentationStyle* style_assignment = addStyleAssignment_4x3(file, r, g, b, a);
setSurfaceColour_4x3(file, shape, style_assignment);
return style_assignment;
}
template <typename Schema>
void IfcHierarchyHelper<Schema>::setSurfaceColour(typename Schema::IfcProductRepresentation* shape,
typename Schema::IfcPresentationStyleAssignment* style_assignment)
typename Schema::IfcPresentationStyleAssignment* setSurfaceColour_2x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcRepresentation* shape, double r, double g, double b, double a)
{
typename Schema::IfcRepresentation::list::ptr reps = shape->Representations();
for (typename Schema::IfcRepresentation::list::it j = reps->begin(); j != reps->end(); ++j) {
setSurfaceColour(*j, style_assignment);
}
typename Schema::IfcPresentationStyleAssignment* style_assignment = addStyleAssignment_2x3(file, r, g, b, a);
setSurfaceColour_2x3(file, shape, style_assignment);
return style_assignment;
}
template <typename Schema>
typename Schema::IfcPresentationStyle* setSurfaceColour_4x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcRepresentation* shape, double r, double g, double b, double a)
{
typename Schema::IfcPresentationStyle* style_assignment = addStyleAssignment_4x3(file, r, g, b, a);
setSurfaceColour_4x3(file, shape, style_assignment);
return style_assignment;
}
template <typename Schema>
void setSurfaceColour_2x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcProductRepresentation* shape, typename Schema::IfcPresentationStyleAssignment* style_assignment)
{
typename Schema::IfcRepresentation::list::ptr reps = shape->Representations();
for (typename Schema::IfcRepresentation::list::it j = reps->begin(); j != reps->end(); ++j) {
setSurfaceColour_2x3(file, *j, style_assignment);
}
}
template <typename Schema>
void setSurfaceColour_4x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcProductRepresentation* shape, typename Schema::IfcPresentationStyle* style)
{
typename Schema::IfcRepresentation::list::ptr reps = shape->Representations();
for (typename Schema::IfcRepresentation::list::it j = reps->begin(); j != reps->end(); ++j) {
setSurfaceColour_4x3(file, *j, style);
}
}
#ifdef HAS_SCHEMA_2x3
@@ -502,18 +540,264 @@ Ifc4x3_rc2::IfcStyledItem* create_styled_item(Ifc4x3_rc2::IfcRepresentationItem*
}
#endif
#ifdef HAS_SCHEMA_4x3_rc3
Ifc4x3_rc3::IfcStyledItem* create_styled_item(Ifc4x3_rc3::IfcRepresentationItem* item, Ifc4x3_rc3::IfcPresentationStyle* style) {
boost::shared_ptr<IfcTemplatedEntityList<Ifc4x3_rc3::IfcPresentationStyle>> styles(new IfcTemplatedEntityList<Ifc4x3_rc3::IfcPresentationStyle>());
styles->push(style);
return new Ifc4x3_rc3::IfcStyledItem(item, styles, boost::none);
}
#endif
#ifdef HAS_SCHEMA_4x3_rc4
Ifc4x3_rc4::IfcStyledItem* create_styled_item(Ifc4x3_rc4::IfcRepresentationItem* item, Ifc4x3_rc4::IfcPresentationStyle* style) {
boost::shared_ptr<IfcTemplatedEntityList<Ifc4x3_rc4::IfcPresentationStyle>> styles(new IfcTemplatedEntityList<Ifc4x3_rc4::IfcPresentationStyle>());
styles->push(style);
return new Ifc4x3_rc4::IfcStyledItem(item, styles, boost::none);
}
#endif
template <typename Schema>
void IfcHierarchyHelper<Schema>::setSurfaceColour(typename Schema::IfcRepresentation* rep,
typename Schema::IfcPresentationStyleAssignment* style_assignment)
void setSurfaceColour_2x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcRepresentation* rep, typename Schema::IfcPresentationStyleAssignment* style_assignment)
{
typename Schema::IfcRepresentationItem::list::ptr items = rep->Items();
for (typename Schema::IfcRepresentationItem::list::it i = items->begin(); i != items->end(); ++i) {
typename Schema::IfcRepresentationItem* item = *i;
typename Schema::IfcStyledItem* styled_item = create_styled_item(item, style_assignment);
addEntity(styled_item);
file.addEntity(styled_item);
}
}
template <typename Schema>
void setSurfaceColour_4x3(IfcHierarchyHelper<Schema>& file, typename Schema::IfcRepresentation* rep, typename Schema::IfcPresentationStyle* style)
{
typename Schema::IfcRepresentationItem::list::ptr items = rep->Items();
for (typename Schema::IfcRepresentationItem::list::it i = items->begin(); i != items->end(); ++i) {
typename Schema::IfcRepresentationItem* item = *i;
typename Schema::IfcStyledItem* styled_item = create_styled_item(item, style);
file.addEntity(styled_item);
}
}
#ifdef HAS_SCHEMA_2x3
Ifc2x3::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc2x3>& file, double r, double g, double b, double a)
{
return addStyleAssignment_2x3(file, r, g, b, a);
}
Ifc2x3::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc2x3>& file, Ifc2x3::IfcProductRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
Ifc2x3::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc2x3>& file, Ifc2x3::IfcRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc2x3>& file, Ifc2x3::IfcProductRepresentation* shape, Ifc2x3::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc2x3>& file, Ifc2x3::IfcRepresentation* shape, Ifc2x3::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
#endif
#ifdef HAS_SCHEMA_4
Ifc4::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc4>& file, double r, double g, double b, double a)
{
return addStyleAssignment_2x3(file, r, g, b, a);
}
Ifc4::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4>& file, Ifc4::IfcProductRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
Ifc4::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4>& file, Ifc4::IfcRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4>& file, Ifc4::IfcProductRepresentation* shape, Ifc4::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4>& file, Ifc4::IfcRepresentation* shape, Ifc4::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
#endif
#ifdef HAS_SCHEMA_4x1
Ifc4x1::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc4x1>& file, double r, double g, double b, double a)
{
return addStyleAssignment_2x3(file, r, g, b, a);
}
Ifc4x1::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x1>& file, Ifc4x1::IfcProductRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
Ifc4x1::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x1>& file, Ifc4x1::IfcRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x1>& file, Ifc4x1::IfcProductRepresentation* shape, Ifc4x1::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x1>& file, Ifc4x1::IfcRepresentation* shape, Ifc4x1::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
#endif
#ifdef HAS_SCHEMA_4x2
Ifc4x2::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc4x2>& file, double r, double g, double b, double a)
{
return addStyleAssignment_2x3(file, r, g, b, a);
}
Ifc4x2::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x2>& file, Ifc4x2::IfcProductRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
Ifc4x2::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x2>& file, Ifc4x2::IfcRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x2>& file, Ifc4x2::IfcProductRepresentation* shape, Ifc4x2::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x2>& file, Ifc4x2::IfcRepresentation* shape, Ifc4x2::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
#endif
#ifdef HAS_SCHEMA_4x3_rc1
Ifc4x3_rc1::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_rc1>& file, double r, double g, double b, double a)
{
return addStyleAssignment_2x3(file, r, g, b, a);
}
Ifc4x3_rc1::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc1>& file, Ifc4x3_rc1::IfcProductRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
Ifc4x3_rc1::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc1>& file, Ifc4x3_rc1::IfcRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc1>& file, Ifc4x3_rc1::IfcProductRepresentation* shape, Ifc4x3_rc1::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc1>& file, Ifc4x3_rc1::IfcRepresentation* shape, Ifc4x3_rc1::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
#endif
#ifdef HAS_SCHEMA_4x3_rc2
Ifc4x3_rc2::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_rc2>& file, double r, double g, double b, double a)
{
return addStyleAssignment_2x3(file, r, g, b, a);
}
Ifc4x3_rc2::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc2>& file, Ifc4x3_rc2::IfcProductRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
Ifc4x3_rc2::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc2>& file, Ifc4x3_rc2::IfcRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_2x3(file, shape, r, g, b, a);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc2>& file, Ifc4x3_rc2::IfcProductRepresentation* shape, Ifc4x3_rc2::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc2>& file, Ifc4x3_rc2::IfcRepresentation* shape, Ifc4x3_rc2::IfcPresentationStyleAssignment* style_assignment)
{
setSurfaceColour_2x3(file, shape, style_assignment);
}
#endif
#ifdef HAS_SCHEMA_4x3_rc3
Ifc4x3_rc3::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_rc3>& file, double r, double g, double b, double a)
{
return addStyleAssignment_4x3(file, r, g, b, a);
}
Ifc4x3_rc3::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc3>& file, Ifc4x3_rc3::IfcProductRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_4x3(file, shape, r, g, b, a);
}
Ifc4x3_rc3::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc3>& file, Ifc4x3_rc3::IfcRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_4x3(file, shape, r, g, b, a);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc3>& file, Ifc4x3_rc3::IfcProductRepresentation* shape, Ifc4x3_rc3::IfcPresentationStyle* style)
{
setSurfaceColour_4x3(file, shape, style);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc3>& file, Ifc4x3_rc3::IfcRepresentation* shape, Ifc4x3_rc3::IfcPresentationStyle* style)
{
setSurfaceColour_4x3(file, shape, style);
}
#endif
#ifdef HAS_SCHEMA_4x3_rc4
Ifc4x3_rc4::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_rc4>& file, double r, double g, double b, double a)
{
return addStyleAssignment_4x3(file, r, g, b, a);
}
Ifc4x3_rc4::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3_rc4::IfcProductRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_4x3(file, shape, r, g, b, a);
}
Ifc4x3_rc4::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3_rc4::IfcRepresentation* shape, double r, double g, double b, double a)
{
return setSurfaceColour_4x3(file, shape, r, g, b, a);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3_rc4::IfcProductRepresentation* shape, Ifc4x3_rc4::IfcPresentationStyle* style)
{
setSurfaceColour_4x3(file, shape, style);
}
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3_rc4::IfcRepresentation* shape, Ifc4x3_rc4::IfcPresentationStyle* style)
{
setSurfaceColour_4x3(file, shape, style);
}
#endif
template <typename Schema>
typename Schema::IfcProductDefinitionShape* IfcHierarchyHelper<Schema>::addMappedItem(
typename Schema::IfcShapeRepresentation* rep,
@@ -612,3 +896,9 @@ template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_rc1>;
#ifdef HAS_SCHEMA_4x3_rc2
template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_rc2>;
#endif
#ifdef HAS_SCHEMA_4x3_rc3
template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_rc3>;
#endif
#ifdef HAS_SCHEMA_4x3_rc4
template IFC_PARSE_API class IfcHierarchyHelper<Ifc4x3_rc4>;
#endif
+114 -15
View File
@@ -50,7 +50,12 @@
#ifdef HAS_SCHEMA_4x3_rc2
#include "../ifcparse/Ifc4x3_rc2.h"
#endif
#ifdef HAS_SCHEMA_4x3_rc3
#include "../ifcparse/Ifc4x3_rc3.h"
#endif
#ifdef HAS_SCHEMA_4x3_rc4
#include "../ifcparse/Ifc4x3_rc4.h"
#endif
#include "../ifcparse/IfcFile.h"
#include "../ifcparse/IfcWrite.h"
@@ -189,6 +194,50 @@ namespace {
}
#endif
#ifdef HAS_SCHEMA_4x3_rc3
Ifc4x3_rc3::IfcObjectDefinition* get_parent_of_relation(Ifc4x3_rc3::IfcRelContainedInSpatialStructure* t) {
return t->RelatingStructure();
}
IfcEntityList::ptr get_children_of_relation(Ifc4x3_rc3::IfcRelContainedInSpatialStructure* t) {
return t->RelatedElements()->generalize();
}
IfcEntityList::ptr get_children_of_relation(Ifc4x3_rc3::IfcRelAggregates* t) {
return t->RelatedObjects()->generalize();
}
void set_children_of_relation(Ifc4x3_rc3::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) {
t->setRelatedElements(cs->as<Ifc4x3_rc3::IfcProduct>());
}
void set_children_of_relation(Ifc4x3_rc3::IfcRelAggregates* t, IfcEntityList::ptr& cs) {
t->setRelatedObjects(cs->as<Ifc4x3_rc3::IfcObjectDefinition>());
}
#endif
#ifdef HAS_SCHEMA_4x3_rc4
Ifc4x3_rc4::IfcObjectDefinition* get_parent_of_relation(Ifc4x3_rc4::IfcRelContainedInSpatialStructure* t) {
return t->RelatingStructure();
}
IfcEntityList::ptr get_children_of_relation(Ifc4x3_rc4::IfcRelContainedInSpatialStructure* t) {
return t->RelatedElements()->generalize();
}
IfcEntityList::ptr get_children_of_relation(Ifc4x3_rc4::IfcRelAggregates* t) {
return t->RelatedObjects()->generalize();
}
void set_children_of_relation(Ifc4x3_rc4::IfcRelContainedInSpatialStructure* t, IfcEntityList::ptr& cs) {
t->setRelatedElements(cs->as<Ifc4x3_rc4::IfcProduct>());
}
void set_children_of_relation(Ifc4x3_rc4::IfcRelAggregates* t, IfcEntityList::ptr& cs) {
t->setRelatedObjects(cs->as<Ifc4x3_rc4::IfcObjectDefinition>());
}
#endif
IfcUtil::IfcBaseClass* get_parent_of_relation(IfcUtil::IfcBaseClass* t) {
return *t->data().getArgument(
t->declaration().as_entity()->attribute_index("RelatingObject")
@@ -336,20 +385,6 @@ public:
void clipRepresentation(typename Schema::IfcRepresentation* shape,
typename Schema::IfcAxis2Placement3D* place, bool agree);
typename Schema::IfcPresentationStyleAssignment* addStyleAssignment(double r, double g, double b, double a=1.0);
typename Schema::IfcPresentationStyleAssignment* setSurfaceColour(typename Schema::IfcProductRepresentation* shape,
double r, double g, double b, double a=1.0);
typename Schema::IfcPresentationStyleAssignment* setSurfaceColour(typename Schema::IfcRepresentation* shape,
double r, double g, double b, double a=1.0);
void setSurfaceColour(typename Schema::IfcProductRepresentation* shape,
typename Schema::IfcPresentationStyleAssignment* style_assignment);
void setSurfaceColour(typename Schema::IfcRepresentation* shape,
typename Schema::IfcPresentationStyleAssignment* style_assignment);
typename Schema::IfcProductDefinitionShape* addMappedItem(typename Schema::IfcShapeRepresentation*,
typename Schema::IfcCartesianTransformationOperator3D* transform = 0,
typename Schema::IfcProductDefinitionShape* def = 0);
@@ -365,6 +400,70 @@ private:
std::map<std::string, typename Schema::IfcGeometricRepresentationContext*> contexts;
};
#ifdef HAS_SCHEMA_2x3
IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc2x3>& file, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc2x3>& file, Ifc2x3::IfcProductRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc2x3>& file, Ifc2x3::IfcRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc2x3>& file, Ifc2x3::IfcProductRepresentation* shape, Ifc2x3::IfcPresentationStyleAssignment* style_assignment);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc2x3>& file, Ifc2x3::IfcRepresentation* shape, Ifc2x3::IfcPresentationStyleAssignment* style_assignment);
#endif
#ifdef HAS_SCHEMA_4
IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc4>& file, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4>& file, Ifc4::IfcProductRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4>& file, Ifc4::IfcRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4>& file, Ifc4::IfcProductRepresentation* shape, Ifc4::IfcPresentationStyleAssignment* style_assignment);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4>& file, Ifc4::IfcRepresentation* shape, Ifc4::IfcPresentationStyleAssignment* style_assignment);
#endif
#ifdef HAS_SCHEMA_4x1
IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc4x1>& file, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x1>& file, Ifc4x1::IfcProductRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x1>& file, Ifc4x1::IfcRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x1>& file, Ifc4x1::IfcProductRepresentation* shape, Ifc4x1::IfcPresentationStyleAssignment* style_assignment);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x1>& file, Ifc4x1::IfcRepresentation* shape, Ifc4x1::IfcPresentationStyleAssignment* style_assignment);
#endif
#ifdef HAS_SCHEMA_4x2
IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc4x2>& file, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x2>& file, Ifc4x2::IfcProductRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x2>& file, Ifc4x2::IfcRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x2>& file, Ifc4x2::IfcProductRepresentation* shape, Ifc4x2::IfcPresentationStyleAssignment* style_assignment);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x2>& file, Ifc4x2::IfcRepresentation* shape, Ifc4x2::IfcPresentationStyleAssignment* style_assignment);
#endif
#ifdef HAS_SCHEMA_4x3_rc1
IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_rc1>& file, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc1>& file, Ifc4x3_rc1::IfcProductRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc1>& file, Ifc4x3_rc1::IfcRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc1>& file, Ifc4x3_rc1::IfcProductRepresentation* shape, Ifc4x3_rc1::IfcPresentationStyleAssignment* style_assignment);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc1>& file, Ifc4x3_rc1::IfcRepresentation* shape, Ifc4x3_rc1::IfcPresentationStyleAssignment* style_assignment);
#endif
#ifdef HAS_SCHEMA_4x3_rc2
IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_rc2>& file, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc2>& file, Ifc4x3_rc2::IfcProductRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc2>& file, Ifc4x3_rc2::IfcRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc2>& file, Ifc4x3_rc2::IfcProductRepresentation* shape, Ifc4x3_rc2::IfcPresentationStyleAssignment* style_assignment);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc2>& file, Ifc4x3_rc2::IfcRepresentation* shape, Ifc4x3_rc2::IfcPresentationStyleAssignment* style_assignment);
#endif
#ifdef HAS_SCHEMA_4x3_rc3
IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_rc3>& file, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc3>& file, Ifc4x3_rc3::IfcProductRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc3>& file, Ifc4x3_rc3::IfcRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc3>& file, Ifc4x3_rc3::IfcProductRepresentation* shape, Ifc4x3_rc3::IfcPresentationStyle* style);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc3>& file, Ifc4x3_rc3::IfcRepresentation* shape, Ifc4x3_rc3::IfcPresentationStyle* style);
#endif
#ifdef HAS_SCHEMA_4x3_rc4
IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_rc4>& file, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3_rc4::IfcProductRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3_rc4::IfcRepresentation* shape, double r, double g, double b, double a = 1.0);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3_rc4::IfcProductRepresentation* shape, Ifc4x3_rc4::IfcPresentationStyle* style);
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_rc4>& file, Ifc4x3_rc4::IfcRepresentation* shape, Ifc4x3_rc4::IfcPresentationStyle* style);
#endif
/*
template <>
inline void IfcHierarchyHelper::addRelatedObject <typename Schema::IfcRelContainedInSpatialStructure> (typename Schema::IfcObjectDefinition* relating_structure,
+18
View File
@@ -37,6 +37,12 @@
#ifdef HAS_SCHEMA_4x3_rc2
#include "../ifcparse/Ifc4x3_rc2.h"
#endif
#ifdef HAS_SCHEMA_4x3_rc3
#include "../ifcparse/Ifc4x3_rc3.h"
#endif
#ifdef HAS_SCHEMA_4x3_rc4
#include "../ifcparse/Ifc4x3_rc4.h"
#endif
double IfcParse::IfcSIPrefixToValue(const std::string& v) {
if ( v == "EXA" ) return 1.e18;
@@ -107,6 +113,12 @@ template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc1>(Ifc4x3_rc1
#ifdef HAS_SCHEMA_4x3_rc2
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc2>(Ifc4x3_rc2::IfcNamedUnit* named_unit);
#endif
#ifdef HAS_SCHEMA_4x3_rc3
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc3>(Ifc4x3_rc3::IfcNamedUnit* named_unit);
#endif
#ifdef HAS_SCHEMA_4x3_rc4
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc4>(Ifc4x3_rc4::IfcNamedUnit* named_unit);
#endif
#else
@@ -128,5 +140,11 @@ template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc1>(typename I
#ifdef HAS_SCHEMA_4x3_rc2
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc2>(typename Ifc4x3_rc2::IfcNamedUnit* named_unit);
#endif
#ifdef HAS_SCHEMA_4x3_rc3
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc3>(typename Ifc4x3_rc3::IfcNamedUnit* named_unit);
#endif
#ifdef HAS_SCHEMA_4x3_rc4
template double IFC_PARSE_API IfcParse::get_SI_equivalent<Ifc4x3_rc4>(typename Ifc4x3_rc4::IfcNamedUnit* named_unit);
#endif
#endif
+12
View File
@@ -94,6 +94,12 @@ void IfcParse::register_schema(schema_definition* s) {
#ifdef HAS_SCHEMA_4x3_rc2
#include "../ifcparse/Ifc4x3_rc2.h"
#endif
#ifdef HAS_SCHEMA_4x3_rc3
#include "../ifcparse/Ifc4x3_rc3.h"
#endif
#ifdef HAS_SCHEMA_4x3_rc4
#include "../ifcparse/Ifc4x3_rc4.h"
#endif
const IfcParse::schema_definition* IfcParse::schema_by_name(const std::string& name) {
// TODO: initialize automatically somehow
@@ -115,6 +121,12 @@ const IfcParse::schema_definition* IfcParse::schema_by_name(const std::string& n
#ifdef HAS_SCHEMA_4x3_rc2
Ifc4x3_rc2::get_schema();
#endif
#ifdef HAS_SCHEMA_4x3_rc3
Ifc4x3_rc3::get_schema();
#endif
#ifdef HAS_SCHEMA_4x3_rc4
Ifc4x3_rc4::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()) {