Biorbd Release_1.13.0
Loading...
Searching...
No Matches
MeshFace.cpp
1#define BIORBD_API_EXPORTS
2#include "RigidBody/MeshFace.h"
3
4#include "Utils/Vector3d.h"
5
6using namespace BIORBD_NAMESPACE;
7
8rigidbody::MeshFace::MeshFace(const std::vector<int> &vertex)
9 : m_face(std::make_shared<std::vector<int>>(vertex)) {}
10
13 copy.DeepCopy(*this);
14 return copy;
15}
16
18 *m_face = *other.m_face;
19}
20
21int &rigidbody::MeshFace::operator()(size_t idx) { return (*m_face)[idx]; }
22
24 return utils::Vector3d(
25 static_cast<double>((*m_face)[0]),
26 static_cast<double>((*m_face)[1]),
27 static_cast<double>((*m_face)[2]));
28}
29
30std::vector<int> rigidbody::MeshFace::face() { return *m_face; }
31
32void rigidbody::MeshFace::setFace(const std::vector<int> &pts) {
33 *m_face = pts;
34}
35
utils::Vector3d faceAsDouble()
convert the integer nature of the face to a double
Definition MeshFace.cpp:23
MeshFace DeepCopy() const
Deep copy of a MeshFace.
Definition MeshFace.cpp:11
MeshFace(const std::vector< int > &vertex=std::vector< int >(3))
Contruct face MeshFace.
Definition MeshFace.cpp:8
int & operator()(size_t idx)
Allows to assign/get using ().
Definition MeshFace.cpp:21
std::vector< int > face()
Returns the face.
Definition MeshFace.cpp:30
void setFace(const std::vector< int > &pts)
set the MeshFace from a new point
Definition MeshFace.cpp:32
std::shared_ptr< std::vector< int > > m_face
The face.
Definition MeshFace.h:71
Wrapper around Eigen Vector3d and attach it to a parent.
Definition Vector3d.h:27