Mercator
DepthShader.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) 2003 Alistair Riddoch
4 
5 #ifndef MERCATOR_FILL_DEPTH_SHADER_H
6 #define MERCATOR_FILL_DEPTH_SHADER_H
7 
8 #include <Mercator/Shader.h>
9 
10 namespace Mercator {
11 
19 class DepthShader : public Shader {
20  private:
22  float m_waterLevel;
24  float m_murkyDepth;
25  public:
27  static const std::string key_waterLevel;
29  static const std::string key_murkyDepth;
30 
32  static const float default_waterLevel;
34  static const float default_murkyDepth;
35 
40  explicit DepthShader(float waterLevel = default_waterLevel,
45  explicit DepthShader(const Parameters & params);
46  virtual ~DepthShader();
47 
49  const float waterLevel() const { return m_waterLevel; }
51  const float murkyDepth() const { return m_murkyDepth; }
52 
53  virtual bool checkIntersect(const Segment &) const;
54  virtual void shade(Surface &) const;
55 };
56 
57 } // namespace Mercator
58 
59 #endif // MERCATOR_FILL_DEPTH_SHADER_H