opensurgsim
TransferPhysicsToVerticesBehavior.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_BLOCKS_TRANSFERPHYSICSTOVERTICESBEHAVIOR_H
17 #define SURGSIM_BLOCKS_TRANSFERPHYSICSTOVERTICESBEHAVIOR_H
18 
19 #include "SurgSim/DataStructures/EmptyData.h"
20 
21 #include "SurgSim/DataStructures/Vertices.h"
22 #include "SurgSim/Framework/Behavior.h"
23 
24 namespace SurgSim
25 {
26 
27 namespace Physics
28 {
29 class DeformableRepresentation;
30 }
31 namespace Graphics
32 {
33 class CurveRepresentation;
34 }
35 
36 namespace Blocks
37 {
38 
42 {
43 public:
44 
47  explicit TransferPhysicsToVerticesBehavior(const std::string& name);
48 
50  std::shared_ptr<Physics::DeformableRepresentation> getSource() const;
51 
55  void setSource(const std::shared_ptr<Framework::Component>& source);
56 
58  std::shared_ptr<Framework::Component> getTarget() const;
59 
64  void setTarget(const std::shared_ptr<Framework::Component>& target);
65 
68  void update(double dt) override;
69 
70  bool doInitialize() override;
71 
72  bool doWakeUp() override;
73 
74 private:
75 
76  std::shared_ptr<Physics::DeformableRepresentation> m_source;
77  std::shared_ptr<Framework::Component> m_target;
78 
81 };
82 }
83 }
84 
85 #endif
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Transfer Physics State to any representation that has a Vertices property, the "Vertices" property on...
Definition: TransferPhysicsToVerticesBehavior.h:41
Behaviors perform actions.
Definition: Behavior.h:40
Base class for mesh structures, handling basic vertex functionality.
Definition: Vertices.h:51