Sink.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_PARTICLES_SINK_H
17 #define SURGSIM_PARTICLES_SINK_H
18 
19 #include <memory>
20 
23 
24 
25 namespace SurgSim
26 {
27 
28 namespace Collision
29 {
30 class Representation;
31 };
32 
33 namespace Framework
34 {
35 class Component;
36 class Logger;
37 };
38 
39 namespace Particles
40 {
41 
42 class Representation;
43 
44 SURGSIM_STATIC_REGISTRATION(Sink);
45 
48 {
49 public:
52  explicit Sink(const std::string& name);
53 
55 
58  void setTarget(const std::shared_ptr<SurgSim::Framework::Component>& target);
59 
62  std::shared_ptr<SurgSim::Framework::Component> getTarget();
63 
67  void setCollisionRepresentation(const std::shared_ptr<SurgSim::Framework::Component>& representation);
68 
72  std::shared_ptr<SurgSim::Framework::Component> getCollisionRepresentation();
73 
74  void update(double dt) override;
75 
76  int getTargetManagerType() const override;
77 
78 private:
79  bool doInitialize() override;
80 
81  bool doWakeUp() override;
82 
83  std::shared_ptr<SurgSim::Collision::Representation> m_collisionRepresentation;
84 
85  std::shared_ptr<SurgSim::Particles::Representation> m_target;
86 
87  std::shared_ptr<SurgSim::Framework::Logger> m_logger;
88 };
89 
90 };
91 };
92 
93 #endif // SURGSIM_PARTICLES_SINK_H
94 
Definition: CompoundShapeToGraphics.cpp:29
std::shared_ptr< SurgSim::Collision::Representation > m_collisionRepresentation
Definition: Sink.h:83
Sink removes particles from a ParticleSystem.
Definition: Sink.h:47
DataStructures::Vertices< ParticleData > Particles
Definition: Particles.h:53
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
Behaviors perform actions.
Definition: Behavior.h:40
std::shared_ptr< SurgSim::Framework::Logger > m_logger
Definition: Sink.h:87
std::shared_ptr< SurgSim::Particles::Representation > m_target
Definition: Sink.h:85