Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
Menge::BFSM::ScaleVelModifier Class Reference

A velocity modifier that scales the input velocity's speed. More...

#include <VelModifierScale.h>

Inheritance diagram for Menge::BFSM::ScaleVelModifier:
Menge::BFSM::VelModifier Menge::Element

Public Member Functions

 ScaleVelModifier ()
 Default constructor.
 
 ScaleVelModifier (const float scale)
 Constructor. More...
 
void setScale (const float scale)
 Sets the scale factor. More...
 
void adaptPrefVelocity (const Agents::BaseAgent *agent, Agents::PrefVelocity &pVel)
 Scales the input preferred velocity's speed by the pre-defined scale factor. More...
 
float getScale () const
 Returns scale factor. More...
 
VelModifiercopy () const
 Creates a copy of this velocity modifier. More...
 
virtual VelModContextgetContext ()
 Provides a display context for interacting with this velocity modifier. More...
 
- Public Member Functions inherited from Menge::BFSM::VelModifier
 VelModifier ()
 Default constructor.
 
virtual void registerAgent (const Agents::BaseAgent *agent)
 Registers an agent for use with the VelModifier. More...
 
virtual void unregisterAgent (const Agents::BaseAgent *agent)
 Unregisters a registed agent. More...
 
void onEnter (const Agents::BaseAgent *agent)
 Called when an agent enters the state with this velocity modifier. More...
 
void onLeave (const Agents::BaseAgent *agent)
 Called when an agent exits the state with this velocity modifier. More...
 
- Public Member Functions inherited from Menge::Element
void destroy ()
 This supplants the destructor. More...
 
virtual BFSM::TaskgetTask ()
 Return an optional task associated with this element. More...
 
virtual SceneGraph::GLNodegetSGNode ()
 Returns an optional visualization element associated with the element. More...
 

Protected Attributes

float _scale
 The scale factor to apply.
 

Friends

class ScaleVMFactory
 

Additional Inherited Members

- Protected Member Functions inherited from Menge::BFSM::VelModifier
virtual ~VelModifier ()
 Virtual destructor.
 

Detailed Description

A velocity modifier that scales the input velocity's speed.

Constructor & Destructor Documentation

Menge::BFSM::ScaleVelModifier::ScaleVelModifier ( const float  scale)

Constructor.

Parameters
scaleThe scale factor to apply to the preferred velocity's speed.

Member Function Documentation

void Menge::BFSM::ScaleVelModifier::adaptPrefVelocity ( const Agents::BaseAgent agent,
Agents::PrefVelocity pVel 
)
virtual

Scales the input preferred velocity's speed by the pre-defined scale factor.

Parameters
agentThe agent for which a preferred velocity is modified.
pVelThe instance of Agents::PrefVelocity to set.

Implements Menge::BFSM::VelModifier.

VelModifier * Menge::BFSM::ScaleVelModifier::copy ( ) const
virtual

Creates a copy of this velocity modifier.

Returns
A unique, deep copy of this velocity modifier.

Implements Menge::BFSM::VelModifier.

VelModContext * Menge::BFSM::ScaleVelModifier::getContext ( )
virtual

Provides a display context for interacting with this velocity modifier.

Returns
A pointer to a context for this vel modifier.

Reimplemented from Menge::BFSM::VelModifier.

float Menge::BFSM::ScaleVelModifier::getScale ( ) const
inline

Returns scale factor.

Returns
The scale factor stored in this modifier.
void Menge::BFSM::ScaleVelModifier::setScale ( const float  scale)

Sets the scale factor.

Parameters
scaleThe the scale factor to apply to the preferred velocity's speed.

The documentation for this class was generated from the following files: