1 // $Id: worldview_select_tool.hxx,v 1.11 2003/07/28 22:46:48 grumbel Exp $
3 // Construo - A wire-frame construction gamee
4 // Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef HEADER_CONSTRUO_WORLDVIEW_SELECT_TOOL_HXX
21 #define HEADER_CONSTRUO_WORLDVIEW_SELECT_TOOL_HXX
23 #include "selection.hxx"
24 #include "worldview_tool.hxx"
29 class WorldViewSelectTool
: public WorldViewTool
34 typedef enum { GETTING_SELECTION_MODE
,
35 MOVING_SELECTION_MODE
,
36 ROTATING_SELECTION_MODE
,
37 SCALING_SELECTION_MODE
,
41 /** The start position of a click & drap operation (aka move or
42 rotate), in world coordinates */
45 /** The difference the selection was moved on the last mouse move */
48 /** The center of a rotation */
49 Vector2d rotate_center
;
51 /** The center of a scalation */
52 Vector2d scale_center
;
53 float old_scale_factor
;
55 WorldViewSelectTool ();
56 ~WorldViewSelectTool ();
61 void draw_background (ZoomGraphicContext
* gc
);
62 void draw_foreground (ZoomGraphicContext
* gc
);
64 void on_primary_button_press (int x
, int y
);
65 void on_primary_button_release (int x
, int y
);
67 void on_secondary_button_press (int x
, int y
);
68 void on_secondary_button_release (int x
, int y
);
70 void on_mouse_move (int x
, int y
, int of_x
, int of_y
);
72 void on_button_press (int button_id
, int x
, int y
);
74 void on_scale_press (int x
, int y
);
75 void on_flip_press (int x
, int y
);
76 void on_duplicate_press (int x
, int y
);
77 void on_delete_press (int x
, int y
);
78 void on_fix_press (int x
, int y
);
79 void on_join_press (int x
, int y
);