Biorbd
MeshFace.cpp
1 #define BIORBD_API_EXPORTS
2 #include "RigidBody/MeshFace.h"
3 
4 #include "Utils/Vector3d.h"
5 
6 biorbd::rigidbody::MeshFace::MeshFace(const std::vector<int>& vertex) :
7  m_face(std::make_shared<std::vector<int>>(vertex))
8 {
9 
10 }
11 
13 {
15  copy.DeepCopy(*this);
16  return copy;
17 }
18 
20 {
21  *m_face = *other.m_face;
22 }
23 
25 {
26  return (*m_face)[idx];
27 }
28 
30 {
31  return biorbd::utils::Vector3d(static_cast<double>((*m_face)[0]),
32  static_cast<double>((*m_face)[1]),
33  static_cast<double>((*m_face)[2]));
34 }
35 
37 {
38  return *m_face;
39 }
40 
41 void biorbd::rigidbody::MeshFace::setFace(const std::vector<int> & pts)
42 {
43  *m_face = pts;
44 }
45 
47 {
48  m_face = other.m_face;
49 }
50 
biorbd::rigidbody::MeshFace::m_face
std::shared_ptr< std::vector< int > > m_face
The face.
Definition: MeshFace.h:73
biorbd::utils::Vector3d
Wrapper around Eigen Vector3d and attach it to a parent.
Definition: Vector3d.h:24
biorbd::rigidbody::MeshFace::DeepCopy
biorbd::rigidbody::MeshFace DeepCopy() const
Deep copy of a MeshFace.
Definition: MeshFace.cpp:12
biorbd::rigidbody::MeshFace
The face of the mesh.
Definition: MeshFace.h:19
biorbd::rigidbody::MeshFace::face
std::vector< int > face()
Returns the face.
Definition: MeshFace.cpp:36
biorbd::rigidbody::MeshFace::setFace
void setFace(const std::vector< int > &pts)
set the MeshFace from a new point
Definition: MeshFace.cpp:41
biorbd::rigidbody::MeshFace::operator()
int & operator()(unsigned int idx)
Allows to assign/get using ()
Definition: MeshFace.cpp:24
biorbd::rigidbody::MeshFace::MeshFace
MeshFace(const std::vector< int > &vertex=std::vector< int >(3))
Contruct face MeshFace.
Definition: MeshFace.cpp:6
biorbd::rigidbody::MeshFace::faceAsDouble
biorbd::utils::Vector3d faceAsDouble()
convert the integer nature of the face to a double
Definition: MeshFace.cpp:29