This class holds all the cloud-related methods. More...
#include <triangle_mesh_cloud.h>
Public Member Functions | |
TriangleMeshCloud (Progress *progress) | |
Constructor. | |
~TriangleMeshCloud () | |
Destructor. | |
void | write_povray (std::ofstream &out, const ParametersSave &, const ParametersCloud &) const |
Dump mesh to file for POV-Ray. | |
void | write_blender (std::ofstream &out, const ParametersSave &, const ParametersCloud &, const std::string &mesh_name) const |
Dump mesh to file for Blender. | |
void | render_texture (Raster< uchar > &) const |
Render the mesh onto a raster image. More... | |
![]() | |
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. | |
virtual const Geometry & | geometry () const =0 |
Access the geometry of this class (needed to abstract concepts like "mid-point" and "height"). | |
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... | |
Protected Member Functions | |
void | do_cloud (const ParametersCloud ¶meters) |
![]() | |
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. | |
Additional Inherited Members | |
![]() | |
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. | |
This class holds all the cloud-related methods.
It's intended to be used as a "mix-in", adding cloud generating functionality to cloud objects subclassed from simpler geometries.
|
protected |
void TriangleMeshCloud::render_texture | ( | Raster< uchar > & | image | ) | const |
Render the mesh onto a raster image.
The only interesting thing with clouds is their alpha, so render a greyscale.