All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ContactConstraintGeneration.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, 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_CONTACTCONSTRAINTGENERATION_H
17 #define SURGSIM_PHYSICS_CONTACTCONSTRAINTGENERATION_H
18 
19 #include <memory>
20 
23 
24 
25 namespace SurgSim
26 {
27 
28 namespace Framework
29 {
30 class Logger;
31 }
32 
33 namespace DataStructures
34 {
35 struct Location;
36 }
37 namespace Collision
38 {
39 class Representation;
40 }
41 
42 namespace Physics
43 {
44 
45 class PhysicsManagerState;
46 class Localization;
47 
59 {
60 public:
63  explicit ContactConstraintGeneration(bool doCopyState = false);
64 
67 
68 private:
69 
72 
74  std::shared_ptr<SurgSim::Framework::Logger> m_logger;
75 
81  virtual std::shared_ptr<PhysicsManagerState> doUpdate(
82  const double& dt,
83  const std::shared_ptr<PhysicsManagerState>& state) override;
84 
90  std::shared_ptr<Localization> makeLocalization(
91  std::shared_ptr<SurgSim::Physics::Representation> physicsRepresentation,
92  std::shared_ptr<SurgSim::Collision::Representation> collisionRepresentation,
93  const SurgSim::DataStructures::Location& location);
94 };
95 
96 }; // Physics
97 }; // SurgSim
98 
99 #endif
std::shared_ptr< Localization > makeLocalization(std::shared_ptr< SurgSim::Physics::Representation > physicsRepresentation, std::shared_ptr< SurgSim::Collision::Representation > collisionRepresentation, const SurgSim::DataStructures::Location &location)
Generate a localization from a Collision Representation.
Definition: ContactConstraintGeneration.cpp:141
ContactConstraintGeneration(bool doCopyState=false)
Constructor.
Definition: ContactConstraintGeneration.cpp:37
~ContactConstraintGeneration()
Destructor.
Definition: ContactConstraintGeneration.cpp:42
Definition: Location.h:31
std::shared_ptr< SurgSim::Framework::Logger > m_logger
The logger for this class.
Definition: ContactConstraintGeneration.h:74
virtual std::shared_ptr< PhysicsManagerState > doUpdate(const double &dt, const std::shared_ptr< PhysicsManagerState > &state) override
Overridden function from Computation, the actual work is done here.
Definition: ContactConstraintGeneration.cpp:47
Generate a constraint for every contact that was calculated.
Definition: ContactConstraintGeneration.h:58
Encapsulates a calculation over a selection of objects, needs to be subclassed to be used...
Definition: Computation.h:30
ConstraintImplementationFactory m_factory
For looking up instances of constrain implementations.
Definition: ContactConstraintGeneration.h:71
This class manages ConstraintImplementations, and can be used to look up the correct implementation b...
Definition: ConstraintImplementationFactory.h:35