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:
27  Shaderstore m_subShaders;
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
virtual bool checkIntersect(const Segment &) const
Check whether this Shader has any effect on the given Segment.
Definition: TileShader.cpp:28
Definition: Area.cpp:20
virtual void shade(Surface &) const
Populate a Surface with data.
Definition: TileShader.cpp:33
Data store for terrain surface data.
Definition: Surface.h:22
Shader agregating surface data.
Definition: TileShader.h:21
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
Definition: Segment.h:36
Base class for Shader objects which create surface data for use when rendering terrain.
Definition: Shader.h:29
Shaderstore m_subShaders
Store of shaders which are agregated by this shader.
Definition: TileShader.h:27
void addShader(Shader *t, int id)
Add a shader to those agregated by the tile shader.
Definition: TileShader.h:33
std::map< int, Shader * > Shaderstore
STL map to store sparse array of Shader pointers.
Definition: TileShader.h:24