mercator
0.4.0
A terrain generation library for the Worldforge system.
|
Surface shader that defines the surface above a given level. More...
#include <ThresholdShader.h>
Public Types | |
typedef std::map< std::string, float > | Parameters |
STL map of parameter values for a shader constructor. More... | |
Public Member Functions | |
HighShader (float threshold=default_threshold) | |
Constructor. More... | |
HighShader (const Parameters ¶ms) | |
Constructor. More... | |
float | threshold () const |
Accessor for level above which the shader renders. More... | |
bool | checkIntersect (const Segment &) const override |
Check whether this Shader has any effect on the given Segment. More... | |
void | shade (Surface &) const override |
Populate a Surface with data. More... | |
bool | getColor () const |
Accessor for color flag. More... | |
bool | getAlpha () const |
Accessor for alpha flag. More... | |
std::unique_ptr< Surface > | newSurface (const Segment &) const |
Create a new Surface which matches the requirements of this shader. More... | |
Static Public Attributes | |
static const std::string | key_threshold |
Key string used when specifying the threshold parameter. More... | |
static const float | default_threshold = 1.f |
Default level above which the shader renders. More... | |
Surface shader that defines the surface above a given level.
Definition at line 13 of file ThresholdShader.h.
|
inherited |
|
explicit |
Constructor.
threshold | level below which the shader renders. |
Definition at line 18 of file ThresholdShader.cpp.
|
explicit |
Constructor.
params | a map of parameters for the shader. |
Definition at line 22 of file ThresholdShader.cpp.
References key_threshold.
|
overridevirtual |
Check whether this Shader has any effect on the given Segment.
Implements Mercator::Shader.
Definition at line 33 of file ThresholdShader.cpp.
References Mercator::Segment::getMax().
Referenced by Mercator::BandShader::highThreshold(), threshold(), and Mercator::LowShader::threshold().
|
inlineinherited |
Accessor for alpha flag.
Definition at line 42 of file Shader.h.
References Mercator::Shader::checkIntersect(), Mercator::Shader::newSurface(), and Mercator::Shader::shade().
|
inlineinherited |
Create a new Surface which matches the requirements of this shader.
Called by terrain when creating a new Segment to add the necessary Surface objects to that Segment.
Definition at line 27 of file Shader.cpp.
Referenced by Mercator::Terrain::addShader(), Mercator::Segment::clearMods(), and Mercator::Shader::getAlpha().
|
overridevirtual |
Populate a Surface with data.
Implements Mercator::Shader.
Definition at line 42 of file ThresholdShader.cpp.
References Mercator::LowShader::default_threshold, Mercator::Buffer< DataType >::getChannels(), Mercator::Buffer< DataType >::getData(), Mercator::Segment::getPoints(), Mercator::Surface::getSegment(), Mercator::Segment::getSize(), and Mercator::LowShader::key_threshold.
Referenced by Mercator::BandShader::highThreshold(), threshold(), and Mercator::LowShader::threshold().
|
inline |
Accessor for level above which the shader renders.
Definition at line 36 of file ThresholdShader.h.
References checkIntersect(), and shade().
|
static |
Default level above which the shader renders.
Definition at line 22 of file ThresholdShader.h.
|
static |
Key string used when specifying the threshold parameter.
Definition at line 19 of file ThresholdShader.h.
Referenced by HighShader().