vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tool.h
Go to the documentation of this file.
1 #ifndef _TOOL_H
2 #define _TOOL_H
3 
5 
7 #include <vrecko/Logger.h>
8 #include <osg/Geometry>
9 #include <osg/Geode>
10 #include <osg/Vec3>
11 #include <osg/ref_ptr>
12 #include <vector>
13 
14 #include <vrecko/ReaderWriter.h>
15 
16 #include <xercesc/parsers/XercesDOMParser.hpp>
17 #include <xercesc/dom/DOM.hpp>
18 #include <xercesc/dom/DOMImplementation.hpp>
19 #include <xercesc/sax/HandlerBase.hpp>
20 #include <xercesc/util/XMLString.hpp>
21 #include <xercesc/util/PlatformUtils.hpp>
22 
23 #include <xercesc/dom/DOMWriter.hpp>
24 #include <xercesc/framework/StdOutFormatTarget.hpp>
25 #include <xercesc/framework/LocalFileFormatTarget.hpp>
26 
27 #include "Geometry.h"
28 
29 XERCES_CPP_NAMESPACE_USE
30 using namespace vrecko;
31 using namespace vrecko;
32 using namespace WGeometry;
33 
34 namespace APRoomEdit {
35 
36  // Tool type enumeration
37  typedef enum ToolType {
38  NONE = 0,
41  WALLADD = 3,
43  POINTMOVE = 5,
44  SAVER = 6,
45  LOADER = 7,
49  POINTADD = 11
50  };
51 
52  class Tool {
53  public:
54  Tool() {type = NONE; dirty=false; }
55  virtual ~Tool() {}
56 
57  ToolType getType() {return type;}
58  string getName() {return name;}
59  void setName(string n) {name = n;}
60  bool isDirty() {return dirty;}
61  void setDirty(bool d) {dirty=d;}
62 
63  virtual void init(osgUtil::LineSegmentIntersector::Intersection* intersection, WG_Wall* curWall, WG_Point* curPoint, PointType type, vrecko::EnvironmentObject* pEOOwner, std::vector<osg::ref_ptr<WG_Wall> >* walls, std::vector<osg::ref_ptr<WG_Point> >* points, osg::Geode* pOSGGeode, osg::Vec3Array* pOSGVertexArray) {}
64  virtual void update(osgUtil::LineSegmentIntersector::Intersection* intersection, WG_Wall* curWall, WG_Point* curPoint, PointType type, vrecko::EnvironmentObject* pEOOwner, std::vector<osg::ref_ptr<WG_Wall> >* walls, std::vector<osg::ref_ptr<WG_Point> >* points, osg::Geode* pOSGGeode, osg::Vec3Array* pOSGVertexArray, osg::Vec3& movingVector) {}
65  virtual void terminate(osgUtil::LineSegmentIntersector::Intersection* intersection, WG_Wall* curWall, WG_Point* curPoint, PointType type, vrecko::EnvironmentObject* pEOOwner, std::vector<osg::ref_ptr<WG_Wall> >* walls, std::vector<osg::ref_ptr<WG_Point> >* points, osg::Geode* pOSGGeode, osg::Vec3Array* pOSGVertexArray) {}
66  virtual bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode) { return true; }
67 
68  protected:
70  bool dirty;
71  std::string name;
72  };
73 }
74 
75 #endif
76