opensurgsim
PushResults.h
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_PUSHRESULTS_H
17 #define SURGSIM_PHYSICS_PUSHRESULTS_H
18 
19 #include "SurgSim/Framework/Macros.h"
20 #include "SurgSim/Physics/Computation.h"
21 
22 namespace SurgSim
23 {
24 namespace Framework
25 {
26 class Logger;
27 }
28 
29 namespace Physics
30 {
31 class PhysicsManagerState;
32 
33 class Representation;
34 
43 class PushResults : public Computation
44 {
45 public:
48  explicit PushResults(bool doCopyState = false);
49 
50  SURGSIM_CLASSNAME(SurgSim::Physics::PushResults);
51 
53  virtual ~PushResults();
54 
57  void setDiscardBadResults(bool filter);
58 
60  bool isDiscardBadResults() const;
61 
63  void setContactTolerance(double tolerance);
64 
67  double getContactTolerance() const;
68 
69 protected:
70  std::shared_ptr<PhysicsManagerState> doUpdate(const double& dt, const std::shared_ptr<PhysicsManagerState>& state)
71  override;
72 
73  std::shared_ptr<SurgSim::Framework::Logger> m_logger;
74 
75 private:
78  double m_contactTolerance;
79 
81  bool m_discardBadResults;
82 };
83 
84 }; // namespace Physics
85 }; // namespace SurgSim
86 
87 #endif // SURGSIM_PHYSICS_PUSHRESULTS_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Propagates the Mlcp result to the representations.
Definition: PushResults.h:43
Encapsulates a calculation over a selection of objects, needs to be subclassed to be used...
Definition: Computation.h:32