DART 6.12.2
Loading...
Searching...
No Matches
dart::math::Mesh< S_ > Class Template Reference

Base class for meshes. More...

#include <Mesh.hpp>

Inheritance diagram for dart::math::Mesh< S_ >:
dart::math::TriMesh< S_ > dart::math::Icosphere< S_ >

Public Types

using S = S_
 
using Index = std::size_t
 
using Vector3 = Eigen::Matrix< S, 3, 1 >
 
using Vertices = std::vector< Vector3 >
 
using Normals = std::vector< Vector3 >
 
using Indices = std::vector< Index >
 

Public Member Functions

virtual ~Mesh ()
 Destructor.
 
bool hasVertices () const
 Returns true if the mesh contains vertices.
 
bool hasVertexNormals () const
 Returns true if the mesh contains vertex normals.
 
const VerticesgetVertices () const
 Returns the vertices of the mesh.
 
const NormalsgetVertexNormals () const
 Returns the vertex normals of the mesh.
 
virtual void clear ()
 Clears all the vertices and vertex normals.
 
bool isEmpty () const
 Returns true if the mesh has no vertices.
 
void translate (const Vector3 &translation)
 Translates the mesh vertices by adding translation to the vertices.
 
Mesh operator+ (const Mesh &other) const
 Addition operator.
 
Meshoperator+= (const Mesh &other)
 Addition assignment operator.
 

Protected Member Functions

 Mesh ()
 Default constructor.
 
void normalizeVertexNormals ()
 Normalizes the vertex normals.
 

Protected Attributes

Vertices mVertices
 Vertices of the mesh.
 
Normals mVertexNormals
 Vertex normals of the mesh.
 

Detailed Description

template<typename S_>
class dart::math::Mesh< S_ >

Base class for meshes.

Member Typedef Documentation

◆ Index

template<typename S_ >
using dart::math::Mesh< S_ >::Index = std::size_t

◆ Indices

template<typename S_ >
using dart::math::Mesh< S_ >::Indices = std::vector<Index>

◆ Normals

template<typename S_ >
using dart::math::Mesh< S_ >::Normals = std::vector<Vector3>

◆ S

template<typename S_ >
using dart::math::Mesh< S_ >::S = S_

◆ Vector3

template<typename S_ >
using dart::math::Mesh< S_ >::Vector3 = Eigen::Matrix<S, 3, 1>

◆ Vertices

template<typename S_ >
using dart::math::Mesh< S_ >::Vertices = std::vector<Vector3>

Constructor & Destructor Documentation

◆ ~Mesh()

template<typename S >
dart::math::Mesh< S >::~Mesh ( )
virtual

Destructor.

◆ Mesh()

template<typename S >
dart::math::Mesh< S >::Mesh ( )
protected

Default constructor.

Member Function Documentation

◆ clear()

template<typename S >
void dart::math::Mesh< S >::clear ( )
virtual

Clears all the vertices and vertex normals.

Reimplemented in dart::math::TriMesh< S_ >.

◆ getVertexNormals()

template<typename S >
const Mesh< S >::Normals & dart::math::Mesh< S >::getVertexNormals ( ) const

Returns the vertex normals of the mesh.

◆ getVertices()

template<typename S >
const Mesh< S >::Vertices & dart::math::Mesh< S >::getVertices ( ) const

Returns the vertices of the mesh.

◆ hasVertexNormals()

template<typename S >
bool dart::math::Mesh< S >::hasVertexNormals ( ) const

Returns true if the mesh contains vertex normals.

◆ hasVertices()

template<typename S >
bool dart::math::Mesh< S >::hasVertices ( ) const

Returns true if the mesh contains vertices.

◆ isEmpty()

template<typename S >
bool dart::math::Mesh< S >::isEmpty ( ) const

Returns true if the mesh has no vertices.

◆ normalizeVertexNormals()

template<typename S >
void dart::math::Mesh< S >::normalizeVertexNormals ( )
protected

Normalizes the vertex normals.

◆ operator+()

template<typename S >
Mesh< S > dart::math::Mesh< S >::operator+ ( const Mesh< S_ > &  other) const

Addition operator.

◆ operator+=()

template<typename S >
Mesh< S > & dart::math::Mesh< S >::operator+= ( const Mesh< S_ > &  other)

Addition assignment operator.

◆ translate()

template<typename S >
void dart::math::Mesh< S >::translate ( const Vector3 translation)

Translates the mesh vertices by adding translation to the vertices.

Member Data Documentation

◆ mVertexNormals

template<typename S_ >
Normals dart::math::Mesh< S_ >::mVertexNormals
protected

Vertex normals of the mesh.

◆ mVertices

template<typename S_ >
Vertices dart::math::Mesh< S_ >::mVertices
protected

Vertices of the mesh.