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