TransferPhysicsToPointCloudBehavior.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_BLOCKS_TRANSFERPHYSICSTOPOINTCLOUDBEHAVIOR_H
#define SURGSIM_BLOCKS_TRANSFERPHYSICSTOPOINTCLOUDBEHAVIOR_H
#include "SurgSim/Framework/Behavior.h"
#include "SurgSim/Framework/Macros.h"
namespace SurgSim
{
namespace Framework
{
class Component;
}
namespace Graphics
{
class PointCloudRepresentation;
}
namespace Physics
{
class DeformableRepresentation;
}
namespace Blocks
{
SURGSIM_STATIC_REGISTRATION(TransferPhysicsToPointCloudBehavior);
class TransferPhysicsToPointCloudBehavior : public SurgSim::Framework::Behavior
{
public:
explicit TransferPhysicsToPointCloudBehavior(const std::string& name);
SURGSIM_CLASSNAME(SurgSim::Blocks::TransferPhysicsToPointCloudBehavior);
void setSource(const std::shared_ptr<SurgSim::Framework::Component>& source);
void setTarget(const std::shared_ptr<SurgSim::Framework::Component>& target);
std::shared_ptr<SurgSim::Physics::DeformableRepresentation> getSource() const;
std::shared_ptr<SurgSim::Graphics::PointCloudRepresentation> getTarget() const;
void update(double dt) override;
private:
bool doInitialize() override;
bool doWakeUp() override;
std::shared_ptr<SurgSim::Physics::DeformableRepresentation> m_source;
std::shared_ptr<SurgSim::Graphics::PointCloudRepresentation> m_target;
};
}; // namespace Blocks
}; // namespace SurgSim
#endif // SURGSIM_BLOCKS_TRANSFERPHYSICSTOPOINTCLOUDBEHAVIOR_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Blocks::TransferPhysicsToPointCloudBehavior::m_target
std::shared_ptr< SurgSim::Graphics::PointCloudRepresentation > m_target
The Graphics PointCloud Representation to which the vertices&#39; positions are set.
Definition: TransferPhysicsToPointCloudBehavior.h:80
Behavior.h
SURGSIM_CLASSNAME
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
Macros.h
SurgSim::Blocks::TransferPhysicsToPointCloudBehavior
Behavior to copy positions of a PhysicsRepresentation to a PointCloud.
Definition: TransferPhysicsToPointCloudBehavior.h:45
SurgSim::Framework::Behavior
Behaviors perform actions.
Definition: Behavior.h:40
SurgSim::Blocks::TransferPhysicsToPointCloudBehavior::m_source
std::shared_ptr< SurgSim::Physics::DeformableRepresentation > m_source
The DeformableRepresentation from which the Ode state comes.
Definition: TransferPhysicsToPointCloudBehavior.h:77