The MeshGeometry is used for triangle mesh geometry.
More...
#include <avogadro/rendering/meshgeometry.h>
|
| MeshGeometry (const MeshGeometry &other) |
|
MeshGeometry & | operator= (MeshGeometry) |
|
void | accept (Visitor &) override |
|
void | render (const Camera &camera) override |
| Render the mesh geometry.
|
|
void | clear () override |
|
size_t | vertexCount () const |
|
size_t | indexCount () const |
|
size_t | triangleCount () const |
|
Core::Array< PackedVertex > | vertices () |
|
Core::Array< unsigned int > | triangles () |
|
|
unsigned int | addVertices (const Core::Array< Vector3f > &vertices, const Core::Array< Vector3f > &normals, const Core::Array< Vector4ub > &colors) |
|
unsigned int | addVertices (const Core::Array< Vector3f > &vertices, const Core::Array< Vector3f > &normals, const Core::Array< Vector3ub > &colors) |
|
unsigned int | addVertices (const Core::Array< Vector3f > &vertices, const Core::Array< Vector3f > &normals) |
|
|
void | addTriangle (unsigned int index1, unsigned int index2, unsigned int index3) |
|
void | addTriangles (const Core::Array< unsigned int > &indices) |
|
|
void | setColor (const Vector3ub &c) |
|
Vector3ub | color () const |
|
|
void | setOpacity (unsigned char opacity_) |
|
unsigned char | opacity () const |
|
| Drawable (const Drawable &other) |
|
Drawable & | operator= (Drawable) |
|
const GeometryNode * | parent () const |
| Get a pointer to the drawable object's parent.
|
|
GeometryNode * | parent () |
|
void | setVisible (bool visibility) |
| Set the visibility of the drawable object.
|
|
bool | isVisible () const |
| Get the current visibility of the drawable.
|
|
Identifier & | identifier () |
|
const Identifier & | identifier () const |
|
virtual std::multimap< float, Identifier > | hits (const Vector3f &rayOrigin, const Vector3f &rayEnd, const Vector3f &rayDirection) const |
|
virtual Core::Array< Identifier > | areaHits (const Frustrum &f) const |
|
void | setRenderPass (RenderPass pass) |
|
RenderPass | renderPass () const |
|
|
static const unsigned int | InvalidIndex |
|
◆ accept()
Accept a visit from our friendly visitor.
Reimplemented from Drawable.
◆ render()
void render |
( |
const Camera & |
camera | ) |
|
|
overridevirtual |
- Parameters
-
camera | The current camera to be used for rendering. |
Reimplemented from Drawable.
◆ addVertices() [1/3]
Add vertices to the object. Note that this just adds vertices to the object. Use addTriangles with size_t indices to actually draw them.
- Parameters
-
vertices | The 3D vertex points to add to the drawable. |
normals | The normal direction at the vertex. |
colors | Vertex color. If not specified, use the current color() and opacity(). If the 3 component color is set, the current opacity() is used. |
- Note
- All arrays must be the same length, or this function call will fail, returning InvalidIndex.
- Returns
- The index of the first vertex added by this call, used to specify element arrays for the actual triangles.
◆ addVertices() [2/3]
Add vertices to the object. Note that this just adds vertices to the object. Use addTriangles with size_t indices to actually draw them.
- Parameters
-
vertices | The 3D vertex points to add to the drawable. |
normals | The normal direction at the vertex. |
colors | Vertex color. If not specified, use the current color() and opacity(). If the 3 component color is set, the current opacity() is used. |
- Note
- All arrays must be the same length, or this function call will fail, returning InvalidIndex.
- Returns
- The index of the first vertex added by this call, used to specify element arrays for the actual triangles.
◆ addVertices() [3/3]
unsigned int addVertices |
( |
const Core::Array< Vector3f > & |
vertices, |
|
|
const Core::Array< Vector3f > & |
normals |
|
) |
| |
Add vertices to the object. Note that this just adds vertices to the object. Use addTriangles with size_t indices to actually draw them.
- Parameters
-
vertices | The 3D vertex points to add to the drawable. |
normals | The normal direction at the vertex. |
colors | Vertex color. If not specified, use the current color() and opacity(). If the 3 component color is set, the current opacity() is used. |
- Note
- All arrays must be the same length, or this function call will fail, returning InvalidIndex.
- Returns
- The index of the first vertex added by this call, used to specify element arrays for the actual triangles.
◆ addTriangle()
void addTriangle |
( |
unsigned int |
index1, |
|
|
unsigned int |
index2, |
|
|
unsigned int |
index3 |
|
) |
| |
Add triangles to the mesh. Triangles are specified as 3-tuples of vertex indices. Must call addVertices first, and use the return value to obtain the valid index range.
◆ addTriangles()
void addTriangles |
( |
const Core::Array< unsigned int > & |
indices | ) |
|
Add triangles to the mesh. Triangles are specified as 3-tuples of vertex indices. Must call addVertices first, and use the return value to obtain the valid index range.
◆ clear()
Clear the contents of the node.
Reimplemented from Drawable.
◆ vertexCount()
size_t vertexCount |
( |
| ) |
const |
Get the number of vertices.
◆ indexCount()
size_t indexCount |
( |
| ) |
const |
Get the number of vertices.
◆ triangleCount()
size_t triangleCount |
( |
| ) |
const |
Get the number of triangles.
◆ setColor()
void setColor |
( |
const Vector3ub & |
c | ) |
|
The default color of the mesh. This is used to set the color of new vertices when no explicit vertex color is specified.
◆ color()
Vector3ub color |
( |
| ) |
const |
The default color of the mesh. This is used to set the color of new vertices when no explicit vertex color is specified.
◆ setOpacity()
void setOpacity |
( |
unsigned char |
opacity_ | ) |
|
The default opacity of the mesh. This is used when either no explicit vertex color is specified, or a three component color is used.
◆ opacity()
unsigned char opacity |
( |
| ) |
const |
The default opacity of the mesh. This is used when either no explicit vertex color is specified, or a three component color is used.
The documentation for this class was generated from the following file: