Go to the documentation of this file.
16 #ifndef SURGSIM_PHYSICS_CONSTRAINT_H
17 #define SURGSIM_PHYSICS_CONSTRAINT_H
45 std::shared_ptr<ConstraintData> data,
46 std::shared_ptr<Representation> representation0,
48 std::shared_ptr<Representation> representation1,
62 std::shared_ptr<ConstraintData> data,
63 std::shared_ptr<Representation> representation0,
65 std::shared_ptr<Representation> representation1,
70 const std::pair<std::shared_ptr<ConstraintImplementation>, std::shared_ptr<ConstraintImplementation>>&
75 const std::pair<std::shared_ptr<Localization>, std::shared_ptr<Localization>>&
80 std::shared_ptr<ConstraintData>
getData()
const;
98 size_t indexOfRepresentation0,
99 size_t indexOfRepresentation1,
100 size_t indexOfConstraint);
110 std::array<Math::MlcpConstraintType, NUM_CONSTRAINT_TYPES>
m_mlcpMap;
116 std::pair<std::shared_ptr<ConstraintImplementation>, std::shared_ptr<ConstraintImplementation>>
m_implementations;
117 std::pair<std::shared_ptr<Localization>, std::shared_ptr<Localization>>
m_localizations;
132 virtual void doBuild(
double dt,
135 size_t indexOfRepresentation0,
136 size_t indexOfRepresentation1,
137 size_t indexOfConstraint);
147 #endif // SURGSIM_PHYSICS_CONSTRAINT_H
Base class for all physics constraints. Contains data specific to the constraint and a pair of implem...
Definition: Constraint.h:35
ConstraintType m_constraintType
The type of this constraint.
Definition: Constraint.h:123
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:78
bool isActive()
Definition: Constraint.cpp:87
const std::pair< std::shared_ptr< ConstraintImplementation >, std::shared_ptr< ConstraintImplementation > > & getImplementations() const
Gets both sides implementation as a pair.
Definition: Constraint.cpp:52
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:98
std::array< Math::MlcpConstraintType, NUM_CONSTRAINT_TYPES > m_mlcpMap
Constraint-MLCP mapping.
Definition: Constraint.h:110
A description of a physical mixed LCP system to be solved.
Definition: MlcpPhysicsProblem.h:44
const std::pair< std::shared_ptr< Localization >, std::shared_ptr< Localization > > & getLocalizations() const
Gets both sides Localization as a pair.
Definition: Constraint.cpp:57
Definition: CompoundShapeToGraphics.cpp:30
size_t getNumDof() const
Gets the number of degree of freedom for this constraint.
Definition: Constraint.cpp:68
ConstraintType
Definition: ConstraintType.h:25
std::pair< std::shared_ptr< Localization >, std::shared_ptr< Localization > > m_localizations
Definition: Constraint.h:117
Base class for all CosntraintData Derived classes should be specific to a given constraint.
Definition: ConstraintData.h:28
void setActive(bool flag)
Definition: Constraint.cpp:93
virtual ~Constraint()
Destructor.
Definition: Constraint.cpp:46
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 somethi...
Definition: Constraint.cpp:29
A Location defines a local position w.r.t.
Definition: Location.h:40
size_t m_numDof
The degrees of freedom that this constraint has.
Definition: Constraint.h:120
std::shared_ptr< ConstraintData > getData() const
Gets the data associated to this constraint.
Definition: Constraint.cpp:63
bool m_active
Flag to indicate whether this constraint is active or not.
Definition: Constraint.h:140
std::shared_ptr< ConstraintData > m_data
Specific data associated to this constraint.
Definition: Constraint.h:113
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 somethi...
Definition: Constraint.cpp:127
ConstraintType getType()
Gets the ConstraintType.
Definition: Constraint.cpp:73
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:116