2
// C++ Interface: TerrainPageSurface
7
// Author: Erik Hjortsberg <erik.hjortsberg@gmail.com>, (C) 2007
9
// This program is free software; you can redistribute it and/or modify
10
// it under the terms of the GNU General Public License as published by
11
// the Free Software Foundation; either version 2 of the License, or
12
// (at your option) any later version.
14
// This program is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
// GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program; if not, write to the Free Software
21
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.//
23
#ifndef EMBEROGRETERRAINPAGESURFACE_H
24
#define EMBEROGRETERRAINPAGESURFACE_H
27
#include "../EmberOgrePrerequisites.h"
29
#include "TerrainPage.h"
41
class TerrainPageSurfaceLayer;
43
class TerrainPageSurfaceCompiler;
44
class TerrainPageShadow;
45
class TerrainLayerDefinition;
48
@author Erik Hjortsberg <erik.hjortsberg@gmail.com>
50
class TerrainPageSurface{
52
typedef std::map<int, TerrainPageSurfaceLayer*> TerrainPageSurfaceLayerStore;
53
TerrainPageSurface(TerrainPage& terrainPage);
55
virtual ~TerrainPageSurface();
57
unsigned int getPixelWidth() const;
60
* The position of the page in Worldforge space
63
const TerrainPosition& getWFPosition() const;
65
SegmentVector& getValidSegments();
68
* The number of Mercator::Segments for each axis. I.e. the root of the total number of segments.
71
int getNumberOfSegmentsPerAxis() const;
73
TerrainPageSurfaceLayer* createSurfaceLayer(const TerrainLayerDefinition& definition, int surfaceIndex, Mercator::Shader* shader);
75
Ogre::MaterialPtr getMaterial();
78
* @brief Recompiles the material.
79
* @param reselectTechnique If true, we'll also see if we need to reselect the technique to use.
81
void recompileMaterial(bool reselectTechnique);
83
void setShadow(TerrainPageShadow* shadow);
85
const TerrainPageSurfaceLayerStore& getLayers() const;
87
TerrainPageSurfaceLayer* updateLayer(int layerIndex, bool repopulate);
91
void updateSceneManagersAfterMaterialsChange();
93
Ogre::MaterialPtr mMaterial;
94
TerrainPage& mTerrainPage;
95
TerrainPageSurfaceLayerStore mLayers;
96
std::auto_ptr<TerrainPageSurfaceCompiler> mSurfaceCompiler;
97
TerrainPageShadow* mShadow;