vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RoomEditor.h
Go to the documentation of this file.
1 #ifndef _ROOM_EDITOR_H
2 #define _ROOM_EDITOR_H
3 
4 #include <vrecko/ReaderWriter.h>
5 
7 
8 #include <vrecko/Ability.h>
10 #include <vrecko/Scene.h>
11 #include <vrecko/EventDispatcher.h>
12 #include <vrecko/Logger.h>
13 
14 #include <osgDB/ReadFile>
15 
16 #include <sstream>
17 #include <map>
18 #include <vector>
19 #include <string>
20 
21 #include "WallGeometry.h"
22 #include "Tool.h"
23 #include "ColorBucket.h"
24 #include "RoomSaver.h"
25 #include "RoomLoader.h"
26 #include "WallRemove.h"
27 #include "PointMove.h"
28 #include "WallAdd.h"
29 #include "WallMovement.h"
30 #include "PointAdd.h"
31 #include "CreateHole.h"
32 #include "HoleRemove.h"
33 
34 using namespace vrecko;
35 using namespace vrecko;
36 
37 namespace APRoomEdit {
38 
40  public:
41  RoomEditor();
42  virtual ~RoomEditor();
43 
44  virtual void update(void);
45 
46  void setIntersection(osg::Vec3& position, vrecko::Scene* scenePtr);
47  inline osgUtil::LineSegmentIntersector::Intersection getIntersection() { return intersection; }
48 
49  virtual bool initialize(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *parameters = NULL);
50  protected:
51  virtual void fillDefaultInfo();
52 
53  virtual bool activate();
54  virtual void deactivate();
55 
56  void issueRequests(bool bStopIfNoSelection);
57 
58  virtual void processButtonPress(CABUTTONEVENT* eventData);
59  virtual void processButtonRelease(CABUTTONEVENT* eventData);
60 
61  void RoomEditor::menuItemClicked(const char* itemID);
62 
63  bool showToolMenu();
64 
65  private:
66  // intersection information of selected object
67  osgUtil::LineSegmentIntersector::Intersection intersection;
68 
69  bool toolChange;
70  bool menuShown;
71  bool bFirstUpdate;
72 
73  Tool* tool;
74  std::map<std::string, std::map<std::string, Tool *> > tools;
75 
76  unsigned long selectedObjectId;
77  WallGeometry* pWallGeometry;
78 
79  osg::Vec3 firstPointerPos;
80 
81  bool hasMoreThanOneTool() { return ((tools.size() > 1) || ((tools.size() == 1) && ((*tools.begin()).second.size() > 1))); }
82 };
83 
84 }
85 
86 
87 
88 #endif
89