My Project
 All Classes Files Functions Variables Enumerations Pages
Public Member Functions | List of all members
TriangleMeshTerrainFlat Class Reference

Class constructing specific case of a flat-base terrain area. More...

#include <triangle_mesh_terrain.h>

Inheritance diagram for TriangleMeshTerrainFlat:
TriangleMeshFlat TriangleMeshTerrain TriangleMesh TriangleMesh

Public Member Functions

 TriangleMeshTerrainFlat (const ParametersTerrain &parameters, Progress *progress)
 Constructor.
 
 ~TriangleMeshTerrainFlat ()
 Destructor.
 
void write_povray (std::ofstream &out, const ParametersSave &, const ParametersTerrain &) const
 Specifc dump-to-povray for flat terrain area.
 
- Public Member Functions inherited from TriangleMeshFlat
 TriangleMeshFlat (ParametersObject::ObjectType obj, float z, uint seed, Progress *progress)
 Constructor.
 
 ~TriangleMeshFlat ()
 Destructor.
 
virtual const Geometrygeometry () const
 Returns the specific geometry.
 
- Public Member Functions inherited from TriangleMesh
 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 Vertexvertex (uint i) const
 Accessor.
 
const Triangletriangle (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...
 
- Public Member Functions inherited from TriangleMeshTerrain
 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

- Protected Member Functions inherited from TriangleMesh
Vertexvertex (uint i)
 Accessor.
 
Triangletriangle (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.
 
- Protected Member Functions inherited from TriangleMeshTerrain
void do_noise (const ParametersTerrain &parameters)
 Add noise to the terrain.
 
void do_sea_level (const ParametersTerrain &parameters)
 Impose a sea level (raise lower vertices, and note sea triangles).
 
void do_power_law (const ParametersTerrain &parameters)
 Apply power law.
 
void do_rivers (const ParametersTerrain &parameters)
 Generate river network.
 
void do_colours (const ParametersTerrain &parameters)
 Final colouration pass.
 
void do_terrain (const ParametersTerrain &parameters)
 Invokes all the above steps (sea-level through final colouring) on a pre-subdivided triangle mesh.
 
- Protected Attributes inherited from TriangleMesh
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.
 
- Protected Attributes inherited from TriangleMeshTerrain
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).
 

Detailed Description

Class constructing specific case of a flat-base terrain area.


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