| 420 | |
| 421 | template <typename Schema> |
| 422 | typename Schema::IfcProductDefinitionShape* IfcHierarchyHelper<Schema>::addAxisBox(double w, double d, double h, typename Schema::IfcRepresentationContext* context) { |
| 423 | typename Schema::IfcRepresentation::list::ptr reps(new typename Schema::IfcRepresentation::list); |
| 424 | typename Schema::IfcRepresentationItem::list::ptr body_items(new typename Schema::IfcRepresentationItem::list); |
| 425 | typename Schema::IfcRepresentationItem::list::ptr axis_items(new typename Schema::IfcRepresentationItem::list); |
| 426 | typename Schema::IfcShapeRepresentation* body_rep = new typename Schema::IfcShapeRepresentation( |
| 427 | context ? context : getRepresentationContext("Model"), std::string("Body"), std::string("SweptSolid"), body_items); |
| 428 | |
| 429 | typename Schema::IfcShapeRepresentation* axis_rep = new typename Schema::IfcShapeRepresentation( |
| 430 | context ? context : getRepresentationContext("Plan"), std::string("Axis"), std::string("Curve2D"), axis_items); |
| 431 | |
| 432 | reps->push(axis_rep); |
| 433 | reps->push(body_rep); |
| 434 | |
| 435 | typename Schema::IfcProductDefinitionShape* shape = new typename Schema::IfcProductDefinitionShape(boost::none, boost::none, reps); |
| 436 | addEntity(shape); |
| 437 | addEntity(body_rep); |
| 438 | addBox(body_rep, w, d, h, 0, 0, 0, context); |
| 439 | addEntity(axis_rep); |
| 440 | addAxis(axis_rep, w); |
| 441 | |
| 442 | return shape; |
| 443 | } |
| 444 | |
| 445 | template <typename Schema> |
| 446 | void IfcHierarchyHelper<Schema>::clipRepresentation(typename Schema::IfcProductRepresentation* shape, |