@@ -107,8 +107,7 @@ int main() {
107107 south_wall->setObjectPlacement (file.addLocalPlacement (storey_placement));
108108
109109 // A pale white colour is assigned to the wall.
110- IfcSchema::IfcPresentationStyleAssignment* wall_colour = file.setSurfaceColour (
111- south_wall_shape, 0.75 , 0.73 , 0.68 );
110+ IfcSchema::IfcPresentationStyleAssignment* wall_colour = setSurfaceColour (file, south_wall_shape, 0.75 , 0.73 , 0.68 );
112111
113112 // Now create a footing for the wall to rest on.
114113 IfcSchema::IfcFooting* footing = new IfcSchema::IfcFooting (guid (), file.getSingle <IfcSchema::IfcOwnerHistory>(),
@@ -122,7 +121,7 @@ int main() {
122121 footing->setRepresentation (file.addBox (10100 , 5460 , 2000 ));
123122 footing->setObjectPlacement (file.addLocalPlacement (storey_placement, 0 , 2500 , -2000 ));
124123 // The footing will have a dark gray colour
125- IfcSchema::IfcPresentationStyleAssignment* footing_colour = file. setSurfaceColour (footing->Representation (), 0.26 , 0.22 , 0.18 );
124+ IfcSchema::IfcPresentationStyleAssignment* footing_colour = setSurfaceColour (file, footing->Representation (), 0.26 , 0.22 , 0.18 );
126125
127126 // IFC has two ways to apply boolean operations to geometry. IfcBooleanResults are commonly used
128127 // to clip geometry to a surface, for example to a slanted roof. For openings that are filled
@@ -192,7 +191,7 @@ int main() {
192191 file.addBuildingProduct (north_roof_part);
193192 file.addBuildingProduct (roof);
194193
195- file. setSurfaceColour (roof_rep, 0.24 , 0.08 , 0.04 );
194+ setSurfaceColour (file, roof_rep, 0.24 , 0.08 , 0.04 );
196195
197196 // Copy the south wall to the north
198197 IfcSchema::IfcWallStandardCase* north_wall = new IfcSchema::IfcWallStandardCase (guid (), file.getSingle <IfcSchema::IfcOwnerHistory>(), S (" North wall" ),
@@ -202,7 +201,7 @@ int main() {
202201#endif
203202 );
204203 file.addBuildingProduct (north_wall);
205- file. setSurfaceColour (north_wall->Representation (), wall_colour);
204+ setSurfaceColour (file, north_wall->Representation (), wall_colour);
206205
207206 // Two identical representations are created for the two remaining walls. Mapped items
208207 // are not used, because it is not allowed by the standard for wall body representations.
@@ -215,7 +214,7 @@ int main() {
215214 // 'axis 3d placement' that specifies the plane against which the geometry is clipped.
216215 file.clipRepresentation (body, file.addPlacement3d (-2500 , 0 , 3000 , -1 , 0 , 1 ), false );
217216 file.clipRepresentation (body, file.addPlacement3d (2500 , 0 , 3000 , 1 , 0 , 1 ), false );
218- file. setSurfaceColour (body, wall_colour);
217+ setSurfaceColour (file, body, wall_colour);
219218
220219 IfcSchema::IfcShapeRepresentation* axis = file.addEmptyRepresentation (" Axis" , " Curve2D" );
221220 file.addAxis (axis, 5000 );
@@ -291,7 +290,7 @@ int main() {
291290 (*it)->setContextOfItems (file.getRepresentationContext (" Model" ));
292291 }
293292 file.addEntity (ground_representation);
294- file. setSurfaceColour (ground_representation, 0.15 , 0.25 , 0.05 );
293+ setSurfaceColour (file, ground_representation, 0.15 , 0.25 , 0.05 );
295294
296295 // According to the Ifc2x3 schema an IfcWallStandardCase needs to have an IfcMaterialLayerSet
297296 // assigned. Note that this material definition is independent of the surface styles we have
@@ -371,7 +370,7 @@ int main() {
371370 );
372371
373372 file.addBuildingProduct (stair);
374- file. setSurfaceColour (stair->Representation (), footing_colour);
373+ setSurfaceColour (file, stair->Representation (), footing_colour);
375374
376375 IfcSchema::IfcOpeningElement* door_opening = new IfcSchema::IfcOpeningElement (guid (), file.getSingle <IfcSchema::IfcOwnerHistory>(),
377376 null, null, null, file.addLocalPlacement (storey_placement, 5000 -180 , 2500 -900 , 0 ), file.addBox (1000 , 1000 , 2200 ), null
@@ -406,7 +405,7 @@ int main() {
406405 file.addBox (door_body, 1000 , 80 , 80 , 0 , file.addPlacement3d ( 0 , 0 , 2120 ));
407406 file.addBox (door_body, 860 , 30 , 2120 );
408407 file.addBuildingProduct (door);
409- file. setSurfaceColour (door->Representation (), 0.9 , 0.9 , 0.9 );
408+ setSurfaceColour (file, door->Representation (), 0.9 , 0.9 , 0.9 );
410409 file.addEntity (new IfcSchema::IfcRelFillsElement (guid (), file.getSingle <IfcSchema::IfcOwnerHistory>(), null, null, door_opening, door));
411410
412411 IfcSchema::IfcDoorStyle* door_style = new IfcSchema::IfcDoorStyle (guid (), file.getSingle <IfcSchema::IfcOwnerHistory>(), S (" Door type" ), null, null, null, null, null,
@@ -440,9 +439,9 @@ int main() {
440439 IfcSchema::IfcPresentationStyleAssignment* frame_style = 0 ;
441440 for (IfcSchema::IfcShapeRepresentation::list::it i = frame_representations->begin (); i != frame_representations->end (); i += 2 ) {
442441 if (frame_style) {
443- file. setSurfaceColour (*i, frame_style);
442+ setSurfaceColour (file, *i, frame_style);
444443 } else {
445- frame_style = file. setSurfaceColour (*i, 0.5 , 0.4 , 0.3 );
444+ frame_style = setSurfaceColour (file, *i, 0.5 , 0.4 , 0.3 );
446445 }
447446 // Because of the duplication the iterator is incremented twice
448447 }
@@ -509,7 +508,7 @@ int main() {
509508 file.addEntity (glass_part);
510509 window_parts->push (glass_part);
511510 file.relatePlacements (window, glass_part);
512- file. setSurfaceColour (glass_part->Representation (), 0.6 , 0.7 , 0.75 , 0.1 );
511+ setSurfaceColour (file, glass_part->Representation (), 0.6 , 0.7 , 0.75 , 0.1 );
513512
514513 // Now create a decomposition relation between the window and the parts. Most viewers and authoring
515514 // tools will consider the window a single entity that can be selected as a whole.
0 commit comments