TransferParticlesToPointCloudBehavior.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_BLOCKS_TRANSFERPARTICLESTOPOINTCLOUDBEHAVIOR_H
17 #define SURGSIM_BLOCKS_TRANSFERPARTICLESTOPOINTCLOUDBEHAVIOR_H
18 
21 
22 namespace SurgSim
23 {
24 
25 namespace Framework
26 {
27 class Component;
28 }
29 
30 namespace Graphics
31 {
32 class PointCloudRepresentation;
33 }
34 
35 namespace Particles
36 {
37 class Representation;
38 }
39 
40 namespace Blocks
41 {
42 SURGSIM_STATIC_REGISTRATION(TransferParticlesToPointCloudBehavior);
43 
46 {
47 public:
51 
53 
56  void setSource(const std::shared_ptr<SurgSim::Framework::Component>& source);
57 
60  void setTarget(const std::shared_ptr<SurgSim::Framework::Component>& target);
61 
64  std::shared_ptr<SurgSim::Particles::Representation> getSource() const;
65 
68  std::shared_ptr<SurgSim::Graphics::PointCloudRepresentation> getTarget() const;
69 
70  void update(double dt) override;
71 
72 private:
73  bool doInitialize() override;
74  bool doWakeUp() override;
75 
77  std::shared_ptr<SurgSim::Particles::Representation> m_source;
78 
80  std::shared_ptr<SurgSim::Graphics::PointCloudRepresentation> m_target;
81 };
82 
83 }; // namespace Blocks
84 }; // namespace SurgSim
85 
86 #endif // SURGSIM_BLOCKS_TRANSFERPARTICLESTOPOINTCLOUDBEHAVIOR_H
Macros.h
SurgSim::Blocks::TransferParticlesToPointCloudBehavior
Behavior to copy positions of a Particles::Representation to a PointCloud.
Definition: TransferParticlesToPointCloudBehavior.h:45
SurgSim::DataStructures::Vertices
Base class for mesh structures, handling basic vertex functionality.
Definition: Vertices.h:51
SurgSim::Framework::Behavior
Behaviors perform actions.
Definition: Behavior.h:40
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::m_target
std::shared_ptr< SurgSim::Graphics::PointCloudRepresentation > m_target
The Graphics PointCloud Representation to which the vertices's positions are set.
Definition: TransferParticlesToPointCloudBehavior.h:80
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::getSource
std::shared_ptr< SurgSim::Particles::Representation > getSource() const
Get the particles representation which sends the positions.
Definition: TransferParticlesToPointCloudBehavior.cpp:60
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::setSource
void setSource(const std::shared_ptr< SurgSim::Framework::Component > &source)
Set the representation from which the positions are from.
Definition: TransferParticlesToPointCloudBehavior.cpp:46
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::getTarget
std::shared_ptr< SurgSim::Graphics::PointCloudRepresentation > getTarget() const
Get the point cloud representation which receives the positions.
Definition: TransferParticlesToPointCloudBehavior.cpp:66
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::setTarget
void setTarget(const std::shared_ptr< SurgSim::Framework::Component > &target)
Set the point cloud representation which will receive the positions.
Definition: TransferParticlesToPointCloudBehavior.cpp:53
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::doWakeUp
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: TransferParticlesToPointCloudBehavior.cpp:81
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::doInitialize
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: TransferParticlesToPointCloudBehavior.cpp:76
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Blocks::TransferParticlesToPointCloudBehavior)
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::update
void update(double dt) override
Update the behavior.
Definition: TransferParticlesToPointCloudBehavior.cpp:71
SurgSim::Particles::Representation
The Representation class defines the base class for all Particle System.
Definition: Representation.h:40
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::m_source
std::shared_ptr< SurgSim::Particles::Representation > m_source
The Particles::Representation from which the positions come.
Definition: TransferParticlesToPointCloudBehavior.h:77
Behavior.h
SurgSim::Blocks::TransferParticlesToPointCloudBehavior::TransferParticlesToPointCloudBehavior
TransferParticlesToPointCloudBehavior(const std::string &name)
Constructor.
Definition: TransferParticlesToPointCloudBehavior.cpp:37