Mercator
Public Member Functions | Public Attributes | List of all members
Mercator::Surface Class Reference

Data store for terrain surface data. More...

#include <Surface.h>

Inheritance diagram for Mercator::Surface:
Mercator::Buffer< ColorT >

Public Member Functions

 Surface (const Segment &segment, const Shader &shader, bool colors=true, bool alpha=true)
 Constructor. More...
 
void populate ()
 Populate the data buffer using the correct shader. More...
 
- Public Member Functions inherited from Mercator::Buffer< ColorT >
 Buffer (const Segment &segment, unsigned int channels=4)
 Constructor. More...
 
ColorT & operator() (unsigned int x, unsigned int y, unsigned int channel)
 Retrieve the data value at a given point. More...
 
const ColorT & operator() (unsigned int x, unsigned int y, unsigned int channel) const
 Retrieve the data value at a given point. More...
 
const SegmentgetSegment () const
 Accessor for the terrain height segment this buffer is associated with.
 
unsigned int getSize () const
 Accessor for the size of segment, m_res + 1.
 
unsigned int getChannels () const
 Accessor for the number of data values per height point.
 
ColorT * getData ()
 Accessor for a pointer to buffer containing data values.
 
void allocate ()
 Allocate the storage required by the buffer. More...
 
bool isValid () const
 Determine if this buffer has valid allocated storage. More...
 
void invalidate ()
 De-allocate the storage for this buffer. More...
 

Public Attributes

const Shaderm_shader
 The shader that populates this surface.
 
- Public Attributes inherited from Mercator::Buffer< ColorT >
const Segmentm_segment
 The terrain height segment this buffer is associated with.
 

Detailed Description

Data store for terrain surface data.

Constructor & Destructor Documentation

Mercator::Surface::Surface ( const Segment seg,
const Shader sh,
bool  color = true,
bool  alpha = true 
)
explicit

Constructor.

Parameters
segthe terrain height segment this surface maps on to.
shthe shader used to generate the surface data.
colortrue if this shader contains color data.
alphatrue if this shader contains alpha data.

Member Function Documentation

void Mercator::Surface::populate ( )

Populate the data buffer using the correct shader.

Call the shader to full this surface buffer with surface data.

References Mercator::Buffer< ColorT >::allocate(), Mercator::Buffer< ColorT >::isValid(), m_shader, and Mercator::Shader::shade().

Referenced by Mercator::TileShader::shade().


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