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

Shader for handling areas. More...

#include <AreaShader.h>

Inheritance diagram for Mercator::AreaShader:
Collaboration diagram for Mercator::AreaShader:

Public Types

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

Public Member Functions

 AreaShader (int layer)
 Constructor. More...
 
void shade (Surface &s) const override
 Populate a Surface with data. More...
 
bool checkIntersect (const Segment &) const override
 Check whether this Shader has any effect on the given Segment. 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 for handling areas.

Definition at line 16 of file AreaShader.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

◆ AreaShader()

Mercator::AreaShader::AreaShader ( int  layer)
explicit

Constructor.

Parameters
layerlayer number.

Definition at line 205 of file AreaShader.cpp.

Member Function Documentation

◆ checkIntersect()

bool Mercator::AreaShader::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 212 of file AreaShader.cpp.

References Mercator::Segment::getAreas().

◆ 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::AreaShader::shade ( Surface ) const
overridevirtual

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