source: golgotha/src/golg/editor/mode/e_object.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 14 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 2.7 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef OBJECT_MODE_HH
10#define OBJECT_MODE_HH
11
12
13#include "editor/e_state.hh"
14#include "editor/mode/e_mode.hh"
15#include "editor/dialogs/object_picker.hh"
16
17class g1_object_class;
18
19class g1_object_mode : public g1_mode_handler
20{
21  g1_typed_reference_class<g1_object_class> add;
22  sw32 sel_color, norm_color;
23
24  i4_bool no_more_move_undos;
25  w32 current_edit_type;
26
27public:
28  float real_object_theta;        // unsnapped_value
29  float get_snap_theta();
30
31  enum { SET_TEAM=1, CLOSE_WINDOW };
32
33
34  virtual state current_state();
35  void mouse_down();
36  void mouse_move(sw32 mx, sw32 my);
37  void key_press(i4_key_press_event_class *kev);
38
39  virtual i4_bool select_object(sw32 mx, sw32 my,
40                                i4_float &ox, i4_float &oy, i4_float &oz,
41                                select_modifier mod);
42
43  virtual void select_objects_in_area(sw32 x1, sw32 y1, sw32 x2, sw32 y2,
44                                      select_modifier mod);
45
46  virtual void move_selected(i4_float xc, i4_float yc, i4_float zc,
47                             sw32 mouse_x, sw32 mouse_y);
48
49  virtual void delete_selected();
50
51  virtual void post_draw(i4_draw_context_class &context);
52
53  virtual void hide_focus();
54  virtual void show_focus();
55
56  virtual void idle();
57  virtual void edit_selected();
58
59  g1_object_mode(g1_controller_edit_class *c);
60};
61
62
63class g1_object_params : public g1_mode_creator
64{
65  w16 current_object_type;
66   
67
68
69  i4_event_handler_reference_class<i4_parent_window_class> edit_win;
70  float object_move_snap;
71
72
73public:
74
75  g1_object_params();
76  char *name() { return "OBJECT"; }
77  enum  { ROTATE,    ZOOM,    ADD,    SELECT,    MOVE,    OBJECT_ROTATE  };
78
79
80  void refresh_picker()
81  {
82    g1_refresh_object_picker();
83  }
84
85  w16 get_object_type()
86  {
87    return current_object_type;
88  }
89
90  void set_object_type(w16 type)
91  {     
92    current_object_type=type;
93    refresh_picker();
94  }
95
96  void create_buttons(i4_parent_window_class *containter);
97  void cleanup();
98
99  g1_mode_handler *create_mode_handler(g1_controller_edit_class *c);
100  void set_edit_window(i4_window_class *p);
101  void close_edit_window();
102};
103
104extern g1_object_params g1_e_object;
105
106
107
108#endif
Note: See TracBrowser for help on using the repository browser.