DriveElementFromInputBehavior.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_DRIVEELEMENTFROMINPUTBEHAVIOR_H
#define SURGSIM_BLOCKS_DRIVEELEMENTFROMINPUTBEHAVIOR_H
#include "SurgSim/Framework/Behavior.h"
#include "SurgSim/Framework/ObjectFactory.h"
namespace SurgSim
{
namespace Input
{
class InputComponent;
}
namespace Blocks
{
SURGSIM_STATIC_REGISTRATION(DriveElementFromInputBehavior);
class DriveElementFromInputBehavior : public SurgSim::Framework::Behavior
{
public:
explicit DriveElementFromInputBehavior(const std::string& name);
SURGSIM_CLASSNAME(SurgSim::Blocks::DriveElementFromInputBehavior);
void setSource(std::shared_ptr<SurgSim::Framework::Component> source);
std::shared_ptr<SurgSim::Framework::Component> getSource();
void setPoseName(const std::string& poseName);
std::string getPoseName();
virtual void update(double dt);
protected:
virtual bool doInitialize();
virtual bool doWakeUp();
private:
std::shared_ptr<SurgSim::Input::InputComponent> m_source;
std::string m_poseName;
};
}; // namespace Blocks
}; // namespace SurgSim
#endif // SURGSIM_BLOCKS_DRIVEELEMENTFROMINPUTBEHAVIOR_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Blocks::DriveElementFromInputBehavior::m_poseName
std::string m_poseName
Definition: DriveElementFromInputBehavior.h:78
ObjectFactory.h
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
SurgSim::Blocks::DriveElementFromInputBehavior::m_source
std::shared_ptr< SurgSim::Input::InputComponent > m_source
InputComponent to get the pose.
Definition: DriveElementFromInputBehavior.h:76
SurgSim::Blocks::DriveElementFromInputBehavior
Behavior to copy a pose from an input component to a SceneElement By adding this behavior to a SceneE...
Definition: DriveElementFromInputBehavior.h:38
SurgSim::Framework::Behavior
Behaviors perform actions.
Definition: Behavior.h:40