]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/beamgatetype.cpp
46f0aad652b09da61b19b7a6860a6f92c107da88
[r2c2.git] / source / libr2c2 / beamgatetype.cpp
1 #include <msp/geometry/box.h>
2 #include <msp/geometry/transformedshape.h>
3 #include <msp/geometry/union.h>
4 #include "beamgatetype.h"
5
6 using namespace std;
7 using namespace Msp;
8
9 namespace R2C2 {
10
11 BeamGateType::BeamGateType():
12         ObjectType(ArticleNumber(0))
13 {
14         name = "Beam gate";
15         Geometry::TransformedShape<float, 3> box1(
16                 Geometry::Box<float>(0.005, 0.03, 0.002),
17                 Transform::translation(Vector(0, 0, 0.001)));
18         Geometry::TransformedShape<float, 3> box2(
19                 Geometry::Box<float>(0.005, 0.008, 0.023),
20                 Transform::translation(Vector(0, -0.025, 0.0125)));
21         Geometry::TransformedShape<float, 3> box3(
22                 Geometry::Box<float>(0.005, 0.008, 0.023),
23                 Transform::translation(Vector(0, 0.025, 0.0125)));
24         vector<Shape *> shapes;
25         shapes.push_back(&box1);
26         shapes.push_back(&box2);
27         shapes.push_back(&box3);
28         shape = Geometry::Union<float, 3>::from_iterator_range(shapes.begin(), shapes.end()).clone();
29 }
30
31 const BeamGateType &BeamGateType::instance()
32 {
33         static BeamGateType type;
34         return type;
35 }
36
37 } // namespace R2C2