Coverage Report

Created: 2025-08-28 06:22

/src/ogre/PlugIns/DotScene/include/OgreDotSceneLoader.h
Line
Count
Source (jump to first uncovered line)
1
#ifndef DOT_SCENELOADER_H
2
#define DOT_SCENELOADER_H
3
4
// Includes
5
#include <OgreDotScenePluginExports.h>
6
#include <OgreColourValue.h>
7
#include <OgreQuaternion.h>
8
#include <OgreResourceGroupManager.h>
9
#include <OgreString.h>
10
#include <OgrePlugin.h>
11
#include <OgreCodec.h>
12
13
namespace pugi
14
{
15
class xml_node;
16
}
17
18
// Forward declarations
19
namespace Ogre
20
{
21
class SceneManager;
22
class SceneNode;
23
24
/** \addtogroup Plugins Plugins
25
*  @{
26
*/
27
/** \defgroup DotSceneCodec DotSceneCodec
28
 *
29
 * %Codec for loading and saving the SceneNode hierarchy in .scene files.
30
 * @{
31
 */
32
class _OgreDotScenePluginExport DotSceneLoader
33
{
34
public:
35
    DotSceneLoader();
36
    virtual ~DotSceneLoader();
37
38
    void load(Ogre::DataStreamPtr& stream, const Ogre::String& groupName, Ogre::SceneNode* rootNode);
39
40
    void exportScene(SceneNode* rootNode, const String& outFileName);
41
42
0
    const Ogre::ColourValue& getBackgroundColour() { return mBackgroundColour; }
43
44
protected:
45
    void writeNode(pugi::xml_node& parentXML, const SceneNode* node);
46
    void processScene(pugi::xml_node& XMLRoot);
47
48
    void processNodes(pugi::xml_node& XMLNode);
49
    void processExternals(pugi::xml_node& XMLNode);
50
    void processEnvironment(pugi::xml_node& XMLNode);
51
    void processTerrainGroup(pugi::xml_node& XMLNode);
52
    void processBlendmaps(pugi::xml_node& XMLNode);
53
    void processUserData(pugi::xml_node& XMLNode, Ogre::UserObjectBindings& userData);
54
    void processLight(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent = 0);
55
    void processCamera(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent = 0);
56
57
    void processNode(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent = 0);
58
    void processLookTarget(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent);
59
    void processTrackTarget(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent);
60
    void processEntity(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent);
61
    void processParticleSystem(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent);
62
    void processBillboardSet(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent);
63
    void processPlane(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent);
64
    void processNodeAnimations(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent);
65
    void processNodeAnimation(pugi::xml_node& XMLNode, Ogre::SceneNode* pParent);
66
    void processKeyframe(pugi::xml_node& XMLNode, Ogre::NodeAnimationTrack* pTrack);
67
68
    void processFog(pugi::xml_node& XMLNode);
69
    void processSkyBox(pugi::xml_node& XMLNode);
70
    void processSkyDome(pugi::xml_node& XMLNode);
71
    void processSkyPlane(pugi::xml_node& XMLNode);
72
73
    void processLightRange(pugi::xml_node& XMLNode, Ogre::Light* pLight);
74
    void processLightAttenuation(pugi::xml_node& XMLNode, Ogre::Light* pLight);
75
  void processLightSourceSize(pugi::xml_node& XMLNode, Ogre::Light* pLight);
76
77
    Ogre::SceneManager* mSceneMgr;
78
    Ogre::SceneNode* mAttachNode;
79
    Ogre::String m_sGroupName;
80
    Ogre::ColourValue mBackgroundColour;
81
};
82
83
class _OgreDotScenePluginExport DotScenePlugin : public Plugin
84
{
85
    const String& getName() const override;
86
87
1
    void install() override {}
88
    void initialise() override;
89
    void shutdown() override;
90
1
    void uninstall() override {}
91
private:
92
    Codec* mCodec;
93
};
94
/** @} */
95
/** @} */
96
} // namespace Ogre
97
#endif // DOT_SCENELOADER_H