| 297 | |
| 298 | template <typename Schema> |
| 299 | void IfcHierarchyHelper<Schema>::addExtrudedPolyline(typename Schema::IfcShapeRepresentation* rep, |
| 300 | const std::vector<std::pair<double, double>>& points, |
| 301 | double h, |
| 302 | typename Schema::IfcAxis2Placement2D* /*place1*/, |
| 303 | typename Schema::IfcAxis2Placement3D* place2, |
| 304 | typename Schema::IfcDirection* dir, |
| 305 | typename Schema::IfcRepresentationContext* /*context*/) { |
| 306 | typename Schema::IfcCartesianPoint::list::ptr cartesian_points(new typename Schema::IfcCartesianPoint::list); |
| 307 | for (std::vector<std::pair<double, double>>::const_iterator i = points.begin(); i != points.end(); ++i) { |
| 308 | cartesian_points->push(addDoublet<typename Schema::IfcCartesianPoint>(i->first, i->second)); |
| 309 | } |
| 310 | if (cartesian_points->size()) { |
| 311 | cartesian_points->push(*cartesian_points->begin()); |
| 312 | } |
| 313 | typename Schema::IfcPolyline* line = new typename Schema::IfcPolyline(cartesian_points); |
| 314 | typename Schema::IfcArbitraryClosedProfileDef* profile = new typename Schema::IfcArbitraryClosedProfileDef( |
| 315 | Schema::IfcProfileTypeEnum::IfcProfileType_AREA, boost::none, line); |
| 316 | |
| 317 | typename Schema::IfcExtrudedAreaSolid* solid = new typename Schema::IfcExtrudedAreaSolid( |
| 318 | profile, place2 ? place2 : addPlacement3d(), dir ? dir : addTriplet<typename Schema::IfcDirection>(0, 0, 1), h); |
| 319 | |
| 320 | typename Schema::IfcRepresentationItem::list::ptr items = rep->Items(); |
| 321 | items->push(solid); |
| 322 | rep->setItems(items); |
| 323 | |
| 324 | addEntity(line); |
| 325 | addEntity(profile); |
| 326 | addEntity(solid); |
| 327 | } |
| 328 | |
| 329 | template <typename Schema> |
| 330 | typename Schema::IfcProductDefinitionShape* IfcHierarchyHelper<Schema>::addExtrudedPolyline(const std::vector<std::pair<double, double>>& points, |