Planeshift
worldeditor.h
Go to the documentation of this file.
1 /*
2 * worldeditor.h - Author: Mike Gist
3 *
4 * Copyright (C) 2009 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5 *
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation (version 2 of the License)
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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 */
19 
20 #include <csutil/ref.h>
21 #include "util/genericevent.h"
22 
23 class pawsMainWidget;
24 class PawsManager;
25 struct iEngine;
26 struct iGraphics3D;
27 struct iKeyboardDriver;
28 struct iObjectRegistry;
29 struct iSceneManipulate;
30 struct iVirtualClock;
31 struct iView;
32 
34 {
35 public:
36  WorldEditor(int argc, char* argv[]);
37  ~WorldEditor();
38 
39  void Run();
40 
41 private:
42  /* Handles an event from the event handler */
43  bool HandleEvent(iEvent &ev);
44 
45  /* Init plugins, paws, world etc. */
46  bool Init();
47 
48  /* Handles camera movement */
49  void HandleMovement();
50 
51  /* Handles mesh manipulation */
52  void HandleMeshManipulation(iEvent &ev);
53 
54  // Editing modes
55  enum EditMode
56  {
57  Select = 0,
58  Create,
59  TranslateXZ,
60  TranslateY,
61  Rotate,
62  Remove
63  };
64 
65  EditMode editMode;
66 
67  // Whether to move the camera or the mesh.
68  bool moveCamera;
69 
70  // CS
71  iObjectRegistry* objectReg;
72  csRef<iView> view;
73  csRef<iGraphics3D> g3d;
74  csRef<iEngine> engine;
75  csRef<iKeyboardDriver> kbd;
76  csRef<iVirtualClock> vc;
77  DeclareGenericEventHandler(EventHandler, WorldEditor, "worldeditor");
78 
79  // PS
80  PawsManager* paws;
81  pawsMainWidget* mainWidget;
82  csRef<iSceneManipulate> sceneManipulator;
84  float rotX, rotY;
85 
86  // Event ids.
87  csEventID MouseMove;
88  csEventID MouseDown;
89  csEventID KeyDown;
90  csEventID FrameEvent;
91 };
Main PlaneShift Window manager.
Definition: pawsmanager.h:82
WorldEditor(int argc, char *argv[])
The main or desktop widget.