Drake
Drake C++ Documentation
VolumeElement Class Reference

Detailed Description

VolumeElement represents a tetrahedral element in a VolumeMesh.

It is a topological entity in the sense that it only knows the indices of its vertices but not their coordinates.

#include <drake/geometry/proximity/volume_mesh.h>

Public Member Functions

 VolumeElement (int v0, int v1, int v2, int v3)
 Constructs VolumeElement. More...
 
 VolumeElement (const int v[4])
 Constructs VolumeElement. More...
 
int num_vertices () const
 Returns the number of vertices in this element. More...
 
int vertex (int i) const
 Returns the vertex index in VolumeMesh of the i-th vertex of this element. More...
 
bool Equal (const VolumeElement &e) const
 Checks to see whether the given VolumeElement use the same four indices in the same order. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 VolumeElement (const VolumeElement &)=default
 
VolumeElementoperator= (const VolumeElement &)=default
 
 VolumeElement (VolumeElement &&)=default
 
VolumeElementoperator= (VolumeElement &&)=default
 

Constructor & Destructor Documentation

◆ VolumeElement() [1/4]

VolumeElement ( const VolumeElement )
default

◆ VolumeElement() [2/4]

VolumeElement ( VolumeElement &&  )
default

◆ VolumeElement() [3/4]

VolumeElement ( int  v0,
int  v1,
int  v2,
int  v3 
)

Constructs VolumeElement.

We follow the convention that the first three vertices define a triangle with its right-handed normal pointing inwards. The fourth vertex is then on the positive side of this first triangle.

Warning
This class does not enforce our convention for the ordering of the vertices.
Parameters
v0Index of the first vertex in VolumeMesh.
v1Index of the second vertex in VolumeMesh.
v2Index of the third vertex in VolumeMesh.
v3Index of the last vertex in VolumeMesh.
Precondition
All indices are non-negative.

◆ VolumeElement() [4/4]

VolumeElement ( const int  v[4])
explicit

Constructs VolumeElement.

Parameters
vArray of four integer indices of the vertices of the element in VolumeMesh.
Precondition
All indices are non-negative.

Member Function Documentation

◆ Equal()

bool Equal ( const VolumeElement e) const

Checks to see whether the given VolumeElement use the same four indices in the same order.

We check for equality to the last bit consistently with VolumeMesh::Equal(). Two permutations of the four vertex indices of a tetrahedron are considered different tetrahedra even though they span the same space.

◆ num_vertices()

int num_vertices ( ) const

Returns the number of vertices in this element.

◆ operator=() [1/2]

VolumeElement& operator= ( VolumeElement &&  )
default

◆ operator=() [2/2]

VolumeElement& operator= ( const VolumeElement )
default

◆ vertex()

int vertex ( int  i) const

Returns the vertex index in VolumeMesh of the i-th vertex of this element.

Parameters
iThe local index of the vertex in this element.
Precondition
0 <= i < 4

The documentation for this class was generated from the following file: