mercator
0.4.0
A terrain generation library for the Worldforge system.
|
Surface shader that defines the surface between two levels. 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 | |
BandShader (float low_threshold=default_lowThreshold, float high_threshold=default_highThreshold) | |
Constructor. More... | |
BandShader (const Parameters ¶ms) | |
Constructor. More... | |
float | lowThreshold () const |
Accessor for the level above which the shader renders. More... | |
float | highThreshold () const |
Accessor for the level below 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_lowThreshold |
Key string used when specifying the low threshold parameter. More... | |
static const std::string | key_highThreshold |
Key string used when specifying the high threshold parameter. More... | |
static const float | default_lowThreshold = -1.f |
Default level above which the shader renders. More... | |
static const float | default_highThreshold = 1.f |
Default level below which the shader renders. More... | |
Surface shader that defines the surface between two levels.
Definition at line 75 of file ThresholdShader.h.
|
inherited |
|
explicit |
Constructor.
low_threshold | level above which the shader renders. |
high_threshold | level below which the shader renders. |
Definition at line 124 of file ThresholdShader.cpp.
|
explicit |
Constructor.
params | a map of parameters for the shader. |
Definition at line 129 of file ThresholdShader.cpp.
References key_highThreshold, and key_lowThreshold.
|
overridevirtual |
Check whether this Shader has any effect on the given Segment.
Implements Mercator::Shader.
Definition at line 145 of file ThresholdShader.cpp.
References Mercator::Segment::getMax(), and Mercator::Segment::getMin().
|
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 |
|
inline |
Accessor for the level below which the shader renders.
Definition at line 108 of file ThresholdShader.h.
References Mercator::HighShader::checkIntersect(), and Mercator::HighShader::shade().
|
inline |
Accessor for the level above which the shader renders.
Definition at line 106 of file ThresholdShader.h.
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 155 of file ThresholdShader.cpp.
References Mercator::Buffer< DataType >::getChannels(), Mercator::Buffer< DataType >::getData(), Mercator::Segment::getPoints(), Mercator::Surface::getSegment(), and Mercator::Segment::getSize().
|
static |
Default level below which the shader renders.
Definition at line 90 of file ThresholdShader.h.
Referenced by Mercator::LowShader::shade().
|
static |
Default level above which the shader renders.
Definition at line 88 of file ThresholdShader.h.
Referenced by Mercator::LowShader::shade().
|
static |
Key string used when specifying the high threshold parameter.
Definition at line 85 of file ThresholdShader.h.
Referenced by BandShader(), and Mercator::LowShader::shade().
|
static |
Key string used when specifying the low threshold parameter.
Definition at line 83 of file ThresholdShader.h.
Referenced by BandShader(), and Mercator::LowShader::shade().