Mercator
TileShader.h
1 // This file may be redistributed and modified only under the terms of
2 // the GNU General Public License (See COPYING for details).
3 // Copyright (C) 2005 Alistair Riddoch
4 
5 #ifndef MERCATOR_TILE_SHADER_H
6 #define MERCATOR_TILE_SHADER_H
7 
8 #include <Mercator/Shader.h>
9 
10 #include <map>
11 
12 namespace Mercator {
13 
21 class TileShader : public Shader {
22  public:
24  typedef std::map<int, Shader *> Shaderstore;
25  private:
28  public:
29  explicit TileShader();
30  virtual ~TileShader();
31 
33  void addShader(Shader * t, int id) {
34  m_subShaders[id] = t;
35  }
36 
37  virtual bool checkIntersect(const Segment &) const;
38  virtual void shade(Surface &) const;
39 };
40 
41 } // namespace Mercator
42 
43 #endif // MERCATOR_TILE_SHADER_H
Mercator::Surface::populate
void populate()
Populate the data buffer using the correct shader.
Definition: Surface.cpp:30
Mercator::Buffer::getSegment
const Segment & getSegment() const
Accessor for the terrain height segment this buffer is associated with.
Definition: Buffer.h:55
Mercator::Buffer::getChannels
unsigned int getChannels() const
Accessor for the number of data values per height point.
Definition: Buffer.h:65
Mercator::Segment
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
Definition: Segment.h:36
Mercator::Surface
Data store for terrain surface data.
Definition: Surface.h:22
Mercator::TileShader::m_subShaders
Shaderstore m_subShaders
Store of shaders which are agregated by this shader.
Definition: TileShader.h:27
Mercator::TileShader::Shaderstore
std::map< int, Shader * > Shaderstore
STL map to store sparse array of Shader pointers.
Definition: TileShader.h:24
Mercator::TileShader::checkIntersect
virtual bool checkIntersect(const Segment &) const
Check whether this Shader has any effect on the given Segment.
Definition: TileShader.cpp:28
Mercator::TileShader
Shader agregating surface data.
Definition: TileShader.h:21
Mercator::TileShader::shade
virtual void shade(Surface &) const
Populate a Surface with data.
Definition: TileShader.cpp:33
Mercator::Buffer::getData
DataType * getData()
Accessor for a pointer to buffer containing data values.
Definition: Buffer.h:70
Mercator::Shader
Base class for Shader objects which create surface data for use when rendering terrain.
Definition: Shader.h:29
Mercator::Buffer::getSize
unsigned int getSize() const
Accessor for the size of segment, m_res + 1.
Definition: Buffer.h:60
Mercator::TileShader::addShader
void addShader(Shader *t, int id)
Add a shader to those agregated by the tile shader.
Definition: TileShader.h:33