mercator  0.4.0
A terrain generation library for the Worldforge system.
Mercator::FillShader Class Reference

Shader that fills the surface. More...

#include <FillShader.h>

Inheritance diagram for Mercator::FillShader:
Collaboration diagram for Mercator::FillShader:

Public Types

typedef std::map< std::string, float > Parameters
 STL map of parameter values for a shader constructor. More...
 

Public Member Functions

 FillShader ()
 Constructor. More...
 
 FillShader (const Parameters &params)
 Constructor. 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< SurfacenewSurface (const Segment &) const
 Create a new Surface which matches the requirements of this shader. More...
 

Detailed Description

Shader that fills the surface.

This shader is typically only used for the lowest possible layer, which is usually bed rock.

Definition at line 16 of file FillShader.h.

Member Typedef Documentation

◆ Parameters

typedef std::map<std::string, float> Mercator::Shader::Parameters
inherited

STL map of parameter values for a shader constructor.

Definition at line 59 of file Shader.h.

Constructor & Destructor Documentation

◆ FillShader() [1/2]

Mercator::FillShader::FillShader ( )
explicitdefault

Constructor.

◆ FillShader() [2/2]

Mercator::FillShader::FillShader ( const Parameters params)
explicit

Constructor.

Parameters
paramsa map of parameters for the shader.

Definition at line 14 of file FillShader.cpp.

Member Function Documentation

◆ checkIntersect()

bool Mercator::FillShader::checkIntersect ( const Segment ) const
overridevirtual

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.

Definition at line 20 of file FillShader.cpp.

◆ getAlpha()

bool Mercator::Shader::getAlpha ( ) const
inlineinherited

Accessor for alpha flag.

Definition at line 42 of file Shader.h.

◆ getColor()

bool Mercator::Shader::getColor ( ) const
inlineinherited

Accessor for color flag.

Definition at line 37 of file Shader.h.

◆ newSurface()

std::unique_ptr< Surface > Mercator::Shader::newSurface ( const Segment segment) const
inherited

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().

◆ shade()

void Mercator::FillShader::shade ( Surface ) const
overridevirtual

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