16 #ifndef SURGSIM_PHYSICS_CONSTRAINT_H
17 #define SURGSIM_PHYSICS_CONSTRAINT_H
41 std::shared_ptr<ConstraintData> data,
42 std::shared_ptr<ConstraintImplementation> implementation0,
43 std::shared_ptr<Localization> localization0,
44 std::shared_ptr<ConstraintImplementation> implementation1,
45 std::shared_ptr<Localization> localization1);
56 std::shared_ptr<ConstraintData> data,
57 std::shared_ptr<ConstraintImplementation> implementation0,
58 std::shared_ptr<Localization> localization0,
59 std::shared_ptr<ConstraintImplementation> implementation1,
60 std::shared_ptr<Localization> localization1);
64 const std::pair<std::shared_ptr<ConstraintImplementation>, std::shared_ptr<ConstraintImplementation>>&
69 const std::pair<std::shared_ptr<Localization>, std::shared_ptr<Localization>>&
74 std::shared_ptr<ConstraintData>
getData()
const;
92 size_t indexOfRepresentation0,
93 size_t indexOfRepresentation1,
94 size_t indexOfConstraint);
104 std::pair<std::shared_ptr<ConstraintImplementation>, std::shared_ptr<ConstraintImplementation>>
m_implementations;
105 std::pair<std::shared_ptr<Localization>, std::shared_ptr<Localization>>
m_localizations;
120 virtual void doBuild(
double dt,
123 size_t indexOfRepresentation0,
124 size_t indexOfRepresentation1,
125 size_t indexOfConstraint);
132 #endif // SURGSIM_PHYSICS_CONSTRAINT_H
Definition: DriveElementFromInputBehavior.cpp:27
std::pair< std::shared_ptr< ConstraintImplementation >, std::shared_ptr< ConstraintImplementation > > m_implementations
Pair of implementations defining the 2 sides of the constraint.
Definition: Constraint.h:104
A description of a physical mixed LCP system to be solved.
Definition: MlcpPhysicsProblem.h:43
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 somethi...
Definition: Constraint.cpp:28
size_t m_numDof
The degrees of freedom that this constraint has.
Definition: Constraint.h:108
bool isActive()
Definition: Constraint.cpp:99
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.
Definition: Constraint.cpp:70
Base class for all CosntraintData Derived classes should be specific to a given constraint.
Definition: ConstraintData.h:27
SurgSim::Math::MlcpConstraintType getType()
Gets the ConstraintType for this constraint.
Definition: Constraint.cpp:65
SurgSim::Math::MlcpConstraintType m_constraintType
The type of this constraint.
Definition: Constraint.h:111
size_t getNumDof() const
Gets the number of degree of freedom for this constraint.
Definition: Constraint.cpp:60
std::shared_ptr< ConstraintData > getData() const
Gets the data associated to this constraint.
Definition: Constraint.cpp:55
virtual ~Constraint()
Destructor.
Definition: Constraint.cpp:38
std::pair< std::shared_ptr< Localization >, std::shared_ptr< Localization > > m_localizations
Definition: Constraint.h:105
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 tr...
Definition: Constraint.cpp:105
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 somethi...
Definition: Constraint.cpp:114
Base class for all physics constraints. Contains data specific to the constraint and a pair of implem...
Definition: Constraint.h:32
std::shared_ptr< ConstraintData > m_data
Specific data associated to this constraint.
Definition: Constraint.h:101
const std::pair< std::shared_ptr< Localization >, std::shared_ptr< Localization > > & getLocalizations() const
Gets both sides Localization as a pair.
Definition: Constraint.cpp:49
const std::pair< std::shared_ptr< ConstraintImplementation >, std::shared_ptr< ConstraintImplementation > > & getImplementations() const
Gets both sides implementation as a pair.
Definition: Constraint.cpp:44
MlcpConstraintType
Definition: MlcpConstraintType.h:24