Homepage Demos Overview Downloads Tutorials Reference
Credits

VisionObjectEvent Class Reference

#include <VisionObjectEvent.h>

Inheritance diagram for VisionObjectEvent:

Inheritance graph
[legend]
List of all members.

Detailed Description

Extends EventBase to also include location in the visual field and distance (though distance is not implimented yet).

Definition at line 8 of file VisionObjectEvent.h.

Public Member Functions

 VisionObjectEvent ()
 Constructor.
 VisionObjectEvent (EventTypeID_t tid, unsigned int sid)
 Constructor, pass a type id and source id.
 VisionObjectEvent (EventTypeID_t tid, unsigned int sid, float cenX, float cenY)
 Constructor, pass the type id, source id, center X and center Y.
virtual ~VisionObjectEvent ()
 destructor
float getCenterX () const
 returns the x coordinate
VisionObjectEventsetCenterX (float cenX)
 sets the x coordinate
float getCenterY () const
 returns the y coordinate
VisionObjectEventsetCenterY (float cenY)
 sets the y coordinate
virtual std::string getDescription (bool showTypeSpecific=true, unsigned int verbosity=0) const
 generates a description of the event with variable verbosity
virtual unsigned int getBinSize () const
 calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work.
virtual unsigned int LoadBuffer (const char buf[], unsigned int len)
 Load from a saved buffer.
virtual unsigned int SaveBuffer (char buf[], unsigned int len) const
 Save to a given buffer.

Protected Attributes

float _cenX
 a value representing location in visual field - from -1 if on the left edge to 1 if it's on the right edge
float _cenY
 a value representing location in visual field - from -1 if on the bottom edge to 1 if it's on the top edge


Constructor & Destructor Documentation

VisionObjectEvent::VisionObjectEvent  )  [inline]
 

Constructor.

Definition at line 11 of file VisionObjectEvent.h.

VisionObjectEvent::VisionObjectEvent EventTypeID_t  tid,
unsigned int  sid
[inline]
 

Constructor, pass a type id and source id.

Definition at line 13 of file VisionObjectEvent.h.

VisionObjectEvent::VisionObjectEvent EventTypeID_t  tid,
unsigned int  sid,
float  cenX,
float  cenY
[inline]
 

Constructor, pass the type id, source id, center X and center Y.

Definition at line 15 of file VisionObjectEvent.h.

virtual VisionObjectEvent::~VisionObjectEvent  )  [inline, virtual]
 

destructor

Definition at line 17 of file VisionObjectEvent.h.


Member Function Documentation

unsigned int VisionObjectEvent::getBinSize  )  const [virtual]
 

calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work.

Returns:
number of bytes read/written, 0 if error (or empty)

Reimplemented from EventBase.

Definition at line 14 of file VisionObjectEvent.cc.

float VisionObjectEvent::getCenterX  )  const [inline]
 

returns the x coordinate

Definition at line 19 of file VisionObjectEvent.h.

Referenced by WalkToTargetMachine::processEvent(), and VisualTargetCloseTrans::processEvent().

float VisionObjectEvent::getCenterY  )  const [inline]
 

returns the y coordinate

Definition at line 22 of file VisionObjectEvent.h.

Referenced by WalkToTargetMachine::processEvent(), and VisualTargetCloseTrans::processEvent().

std::string VisionObjectEvent::getDescription bool  showTypeSpecific = true,
unsigned int  verbosity = 0
const [virtual]
 

generates a description of the event with variable verbosity

Parameters:
showTypeSpecific will signal subclasses to add additional information
verbosity can be one of the following values:
  • 0 - the name and type
  • 1 - the name, type, duration, and timestamp
  • 2 and above - the name, type, duration, and magnitude if showTypeSpecific, additional fields will be added after the common fields listed above.

Reimplemented from EventBase.

Definition at line 5 of file VisionObjectEvent.cc.

unsigned int VisionObjectEvent::LoadBuffer const char  buf[],
unsigned int  len
[virtual]
 

Load from a saved buffer.

Parameters:
buf pointer to the memory where you should begin loading
len length of buf available (this isn't all yours, might be more stuff saved after yours)
Returns:
the number of bytes actually used

Reimplemented from EventBase.

Definition at line 25 of file VisionObjectEvent.cc.

Referenced by EventTranslator::sendEvent().

unsigned int VisionObjectEvent::SaveBuffer char  buf[],
unsigned int  len
const [virtual]
 

Save to a given buffer.

Parameters:
buf pointer to the memory where you should begin writing
len length of buf available. (this isn't all yours, constrain yourself to what you returned in getBinSize() )
Returns:
the number of bytes actually used

Reimplemented from EventBase.

Definition at line 44 of file VisionObjectEvent.cc.

VisionObjectEvent& VisionObjectEvent::setCenterX float  cenX  )  [inline]
 

sets the x coordinate

Definition at line 20 of file VisionObjectEvent.h.

VisionObjectEvent& VisionObjectEvent::setCenterY float  cenY  )  [inline]
 

sets the y coordinate

Definition at line 23 of file VisionObjectEvent.h.


Member Data Documentation

float VisionObjectEvent::_cenX [protected]
 

a value representing location in visual field - from -1 if on the left edge to 1 if it's on the right edge

Definition at line 38 of file VisionObjectEvent.h.

Referenced by getDescription(), LoadBuffer(), SaveBuffer(), setCenterX(), and VisionObjectEvent().

float VisionObjectEvent::_cenY [protected]
 

a value representing location in visual field - from -1 if on the bottom edge to 1 if it's on the top edge

Definition at line 39 of file VisionObjectEvent.h.

Referenced by LoadBuffer(), SaveBuffer(), setCenterY(), and VisionObjectEvent().


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

Tekkotsu v2.2.1
Generated Tue Nov 23 16:37:54 2004 by Doxygen 1.3.9.1