| 107 | } |
| 108 | |
| 109 | int main(int argc, char** argv) { |
| 110 | const char filename[] = "arbitrary_open_profile_def.ifc"; |
| 111 | IfcHierarchyHelper<IfcSchema> file; |
| 112 | file.header().file_name()->setname(filename); |
| 113 | |
| 114 | double coords1[] = {-50.0, 0.0}; |
| 115 | double coords2[] = { 50.0, 0.0}; |
| 116 | IfcSchema::IfcCartesianPoint::list::ptr points (new IfcSchema::IfcCartesianPoint::list()); |
| 117 | points->push(new IfcSchema::IfcCartesianPoint(std::vector<double>(coords1, coords1+2))); |
| 118 | points->push(new IfcSchema::IfcCartesianPoint(std::vector<double>(coords2, coords2+2))); |
| 119 | file.addEntities(points->generalize()); |
| 120 | IfcSchema::IfcPolyline* poly = new IfcSchema::IfcPolyline(points); |
| 121 | file.addEntity(poly); |
| 122 | |
| 123 | create_products_from_curve(file, poly); |
| 124 | |
| 125 | IfcSchema::IfcEllipse* ellipse = new IfcSchema::IfcEllipse(file.addPlacement2d(), 50., 25.); |
| 126 | file.addEntity(ellipse); |
| 127 | aggregate_of_instance::ptr trim1(new aggregate_of_instance); |
| 128 | aggregate_of_instance::ptr trim2(new aggregate_of_instance); |
| 129 | trim1->push(new IfcSchema::IfcParameterValue( 0.)); |
| 130 | trim2->push(new IfcSchema::IfcParameterValue(180.)); |
| 131 | IfcSchema::IfcTrimmedCurve* trim = new IfcSchema::IfcTrimmedCurve(ellipse, trim1->as<IfcSchema::IfcTrimmingSelect>(), trim2->as<IfcSchema::IfcTrimmingSelect>(), true, IfcSchema::IfcTrimmingPreference::IfcTrimmingPreference_PARAMETER); |
| 132 | file.addEntity(trim); |
| 133 | |
| 134 | create_products_from_curve(file, trim); |
| 135 | |
| 136 | using namespace std::string_literals; |
| 137 | file.getSingle<IfcSchema::IfcProject>()->setName("arbitrary_open_profile_def"s); |
| 138 | |
| 139 | std::ofstream f(filename); |
| 140 | f << file; |
| 141 | } |
nothing calls this directly
no test coverage detected