~ubuntu-branches/debian/sid/ember/sid

« back to all changes in this revision

Viewing changes to src/components/ogre/terrain/TerrainMod.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2009-07-23 07:46:40 UTC
  • Revision ID: james.westby@ubuntu.com-20090723074640-wh0ukzis0kda36qv
Tags: upstream-0.5.6
ImportĀ upstreamĀ versionĀ 0.5.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// C++ Interface: TerrainMod
 
3
//
 
4
// Description: The purpose of this class is to wrap an Eris::TerrainMod instance
 
5
//
 
6
//              TerrainGenerator listens for changes in the modifier and
 
7
//              updates or removes the modifiers from the terrain as needed.
 
8
//
 
9
//
 
10
// Author: Tamas Bates <rhymer@gmail.com>, (C) 2008
 
11
// Author: Erik Hjortsberg <erik.hjortsberg@gmail.com>, (C) 2008
 
12
//
 
13
// This program is free software; you can redistribute it and/or modify
 
14
// it under the terms of the GNU General Public License as published by
 
15
// the Free Software Foundation; either version 2 of the License, or
 
16
// (at your option) any later version.
 
17
//
 
18
// This program is distributed in the hope that it will be useful,
 
19
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
// GNU General Public License for more details.
 
22
//
 
23
// You should have received a copy of the GNU General Public License
 
24
// along with this program; if not, write to the Free Software
 
25
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.//
 
26
//
 
27
#ifndef EMBEROGRETERRAINMOD_H
 
28
#define EMBEROGRETERRAINMOD_H
 
29
 
 
30
#include <sigc++/signal.h>
 
31
#include <Eris/Entity.h>
 
32
 
 
33
namespace Mercator
 
34
{
 
35
        class TerrainMod;
 
36
        class CraterTerrainMod;
 
37
}
 
38
 
 
39
namespace Eris 
 
40
{
 
41
        class TerrainMod;
 
42
}
 
43
 
 
44
namespace EmberOgre
 
45
{
 
46
 
 
47
class EmberEntity;
 
48
 
 
49
namespace Terrain {
 
50
 
 
51
/**
 
52
@author Tamas Bates
 
53
@author Erik Hjortsberg
 
54
@brief Wrapper class that envelopes an Eris::TerrainMod.
 
55
The heavy lifting occurs in Eris::TerrainMod, but this class allows some additional features to be added if so needed.
 
56
*/
 
57
class TerrainMod
 
58
{
 
59
public:
 
60
        /**
 
61
         * @brief Ctor.
 
62
         * @param entity The entity to which this mod belongs.
 
63
         */
 
64
        TerrainMod(EmberEntity* entity);
 
65
 
 
66
        /**
 
67
         * @brief Dtor.
 
68
         */
 
69
        ~TerrainMod();
 
70
        
 
71
        /**
 
72
         * @brief Sets up the observation of the entity, and parses the mod info, creating the initial mod instance.
 
73
         * @return True if the atlas data was conformant and successfully parsed.
 
74
         */
 
75
        bool init();
 
76
 
 
77
        /**
 
78
         *    @brief Used to retrieve a pointer to this modifier
 
79
         * @returns a pointer to this modifier
 
80
         */
 
81
        Eris::TerrainMod* getErisMod() const;
 
82
 
 
83
        /**
 
84
         * Emitted whenever the modifier is changed or moved.
 
85
         */
 
86
        sigc::signal<void> EventModChanged;
 
87
 
 
88
        /**
 
89
         *Emitted just before the entity owning this mod is deleted.
 
90
         *Should be caught by TerrainGenerator to remove this mod from the terrain.
 
91
         */
 
92
        sigc::signal<void> EventModDeleted;
 
93
        
 
94
protected:
 
95
 
 
96
        /**
 
97
         * @brief Listen for the mod changed event and pass it on.
 
98
         */
 
99
        void terrainMod_ModChanged();
 
100
        
 
101
        /**
 
102
         * @brief Listen for the mod deleted event and pass it on.
 
103
         */
 
104
        void terrainMod_ModDeleted();
 
105
        
 
106
        /**
 
107
         * @brief The actual Eris::TerrainMod implementation responsible for the parsing and updating of the mod.
 
108
         */
 
109
        Eris::TerrainMod* mInnerMod;
 
110
};
 
111
 
 
112
}
 
113
};
 
114
 
 
115
#endif