Marine systems simulation
DotSceneLoader.h
1#ifndef DOT_SCENELOADER_H
2#define DOT_SCENELOADER_H
3
4#pragma warning(push)
5#pragma warning( disable : 4251 )
6#include <OgreString.h>
7#include <OgreVector3.h>
8#include <OgreQuaternion.h>
9#pragma warning(pop)
10#include <vector>
11
12// Forward declarations
13class TiXmlElement;
14
15namespace Ogre
16{
17 // Forward declarations
18 class SceneManager;
19 class SceneNode;
20
22 {
23 public:
24 String nodeName;
25 String propertyNm;
26 String valueName;
27 String typeName;
28
29 nodeProperty(const String &node, const String &propertyName, const String &value, const String &type)
30 : nodeName(node), propertyNm(propertyName), valueName(value), typeName(type) {}
31 };
32
34 {
35 public:
36 DotSceneLoader() : mSceneMgr(0) {}
37 virtual ~DotSceneLoader() {}
38
39 void parseDotScene(const String &SceneName, const String &groupName, SceneManager *yourSceneMgr, SceneNode *pAttachNode = NULL, const String &sPrependNode = "");
40 String getProperty(const String &ndNm, const String &prop);
41
42 std::vector<nodeProperty> nodeProperties;
43 std::vector<String> staticObjects;
44 std::vector<String> dynamicObjects;
45
46 protected:
47 void processScene(TiXmlElement *XMLRoot);
48
49 void processNodes(TiXmlElement *XMLNode);
50 void processExternals(TiXmlElement *XMLNode);
51 void processEnvironment(TiXmlElement *XMLNode);
52 void processTerrain(TiXmlElement *XMLNode);
53 void processUserDataReference(TiXmlElement *XMLNode, SceneNode *pParent = 0);
54 void processUserDataReference(TiXmlElement *XMLNode, Entity *pEntity);
55 void processOctree(TiXmlElement *XMLNode);
56 void processLight(TiXmlElement *XMLNode, SceneNode *pParent = 0);
57 void processCamera(TiXmlElement *XMLNode, SceneNode *pParent = 0);
58
59 void processNode(TiXmlElement *XMLNode, SceneNode *pParent = 0);
60 void processLookTarget(TiXmlElement *XMLNode, SceneNode *pParent);
61 void processTrackTarget(TiXmlElement *XMLNode, SceneNode *pParent);
62 void processEntity(TiXmlElement *XMLNode, SceneNode *pParent);
63 void processParticleSystem(TiXmlElement *XMLNode, SceneNode *pParent);
64 void processBillboardSet(TiXmlElement *XMLNode, SceneNode *pParent);
65 void processPlane(TiXmlElement *XMLNode, SceneNode *pParent);
66
67 void processFog(TiXmlElement *XMLNode);
68 void processSkyBox(TiXmlElement *XMLNode);
69 void processSkyDome(TiXmlElement *XMLNode);
70 void processSkyPlane(TiXmlElement *XMLNode);
71 void processClipping(TiXmlElement *XMLNode);
72
73 void processLightRange(TiXmlElement *XMLNode, Light *pLight);
74 void processLightAttenuation(TiXmlElement *XMLNode, Light *pLight);
75
76 String getAttrib(TiXmlElement *XMLNode, const String &parameter, const String &defaultValue = "");
77 Real getAttribReal(TiXmlElement *XMLNode, const String &parameter, Real defaultValue = 0);
78 bool getAttribBool(TiXmlElement *XMLNode, const String &parameter, bool defaultValue = false);
79
80 Vector3 parseVector3(TiXmlElement *XMLNode);
81 Quaternion parseQuaternion(TiXmlElement *XMLNode);
82 ColourValue parseColour(TiXmlElement *XMLNode);
83
84
85 SceneManager *mSceneMgr;
86 SceneNode *mAttachNode;
87 String m_sGroupName;
88 String m_sPrependNode;
89 };
90}
91
92#endif // DOT_SCENELOADER_H
Definition: DotSceneLoader.h:34
Definition: DotSceneLoader.h:22