cmil::Motion Class Reference

This is data which provides general relative motion. More...

#include <InputData.h>

Inheritance diagram for cmil::Motion:

Inheritance graph
[legend]
Collaboration diagram for cmil::Motion:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Motion (const std::string &ident)
virtual InputDataclone ()
std::string getName () const
void do_run (MotionAction *action) const
void setMotion (int xrel, int yrel)

Private Attributes

unsigned int m_xrel
unsigned int m_yrel

Detailed Description

This is data which provides general relative motion.

Definition at line 219 of file InputData.h.


Constructor & Destructor Documentation

cmil::Motion::Motion ( const std::string &  ident  )  [inline]

Definition at line 221 of file InputData.h.

Referenced by clone().

00221 : tInputData<MotionAction>(ident), m_xrel(0), m_yrel(0) {}

Here is the caller graph for this function:


Member Function Documentation

virtual InputData* cmil::Motion::clone (  )  [inline, virtual]

Implements cmil::InputData.

Definition at line 223 of file InputData.h.

References Motion().

00223                                  {
00224         return new Motion(*this);
00225       };

Here is the call graph for this function:

void cmil::Motion::do_run ( MotionAction action  )  const [inline]

Definition at line 232 of file InputData.h.

References m_xrel, m_yrel, and cmil::MotionAction::runMotion().

00232                                               {
00233         action->runMotion(m_xrel, m_yrel);
00234       }

Here is the call graph for this function:

std::string cmil::Motion::getName (  )  const [inline, virtual]

Reimplemented from cmil::InputData.

Definition at line 228 of file InputData.h.

00228                                 {
00229         return "Motion";
00230       }; 

void cmil::Motion::setMotion ( int  xrel,
int  yrel 
) [inline]

Definition at line 236 of file InputData.h.

References Logger::log_error(), m_xrel, and m_yrel.

Referenced by cmil::SDL::SDLControllers::translate().

00236                                          {
00237         if( ((xrel * yrel) <= 1) )  {
00238           m_xrel = xrel;
00239           m_yrel = yrel;
00240         }
00241         else 
00242           log_error("setMotion() unable to to set motion due to relative bounds exceeded");
00243       }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

unsigned int cmil::Motion::m_xrel [private]

Definition at line 246 of file InputData.h.

Referenced by do_run(), and setMotion().

unsigned int cmil::Motion::m_yrel [private]

Definition at line 247 of file InputData.h.

Referenced by do_run(), and setMotion().


The documentation for this class was generated from the following file:
(c) 2006-2007 John P. Feltz
Generated on Wed Jul 25 16:08:02 2007 for Common Media Input Layer by doxygen 1.4.7

SourceForge.net Logo