Mercator
Public Member Functions | Static Public Attributes | Private Attributes
Mercator::BandShader Class Reference

Surface shader that defines the surface between two levels. More...

#include <ThresholdShader.h>

Inheritance diagram for Mercator::BandShader:
Mercator::Shader

List of all members.

Public Member Functions

 BandShader (float low_threshold=default_lowThreshold, float high_threshold=default_highThreshold)
 Constructor.
 BandShader (const Parameters &params)
 Constructor.
const float lowThreshold () const
 Accessor for the level above which the shader renders.
const float highThreshold () const
 Accessor for the level below which the shader renders.
virtual bool checkIntersect (const Segment &) const
 Check whether this Shader has any effect on the given Segment.
virtual void shade (Surface &) const
 Populate a Surface with data.

Static Public Attributes

static const std::string key_lowThreshold
 Key string used when specifying the low threshold parameter.
static const std::string key_highThreshold
 Key string used when specifying the high threshold parameter.
static const float default_lowThreshold = -1.f
 Default level above which the shader renders.
static const float default_highThreshold = 1.f
 Default level below which the shader renders.

Private Attributes

float m_lowThreshold
 The level above which the shader renders.
float m_highThreshold
 The level below which the shader renders.

Detailed Description

Surface shader that defines the surface between two levels.


Constructor & Destructor Documentation

Mercator::BandShader::BandShader ( float  low_threshold = default_lowThreshold,
float  high_threshold = default_highThreshold 
) [explicit]

Constructor.

Parameters:
low_thresholdlevel above which the shader renders.
high_thresholdlevel below which the shader renders.
Mercator::BandShader::BandShader ( const Parameters params) [explicit]

Constructor.

Parameters:
paramsa map of parameters for the shader.

References key_highThreshold, key_lowThreshold, m_highThreshold, and m_lowThreshold.


Member Function Documentation

bool Mercator::BandShader::checkIntersect ( const Segment ) const [virtual]

Check whether this Shader has any effect on the given Segment.

Returns:
true if the given Segment height range is within the range that this Shader uses. e.g. A high altitude snow shader will have no effect on low level terrain.

Implements Mercator::Shader.

References Mercator::Segment::getMax(), Mercator::Segment::getMin(), m_highThreshold, and m_lowThreshold.


The documentation for this class was generated from the following files: