Biorbd Release_1.13.0
Loading...
Searching...
No Matches
Range.cpp
1#define BIORBD_API_EXPORTS
2#include "Utils/Range.h"
3
4using namespace BIORBD_NAMESPACE;
5
6utils::Range::Range(double min, double max)
7 : m_min(std::make_shared<double>(min)),
8 m_max(std::make_shared<double>(max)) {}
9
11 utils::Range copy;
12 copy.DeepCopy(*this);
13 return copy;
14}
15
17 *m_min = *other.m_min;
18 *m_max = *other.m_max;
19}
20
21void utils::Range::setMin(double min) { *m_min = min; }
22
23double utils::Range::min() const { return *m_min; }
24
25void utils::Range::setMax(double max) { *m_max = max; }
26
27double utils::Range::max() const { return *m_max; }
double max() const
Return the maximum value.
Definition Range.cpp:27
void setMin(double min)
Set a new value for the minimum.
Definition Range.cpp:21
std::shared_ptr< double > m_min
The minimal value allowed by the range.
Definition Range.h:60
Range(double min=-M_PI, double max=M_PI)
Construct generalized coordinates range.
Definition Range.cpp:6
std::shared_ptr< double > m_max
The maximal value allowed by the range.
Definition Range.h:61
Range DeepCopy() const
Deep copy of the Range.
Definition Range.cpp:10
double min() const
Return the minimum value.
Definition Range.cpp:23
void setMax(double max)
Set a new value for the maximal.
Definition Range.cpp:25