Public Member Functions | Private Member Functions | Private Attributes | List of all members
SurgSim::Physics::SlidingConstraint Class Reference

Sliding constraint between two physics representations. More...

#include <SurgSim/Physics/SlidingConstraint.h>

Inheritance diagram for SurgSim::Physics::SlidingConstraint:
SurgSim::Physics::Constraint

Public Member Functions

 SlidingConstraint (ConstraintType constraintType, std::shared_ptr< ConstraintData > data, std::shared_ptr< Representation > representation0, const SurgSim::DataStructures::Location &location0, std::shared_ptr< Representation > representation1, const SurgSim::DataStructures::Location &location1, const Math::Vector3d &slidingDirection)
 Sets all the values for this constraints, does validation on the parameters and will throw if something is wrong with the constraint. More...
 
virtual ~SlidingConstraint ()
 Destructor. More...
 
- Public Member Functions inherited from SurgSim::Physics::Constraint
 Constraint (ConstraintType constraintType, std::shared_ptr< ConstraintData > data, std::shared_ptr< Representation > representation0, const SurgSim::DataStructures::Location &location0, std::shared_ptr< Representation > representation1, const SurgSim::DataStructures::Location &location1)
 Sets all the values for this constraints, does validation on the parameters and will throw if something is wrong with the constraint. More...
 
virtual ~Constraint ()
 Destructor. More...
 
void setInformation (ConstraintType constraintType, std::shared_ptr< ConstraintData > data, std::shared_ptr< Representation > representation0, const SurgSim::DataStructures::Location &location0, std::shared_ptr< Representation > representation1, const SurgSim::DataStructures::Location &location1)
 Sets all the values for this constraints, does validation on the parameters and will throw if something is wrong with the constraint. More...
 
const std::pair< std::shared_ptr< ConstraintImplementation >, std::shared_ptr< ConstraintImplementation > > & getImplementations () const
 Gets both sides implementation as a pair. More...
 
const std::pair< std::shared_ptr< Localization >, std::shared_ptr< Localization > > & getLocalizations () const
 Gets both sides Localization as a pair. More...
 
std::shared_ptr< ConstraintDatagetData () const
 Gets the data associated to this constraint. More...
 
size_t getNumDof () const
 Gets the number of degree of freedom for this constraint. More...
 
ConstraintType getType ()
 Gets the ConstraintType. More...
 
void build (double dt, MlcpPhysicsProblem *mlcpPhysicsProblem, size_t indexOfRepresentation0, size_t indexOfRepresentation1, size_t indexOfConstraint)
 Builds subset of an Mlcp physics problem associated to this constraint. More...
 
bool isActive ()
 
void setActive (bool flag)
 

Private Member Functions

void doBuild (double dt, const ConstraintData &data, MlcpPhysicsProblem *mlcpPhysicsProblem, size_t indexOfRepresentation0, size_t indexOfRepresentation1, size_t indexOfConstraint) override
 Builds subset of an Mlcp physics problem associated to this constraint user-defined call for extra treatment. More...
 

Private Attributes

std::shared_ptr< SlidingConstraintDatam_slidingConstraintData
 The sliding constraint data. More...
 
Math::Vector3d m_directionEnd
 The end of the sliding direction, local to the representation1. More...
 

Additional Inherited Members

- Protected Attributes inherited from SurgSim::Physics::Constraint
std::array< Math::MlcpConstraintType, NUM_CONSTRAINT_TYPESm_mlcpMap
 Constraint-MLCP mapping. More...
 
std::shared_ptr< ConstraintDatam_data
 Specific data associated to this constraint. More...
 
std::pair< std::shared_ptr< ConstraintImplementation >, std::shared_ptr< ConstraintImplementation > > m_implementations
 Pair of implementations defining the 2 sides of the constraint. More...
 
std::pair< std::shared_ptr< Localization >, std::shared_ptr< Localization > > m_localizations
 
size_t m_numDof
 The degrees of freedom that this constraint has. More...
 
ConstraintType m_constraintType
 The type of this constraint. More...
 
bool m_active
 Flag to indicate whether this constraint is active or not. More...
 

Detailed Description

Sliding constraint between two physics representations.

The sliding direction vector (direction + origin) needs to be updated each physics time step. This is done by transforming the direction and origin into the local coordinates of the physics representations and recalculating them every time step. representation0 is the one that can 'slide' against Representation1, for example Representation0 could be a suture Representation1 tissue.

Constructor & Destructor Documentation

§ SlidingConstraint()

SurgSim::Physics::SlidingConstraint::SlidingConstraint ( ConstraintType  constraintType,
std::shared_ptr< ConstraintData data,
std::shared_ptr< Representation representation0,
const SurgSim::DataStructures::Location location0,
std::shared_ptr< Representation representation1,
const SurgSim::DataStructures::Location location1,
const Math::Vector3d slidingDirection 
)

Sets all the values for this constraints, does validation on the parameters and will throw if something is wrong with the constraint.

Parameters
constraintTypeThe constraint type.
dataThe data for this constraint.
representation0The moving representation e.g. suture.
representation1The non-moving representation e.g. tissue.
location0,location1Both locations of the representations involved in this constraint.
slidingDirectionThe direction of sliding.

§ ~SlidingConstraint()

SurgSim::Physics::SlidingConstraint::~SlidingConstraint ( )
virtual

Destructor.

Member Function Documentation

§ doBuild()

void SurgSim::Physics::SlidingConstraint::doBuild ( double  dt,
const ConstraintData data,
MlcpPhysicsProblem mlcpPhysicsProblem,
size_t  indexOfRepresentation0,
size_t  indexOfRepresentation1,
size_t  indexOfConstraint 
)
overrideprivatevirtual

Builds subset of an Mlcp physics problem associated to this constraint user-defined call for extra treatment.

Parameters
dtThe time step
dataThe data specific to this constraint
[in,out]mlcpPhysicsProblemThe Mlcp physics problem to be filled up
indexOfRepresentation0The index of the 1st representation in the Mlcp
indexOfRepresentation1The index of the 2nd representation in the Mlcp
indexOfConstraintThe index of this constraint in the Mlcp

Reimplemented from SurgSim::Physics::Constraint.

Member Data Documentation

§ m_directionEnd

Math::Vector3d SurgSim::Physics::SlidingConstraint::m_directionEnd
private

The end of the sliding direction, local to the representation1.

§ m_slidingConstraintData

std::shared_ptr<SlidingConstraintData> SurgSim::Physics::SlidingConstraint::m_slidingConstraintData
private

The sliding constraint data.


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