LocomotionEvent.h
Go to the documentation of this file.00001
00002 #ifndef INCLUDED_LocomotionEvent_h_
00003 #define INCLUDED_LocomotionEvent_h_
00004
00005 #include "EventBase.h"
00006 #include <iostream>
00007
00008
00009
00010
00011
00012
00013
00014
00015 class LocomotionEvent : public EventBase {
00016 public:
00017
00018
00019
00020
00021 LocomotionEvent() : EventBase(),x(0),y(0),a(0) {}
00022 LocomotionEvent(EventGeneratorID_t gid, size_t sid, EventTypeID_t tid, unsigned int dur=0) : EventBase(gid,sid,tid,dur),x(0),y(0),a(0) {}
00023 LocomotionEvent(EventGeneratorID_t gid, size_t sid, EventTypeID_t tid, unsigned int dur, const std::string& n, float mag) : EventBase(gid,sid,tid,dur,n,mag),x(0),y(0),a(0) {}
00024 virtual EventBase* clone() const { return new LocomotionEvent(*this); }
00025
00026
00027 virtual unsigned int getClassTypeID() const { return autoRegisterLocomotionEvent; }
00028
00029
00030 LocomotionEvent& setXYA(float X, float Y, float A) {
00031 x=X;
00032 y=Y;
00033 a=A;
00034 return *this;
00035 }
00036
00037 virtual std::string getDescription(bool showTypeSpecific=true, unsigned int verbosity=0) const;
00038
00039 virtual unsigned int getBinSize() const;
00040 virtual unsigned int loadBinaryBuffer(const char buf[], unsigned int len);
00041 virtual unsigned int saveBinaryBuffer(char buf[], unsigned int len) const;
00042 virtual void loadXML(xmlNode* node);
00043 virtual void saveXML(xmlNode * node) const;
00044
00045
00046 virtual bool isStop() const { return fabs(x) < 1e-3 && fabs(y) < 1e-3 && fabs(a) < 1e-3;}
00047
00048 float x;
00049 float y;
00050 float a;
00051
00052 protected:
00053
00054 static const EventBase::classTypeID_t autoRegisterLocomotionEvent;
00055 };
00056
00057
00058
00059
00060
00061
00062 #endif