vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Editor.h
Go to the documentation of this file.
1 #ifndef _EDITOR_H_
2 #define _EDITOR_H_
3 
5 
6 #include <vrecko/PluginManager.h>
7 #include <vrecko/World.h>
9 #include <vrecko/Scene.h>
10 #include <osg/Light>
11 #include <osg/LightSource>
12 #include <osg/Material>
13 #include <osg/BlendFunc>
14 #include <osg/AlphaFunc>
15 #include <osg/PositionAttitudeTransform>
16 
17 #include <osgDB/readFile>
18 //XML parameters
19 #include <helpers/XercesXMLUtils.h>
20 #include <vrecko/ReaderWriter.h>
21 #include <xercesc/parsers/XercesDOMParser.hpp>
22 
23 #include <osg/Group>
24 #include <osg/Geode>
25 #include <osg/Geometry>
26 #include <osg/Shape>
27 #include <osg/ShapeDrawable>
28 #include <osg/Timer>
29 
30 #include <iostream>
31 #include <sstream>
32 #include <vector>
33 #include <cmath>
34 #include <fstream>
35 
36 #include <windows.h>
37 
39 
40 using namespace vrecko;
41 
42 namespace APLightsEditor {
43 
44 struct _Light
45 {
46  _Light(EnvironmentObject* eoPtr, int lightID, EnvironmentObject* eoSpotPtr = NULL)
47  {
48  _lightID = lightID;
49  _eoPtr = eoPtr;
50  _eoSpotPtr = eoSpotPtr;
51 
52  _eoPtr->setNodeMask(_eoPtr->getNodeMask() & ~0x40);
53 
54  if(eoSpotPtr)
55  _eoSpotPtr->setNodeMask(_eoPtr->getNodeMask() & ~0x40);
56  }
57 
58  int _lightID;
61 };
62 
64 {
65  public:
66  Editor();
67  virtual ~Editor();
68  void update(void);
69  protected:
71  std::vector<_Light> lightMarker;
73  int sunID;
77 
78  bool makeMenu();
79  void saveToXML(const char* FileName);
80  EnvironmentObject* DrawPoint(osg::Vec3 position, float pointRadius, osg::Vec4 pointColor);
81  virtual void fillDefaultInfo();
82  virtual bool activate();
83  virtual void deactivate();
84  virtual void menuItemClicked(const char* itemID);
85  virtual void menuSliderChanged(const char* sliderID, float sliderPos);
86  bool initialize(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode = NULL);
87 
88 };
89 }
90 
91 #endif