]> git.tdb.fi Git - r2c2.git/blob - source/designer/terraintool.h
Edit a single terrain node at a time if shift is held
[r2c2.git] / source / designer / terraintool.h
1 #ifndef TERRAINTOOL_H_
2 #define TERRAINTOOL_H_
3
4 #include <msp/gl/mesh.h>
5 #include <msp/gl/renderable.h>
6 #include "libr2c2/terrain.h"
7 #include "tool.h"
8
9 class TerrainTool: public Tool, public Msp::GL::Renderable
10 {
11 private:
12         R2C2::Terrain &terrain;
13         Msp::GL::Mesh marker;
14         R2C2::Terrain::NodeCoordinates highlight_node;
15         R2C2::Vector marker_position;
16         unsigned marker_orientation;
17         bool dragging;
18         float drag_start;
19
20 public:
21         TerrainTool(Designer &, Msp::Input::Keyboard &, Msp::Input::Mouse &, R2C2::Terrain &);
22         virtual ~TerrainTool();
23
24 private:
25         void update_marker();
26
27         virtual void key_press(unsigned);
28         virtual void key_release(unsigned);
29         virtual void button_press(unsigned);
30         virtual void button_release(unsigned);
31         virtual void pointer_motion();
32
33 public:
34         virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
35 };
36
37 #endif