MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / addBox

Method addBox

src/ifcparse/IfcHierarchyHelper.cpp:354–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352
353template <typename Schema>
354void IfcHierarchyHelper<Schema>::addBox(typename Schema::IfcShapeRepresentation* rep,
355 double w,
356 double d,
357 double h,
358 typename Schema::IfcAxis2Placement2D* place,
359 typename Schema::IfcAxis2Placement3D* place2,
360 typename Schema::IfcDirection* dir,
361 typename Schema::IfcRepresentationContext* context) {
362 if (false) { // TODO What's this?
363 typename Schema::IfcRectangleProfileDef* profile = new typename Schema::IfcRectangleProfileDef(
364 Schema::IfcProfileTypeEnum::IfcProfileType_AREA, boost::none, place ? place : addPlacement2d(), w, d);
365 typename Schema::IfcExtrudedAreaSolid* solid = new typename Schema::IfcExtrudedAreaSolid(profile,
366 place2 ? place2 : addPlacement3d(),
367 dir ? dir : addTriplet<typename Schema::IfcDirection>(0, 0, 1),
368 h);
369
370 addEntity(profile);
371 addEntity(solid);
372 typename Schema::IfcRepresentationItem::list::ptr items = rep->Items();
373 items->push(solid);
374 rep->setItems(items);
375 } else {
376 std::vector<std::pair<double, double>> points;
377 points.push_back(std::make_pair(-w / 2, -d / 2));
378 points.push_back(std::make_pair(w / 2, -d / 2));
379 points.push_back(std::make_pair(w / 2, d / 2));
380 points.push_back(std::make_pair(-w / 2, d / 2));
381 // The call to addExtrudedPolyline() closes the polyline
382 addExtrudedPolyline(rep, points, h, place, place2, dir, context);
383 }
384}
385
386template <typename Schema>
387void IfcHierarchyHelper<Schema>::addAxis(typename Schema::IfcShapeRepresentation* rep, double l, typename Schema::IfcRepresentationContext* /*context*/) {

Callers 1

mainFunction · 0.80

Calls 2

push_backMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected