16 #ifndef SURGSIM_PHYSICS_CONSTRAINT_H 17 #define SURGSIM_PHYSICS_CONSTRAINT_H 19 #include "SurgSim/DataStructures/Location.h" 20 #include "SurgSim/Physics/ConstraintData.h" 21 #include "SurgSim/Physics/ConstraintImplementation.h" 22 #include "SurgSim/Physics/MlcpPhysicsProblem.h" 44 ConstraintType constraintType,
45 std::shared_ptr<ConstraintData> data,
46 std::shared_ptr<Representation> representation0,
48 std::shared_ptr<Representation> representation1,
61 ConstraintType constraintType,
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 Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
void setActive(bool flag)
Definition: Constraint.cpp:93
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
A description of a physical mixed LCP system to be solved.
Definition: MlcpPhysicsProblem.h:43
A Location defines a local position w.r.t.
Definition: Location.h:39
size_t m_numDof
The degrees of freedom that this constraint has.
Definition: Constraint.h:120
bool isActive()
Definition: Constraint.cpp:87
bool m_active
Flag to indicate whether this constraint is active or not.
Definition: Constraint.h:140
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
Base class for all CosntraintData Derived classes should be specific to a given constraint.
Definition: ConstraintData.h:27
ConstraintType getType()
Gets the ConstraintType.
Definition: Constraint.cpp:73
virtual ~Constraint()
Destructor.
Definition: Constraint.cpp:46
const std::pair< std::shared_ptr< Localization >, std::shared_ptr< Localization > > & getLocalizations() const
Gets both sides Localization as a pair.
Definition: Constraint.cpp:57
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
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
Base class for all physics constraints. Contains data specific to the constraint and a pair of implem...
Definition: Constraint.h:34
const std::pair< std::shared_ptr< ConstraintImplementation >, std::shared_ptr< ConstraintImplementation > > & getImplementations() const
Gets both sides implementation as a pair.
Definition: Constraint.cpp:52
std::shared_ptr< ConstraintData > m_data
Specific data associated to this constraint.
Definition: Constraint.h:113
std::shared_ptr< ConstraintData > getData() const
Gets the data associated to this constraint.
Definition: Constraint.cpp:63
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
std::array< Math::MlcpConstraintType, NUM_CONSTRAINT_TYPES > m_mlcpMap
Constraint-MLCP mapping.
Definition: Constraint.h:110
size_t getNumDof() const
Gets the number of degree of freedom for this constraint.
Definition: Constraint.cpp:68
ConstraintType m_constraintType
The type of this constraint.
Definition: Constraint.h:123