]> git.tdb.fi Git - r2c2.git/blob - source/designer/manipulator.h
Don't crash if a train has no router
[r2c2.git] / source / designer / manipulator.h
1 #ifndef MANIPULATOR_H_
2 #define MANIPULATOR_H_
3
4 #include <set>
5 #include <vector>
6 #include "libr2c2/object.h"
7 #include "tool.h"
8
9 class Selection;
10
11 class Manipulator: public Tool
12 {
13 protected:
14         struct MObject
15         {
16                 R2C2::Object *object;
17                 R2C2::Vector original_position;
18                 R2C2::Angle original_rotation;
19
20                 MObject(R2C2::Object *);
21         };
22
23 public:
24         sigc::signal<void, bool> signal_done;
25
26 protected:
27         typedef std::vector<MObject> ObjectArray;
28
29         ObjectArray objects;
30         R2C2::Vector center;
31
32 public:
33         Manipulator(Designer &, Msp::Input::Keyboard &, Msp::Input::Mouse &, const std::set<R2C2::Object *> &);
34         virtual ~Manipulator();
35
36 private:
37         virtual void finish();
38 };
39
40 #endif