Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MagicView.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: MagicView.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Interface of the MagicView class
13 */
14 
15 
16 #if !defined(AFX_MAGICVIEW_H__387B567A_8235_41B8_A993_E41567E680D7__INCLUDED_)
17 #define AFX_MAGICVIEW_H__387B567A_8235_41B8_A993_E41567E680D7__INCLUDED_
18 
19 #if _MSC_VER > 1000
20 #pragma once
21 #endif // _MSC_VER > 1000
22 
23 // +--------------------------------------------------------------------+
24 
25 class MagicDoc;
26 class ActiveWindow;
27 class Grid;
28 class Light;
29 class Scene;
30 class Screen;
31 class Video;
32 class VideoSettings;
33 class ModelView;
34 class UVMapView;
35 
36 // +--------------------------------------------------------------------+
37 
38 class MagicView : public CView
39 {
40 protected: // create from serialization only
41  MagicView();
42  DECLARE_DYNCREATE(MagicView)
43 
44 // Attributes
45 public:
47 
48  static MagicView* GetInstance();
49 
50 // Operations
51 public:
52 
53 // Overrides
54  // ClassWizard generated virtual function overrides
55  //{{AFX_VIRTUAL(MagicView)
56  public:
57  virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
58  virtual void OnInitialUpdate();
59  protected:
60  virtual void OnDraw(CDC* pDC);
61  virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
62  //}}AFX_VIRTUAL
63 
64 // Implementation
65 public:
66  virtual ~MagicView();
67 #ifdef _DEBUG
68  virtual void AssertValid() const;
69  virtual void Dump(CDumpContext& dc) const;
70 #endif
71 
72  virtual void OnEnterSizeMove();
73  virtual void OnExitSizeMove();
74  virtual void ResizeVideo();
75  virtual CPoint LPtoWP(const CPoint& p);
76 
77 protected:
82  DWORD window_style;
85  bool is_sizing;
86 
96  int view_mode;
98  bool drag_left;
99  bool drag_right;
100  CPoint drag_start;
101 
105 
106  enum VIEW_MODE {
107  VIEW_TOP = 0,
109  VIEW_SIDE = 2,
111  VIEW_ALL = 4,
113  };
114 
115  virtual void SetupModelViews();
116  virtual void SetFocusModelView(int f);
117  virtual int GetWinIndexByPoint(int x, int y);
118  ModelView* GetModelViewByIndex(int index);
119 
120  bool IsUVEdit() const { return (view_mode == VIEW_UV_MAP) && (uvmap_view != 0); }
121  void CloseUVEditor();
122 
123 // Generated message map functions
124 protected:
125  //{{AFX_MSG(MagicView)
126  afx_msg void OnSize(UINT nType, int cx, int cy);
127  afx_msg void OnRender();
128  afx_msg void OnPaint();
129  afx_msg void OnViewAll();
130  afx_msg void OnUpdateViewAll(CCmdUI* pCmdUI);
131  afx_msg void OnViewFront();
132  afx_msg void OnUpdateViewFront(CCmdUI* pCmdUI);
133  afx_msg void OnViewPerspective();
134  afx_msg void OnUpdateViewPerspective(CCmdUI* pCmdUI);
135  afx_msg void OnViewSide();
136  afx_msg void OnUpdateViewSide(CCmdUI* pCmdUI);
137  afx_msg void OnViewTop();
138  afx_msg void OnUpdateViewTop(CCmdUI* pCmdUI);
139  afx_msg void OnTextureMap();
140  afx_msg void OnModifyMaterial();
141  afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
142  afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
143  afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
144  afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
145  afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
146  afx_msg void OnMouseMove(UINT nFlags, CPoint point);
147  afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
148  afx_msg void OnViewZoomNormal();
149  afx_msg void OnViewZoomIn();
150  afx_msg void OnViewZoomOut();
151  afx_msg void OnViewModeWireframe();
152  afx_msg void OnViewModeSolid();
153  afx_msg void OnViewModeTextured();
154  afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
155  afx_msg void OnGridProperties();
156  afx_msg void OnGridShow();
157  afx_msg void OnGridSnap();
158  afx_msg void OnUpdateGridSnap(CCmdUI* pCmdUI);
159  afx_msg void OnViewBackColor();
160  afx_msg void OnFileImport();
161  afx_msg void OnFileExport();
162  afx_msg void OnSelectAll();
163  afx_msg void OnSelectNone();
164  afx_msg void OnUpdateTextureMap(CCmdUI* pCmdUI);
165  afx_msg void OnUpdateModifyMaterial(CCmdUI* pCmdUI);
166  afx_msg void OnSelectInverse();
167  afx_msg void OnModifyUVMap();
168  afx_msg void OnUpdateModifyUVMap(CCmdUI* pCmdUI);
169  afx_msg void OnViewShadows();
170  afx_msg void OnUpdateViewShadows(CCmdUI* pCmdUI);
171  afx_msg void OnViewAnimatelight();
172  afx_msg void OnUpdateViewAnimatelight(CCmdUI* pCmdUI);
173  afx_msg void OnViewBumpmaps();
174  afx_msg void OnUpdateViewBumpmaps(CCmdUI* pCmdUI);
175  afx_msg void OnViewVertexshader();
176  afx_msg void OnUpdateViewVertexshader(CCmdUI* pCmdUI);
177  afx_msg void OnViewPixelshader();
178  afx_msg void OnUpdateViewPixelshader(CCmdUI* pCmdUI);
179  afx_msg void OnViewVisibleshadows();
180  afx_msg void OnUpdateViewVisibleshadows(CCmdUI* pCmdUI);
181  afx_msg void OnEditUndo();
182  afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
183  afx_msg void OnEditRedo();
184  afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
185  afx_msg void OnSurfaceProperties();
186  afx_msg void OnUpdateSurfaceProperties(CCmdUI* pCmdUI);
187  //}}AFX_MSG
188  DECLARE_MESSAGE_MAP()
189 };
190 
191 #ifndef _DEBUG // debug version in MagicView.cpp
193  { return (MagicDoc*)m_pDocument; }
194 #endif
195 
196 // +--------------------------------------------------------------------+
197 
198 //{{AFX_INSERT_LOCATION}}
199 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
200 
201 #endif // !defined(AFX_MAGICVIEW_H__387B567A_8235_41B8_A993_E41567E680D7__INCLUDED_)