Encapsulation of a triangular mesh that makes up a surface.
More...
#include <avogadro/core/mesh.h>
- Author
- Marcus D. Hanwell
The Mesh class is a data container that provides a Mesh object. All meshes should be owned by a Molecule. It should also be removed by the Molecule that owns it. Meshes encapsulate triangular meshes that can also have colors associated with each vertex.
bool reserve |
( |
unsigned int |
size, |
|
|
bool |
colors = false |
|
) |
| |
Reserve the expected space for the mesh. This causes all member array storage to call the reserve function with the number specified.
- Parameters
-
size | Expected size of the mesh. |
colors | Should the colors array reserve this space too? Defaults to false. |
- Returns
- True on success.
void setStable |
( |
bool |
stable | ) |
|
This function allows long running calculations to mark the mesh as in progress.
- Parameters
-
stable | Indicate that the Mesh is currently being modified. |
Indicate whether the Mesh is complete or currently being modified. In general using Mesh values from an unstable Mesh is not advisable.
- Returns
- True if the Mesh is complete, false if it is being modified.
void setIsoValue |
( |
float |
value | ) |
|
Set the iso value that was used to generate the Mesh.
- Returns
- The iso value used to generate the Mesh.
void setOtherMesh |
( |
unsigned int |
other | ) |
|
Set the unique id of the other Mesh if this Mesh is part of a pair.
unsigned int otherMesh |
( |
| ) |
const |
- Returns
- The unique id of the other Mesh if this is part of a pair.
void setCube |
( |
unsigned int |
cube_ | ) |
|
Set the unique id of the Cube the Mesh was generated from.
unsigned int cube |
( |
| ) |
const |
- Returns
- The unique id of the Cube the Mesh was generated from.
- Returns
- Array containing all of the vertices in a one dimensional array.
unsigned int numVertices |
( |
| ) |
const |
- Returns
- The number of vertices.
const Vector3f* vertex |
( |
int |
n | ) |
const |
- Returns
- Pointer to the first vertex of the specified triangle.
bool setVertices |
( |
const Core::Array< Vector3f > & |
values | ) |
|
Clear the vertices vector and assign new values.
bool addVertices |
( |
const Core::Array< Vector3f > & |
values | ) |
|
Add one or more vertices, i.e., the array is expected to be of length 3 x n where n is an integer.
- Returns
- Array containing all of the normals in a one-dimensional array.
unsigned int numNormals |
( |
| ) |
const |
- Returns
- The number of normals.
const Vector3f* normal |
( |
int |
n | ) |
const |
- Returns
- Pointer to the first normal of the specified triangle.
bool setNormals |
( |
const Core::Array< Vector3f > & |
values | ) |
|
Clear the normals array and assign new values.
bool addNormals |
( |
const Core::Array< Vector3f > & |
values | ) |
|
Add one or more normals, i.e., the array is expected to be of length 3 x n where n is an integer.
- Returns
- Array containing all of the colors in a one-dimensional array.
const Color3f* color |
( |
int |
n | ) |
const |
- Returns
- Pointer to the first color of the specified triangle.
Clear the colors array and assign new values.
Add one or more normals, i.e., the array is expected to be of length 3 x n where n is an integer.
Sanity checking function - is the mesh sane?
- Returns
- True if the Mesh object is sane and composed of the right number of elements.
Clear all mesh data.
- Returns
- True on success.
void setName |
( |
const std::string & |
name_ | ) |
|
Set the name of the Mesh.
std::string name |
( |
| ) |
const |
- Returns
- The name of the Mesh.
The documentation for this class was generated from the following file: