Avogadro::Rendering::MeshGeometry#
-
class MeshGeometry : public Drawable#
The MeshGeometry is used for triangle mesh geometry.
- Author
Marcus D. Hanwell
Subclassed by ArcSector, Quad
Unnamed Group
-
unsigned int addVertices(const Core::Array<Vector3f> &vertices, const Core::Array<Vector3f> &normals, const Core::Array<Vector4ub> &colors)#
Add vertices to the object. Note that this just adds vertices to the object. Use addTriangles with size_t indices to actually draw them.
Note
All arrays must be the same length, or this function call will fail, returning InvalidIndex.
- Parameters:
- Returns:
The index of the first vertex added by this call, used to specify element arrays for the actual triangles.
-
unsigned int addVertices(const Core::Array<Vector3f> &vertices, const Core::Array<Vector3f> &normals, const Core::Array<Vector3ub> &colors)#
Add vertices to the object. Note that this just adds vertices to the object. Use addTriangles with size_t indices to actually draw them.
Note
All arrays must be the same length, or this function call will fail, returning InvalidIndex.
- Parameters:
- Returns:
The index of the first vertex added by this call, used to specify element arrays for the actual triangles.
-
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.
Note
All arrays must be the same length, or this function call will fail, returning InvalidIndex.
- Parameters:
- Returns:
The index of the first vertex added by this call, used to specify element arrays for the actual triangles.
Unnamed Group
-
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.
Unnamed Group
-
inline 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.
-
inline 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.
Unnamed Group
-
inline 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.
-
inline 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.
Public Functions
-
MeshGeometry()#
-
MeshGeometry(const MeshGeometry &other)#
-
~MeshGeometry() override#
-
inline MeshGeometry &operator=(MeshGeometry)#
-
virtual void render(const Camera &camera) override#
Render the mesh geometry.
- Parameters:
camera – The current camera to be used for rendering.
-
virtual void clear() override#
Clear the contents of the node.
-
inline size_t vertexCount() const#
Get the number of vertices.
-
inline size_t indexCount() const#
Get the number of vertices.
-
inline size_t triangleCount() const#
Get the number of triangles.
-
inline Core::Array<PackedVertex> vertices()#
Public Static Attributes
-
static const unsigned int InvalidIndex#
Friends
-
friend void swap(MeshGeometry &lhs, MeshGeometry &rhs)#