Debian Codegraph @

editor/editorView.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/editor/editorView.h $
21 * $Revision: 1.1.1.1 $
22 * $Date: 2003-08-26 03:57:37 $
23 * $Author: kevinb $
24 *
25 * CEditorView containss GrWnds and other editor views.
26 *
27 * $Log: not supported by cvs2svn $
28 *
29 * 48 10/14/99 4:21p Matt
30 * Added code to remove duplicate faces from a room.
31 *
32 * 47 10/07/99 3:12p Matt
33 * Added a function to flip the view 180 degrees.
34 *
35 * 46 9/07/99 12:10p Matt
36 * Added a function to propagate a texture to all adjacent coplanar faces
37 * in a room.
38 *
39 * 45 8/24/99 4:24p Matt
40 * Added a function to rotate a placed room by 45 degrees.
41 *
42 * 44 5/08/99 6:39p Matt
43 * Added a function to delete a face and all faces connected to it.
44 *
45 * 43 4/30/99 6:52p Matt
46 * Added a function to merge an object's geometry into a room.
47 *
48 * 42 4/28/99 12:51a Matt
49 * Added some funtions to edit face geometry.
50 *
51 * 41 4/19/99 12:10a Matt
52 * Added a menu item to delete a vertex from a face.
53 *
54 * 40 4/06/99 10:23a Matt
55 *
56 * 39 3/31/99 12:58p Matt
57 * Added snap-point-to-face
58 *
59 * 38 3/29/99 6:46p Matt
60 * Added menu item to fix/remove degenerate faces
61 *
62 * 37 3/23/99 5:12p Matt
63 * Added function to combine rooms.
64 *
65 * 36 3/01/99 10:39p Matt
66 * Added menu options to set & clear room center points
67 *
68 * 35 2/28/99 6:32p Matt
69 * Disable z-buffer button if OpenGL is being used in the editor.
70 *
71 * 34 1/15/99 10:50a Matt
72 * Added rename room to Room menu & added shortcut key
73 *
74 * 33 12/23/98 10:53a Matt
75 * Added functions to create a face
76 *
77 * 32 10/03/98 11:22p Matt
78 * Added system to seperately control outline mode for mine, terrain, sky,
79 * & objects
80 *
81 * 31 10/03/98 8:31p Matt
82 * Added Join Rooms Exact function.
83 *
84 * 30 9/09/98 4:07p Matt
85 * Added Smooth Bridge function
86 *
87 * 29 9/08/98 6:12p Matt
88 * Added code to check for and fix duplicate and unused points.
89 *
90 * 28 9/08/98 12:06p Jason
91 * added ReInit openGL button
92 *
93 * 27 9/07/98 10:58p Matt
94 * Added snap point to point.
95 *
96 * 26 9/04/98 3:34p Matt
97 * Added groovy vertex snap code
98 *
99 * 25 6/25/98 7:15p Matt
100 * Added a function to delete a pair of portals.
101 *
102 * 24 6/08/98 12:28p Matt
103 * Added a function to triangulate a face
104 *
105 * 23 5/22/98 4:47p Matt
106 * Added menu item to propagate a texture to all the faces in a room.
107 *
108 * 22 4/27/98 6:41p Matt
109 * Added code to join all adjacent faces between two rooms
110 *
111 * 21 2/16/98 1:27p Matt
112 * Added function to snap the placed room to a vertex/edge on the base
113 * room/face
114 *
115 * 20 2/11/98 12:39p Matt
116 * Implemented Delete Face menu item.
117 *
118 * 19 1/29/98 2:15p Samir
119 * Implemented ObjectListModeless and Toolbar button.
120 *
121 * 18 1/27/98 6:15p Samir
122 * Added Object toolbar button.
123 *
124 * 17 1/20/98 4:08p Matt
125 * Added function to swap current and marked room:face. Added some
126 * addition error checking to bridge function.
127 *
128 * 16 11/05/97 7:13p Matt
129 * Added join rooms function
130 *
131 * 15 10/03/97 3:37p Matt
132 * Added menu item to place a building on the terrain
133 *
134 * 14 9/24/97 3:22p Matt
135 * Added Drop Room function
136 *
137 * 13 9/17/97 11:21a Matt
138 * Ripped out segment code
139 *
140 * 12 9/16/97 4:09p Jason
141 * implemented software zbuffer
142 *
143 * 11 9/14/97 11:07p Matt
144 * Fixed up Room menu
145 *
146 * 10 8/21/97 6:00p Matt
147 * Added delete current room function
148 *
149 * 9 8/19/97 5:58p Samir
150 * OLE additions
151 *
152 * 8 8/19/97 10:54a Matt
153 * Added remove placed room option
154 *
155 * 7 8/18/97 6:59p Matt
156 * Implemented Place Room/Attach room system
157 *
158 * 6 8/04/97 12:52p Matt
159 * Added hooks for mark & bridge
160 *
161 * 5 8/01/97 6:10p Matt
162 * Added hooks for attach room
163 *
164 * 4 7/28/97 11:29a Samir
165 * Fixed editor->game goofiness. Isolated GrWnd creation and destruction
166 * to a couple of functions.
167 *
168 * 3 7/22/97 10:33a Matt
169 * Added functions for new room menu
170 *
171 * 18 6/30/97 1:29p Jason
172 * added netherspace stuff
173 *
174 * 17 6/03/97 4:55p Mark
175 *
176 * 16 5/27/97 3:30p Matt
177 * Added editor button to toggle lighting
178 *
179 * 15 4/03/97 1:17p Matt
180 * Took out support for toolbar movement mode toggle button, now that that
181 * function has been moved to the object keypad.
182 *
183 * 14 4/02/97 8:07p Matt
184 * Added variable & button to toggle object move state
185 *
186 * 13 3/07/97 4:18p Jason
187 * implemented terrain functionality in the editor
188 *
189 * 12 2/28/97 6:37p Matt
190 * Added variable & toggle button for box selection mode
191 *
192 * 11 2/11/97 1:42p Samir
193 * Moved file opening and closing to editorDoc where it should be.
194 *
195 * 10 2/10/97 5:40p Matt
196 * Code to handle several File menu options
197 *
198 * 9 2/07/97 7:41p Matt
199 * Hooked in next & prev segment & side funcs
200 *
201 * 8 1/23/97 4:09p Samir
202 * Added stuff for toggling wireframe, texture windows, tiling or
203 * cascading
204 *
205 * 7 1/21/97 12:51p Samir
206 * GrWnds created based on D3EditState info
207 *
208 * $NoKeywords: $
209 */
210
211 // editorView.h : interface of the CEditorView class
212 //
213 /////////////////////////////////////////////////////////////////////////////
214
215 #ifndef C_EDITORVIEW_H
216 #define C_EDITORVIEW_H
217
218 #include "WireframeGrWnd.h"
219 #include "TextureGrWnd.h"
220
221 class CEditorView : public CView {
222 protected: // create from serialization only
223 CEditorView();
224 DECLARE_DYNCREATE(CEditorView)
225
226 // Attributes
227 public:
228 int SafetyCheck();
229 CEditorDoc *GetDocument();
230
231 // Operations
232 public:
233 void ActivateView();
234 void DeactivateView();
235 bool SetupPopup(CMenu *popup);
236
237 // Overrides
238 // ClassWizard generated virtual function overrides
239 //{{AFX_VIRTUAL(CEditorView)
240 public:
241 virtual void OnDraw(CDC *pDC); // overridden to draw this view
242 virtual BOOL PreCreateWindow(CREATESTRUCT &cs);
243 virtual void OnInitialUpdate();
244
245 protected:
246 virtual BOOL OnPreparePrinting(CPrintInfo *pInfo);
247 virtual void OnBeginPrinting(CDC *pDC, CPrintInfo *pInfo);
248 virtual void OnEndPrinting(CDC *pDC, CPrintInfo *pInfo);
249 virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
250 //}}AFX_VIRTUAL
251
252 // Implementation
253 public:
254 virtual ~CEditorView();
255 #ifdef _DEBUG
256 virtual void AssertValid() const;
257 virtual void Dump(CDumpContext &dc) const;
258 #endif
259
260 protected:
261 // Generated message map functions
262 protected:
263 //{{AFX_MSG(CEditorView)
264 afx_msg void OnSize(UINT nType, int cx, int cy);
265 afx_msg void OnDestroy();
266 afx_msg void OnButtonOutline();
267 afx_msg void OnUpdateButtonOutline(CCmdUI *pCmdUI);
268 afx_msg void OnUpdateViewTexturemine(CCmdUI *pCmdUI);
269 afx_msg void OnViewTexturemine();
270 afx_msg void OnUpdateViewWireframemine(CCmdUI *pCmdUI);
271 afx_msg void OnViewWireframemine();
272 afx_msg void OnParentNotify(UINT message, LPARAM lParam);
273 afx_msg void OnWindowTile();
274 afx_msg void OnWindowCascade();
275 afx_msg void OnButtonWindowSelection();
276 afx_msg void OnUpdateButtonWindowSelection(CCmdUI *pCmdUI);
277 afx_msg void OnButtonLighting();
278 afx_msg void OnUpdateButtonLighting(CCmdUI *pCmdUI);
279 afx_msg BOOL OnHelpInfo(HELPINFO *pHelpInfo);
280 afx_msg void OnRoomAdd();
281 afx_msg void OnRoomGrabTexture();
282 afx_msg void OnRoomNextFace();
283 afx_msg void OnRoomPreviousFace();
284 afx_msg void OnRoomSelectByNumber();
285 afx_msg void OnRoomAttachRoom();
286 afx_msg void OnRoomBuildBridge();
287 afx_msg void OnRoomMark();
288 afx_msg void OnRoomPlaceRoom();
289 afx_msg void OnUpdateRoomAttachRoom(CCmdUI *pCmdUI);
290 afx_msg void OnRoomUnPlaceRoom();
291 afx_msg void OnUpdateRoomUnPlaceRoom(CCmdUI *pCmdUI);
292 afx_msg void OnCancelEditSrvr();
293 afx_msg void OnRoomDelete();
294 afx_msg void OnRoomSelectFaceByNumber();
295 afx_msg void OnRoomSaveCurrentRoom();
296 afx_msg void OnZbutton();
297 afx_msg void OnUpdateZbutton(CCmdUI *pCmdUI);
298 afx_msg void OnRoomDropRoom();
299 afx_msg void OnRoomPlaceTerrainRoom();
300 afx_msg void OnRoomJoinRooms();
301 afx_msg void OnRoomSwapMarkedAndCurrentRoomFace();
302 afx_msg void OnRoomDeleteFace();
303 afx_msg void OnRoomSnapPlacedRoom();
304 afx_msg void OnUpdateRoomSnapPlacedRoom(CCmdUI *pCmdUI);
305 afx_msg void OnRoomJoinAdjacentFaces();
306 afx_msg void OnRoomPropagateToAll();
307 afx_msg void OnRoomSplitFace();
308 afx_msg void OnRoomDeletePortal();
309 afx_msg void OnRoomSnapPointToEdge();
310 afx_msg void OnRoomUndoSnap();
311 afx_msg void OnUpdateRoomUndoSnap(CCmdUI *pCmdUI);
312 afx_msg void OnRoomSnapPointToPoint();
313 afx_msg void OnReinitOpengl();
314 afx_msg void OnUpdateReinitOpengl(CCmdUI *pCmdUI);
315 afx_msg void OnFileRemoveExtraPoints();
316 afx_msg void OnRoomBuildSmoothBridge();
317 afx_msg void OnRoomJoinRoomsExact();
318 afx_msg void OnRoomStartNewFace();
319 afx_msg void OnRoomFinishNewFace();
320 afx_msg void OnRoomAddVertToNewFace();
321 afx_msg void OnRoomRenameRoom();
322 afx_msg void OnRoomSetCenterFromViewer();
323 afx_msg void OnRoomClearCenterPoint();
324 afx_msg void OnUpdateRoomClearCenterPoint(CCmdUI *pCmdUI);
325 afx_msg void OnUpdateRoomSetCenterFromViewer(CCmdUI *pCmdUI);
326 afx_msg void OnRoomCombine();
327 afx_msg void OnFileFixDegenerateFaces();
328 afx_msg void OnRoomSnapPointToFace();
329 afx_msg void OnRoomLinkToNewExternal();
330 afx_msg void OnRoomDeleteVert();
331 afx_msg void OnRoomFaceAddVertToEdge();
332 afx_msg void OnRoomFaceMoveVertOnEdge();
333 afx_msg void OnRoomFaceSplitFace();
334 afx_msg void OnRoomFaceDeleteVertOnEdge();
335 afx_msg void OnRoomMergeObjectIntoRoom();
336 afx_msg void OnRoomDeleteConnectedFaces();
337 afx_msg void OnRoomRotatePlacedRoom45Degrees();
338 afx_msg void OnRoomPropagateToAdjacentCoplanarFaces();
339 afx_msg void OnViewFlip();
340 afx_msg void OnFileRemoveDuplicateFacesFromCurrentRoom();
341 //}}AFX_MSG
342 DECLARE_MESSAGE_MAP()
343
344 // afx_msg void OnFileSave();
345 // afx_msg void OnFileSaveAs();
346
347 private:
348 CWireframeGrWnd m_grwndWireframe;
349 CTextureGrWnd m_grwndTexture;
350
351 BOOL m_grwndCreated;
352 BOOL m_grwndActive;
353
354 private:
355 void KillChildViews();
356 void CreateChildViews();
357 };
358
359 #ifndef _DEBUG // debug version in editorView.cpp
360 inline CEditorDoc *CEditorView::GetDocument() { return (CEditorDoc *)m_pDocument; }
361 #endif
362
363 /////////////////////////////////////////////////////////////////////////////
364 #endif