Biorbd Release_1.13.0
Loading...
Searching...
No Matches
BIORBD_NAMESPACE::rigidbody::NodeSegment Class Reference

A point attached to a segment, generally speaking a skin marker. More...

#include <NodeSegment.h>

Inheritance diagram for BIORBD_NAMESPACE::rigidbody::NodeSegment:
BIORBD_NAMESPACE::utils::Vector3d BIORBD_NAMESPACE::utils::Node BIORBD_NAMESPACE::rigidbody::SoftContactNode BIORBD_NAMESPACE::rigidbody::SoftContactSphere

Public Member Functions

 NodeSegment ()
 Construct a segment node.
 NodeSegment (const utils::Scalar &x, const utils::Scalar &y, const utils::Scalar &z)
 Construct a segment node.
 NodeSegment (const utils::Vector3d &other)
 Construct a segment node from another node.
 NodeSegment (const utils::Scalar &x, const utils::Scalar &y, const utils::Scalar &z, const utils::String &name, const utils::String &parentName, bool isTechnical, bool isAnatomical, const utils::String &axesToRemove, int parentID)
 Construct a segment node.
 NodeSegment (const utils::Vector3d &node, const utils::String &name, const utils::String &parentName, bool isTechnical, bool isAnatomical, const utils::String &axesToRemove, int parentID)
 Construct a segment node.
NodeSegment DeepCopy () const
 Deep copy of the segment node.
void DeepCopy (const NodeSegment &other)
 Deep copy of the segment node.
void setValues (const NodeSegment &values)
 Set internal values of the node without changing other parameters.
bool isTechnical () const
 Return if node is technical.
bool isAnatomical () const
 Return if node is anatomical.
int parentId () const
 Return the parent index.
const std::vector< bool > & axesToRemove () const
 Accessor to axes to remove.
const std::vector< bool > axes () const
 A vector of bool which is the opposite of axesToRemove.
NodeSegment removeAxes () const
 To remove axis.
bool isAxisRemoved (size_t i) const
 Check if axis is removed.
bool isAxisKept (size_t i) const
 Check if axis is kept.
std::vector< int > availableAxesIndices () const
 Get all the indices of the axes to keep (X=0, Y=1, Z=2).
void addAxesToRemove (size_t axisNumber)
 Add an axis to remove.
void addAxesToRemove (const utils::String &axis)
 Add axis to remove.
void addAxesToRemove (const std::vector< size_t > &axes)
 Add multiple axes to remove.
void addAxesToRemove (const std::vector< utils::String > &axes)
 Add multiple axes to remove.
utils::String axesToRemoveAsString () const
 Return the axes to removed.
int nbAxesToRemove () const
 Return the number of axes to remove.
Public Member Functions inherited from BIORBD_NAMESPACE::utils::Vector3d
 Vector3d ()
 Construct 3D vector.
 Vector3d (const Scalar &x, const Scalar &y, const Scalar &z)
 Construct 3D vector.
 Vector3d (const Scalar &x, const Scalar &y, const Scalar &z, const String &name, const String &parentName)
 Construct a 3D vector.
 Vector3d (const Vector3d vec, const String &name, const String &parentName)
 Construct a 3D vector.
 Vector3d (const RigidBodyDynamics::Math::Vector3d &other)
 Construct a 3D vector from a Casadi 3D vector (drop the trailling 1).
 Vector3d (const RigidBodyDynamics::Math::VectorNd &other)
 Construct a 3D vector from a Casadi ND vector (drop the trailling 1).
 Vector3d (const RigidBodyDynamics::Math::Vector4d &other)
 Construct a 3D vector from an eigen 4D vector (drop the trailling 1).
Vector3d DeepCopy () const
 Deep copy of a 3D vector.
void DeepCopy (const Vector3d &other)
 Deep copy of a 3D vector into another 3D vector.
Vector3d applyRT (const RotoTrans &rt) const
 Apply a RotoTrans to the 3D vector.
void applyRT (const RotoTrans &rt)
 Apply a RotoTrans to the 3D vector.
void setPosition (const Vector3d &v)
 Set a new position.
Public Member Functions inherited from BIORBD_NAMESPACE::utils::Node
 Node ()
 Construct Node.
 Node (const Node &other)
 Construct Node from another node.
 Node (const String &name)
 Construct Node.
 Node (const String &name, const String &parentName)
 Construct Node.
virtual ~Node ()
 Destroy class properly.
void DeepCopy (const Node &other)
 Deep copy of the node in another node.
void setName (const String &name)
 Set the name of the node.
const String & name () const
 Return the name of the node.
const String & parent () const
 Return the parent name of the node.
void setParent (const String &name)
 Set the parent name of the node.
NODE_TYPE typeOfNode () const
 Return the type of node.

Protected Member Functions

void setType ()
 Set the type of the segment node.
Protected Member Functions inherited from BIORBD_NAMESPACE::utils::Vector3d
void setType ()
 Set the type Vector3d.

Protected Attributes

std::shared_ptr< std::vector< bool > > m_axesRemoved
 The axes to remove.
std::shared_ptr< int > m_nbAxesToRemove
std::shared_ptr< bool > m_technical
 If a marker is a technical marker.
std::shared_ptr< bool > m_anatomical
 It marker is a anatomical marker.
std::shared_ptr< int > m_id
 The parent identification.
Protected Attributes inherited from BIORBD_NAMESPACE::utils::Node
std::shared_ptr< String > m_name
 The name of the node.
std::shared_ptr< String > m_parentName
 The parent name of the node.
std::shared_ptr< NODE_TYPE > m_typeOfNode
 The type of the node.

Detailed Description

A point attached to a segment, generally speaking a skin marker.

Definition at line 20 of file NodeSegment.h.

Constructor & Destructor Documentation

◆ NodeSegment() [1/5]

rigidbody::NodeSegment::NodeSegment ( )

Construct a segment node.

Definition at line 8 of file NodeSegment.cpp.

◆ NodeSegment() [2/5]

rigidbody::NodeSegment::NodeSegment ( const utils::Scalar & x,
const utils::Scalar & y,
const utils::Scalar & z )

Construct a segment node.

Parameters
xX-Component of the node
yY-Component of the node
zZ-Component of the node

Definition at line 18 of file NodeSegment.cpp.

◆ NodeSegment() [3/5]

rigidbody::NodeSegment::NodeSegment ( const utils::Vector3d & other)

Construct a segment node from another node.

Parameters
otherThe other node

Definition at line 31 of file NodeSegment.cpp.

◆ NodeSegment() [4/5]

rigidbody::NodeSegment::NodeSegment ( const utils::Scalar & x,
const utils::Scalar & y,
const utils::Scalar & z,
const utils::String & name,
const utils::String & parentName,
bool isTechnical,
bool isAnatomical,
const utils::String & axesToRemove,
int parentID )

Construct a segment node.

Parameters
xX-Component of the node
yY-Component of the node
zZ-Component of the node
nameThe name of the node
parentNameThe name of the parent
isTechnicalIf the node is technical
isAnatomicalIf the node is anatomical
axesToRemoveThe axes to remove
parentIDThe index of the parent segment

Definition at line 41 of file NodeSegment.cpp.

◆ NodeSegment() [5/5]

rigidbody::NodeSegment::NodeSegment ( const utils::Vector3d & node,
const utils::String & name,
const utils::String & parentName,
bool isTechnical,
bool isAnatomical,
const utils::String & axesToRemove,
int parentID )

Construct a segment node.

Parameters
nodeThe position of the node
nameThe name of the node
parentNameThe name of the parent
isTechnicalIf the node is technical
isAnatomicalIf the node is anatomical
axesToRemoveThe axes to remove
parentIDThe index of the parent segment

Definition at line 60 of file NodeSegment.cpp.

Member Function Documentation

◆ addAxesToRemove() [1/4]

void rigidbody::NodeSegment::addAxesToRemove ( const std::vector< size_t > & axes)

Add multiple axes to remove.

Parameters
axesThe multiples axes numbers to remove (x = 0, y = 1 and z = 2)

Definition at line 168 of file NodeSegment.cpp.

◆ addAxesToRemove() [2/4]

void rigidbody::NodeSegment::addAxesToRemove ( const std::vector< utils::String > & axes)

Add multiple axes to remove.

Parameters
axesThe multiples axes names to remove ("x", "y" or "z")

Definition at line 174 of file NodeSegment.cpp.

◆ addAxesToRemove() [3/4]

void rigidbody::NodeSegment::addAxesToRemove ( const utils::String & axis)

Add axis to remove.

Parameters
axisThe name of the axis to remove ("x", "y" or "z")

Definition at line 154 of file NodeSegment.cpp.

◆ addAxesToRemove() [4/4]

void rigidbody::NodeSegment::addAxesToRemove ( size_t axisNumber)

Add an axis to remove.

Parameters
axisNumberThe axis number to remove (x = 0, y = 1 and z = 2)

Definition at line 146 of file NodeSegment.cpp.

◆ availableAxesIndices()

std::vector< int > rigidbody::NodeSegment::availableAxesIndices ( ) const

Get all the indices of the axes to keep (X=0, Y=1, Z=2).

Returns
The indices of the axes to keep

Definition at line 134 of file NodeSegment.cpp.

◆ axes()

const std::vector< bool > rigidbody::NodeSegment::axes ( ) const

A vector of bool which is the opposite of axesToRemove.

Returns
The axes to keep

Definition at line 108 of file NodeSegment.cpp.

◆ axesToRemove()

const std::vector< bool > & rigidbody::NodeSegment::axesToRemove ( ) const

Accessor to axes to remove.

Returns
The axes to remove

Definition at line 104 of file NodeSegment.cpp.

◆ axesToRemoveAsString()

utils::String rigidbody::NodeSegment::axesToRemoveAsString ( ) const

Return the axes to removed.

Returns
The axes to removed

Definition at line 181 of file NodeSegment.cpp.

◆ DeepCopy() [1/2]

rigidbody::NodeSegment rigidbody::NodeSegment::DeepCopy ( ) const

Deep copy of the segment node.

Returns
A deep copy of the segment node

Definition at line 77 of file NodeSegment.cpp.

◆ DeepCopy() [2/2]

void rigidbody::NodeSegment::DeepCopy ( const NodeSegment & other)

Deep copy of the segment node.

Parameters
otherThe segment node to copy

Definition at line 83 of file NodeSegment.cpp.

◆ isAnatomical()

bool rigidbody::NodeSegment::isAnatomical ( ) const

Return if node is anatomical.

Returns
If node is anatomical

Definition at line 98 of file NodeSegment.cpp.

◆ isAxisKept()

bool rigidbody::NodeSegment::isAxisKept ( size_t i) const

Check if axis is kept.

Parameters
iThe index of the axis (X=0, Y=1, Z=2)
Returns
If axis is kept or not

Definition at line 130 of file NodeSegment.cpp.

◆ isAxisRemoved()

bool rigidbody::NodeSegment::isAxisRemoved ( size_t i) const

Check if axis is removed.

Parameters
iThe index of the axis (X=0, Y=1, Z=2)
Returns
If axis is removed or not

Definition at line 126 of file NodeSegment.cpp.

◆ isTechnical()

bool rigidbody::NodeSegment::isTechnical ( ) const

Return if node is technical.

Returns
If node is technical

Definition at line 100 of file NodeSegment.cpp.

◆ nbAxesToRemove()

int rigidbody::NodeSegment::nbAxesToRemove ( ) const

Return the number of axes to remove.

Returns
The number of axes to remove

Definition at line 144 of file NodeSegment.cpp.

◆ parentId()

int rigidbody::NodeSegment::parentId ( ) const

Return the parent index.

Returns
The parent index

Definition at line 102 of file NodeSegment.cpp.

◆ removeAxes()

rigidbody::NodeSegment rigidbody::NodeSegment::removeAxes ( ) const

To remove axis.

Returns
Projected position of the node when removing speficic axes speficied using addAxesToRemove

Definition at line 116 of file NodeSegment.cpp.

◆ setType()

void rigidbody::NodeSegment::setType ( )
protectedvirtual

Set the type of the segment node.

Implements BIORBD_NAMESPACE::utils::Node.

Reimplemented in BIORBD_NAMESPACE::rigidbody::SoftContactNode, and BIORBD_NAMESPACE::rigidbody::SoftContactSphere.

Definition at line 195 of file NodeSegment.cpp.

◆ setValues()

void rigidbody::NodeSegment::setValues ( const NodeSegment & values)

Set internal values of the node without changing other parameters.

Parameters
valuesThe new values

Definition at line 92 of file NodeSegment.cpp.

Member Data Documentation

◆ m_anatomical

std::shared_ptr<bool> BIORBD_NAMESPACE::rigidbody::NodeSegment::m_anatomical
protected

It marker is a anatomical marker.

Definition at line 227 of file NodeSegment.h.

◆ m_axesRemoved

std::shared_ptr<std::vector<bool> > BIORBD_NAMESPACE::rigidbody::NodeSegment::m_axesRemoved
protected

The axes to remove.

Definition at line 221 of file NodeSegment.h.

◆ m_id

std::shared_ptr<int> BIORBD_NAMESPACE::rigidbody::NodeSegment::m_id
protected

The parent identification.

Definition at line 228 of file NodeSegment.h.

◆ m_nbAxesToRemove

std::shared_ptr<int> BIORBD_NAMESPACE::rigidbody::NodeSegment::m_nbAxesToRemove
protected

Removed one of multiple axes (1 axis : project on a plan, 2 axes : project on the 3rd axis, 3 axes : return the position of the parent reference)

Definition at line 223 of file NodeSegment.h.

◆ m_technical

std::shared_ptr<bool> BIORBD_NAMESPACE::rigidbody::NodeSegment::m_technical
protected

If a marker is a technical marker.

Definition at line 226 of file NodeSegment.h.


The documentation for this class was generated from the following files: