SCM Library
Spherical Cube Map rendering library
|
An scm_label renders annotations on the sphere. More...
#include <scm-label.hpp>
Public Member Functions | |
scm_label (const std::string &, int) | |
Create a new label. More... | |
~scm_label () | |
Finalize all OpenGL state. | |
void | draw (GLubyte r, GLubyte g, GLubyte b, GLubyte a) |
Draw all annotations using the given color and transparency. More... | |
An scm_label renders annotations on the sphere.
The label renderer reads data from a CSV file giving a list of surface features, each with the following elements:
Key | Type |
---|---|
Name | a string |
Latitude | in degrees |
Longitude | in degrees |
Diameter | in meters |
Radius | distance from the center of the globe, in meters |
Feature | a two-letter code |
The name string is rendered in text scaled to fit the given diameter. The currently-defined two-letter codes are:
Code | Feature | Representation |
---|---|---|
AA | Crater | Circle of given diameter |
SF | Secondary Crater | Circle of given diameter with half opacity |
MO | Mountain | Triangle icon |
LF | Landing Site | Flag icon |
@* | Star | Star icon |
@C | Circle | Circle icon |
scm_label::scm_label | ( | const std::string & | file, |
int | size | ||
) |
Create a new label.
Render all strings to a font atlas and initialize any OpenGL state needed to render all annotations.
file | CSV data string |
size | Icon size (in pixels) |
void scm_label::draw | ( | GLubyte | r, |
GLubyte | g, | ||
GLubyte | b, | ||
GLubyte | a | ||
) |
Draw all annotations using the given color and transparency.
r | Red |
g | Green |
b | Blue |
a | Alpha |