All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SurgSim::Physics::Constraint Class Reference

Base class for all physics constraints. Contains data specific to the constraint and a pair of implementations. More...

#include <SurgSim/Physics/Constraint.h>

Public Member Functions

 Constraint (std::shared_ptr< ConstraintData > data, std::shared_ptr< ConstraintImplementation > implementation0, std::shared_ptr< Localization > localization0, std::shared_ptr< ConstraintImplementation > implementation1, std::shared_ptr< Localization > localization1)
 Sets all the values for this constraints, does validation on the parameters and will throw it something is wrong with the constraint. More...
 
virtual ~Constraint ()
 Destructor. More...
 
void setInformation (std::shared_ptr< ConstraintData > data, std::shared_ptr< ConstraintImplementation > implementation0, std::shared_ptr< Localization > localization0, std::shared_ptr< ConstraintImplementation > implementation1, std::shared_ptr< Localization > localization1)
 Sets all the values for this constraints, does validation on the parameters and will throw it 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...
 
SurgSim::Math::MlcpConstraintType getType ()
 Gets the ConstraintType for this constraint. 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 ()
 

Private Member Functions

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

Private Attributes

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...
 
SurgSim::Math::MlcpConstraintType m_constraintType
 The type of this constraint. More...
 

Detailed Description

Base class for all physics constraints. Contains data specific to the constraint and a pair of implementations.

Constructor & Destructor Documentation

SurgSim::Physics::Constraint::Constraint ( std::shared_ptr< ConstraintData data,
std::shared_ptr< ConstraintImplementation implementation0,
std::shared_ptr< Localization localization0,
std::shared_ptr< ConstraintImplementation implementation1,
std::shared_ptr< Localization localization1 
)

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

Parameters
dataThe data for this constraint.
implementation0,implementation1Both sides implementation of the constraint.
localization0,localization1Both localizations of the representations involved in this constraint.
SurgSim::Physics::Constraint::~Constraint ( )
virtual

Destructor.

Member Function Documentation

void SurgSim::Physics::Constraint::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.

Parameters
dtThe time step.
[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.
void SurgSim::Physics::Constraint::doBuild ( double  dt,
const ConstraintData data,
MlcpPhysicsProblem mlcpPhysicsProblem,
size_t  indexOfRepresentation0,
size_t  indexOfRepresentation1,
size_t  indexOfConstraint 
)
privatevirtual

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
std::shared_ptr< ConstraintData > SurgSim::Physics::Constraint::getData ( ) const

Gets the data associated to this constraint.

Returns
The data associated to this constraint.
const std::pair< std::shared_ptr< ConstraintImplementation >, std::shared_ptr< ConstraintImplementation > > & SurgSim::Physics::Constraint::getImplementations ( ) const

Gets both sides implementation as a pair.

Returns
the pair of implementations forming this constraint.
const std::pair< std::shared_ptr< Localization >, std::shared_ptr< Localization > > & SurgSim::Physics::Constraint::getLocalizations ( ) const

Gets both sides Localization as a pair.

Returns
the pair of localizations forming this constraint.
size_t SurgSim::Physics::Constraint::getNumDof ( ) const

Gets the number of degree of freedom for this constraint.

Returns
The number of degree of freedom for this constraint.
SurgSim::Math::MlcpConstraintType SurgSim::Physics::Constraint::getType ( )

Gets the ConstraintType for this constraint.

Returns
The type.
bool SurgSim::Physics::Constraint::isActive ( )
Returns
Whether this constraint is active.
void SurgSim::Physics::Constraint::setInformation ( std::shared_ptr< ConstraintData data,
std::shared_ptr< ConstraintImplementation implementation0,
std::shared_ptr< Localization localization0,
std::shared_ptr< ConstraintImplementation implementation1,
std::shared_ptr< Localization localization1 
)

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

Parameters
dataThe data for this constraint.
implementation0,implementation1Both sides implementation of the constraint.
localization0,localization1Both localizations of the representations involved in this constraint.

Member Data Documentation

SurgSim::Math::MlcpConstraintType SurgSim::Physics::Constraint::m_constraintType
private

The type of this constraint.

std::shared_ptr<ConstraintData> SurgSim::Physics::Constraint::m_data
private

Specific data associated to this constraint.

std::pair<std::shared_ptr<ConstraintImplementation>, std::shared_ptr<ConstraintImplementation> > SurgSim::Physics::Constraint::m_implementations
private

Pair of implementations defining the 2 sides of the constraint.

std::pair<std::shared_ptr<Localization>, std::shared_ptr<Localization> > SurgSim::Physics::Constraint::m_localizations
private
size_t SurgSim::Physics::Constraint::m_numDof
private

The degrees of freedom that this constraint has.


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