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 Localization;
46 class PhysicsManagerState;
47 class Representation;
48 
60 {
61 public:
64  explicit ContactConstraintGeneration(bool doCopyState = false);
65 
67 
70 
71 private:
73  std::shared_ptr<SurgSim::Framework::Logger> m_logger;
74 
80  std::shared_ptr<PhysicsManagerState> doUpdate(const double& dt, const std::shared_ptr<PhysicsManagerState>& state)
81  override;
82 
89  std::shared_ptr<SurgSim::DataStructures::Location> makeLocation(
90  std::shared_ptr<SurgSim::Physics::Representation> physicsRepresentation,
91  std::shared_ptr<SurgSim::Collision::Representation> collisionRepresentation,
92  const SurgSim::DataStructures::Location& location);
93 };
94 
95 }; // Physics
96 }; // SurgSim
97 
98 #endif
SurgSim::Physics::ContactConstraintGeneration::m_logger
std::shared_ptr< SurgSim::Framework::Logger > m_logger
The logger for this class.
Definition: ContactConstraintGeneration.h:73
Computation.h
Macros.h
SurgSim
Definition: CompoundShapeToGraphics.cpp:30
SurgSim::Physics::ContactConstraintGeneration::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Physics::ContactConstraintGeneration)
SurgSim::Physics::ContactConstraintGeneration::doUpdate
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:46
SurgSim::Physics::ContactConstraintGeneration
Generate a constraint for every contact that was calculated.
Definition: ContactConstraintGeneration.h:60
SurgSim::Physics::ContactConstraintGeneration::ContactConstraintGeneration
ContactConstraintGeneration(bool doCopyState=false)
Constructor.
Definition: ContactConstraintGeneration.cpp:36
SurgSim::Physics::ContactConstraintGeneration::~ContactConstraintGeneration
~ContactConstraintGeneration()
Destructor.
Definition: ContactConstraintGeneration.cpp:41
SurgSim::DataStructures::Location
A Location defines a local position w.r.t.
Definition: Location.h:40
SurgSim::Physics::ContactConstraintGeneration::makeLocation
std::shared_ptr< SurgSim::DataStructures::Location > makeLocation(std::shared_ptr< SurgSim::Physics::Representation > physicsRepresentation, std::shared_ptr< SurgSim::Collision::Representation > collisionRepresentation, const SurgSim::DataStructures::Location &location)
Generate a location from a Collision Representation.
Definition: ContactConstraintGeneration.cpp:122
SurgSim::Physics::Computation
Encapsulates a calculation over a selection of objects, needs to be subclassed to be used.
Definition: Computation.h:33