| 102 | } |
| 103 | |
| 104 | IfcSchema::IfcRepresentationItem* serialize(IfcHierarchyHelper<IfcSchema>& file) const { |
| 105 | IfcSchema::IfcRepresentationItem* my; |
| 106 | if (op == OP_TERMINAL) { |
| 107 | IfcSchema::IfcAxis2Placement3D* place = file.addPlacement3d(x,y,z,zx,zy,zz,xx,xy,xz); |
| 108 | if (prim == PRIM_SPHERE) { |
| 109 | my = new IfcSchema::IfcSphere(place, a); |
| 110 | } else if (prim == PRIM_BOX) { |
| 111 | my = new IfcSchema::IfcBlock(place, a, b, c); |
| 112 | } else if (prim == PRIM_PYRAMID) { |
| 113 | my = new IfcSchema::IfcRectangularPyramid(place, a, b, c); |
| 114 | } else if (prim == PRIM_CYLINDER) { |
| 115 | my = new IfcSchema::IfcRightCircularCylinder(place, b, a); |
| 116 | } else if (prim == PRIM_CONE) { |
| 117 | my = new IfcSchema::IfcRightCircularCone(place, b, a); |
| 118 | } |
| 119 | } else { |
| 120 | IfcSchema::IfcBooleanOperator o = IfcSchema::IfcBooleanOperator::IfcBooleanOperator_UNION; |
| 121 | if (op == OP_ADD) { |
| 122 | o = IfcSchema::IfcBooleanOperator::IfcBooleanOperator_UNION; |
| 123 | } else if (op == OP_SUBTRACT) { |
| 124 | o = IfcSchema::IfcBooleanOperator::IfcBooleanOperator_DIFFERENCE; |
| 125 | } else if (op == OP_INTERSECT) { |
| 126 | o = IfcSchema::IfcBooleanOperator::IfcBooleanOperator_INTERSECTION; |
| 127 | } |
| 128 | my = new IfcSchema::IfcBooleanResult(o, left->serialize(file)->as<IfcSchema::IfcBooleanOperand>(), right->serialize(file)->as<IfcSchema::IfcBooleanOperand>()); |
| 129 | } |
| 130 | file.addEntity(my); |
| 131 | return my; |
| 132 | } |
| 133 | }; |
| 134 | |
| 135 | int main(int argc, char** argv) { |
no test coverage detected