| 36 | boost::none_t const null = boost::none; |
| 37 | |
| 38 | int main(int argc, char** argv) { |
| 39 | const char filename[] = "composite_profile_def.ifc"; |
| 40 | IfcHierarchyHelper<IfcSchema> file; |
| 41 | file.header().file_name()->setname(filename); |
| 42 | |
| 43 | double coords1[] = {100.0, 0.0}; |
| 44 | double coords2[] = {200.0, 0.0}; |
| 45 | double coords3[] = {300.0, 0.0}; |
| 46 | |
| 47 | IfcSchema::IfcProfileDef::list::ptr profiles (new IfcSchema::IfcProfileDef::list()); |
| 48 | |
| 49 | IfcSchema::IfcCartesianTransformationOperator2D* transform1 = new IfcSchema::IfcCartesianTransformationOperator2D(file.addDoublet<IfcSchema::IfcDirection>(1, 0), file.addDoublet<IfcSchema::IfcDirection>(0, -1), file.addDoublet<IfcSchema::IfcCartesianPoint>(40, 0), null); |
| 50 | IfcSchema::IfcCartesianTransformationOperator2D* transform2 = new IfcSchema::IfcCartesianTransformationOperator2D(file.addDoublet<IfcSchema::IfcDirection>(0, -1), file.addDoublet<IfcSchema::IfcDirection>(1, 0), file.addDoublet<IfcSchema::IfcCartesianPoint>(40, 0), 0.3); |
| 51 | |
| 52 | IfcSchema::IfcProfileDef* p1 = new Ifc2x3::IfcIShapeProfileDef( |
| 53 | IfcSchema::IfcProfileTypeEnum::IfcProfileType_AREA, |
| 54 | null, file.addPlacement2d(), 25.0, 50.0, 5.0, 5.0, 2.0); |
| 55 | |
| 56 | IfcSchema::IfcProfileDef* p2 = new Ifc2x3::IfcLShapeProfileDef( |
| 57 | IfcSchema::IfcProfileTypeEnum::IfcProfileType_AREA, |
| 58 | null, file.addPlacement2d(), 50.0, 25.0, 5.0, 1.0, 2.0, 2.0, null, null); |
| 59 | |
| 60 | IfcSchema::IfcProfileDef* p3 = new Ifc2x3::IfcTShapeProfileDef( |
| 61 | IfcSchema::IfcProfileTypeEnum::IfcProfileType_AREA, |
| 62 | null, file.addPlacement2d(), 50.0, 40.0, 10.0, 10.0, 3.0, 2.0, 1.0, 2.0, 2.0, null); |
| 63 | |
| 64 | IfcSchema::IfcProfileDef* p4 = new Ifc2x3::IfcCShapeProfileDef( |
| 65 | IfcSchema::IfcProfileTypeEnum::IfcProfileType_AREA, |
| 66 | null, file.addPlacement2d(80.), 50.0, 25.0, 5.0, 10.0, 2.0, null); |
| 67 | |
| 68 | file.addEntity(p2); |
| 69 | file.addEntity(p3); |
| 70 | |
| 71 | file.addEntity(transform1); |
| 72 | file.addEntity(transform2); |
| 73 | |
| 74 | IfcSchema::IfcDerivedProfileDef* p5 = new IfcSchema::IfcDerivedProfileDef(IfcSchema::IfcProfileTypeEnum::IfcProfileType_AREA, null, p2, transform1, null); |
| 75 | IfcSchema::IfcDerivedProfileDef* p6 = new IfcSchema::IfcDerivedProfileDef(IfcSchema::IfcProfileTypeEnum::IfcProfileType_AREA, null, p3, transform2, null); |
| 76 | |
| 77 | profiles->push(p1); |
| 78 | profiles->push(p5); |
| 79 | profiles->push(p6); |
| 80 | profiles->push(p4); |
| 81 | |
| 82 | file.addEntities(profiles->generalize()); |
| 83 | |
| 84 | IfcSchema::IfcCompositeProfileDef* composite = new IfcSchema::IfcCompositeProfileDef(IfcSchema::IfcProfileTypeEnum::IfcProfileType_AREA, S("IFC"), profiles, null); |
| 85 | |
| 86 | IfcSchema::IfcBuildingElementProxy* product = new IfcSchema::IfcBuildingElementProxy( |
| 87 | guid(), 0, S("profile"), null, null, 0, 0, null, null); |
| 88 | |
| 89 | file.addBuildingProduct(product); |
| 90 | |
| 91 | product->setOwnerHistory(file.getSingle<IfcSchema::IfcOwnerHistory>()); |
| 92 | |
| 93 | product->setObjectPlacement(file.addLocalPlacement()); |
| 94 | |
| 95 | IfcSchema::IfcExtrudedAreaSolid* solid = new IfcSchema::IfcExtrudedAreaSolid(composite, |
nothing calls this directly
no test coverage detected