33 #ifndef DART_DYNAMICS_DETAIL_DEGREEOFFREEDOMPTR_HPP_
34 #define DART_DYNAMICS_DETAIL_DEGREEOFFREEDOMPTR_HPP_
51 template <
class DegreeOfFreedomT,
class BodyNodeT>
55 template <
class,
class>
69 template <
class OtherDegreeOfFreedomT,
class OtherBodyNodeT>
85 template <
class OtherDegreeOfFreedomT,
class OtherBodyNodeT>
95 operator DegreeOfFreedomT*()
const
113 DegreeOfFreedomT*
get()
const
138 void set(DegreeOfFreedomT* _ptr)
147 mIndex = _ptr->getIndexInJoint();
155 template <
class OtherDofT,
class OtherBodyNodeT>
169 template <
class OtherDofT,
class OtherBodyNodeT>
173 return !(*
this == _rhs);
177 template <
class OtherDofT,
class OtherBodyNodeT>
188 template <
class OtherDofT,
class OtherBodyNodeT>
199 template <
class OtherDofT,
class OtherBodyNodeT>
203 return (*
this < _rhs) || (*
this == _rhs);
207 template <
class OtherDofT,
class OtherBodyNodeT>
211 return (*
this > _rhs) || (*
this == _rhs);
230 template <
class DegreeOfFreedomT,
class BodyNodeT>
234 template <
class,
class>
251 template <
class OtherDofT,
class OtherBodyNodeT>
259 template <
class OtherDofT,
class OtherBodyNodeT>
274 template <
class OtherDofT,
class OtherBodyNodeT>
283 template <
class OtherDofT,
class OtherBodyNodeT>
298 if (
nullptr == bodyNode)
302 bodyNode->getParentJoint()->getDof(
mIndex));
306 void set(DegreeOfFreedomT* _ptr)
316 mIndex = _ptr->getIndexInJoint();
321 template <
class OtherDofT,
class OtherBodyNodeT>
TemplateBodyNodePtr is a templated class that enables users to create a reference-counting BodyNodePt...
Definition: BodyNodePtr.hpp:110
TemplateDegreeOfFreedomPtr is a templated class that enables users to create a reference-counting Deg...
Definition: DegreeOfFreedomPtr.hpp:53
DegreeOfFreedomT & operator*() const
Dereferencing operator.
Definition: DegreeOfFreedomPtr.hpp:101
TemplateBodyNodePtr< BodyNodeT > mBodyNodePtr
Reference-holding pointer to the child BodyNode of this DegreeOfFreedom.
Definition: DegreeOfFreedomPtr.hpp:218
bool operator>=(const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
Greater than or equal to.
Definition: DegreeOfFreedomPtr.hpp:208
bool operator<=(const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
Less than or equal to.
Definition: DegreeOfFreedomPtr.hpp:200
bool operator==(const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
Equality.
Definition: DegreeOfFreedomPtr.hpp:156
bool operator>(const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
Greater than.
Definition: DegreeOfFreedomPtr.hpp:189
TemplateDegreeOfFreedomPtr()=default
Default constructor.
TemplateDegreeOfFreedomPtr(DegreeOfFreedomT *_ptr)
Typical constructor.
Definition: DegreeOfFreedomPtr.hpp:63
TemplateDegreeOfFreedomPtr(const TemplateDegreeOfFreedomPtr< OtherDegreeOfFreedomT, OtherBodyNodeT > &_dofp)
Constructor that takes in a strong DegreeOfFreedomPtrs.
Definition: DegreeOfFreedomPtr.hpp:70
DegreeOfFreedomT * operator->() const
Dereferencing operation.
Definition: DegreeOfFreedomPtr.hpp:107
TemplateDegreeOfFreedomPtr & operator=(DegreeOfFreedomT *_ptr)
Assignment operator.
Definition: DegreeOfFreedomPtr.hpp:78
TemplateBodyNodePtr< BodyNodeT > getBodyNodePtr() const
Get the BodyNode that this DegreeOfFreedomPtr is tied to.
Definition: DegreeOfFreedomPtr.hpp:122
void set(DegreeOfFreedomT *_ptr)
Set the DegreeOfFreedom for this DegreeOfFreedomPtr.
Definition: DegreeOfFreedomPtr.hpp:138
bool operator!=(const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
Inequality.
Definition: DegreeOfFreedomPtr.hpp:170
bool operator<(const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_rhs) const
Less than.
Definition: DegreeOfFreedomPtr.hpp:178
TemplateDegreeOfFreedomPtr & operator=(const TemplateDegreeOfFreedomPtr< OtherDegreeOfFreedomT, OtherBodyNodeT > &_dofp)
Assignment operator for DegreeOfFreedomPtrs.
Definition: DegreeOfFreedomPtr.hpp:86
std::size_t getLocalIndex() const
Get the local generalized coordinate index that this DegreeOfFreedomPtr is tied to.
Definition: DegreeOfFreedomPtr.hpp:129
DegreeOfFreedomT * get() const
Get the raw DegreeOfFreedom pointer.
Definition: DegreeOfFreedomPtr.hpp:113
std::size_t mIndex
Local index of this DegreeOfFreedom within its Joint.
Definition: DegreeOfFreedomPtr.hpp:221
TemplateWeakBodyNodePtr is a templated class that enables users to create a non-reference-holding Wea...
Definition: BodyNodePtr.hpp:224
TemplateWeakDegreeOfFreedomPtr is a templated class that enables users to create a non-reference-hold...
Definition: DegreeOfFreedomPtr.hpp:232
void set(DegreeOfFreedomT *_ptr)
Set the DegreeOfFreedom for this WeakDegreeOfFreedomPtr.
Definition: DegreeOfFreedomPtr.hpp:306
TemplateWeakDegreeOfFreedomPtr & operator=(const TemplateWeakDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_weakPtr)
Assignemnt operator for WeakDegreeOfFreedomPtrs.
Definition: DegreeOfFreedomPtr.hpp:275
TemplateWeakDegreeOfFreedomPtr(const TemplateWeakDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_weakPtr)
Constructor that takes in a WeakDegreeOfFreedomPtr.
Definition: DegreeOfFreedomPtr.hpp:252
TemplateWeakDegreeOfFreedomPtr(const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_strongPtr)
Constructor that takes in a strong DegreeOfFreedomPtr.
Definition: DegreeOfFreedomPtr.hpp:260
TemplateWeakDegreeOfFreedomPtr()
Default constructor.
Definition: DegreeOfFreedomPtr.hpp:238
TemplateWeakDegreeOfFreedomPtr & operator=(const TemplateDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_strongPtr)
Assignment operator for strong DegreeOfFreedomPtrs.
Definition: DegreeOfFreedomPtr.hpp:284
TemplateWeakBodyNodePtr< BodyNodeT > mWeakBodyNode
Weak pointer to the child BodyNode of this DegreeOfFreedom.
Definition: DegreeOfFreedomPtr.hpp:331
TemplateWeakDegreeOfFreedomPtr(DegreeOfFreedomT *_ptr)
Typical constructor.
Definition: DegreeOfFreedomPtr.hpp:245
void set(const TemplateWeakDegreeOfFreedomPtr< OtherDofT, OtherBodyNodeT > &_weakPtr)
Attempt to set the DegreeOfFreedom for this WeakDegreeOfFreedomPtr based on another WeakDegreeOfFreed...
Definition: DegreeOfFreedomPtr.hpp:322
TemplateWeakDegreeOfFreedomPtr & operator=(DegreeOfFreedomT *_ptr)
Assignment operator for raw DegreeOfFreedom pointers.
Definition: DegreeOfFreedomPtr.hpp:267
std::size_t mIndex
Local index of this DegreeOfFreedom within its Joint.
Definition: DegreeOfFreedomPtr.hpp:334
TemplateDegreeOfFreedomPtr< DegreeOfFreedomT, BodyNodeT > lock() const
Locks the DegreeOfFreedom reference to ensure that the referenced DegreeOfFreedom is currently still ...
Definition: DegreeOfFreedomPtr.hpp:295
constexpr std::size_t INVALID_INDEX
Definition: InvalidIndex.hpp:41
Definition: BulletCollisionDetector.cpp:65