Mercator  0.4.0
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...
 
const SegmentgetSegment () const
 Accessor for the terrain height segment this surface is associated with.
 
- Public Member Functions inherited from Mercator::Buffer< ColorT >
 Buffer (unsigned int size, unsigned int channels)
 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...
 
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.
 
const ColorT * getData () const
 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.
 
const Segmentm_segment
 The terrain height segment this buffer is associated with.
 

Additional Inherited Members

- Protected Attributes inherited from Mercator::Buffer< ColorT >
const unsigned int m_channels
 The number of data values per height point.
 
const unsigned int m_size
 The size of segment, m_res + 1.
 
ColorT * m_data
 Pointer to buffer containing data values.
 

Detailed Description

Data store for terrain surface data.

Constructor & Destructor Documentation

◆ Surface()

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

◆ populate()

void Mercator::Surface::populate ( )

Populate the data buffer using the correct shader.

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


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