16 #ifndef SURGSIM_BLOCKS_FUNCTIONBEHAVIOR_H 17 #define SURGSIM_BLOCKS_FUNCTIONBEHAVIOR_H 30 SURGSIM_STATIC_REGISTRATION(FunctionBehavior);
82 void setFunction(std::function<
void(
double)>
function);
90 void update(
double dt)
override;
107 #endif // SURGSIM_BLOCKS_FUNCTIONBEHAVIOR_H int getTargetManagerType() const override
Specifies which manger will handle this behavior.
Definition: FunctionBehavior.cpp:47
Definition: CompoundShapeToGraphics.cpp:29
SURGSIM_CLASSNAME(SurgSim::Blocks::FunctionBehavior)
A Behavior that can run any callable target in its update function.
Definition: FunctionBehavior.h:71
FunctionBehavior(const std::string &name)
Constructor.
Definition: FunctionBehavior.cpp:28
std::function< void(double)> m_function
The function to run in update.
Definition: FunctionBehavior.h:101
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: FunctionBehavior.cpp:58
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: FunctionBehavior.cpp:70
void setFunction(std::function< void(double)> function)
Set the function to run in this behavior's update.
Definition: FunctionBehavior.cpp:52
void setTargetManagerType(int type)
Set which manager will handle this behavior.
Definition: FunctionBehavior.cpp:40
int m_targetManager
The manager type that will handle this behavior.
Definition: FunctionBehavior.h:98
Behaviors perform actions.
Definition: Behavior.h:40
void update(double dt) override
Update the behavior.
Definition: FunctionBehavior.cpp:35