Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Selector.h
Go to the documentation of this file.
1 /* Project Magic 2.0
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Magic.exe
6  FILE: Selector.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Class definition for Selector (free-form selection tool)
13 */
14 
15 #ifndef Selector_h
16 #define Selector_h
17 
18 #include "Polygon.h"
19 #include "Graphic.h"
20 #include "Video.h"
21 
22 class ModelView;
23 class Model;
24 class Selection;
25 class Surface;
26 
27 // +----------------------------------------------------------------------+
28 
29 class Selector : public Graphic
30 {
31 public:
32  Selector(Selection* s=0);
33  virtual ~Selector();
34 
36 
37  // Operations
38  virtual void Render(Video* video, DWORD flags);
39  virtual bool CheckVisibility(Projector& projector) { return true; }
40 
41  void Clear();
42  void Begin(Model* m, int mode, int select_mode = SELECT_REPLACE);
43  void AddMark(CPoint& p);
44  void End();
45 
46  bool IsActive() const { return view_mode ? true : false; }
47  int GetViewMode() const { return view_mode; }
48  Selection* GetSelection() const { return selection; }
49 
50  void UseModel(Model* m);
52  void SelectInverse();
54  void SelectVert(Surface* s, int v, int select_mode = SELECT_REPLACE);
55  void SelectPoly(Poly* p, int select_mode = SELECT_REPLACE);
57 
58  void Reselect();
59 
60 protected:
61  enum { MAX_MARK = 4096 };
62 
63  int view_mode;
64  int nmarks;
65  CPoint marks[MAX_MARK];
67 
71 };
72 
73 
74 // +----------------------------------------------------------------------+
75 
76 #endif Selector_h