| 54 | } |
| 55 | |
| 56 | int main(int argc, char** argv) { |
| 57 | IfcHierarchyHelper<IfcSchema> file; |
| 58 | |
| 59 | IfcSchema::IfcBuildingElementProxy* product = new IfcSchema::IfcBuildingElementProxy( |
| 60 | guid(), 0, S("Blender's Suzanne"), null, null, 0, 0, null, null); |
| 61 | file.addBuildingProduct(product); |
| 62 | product->setOwnerHistory(file.getSingle<IfcSchema::IfcOwnerHistory>()); |
| 63 | |
| 64 | product->setObjectPlacement(file.addLocalPlacement()); |
| 65 | |
| 66 | IfcSchema::IfcRepresentation::list::ptr reps (new IfcSchema::IfcRepresentation::list); |
| 67 | IfcSchema::IfcRepresentationItem::list::ptr items (new IfcSchema::IfcRepresentationItem::list); |
| 68 | |
| 69 | std::vector< std::vector< double > > vertices_vector = create_vector_from_array(vertices, sizeof(vertices) / sizeof(vertices[0])); |
| 70 | std::vector< std::vector< int > > indices_vector = create_vector_from_array(indices, sizeof(indices) / sizeof(indices[0])); |
| 71 | |
| 72 | IfcSchema::IfcCartesianPointList3D* coordinates = new IfcSchema::IfcCartesianPointList3D(vertices_vector); |
| 73 | IfcSchema::IfcTriangulatedFaceSet* faceset = new IfcSchema::IfcTriangulatedFaceSet(coordinates, null, null, indices_vector, null); |
| 74 | |
| 75 | items->push(faceset); |
| 76 | IfcSchema::IfcShapeRepresentation* rep = new IfcSchema::IfcShapeRepresentation( |
| 77 | file.getRepresentationContext("Model"), S("Body"), S("SurfaceModel"), items); |
| 78 | reps->push(rep); |
| 79 | |
| 80 | IfcSchema::IfcProductDefinitionShape* shape = new IfcSchema::IfcProductDefinitionShape(boost::none, boost::none, reps); |
| 81 | file.addEntity(shape); |
| 82 | |
| 83 | product->setRepresentation(shape); |
| 84 | |
| 85 | const std::string filename = "triangulated_faceset.ifc"; |
| 86 | file.header().file_name()->setname(filename); |
| 87 | std::ofstream f(filename); |
| 88 | f << file; |
| 89 | } |
nothing calls this directly
no test coverage detected