Class constructing specific case of a planetary terrain. More...
#include <triangle_mesh_terrain.h>
Public Member Functions | |
TriangleMeshTerrainPlanet (const ParametersTerrain ¶m, Progress *progress) | |
Constructor. | |
~TriangleMeshTerrainPlanet () | |
Destructor. | |
void | write_povray (std::ofstream &out, const ParametersSave &, const ParametersTerrain &) const |
Specifc dump-to-povray for planet terrain. | |
![]() | |
TriangleMeshSubdividedIcosahedron (float radius, uint subdivisions, uint flat_subdivisions, uint seed, const XYZ &variation, Progress *progress) | |
Constructor. | |
~TriangleMeshSubdividedIcosahedron () | |
Destructor. | |
![]() | |
TriangleMeshIcosahedron (float radius, uint seed, Progress *progress) | |
Constructor. | |
~TriangleMeshIcosahedron () | |
Destructor. | |
virtual const Geometry & | geometry () const |
Returns the specific geometry. | |
![]() | |
TriangleMesh (Progress *progress) | |
Constructor. | |
virtual | ~TriangleMesh () |
Destructor. | |
void | set_emissive (float e) |
Accessor. | |
float | emissive () const |
Accessor. | |
void | add_vertex (const Vertex &v) |
Append a vertex. | |
void | add_triangle (const Triangle &t) |
Append a triangle. | |
const Vertex & | vertex (uint i) const |
Accessor. | |
const Triangle & | triangle (uint i) const |
Accessor. | |
float | vertex_height (uint i) const |
Return height of a vertex. | |
void | set_vertex_height (uint i, float h) |
Set height of a vertex. | |
float | triangle_height_min (uint i) const |
Return minimum height of a triangle's vertices. | |
float | triangle_height_max (uint i) const |
Return maximum height of a triangle's vertices. | |
float | triangle_height_average (uint i) const |
Return mean height of a triangle's vertices. | |
const XYZ | triangle_normal (uint i) const |
Compute and return the normal to a triangle. | |
uint | which_colour_for_triangle (uint t) const |
Return which vertex colour to use for a triangle. | |
uint | vertices () const |
Returns number of vertices in mesh. | |
uint | triangles () const |
Returns number of triangles in mesh. | |
uint | triangles_of_colour0 () const |
Returns number of triangles in mesh indexing colour[0] of vertices. | |
uint | triangles_of_colour1 () const |
Returns number of triangles in mesh indexing colour[1] of vertices. | |
void | compute_vertex_normals () |
(Re-)computes vertex normals. | |
void | subdivide (const XYZ &variation, uint level, uint levels) |
Perform a single subdivision pass with perturbations up to the specified size. More... | |
void | subdivide (uint subdivisions, uint flat_subdivisions, const XYZ &variation) |
Perform a number of subdivisions, possibly some unperturbed ("flat"), and halving the perturbation variation each iteration. | |
void | write_povray (std::ofstream &out, bool exclude_alternate_colour, bool double_illuminate, bool no_shadow) const |
Dump the mesh to the file in a form suitable for use by POVRay. | |
void | write_blender (std::ofstream &out, const std::string &mesh_name, const FloatRGBA *fake_alpha) const |
Dump the mesh to the file in a form suitable for use by Blender. More... | |
![]() | |
TriangleMeshTerrain (Progress *progress) | |
Constructor. | |
~TriangleMeshTerrain () | |
Destructor. | |
virtual void | write_blender (std::ofstream &out, const ParametersSave &, const ParametersTerrain &, const std::string &mesh_name) const |
Dump the model for Blender. More... | |
virtual void | render_texture (Raster< ByteRGBA > &, Raster< ushort > *, Raster< ByteRGBA > *, bool shading, float ambient, const XYZ &illumination) const |
Render the mesh onto raster images (colour texture, and optionally 16-bit DEM and/or normal map). | |
Additional Inherited Members | |
![]() | |
Vertex & | vertex (uint i) |
Accessor. | |
Triangle & | triangle (uint i) |
Accessor. | |
void | progress_start (uint steps, const std::string &info) const |
Convenience wrapper with null test. | |
void | progress_stall (const std::string &reason) const |
Convenience wrapper with null test. | |
void | progress_step (uint step) const |
Convenience wrapper with null test. | |
void | progress_complete (const std::string &info) const |
Convenience wrapper with null test. | |
![]() | |
void | do_noise (const ParametersTerrain ¶meters) |
Add noise to the terrain. | |
void | do_sea_level (const ParametersTerrain ¶meters) |
Impose a sea level (raise lower vertices, and note sea triangles). | |
void | do_power_law (const ParametersTerrain ¶meters) |
Apply power law. | |
void | do_rivers (const ParametersTerrain ¶meters) |
Generate river network. | |
void | do_colours (const ParametersTerrain ¶meters) |
Final colouration pass. | |
void | do_terrain (const ParametersTerrain ¶meters) |
Invokes all the above steps (sea-level through final colouring) on a pre-subdivided triangle mesh. | |
![]() | |
std::vector< Vertex > | _vertex |
The vertices of this mesh. | |
std::vector< Triangle > | _triangle |
The triangles of this mesh. | |
uint | _triangle_switch_colour |
The index of the triangle at which we switch to the alternate colour. | |
float | _emissive |
The emission level for vertices with the _emissive flag set. | |
Progress *const | _progress |
Pointer to the progress object to which progress reports should be made. | |
![]() | |
std::set< uint > | sea_triangles |
Indices of the set of triangles with all vertices at sea-level. | |
std::set< uint > | river_vertices |
Indices of the set of vertices comprising the river network. | |
float | max_height |
Maximum height of terrain (used to scale to/from "normalised" height). | |
Class constructing specific case of a planetary terrain.