Mercator
DepthShader.h
00001 // This file may be redistributed and modified only under the terms of
00002 // the GNU General Public License (See COPYING for details).
00003 // Copyright (C) 2003 Alistair Riddoch
00004 
00005 #ifndef MERCATOR_FILL_DEPTH_SHADER_H
00006 #define MERCATOR_FILL_DEPTH_SHADER_H
00007 
00008 #include <Mercator/Shader.h>
00009 
00010 namespace Mercator {
00011 
00019 class DepthShader : public Shader {
00020   private:
00022     float m_waterLevel;
00024     float m_murkyDepth;
00025   public:
00027     static const std::string key_waterLevel;
00029     static const std::string key_murkyDepth;
00030 
00032     static const float default_waterLevel;
00034     static const float default_murkyDepth;
00035 
00040     explicit DepthShader(float waterLevel = default_waterLevel,
00041                          float murkyDepth = default_murkyDepth);
00045     explicit DepthShader(const Parameters & params);
00046     virtual ~DepthShader();
00047 
00049     const float waterLevel() const { return m_waterLevel; }
00051     const float murkyDepth() const { return m_murkyDepth; }
00052 
00053     virtual bool checkIntersect(const Segment &) const;
00054     virtual void shade(Surface &) const;
00055 };
00056 
00057 } // namespace Mercator
00058 
00059 #endif // MERCATOR_FILL_DEPTH_SHADER_H