Behavior.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_FRAMEWORK_BEHAVIOR_H
#define SURGSIM_FRAMEWORK_BEHAVIOR_H
#include "SurgSim/Framework/Component.h"
namespace SurgSim
{
namespace Framework
{
enum {
MANAGER_TYPE_NONE = -1,
MANAGER_TYPE_BEHAVIOR,
MANAGER_TYPE_GRAPHICS,
MANAGER_TYPE_INPUT,
MANAGER_TYPE_PHYSICS,
MANAGER_TYPE_COUNT
};
class Behavior: public Component
{
public:
explicit Behavior(const std::string& name) : Component(name)
{
}
virtual ~Behavior()
{
}
virtual void update(double dt) = 0;
virtual int getTargetManagerType() const { return MANAGER_TYPE_BEHAVIOR; }
};
}; //namespace Framework
}; //namespace SurgSim
#endif // SURGSIM_FRAMEWORK_BEHAVIOR_H
SurgSim::Framework::Behavior::~Behavior
virtual ~Behavior()
Definition: Behavior.h:46
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Framework::Behavior::getTargetManagerType
virtual int getTargetManagerType() const
Specifies which manger will handle this behavior.
Definition: Behavior.h:55
SurgSim::Framework::MANAGER_TYPE_BEHAVIOR
Definition: Behavior.h:30
Component.h
SurgSim::Framework::MANAGER_TYPE_INPUT
Definition: Behavior.h:32
SurgSim::Framework::Component
Component is the main interface class to pass information to the system managers each will decide whe...
Definition: Component.h:42
SurgSim::Framework::MANAGER_TYPE_NONE
Definition: Behavior.h:29
SurgSim::Framework::Behavior::update
virtual void update(double dt)=0
Update the behavior.
SurgSim::Framework::Behavior
Behaviors perform actions.
Definition: Behavior.h:40
SurgSim::Framework::MANAGER_TYPE_COUNT
Definition: Behavior.h:34
SurgSim::Framework::Behavior::Behavior
Behavior(const std::string &name)
Definition: Behavior.h:43
SurgSim::Framework::MANAGER_TYPE_GRAPHICS
Definition: Behavior.h:31
SurgSim::Framework::MANAGER_TYPE_PHYSICS
Definition: Behavior.h:33