Skip to content

Commit 5a06715

Browse files
committed
Update examples
1 parent 0cd5c67 commit 5a06715

File tree

5 files changed

+35
-5
lines changed

5 files changed

+35
-5
lines changed

src/examples/IfcAdvancedHouse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int main() {
6060
// The IfcHierarchyHelper is a subclass of the regular IfcFile that provides several
6161
// convenience functions for working with geometry in IFC files.
6262
IfcHierarchyHelper<IfcSchema> file;
63-
file.header().file_name().name("IfcAdvancedHouse.ifc");
63+
file.header().file_name()->setname("IfcAdvancedHouse.ifc");
6464

6565
IfcSchema::IfcBuilding* building = file.addBuilding();
6666
// By adding a building, a hierarchy has been automatically created that consists of the following

src/examples/IfcOpenHouse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ int main() {
6262
// The IfcHierarchyHelper is a subclass of the regular IfcFile that provides several
6363
// convenience functions for working with geometry in IFC files.
6464
IfcHierarchyHelper<IfcSchema> file;
65-
file.header().file_name().name("IfcOpenHouse.ifc");
65+
file.header().file_name()->setname("IfcOpenHouse.ifc");
6666

6767
// Start by adding a wall to the file, initially leaving most attributes blank.
6868
IfcSchema::IfcWallStandardCase* south_wall = new IfcSchema::IfcWallStandardCase(

src/examples/IfcParseExamples.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void process_pset(element_properties& props, const T* inst) {
137137
if (!singleval->NominalValue()) {
138138
propvalue = "-";
139139
} else {
140-
props[*pset->Name()][propname] = format_string(singleval->NominalValue()->template as<IfcUtil::IfcBaseClass>()->data().get_attribute_value(0));
140+
props[*pset->Name()][propname] = format_string(singleval->NominalValue()->template as<IfcUtil::IfcBaseClass>()->get_attribute_value(0));
141141
}
142142
}
143143
}
@@ -149,8 +149,8 @@ void process_pset(element_properties& props, const T* inst) {
149149
auto qs = qset->Quantities();
150150
for (auto it = qs->begin(); it != qs->end(); ++it) {
151151
auto& q = *it;
152-
if (q->template as<typename Schema::IfcPhysicalSimpleQuantity>() && q->data().get_attribute_value(3).type() == IfcUtil::Argument_DOUBLE) {
153-
double v = q->data().get_attribute_value(3);
152+
if (q->template as<typename Schema::IfcPhysicalSimpleQuantity>() && q->get_attribute_value(3).type() == IfcUtil::Argument_DOUBLE) {
153+
double v = q->get_attribute_value(3);
154154
props[*qset->Name()][q->Name()] = std::to_string(v);
155155
}
156156
}

src/ifcparse/IfcHierarchyHelper.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,28 @@ void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add1>& file, Ifc4x3_add1::IfcRep
915915
}
916916
#endif
917917

918+
#ifdef HAS_SCHEMA_4x3_add2
919+
Ifc4x3_add2::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_add2>& file, double r, double g, double b, double a) {
920+
return addStyleAssignment_4x3(file, r, g, b, a);
921+
}
922+
923+
Ifc4x3_add2::IfcPresentationStyle* setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcProductRepresentation* shape, double r, double g, double b, double a) {
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+
return setSurfaceColour_4x3(file, shape, r, g, b, a);
929+
}
930+
931+
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcProductRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style) {
932+
setSurfaceColour_4x3(file, shape, style);
933+
}
934+
935+
void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style) {
936+
setSurfaceColour_4x3(file, shape, style);
937+
}
938+
#endif
939+
918940
template <typename Schema>
919941
typename Schema::IfcProductDefinitionShape* IfcHierarchyHelper<Schema>::addMappedItem(
920942
typename Schema::IfcShapeRepresentation* rep,

src/ifcparse/IfcHierarchyHelper.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,4 +623,12 @@ IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add1>& file, Ifc4x
623623
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add1>& file, Ifc4x3_add1::IfcRepresentation* shape, Ifc4x3_add1::IfcPresentationStyle* style);
624624
#endif
625625

626+
#ifdef HAS_SCHEMA_4x3_add2
627+
IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle* addStyleAssignment(IfcHierarchyHelper<Ifc4x3_add2>& file, double r, double g, double b, double a = 1.0);
628+
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);
629+
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);
630+
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcProductRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style);
631+
IFC_PARSE_API void setSurfaceColour(IfcHierarchyHelper<Ifc4x3_add2>& file, Ifc4x3_add2::IfcRepresentation* shape, Ifc4x3_add2::IfcPresentationStyle* style);
632+
#endif
633+
626634
#endif

0 commit comments

Comments
 (0)