Data store for terrain surface data.
More...
#include <Surface.h>
|
| 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 Segment & | getSegment () const |
| Accessor for the terrain height segment this surface is associated with. 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. More...
|
|
unsigned int | getChannels () const |
| Accessor for the number of data values per height point. More...
|
|
ColorT * | getData () |
| Accessor for a pointer to buffer containing data values. More...
|
|
const ColorT * | getData () const |
| Accessor for a pointer to buffer containing data values. More...
|
|
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...
|
|
|
const unsigned int | m_channels |
| The number of data values per height point. More...
|
|
const unsigned int | m_size |
| The size of segment, m_res + 1. More...
|
|
std::vector< ColorT > | m_data |
| Pointer to buffer containing data values. More...
|
|
Data store for terrain surface data.
Definition at line 23 of file Surface.h.
◆ Surface()
Mercator::Surface::Surface |
( |
const Segment & |
seg, |
|
|
const Shader & |
sh, |
|
|
bool |
color = true , |
|
|
bool |
alpha = true |
|
) |
| |
|
explicit |
Constructor.
- Parameters
-
seg | the terrain height segment this surface maps on to. |
sh | the shader used to generate the surface data. |
color | true if this shader contains color data. |
alpha | true if this shader contains alpha data. |
Definition at line 18 of file Surface.cpp.
◆ allocate()
Allocate the storage required by the buffer.
Allocate memory based on the size and number of channels required by the buffer.
Definition at line 76 of file Buffer.h.
◆ getChannels()
Accessor for the number of data values per height point.
Definition at line 58 of file Buffer.h.
◆ getData() [1/2]
Accessor for a pointer to buffer containing data values.
Definition at line 63 of file Buffer.h.
◆ getData() [2/2]
Accessor for a pointer to buffer containing data values.
Definition at line 68 of file Buffer.h.
◆ getSegment()
const Segment & Mercator::Surface::getSegment |
( |
| ) |
const |
|
inline |
◆ getSize()
Accessor for the size of segment, m_res + 1.
Definition at line 53 of file Buffer.h.
◆ invalidate()
De-allocate the storage for this buffer.
Free the storage allocate for this buffer.
Definition at line 90 of file Buffer.h.
◆ isValid()
Determine if this buffer has valid allocated storage.
- Returns
- true if storage is allocated.
Definition at line 83 of file Buffer.h.
◆ operator()() [1/2]
ColorT & Mercator::Buffer< ColorT >::operator() |
( |
unsigned int |
x, |
|
|
unsigned int |
y, |
|
|
unsigned int |
channel |
|
) |
| |
|
inlineinherited |
Retrieve the data value at a given point.
Access the data value associated with given point in the segment in a given channel in this buffer.
- Returns
- a reference to the value at the point requested.
Definition at line 36 of file Buffer.h.
◆ operator()() [2/2]
const ColorT & Mercator::Buffer< ColorT >::operator() |
( |
unsigned int |
x, |
|
|
unsigned int |
y, |
|
|
unsigned int |
channel |
|
) |
| const |
|
inlineinherited |
Retrieve the data value at a given point.
Return the data value associated with given point in the segment in a given channel in this buffer.
- Returns
- the value at the point requested.
Definition at line 45 of file Buffer.h.
◆ populate()
void Mercator::Surface::populate |
( |
| ) |
|
◆ m_channels
The number of data values per height point.
Definition at line 17 of file Buffer.h.
◆ m_data
Pointer to buffer containing data values.
Definition at line 21 of file Buffer.h.
◆ m_segment
const Segment& Mercator::Surface::m_segment |
◆ m_shader
const Shader& Mercator::Surface::m_shader |
The shader that populates this surface.
Definition at line 26 of file Surface.h.
Referenced by populate().
◆ m_size
The size of segment, m_res + 1.
Definition at line 19 of file Buffer.h.
The documentation for this class was generated from the following files: