GBE::GMoveAgent Class Reference

Handles movements for forms. More...

#include <GMoveAgent.h>

Inheritance diagram for GBE::GMoveAgent:

Inheritance graph
[legend]
Collaboration diagram for GBE::GMoveAgent:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual QStringList getAvailableActions () const
virtual QString getActionDescription (const QString &action) const
virtual void performAction (const QString &action, QStringList params)
virtual void initTranslationSpeed (const GCS::GVector3 &speed)
virtual void initRotationSpeed (const GCS::GVector3 &speed)
virtual void initSlowDownFactor (double factor)
virtual void initUpdateInterval (unsigned long interval)

Public Member Functions

 GMoveAgent ()
virtual ~GMoveAgent ()

Protected Slots

virtual void updateForm ()

Protected Member Functions

virtual void run ()

Protected Attributes

QTime Time

Detailed Description

Handles movements for forms.

This agent periodically updates the forms position according to the current speed.

Adds the following xml data to the element data:

  <dynamics>
    <slowdownfactor>double value</slowdownfactor>
    <translationspeed>double value</translationspeed>
    <rotationspeed>double value</rotationspeed>
    <updateinterval>unsigned long integer value</updateinterval>
  </dynamics>

See also:
GCS::GForm
Todo:
add another value: last update time and use it on execution resuming


Constructor & Destructor Documentation

GBE::GMoveAgent::GMoveAgent (  ) 

Constructor.

GBE::GMoveAgent::~GMoveAgent (  )  [virtual]

Destructor.


Member Function Documentation

QString GBE::GMoveAgent::getActionDescription ( const QString &  action  )  const [virtual, slot]

Returns:
description of given action.

Reimplemented from GCS::GAgent.

QStringList GBE::GMoveAgent::getAvailableActions (  )  const [virtual, slot]

Returns:
list of available actions
See also:
performAction

Reimplemented from GCS::GAgent.

void GBE::GMoveAgent::initRotationSpeed ( const GCS::GVector3 speed  )  [virtual, slot]

Initializes rotation speed in the element data.

void GBE::GMoveAgent::initSlowDownFactor ( double  factor  )  [virtual, slot]

Initializes slow down fractor in the element data. This value should be between 0 and 1 to get some slowdown. If you set it higher than 1 it will actually accelerate.

void GBE::GMoveAgent::initTranslationSpeed ( const GCS::GVector3 speed  )  [virtual, slot]

Initializes translation speed in the element data

void GBE::GMoveAgent::initUpdateInterval ( unsigned long  interval  )  [virtual, slot]

Initializes update interval in the element data.

void GBE::GMoveAgent::performAction ( const QString &  action,
QStringList  params 
) [virtual, slot]

Known actions: addTranslationSpeedImpulse (param 1: "x, y, z") addRotationImpulse (param 1: "x, y, z") fullStop (no parameters)

See also:
GCS::GAgent::performAction()

void GBE::GMoveAgent::run (  )  [protected, virtual]

Constantly updates the forms position and also slows down according to SlowDownFactor.

See also:
Interval, SlowDownFactor, updateForm()

Reimplemented from GCS::GAgent.

void GBE::GMoveAgent::updateForm (  )  [protected, virtual, slot]

Here the actual updating is performed.

Subtracts CurrentSpeed * SlowDownFraction*elapsed_time from CurrentSpeed for translation and rotation speed.

See also:
run()


Member Data Documentation

QTime GBE::GMoveAgent::Time [protected]

Used to measure time intervals between updates.


The documentation for this class was generated from the following files:
Generated on Thu Nov 16 07:49:22 2006 for G System by  doxygen 1.4.7