Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Selection.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: Selection.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Classes for rendering solid meshes of polygons
13 */
14 
15 #ifndef Selection_h
16 #define Selection_h
17 
18 #include <vector>
19 #include "Polygon.h"
20 #include "Graphic.h"
21 #include "Video.h"
22 #include "List.h"
23 
24 // +--------------------------------------------------------------------+
25 
26 class Selection;
27 class Solid;
28 class Model;
29 class ModelView;
30 class Surface;
31 class Segment;
32 
33 // +--------------------------------------------------------------------+
34 
35 class Selection : public Graphic
36 {
37 public:
38  static const char* TYPENAME() { return "Selection"; }
39 
40  Selection();
41  virtual ~Selection();
42 
43  // operations
44  virtual void Render(Video* video, DWORD flags);
45  virtual bool CheckVisibility(Projector& projector) { return true; }
46 
47  // accessors / mutators
48  void UseModel(Model* m) { model = m; }
49  void UseView(ModelView* v){ model_view = v; }
50  Model* GetModel() const { return model; }
51  List<Poly>& GetPolys() { return polys; }
52  std::vector<DWORD>& GetVerts() { return verts; }
53 
54  virtual void Clear() { polys.clear();
55  verts.clear(); }
56 
57  void AddPoly(Poly* p);
58  void AddVert(WORD s, WORD v);
59  void RemovePoly(Poly* p);
60  void RemoveVert(WORD s, WORD v);
61  bool Contains(Poly* p) const;
62  bool Contains(WORD s, WORD v) const;
63 
64 protected:
68  std::vector<DWORD> verts;
69 };
70 
71 // +--------------------------------------------------------------------+
72 
73 #endif Selection_h
74