SlidingConstraint.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2015, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_PHYSICS_SLIDINGCONSTRAINT_H
17 #define SURGSIM_PHYSICS_SLIDINGCONSTRAINT_H
18 
22 
23 namespace SurgSim
24 {
25 
26 namespace Physics
27 {
28 
36 {
37 public:
47  ConstraintType constraintType,
48  std::shared_ptr<ConstraintData> data,
49  std::shared_ptr<Representation> representation0,
50  const SurgSim::DataStructures::Location& location0,
51  std::shared_ptr<Representation> representation1,
52  const SurgSim::DataStructures::Location& location1,
53  const Math::Vector3d& slidingDirection);
54 
56  virtual ~SlidingConstraint();
57 
58 private:
59  void doBuild(double dt,
60  const ConstraintData& data,
61  MlcpPhysicsProblem* mlcpPhysicsProblem,
62  size_t indexOfRepresentation0,
63  size_t indexOfRepresentation1,
64  size_t indexOfConstraint) override;
65 
67  std::shared_ptr<SlidingConstraintData> m_slidingConstraintData;
68 
71 };
72 
73 }; // namespace Physics
74 
75 }; // namespace SurgSim
76 
77 #endif // SURGSIM_PHYSICS_SLIDINGCONSTRAINT_H
SurgSim::Physics::SlidingConstraint::~SlidingConstraint
virtual ~SlidingConstraint()
Destructor.
Definition: SlidingConstraint.cpp:49
SurgSim::Physics::SlidingConstraint::m_slidingConstraintData
std::shared_ptr< SlidingConstraintData > m_slidingConstraintData
The sliding constraint data.
Definition: SlidingConstraint.h:67
SurgSim::Physics::Constraint
Base class for all physics constraints. Contains data specific to the constraint and a pair of implem...
Definition: Constraint.h:34
Constraint.h
SurgSim::Physics::SlidingConstraint
Sliding constraint between two physics representations.
Definition: SlidingConstraint.h:35
SurgSim::Physics::MlcpPhysicsProblem
A description of a physical mixed LCP system to be solved.
Definition: MlcpPhysicsProblem.h:43
SurgSim::Math::Vector3d
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SlidingConstraintData.h
SurgSim::Physics::ConstraintType
ConstraintType
Definition: ConstraintType.h:24
SurgSim::Physics::SlidingConstraint::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 somethi...
Definition: SlidingConstraint.cpp:32
SurgSim::Physics::ConstraintData
Base class for all CosntraintData Derived classes should be specific to a given constraint.
Definition: ConstraintData.h:27
SurgSim::DataStructures::Location
A Location defines a local position w.r.t.
Definition: Location.h:39
Representation.h
SurgSim::Physics::SlidingConstraint::doBuild
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 tr...
Definition: SlidingConstraint.cpp:53
SurgSim::Physics::SlidingConstraint::m_directionEnd
Math::Vector3d m_directionEnd
The end of the sliding direction, local to the representation1.
Definition: SlidingConstraint.h:70