Mercator
|
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_THRESHOLD_SHADER_H 00006 #define MERCATOR_FILL_THRESHOLD_SHADER_H 00007 00008 #include <Mercator/Shader.h> 00009 00010 namespace Mercator { 00011 00013 class HighShader : public Shader { 00014 private: 00016 float m_threshold; 00017 public: 00019 static const std::string key_threshold; 00020 00022 static const float default_threshold; 00023 00027 explicit HighShader(float threshold = default_threshold); 00031 explicit HighShader(const Parameters & params); 00032 virtual ~HighShader(); 00033 00035 const float threshold() const { return m_threshold; } 00036 00037 virtual bool checkIntersect(const Segment &) const; 00038 virtual void shade(Surface &) const; 00039 }; 00040 00042 class LowShader : public Shader { 00043 private: 00045 float m_threshold; 00046 public: 00048 static const std::string key_threshold; 00049 00051 static const float default_threshold; 00052 00056 explicit LowShader(float threshold = default_threshold); 00060 explicit LowShader(const Parameters & params); 00061 virtual ~LowShader(); 00062 00064 const float threshold() const { return m_threshold; } 00065 00066 virtual bool checkIntersect(const Segment &) const; 00067 virtual void shade(Surface &) const; 00068 }; 00069 00071 class BandShader : public Shader { 00072 private: 00074 float m_lowThreshold; 00076 float m_highThreshold; 00077 public: 00079 static const std::string key_lowThreshold; 00081 static const std::string key_highThreshold; 00082 00084 static const float default_lowThreshold; 00086 static const float default_highThreshold; 00087 00092 explicit BandShader(float low_threshold = default_lowThreshold, 00093 float high_threshold = default_highThreshold); 00097 explicit BandShader(const Parameters & params); 00098 virtual ~BandShader(); 00099 00101 const float lowThreshold() const { return m_lowThreshold; } 00103 const float highThreshold() const { return m_highThreshold; } 00104 00105 virtual bool checkIntersect(const Segment &) const; 00106 virtual void shade(Surface &) const; 00107 }; 00108 00109 } // namespace Mercator 00110 00111 #endif // MERCATOR_FILL_THRESHOLD_SHADER_H