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.
◆ Mesh() [1/2]
◆ Mesh() [2/2]
◆ ~Mesh()
◆ reserve()
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.
◆ setStable()
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. |
◆ stable()
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.
◆ setIsoValue()
void setIsoValue |
( |
float |
value | ) |
|
Set the iso value that was used to generate the Mesh.
◆ isoValue()
- Returns
- The iso value used to generate the Mesh.
◆ setOtherMesh()
void setOtherMesh |
( |
unsigned int |
other | ) |
|
Set the unique id of the other Mesh if this Mesh is part of a pair.
◆ otherMesh()
unsigned int otherMesh |
( |
| ) |
const |
- Returns
- The unique id of the other Mesh if this is part of a pair.
◆ setCube()
void setCube |
( |
unsigned int |
cube_ | ) |
|
Set the unique id of the Cube the Mesh was generated from.
◆ cube()
unsigned int cube |
( |
| ) |
const |
- Returns
- The unique id of the Cube the Mesh was generated from.
◆ vertices()
- Returns
- Array containing all of the vertices in a one dimensional array.
◆ numVertices()
unsigned int numVertices |
( |
| ) |
const |
- Returns
- The number of vertices.
◆ vertex()
const Vector3f* vertex |
( |
int |
n | ) |
const |
- Returns
- Pointer to the first vertex of the specified triangle.
◆ setVertices()
bool setVertices |
( |
const Core::Array< Vector3f > & |
values | ) |
|
Clear the vertices vector and assign new values.
◆ addVertices()
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.
◆ normals()
- Returns
- Array containing all of the normals in a one-dimensional array.
◆ numNormals()
unsigned int numNormals |
( |
| ) |
const |
- Returns
- The number of normals.
◆ normal()
const Vector3f* normal |
( |
int |
n | ) |
const |
- Returns
- Pointer to the first normal of the specified triangle.
◆ setNormals()
bool setNormals |
( |
const Core::Array< Vector3f > & |
values | ) |
|
Clear the normals array and assign new values.
◆ addNormals()
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.
◆ colors()
- Returns
- Array containing all of the colors in a one-dimensional array.
◆ color()
const Color3f* color |
( |
int |
n | ) |
const |
- Returns
- Pointer to the first color of the specified triangle.
◆ setColors()
Clear the colors array and assign new values.
◆ addColors()
Add one or more normals, i.e., the array is expected to be of length 3 x n where n is an integer.
◆ valid()
Sanity checking function - is the mesh sane?
- Returns
- True if the Mesh object is sane and composed of the right number of elements.
◆ clear()
Clear all mesh data.
- Returns
- True on success.
◆ operator=()
◆ setName()
void setName |
( |
const std::string & |
name_ | ) |
|
Set the name of the Mesh.
◆ name()
std::string name |
( |
| ) |
const |
- Returns
- The name of the Mesh.
◆ lock()
The documentation for this class was generated from the following file: