Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
UVMapView.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: UVMapView.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Interface of the UVMapView class
13 */
14 
15 
16 #ifndef UVMapView_h
17 #define UVMapView_h
18 
19 #include <vector>
20 #include "View.h"
21 #include "Polygon.h"
22 #include "List.h"
23 
24 // +--------------------------------------------------------------------+
25 
26 class Video;
27 
28 // +--------------------------------------------------------------------+
29 
30 class UVMapView : public View
31 {
32 public:
33  UVMapView(Window* c);
34  virtual ~UVMapView();
35 
37 
38  virtual void Refresh();
39 
40  void UseMaterial(Material* m);
41  void UsePolys(List<Poly>& p);
42 
43  void MoveBy(double dx, double dy);
44  void DragBy(double dx, double dy);
45  void ZoomIn() { zoom *= 1.15; }
46  void ZoomOut() { zoom *= 0.85; }
47 
48  void Clear();
49  void Begin(int select_mode = SELECT_REPLACE);
50  void AddMark(CPoint& p);
51  void End();
52 
53  bool IsActive() const { return active; }
54  void SelectAll();
55  void SelectNone();
56  void SelectInverse();
57 
58  bool IsSelected(Poly* p, WORD v);
59  bool WillSelect(CPoint& p);
60 
61 protected:
62  enum { MAX_MARK = 4096 };
63 
67 
68  double zoom;
69  double x_offset;
70  double y_offset;
71 
72  int nmarks;
73  CPoint marks[MAX_MARK];
75  bool active;
76 
77  std::vector<DWORD> selverts;
78 };
79 
80 // +--------------------------------------------------------------------+
81 
82 #endif UVMapView_h