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 WalkToTargetNode::processEvent(), and VisualTargetCloseTrans::processEvent().

float VisionObjectEvent::getCenterY  )  const [inline]
 

returns the y coordinate

Definition at line 22 of file VisionObjectEvent.h.

Referenced by WalkToTargetNode::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 should be read by subclasses to add additional information
verbosity can be one of the following values:
  • 0 - Basic: event_name \t generator_id \t source_id \t type_id
  • 1 - Numerics: event_name \t generator_id \t source_id \t type_id
  • 2 - Timing: event_name \t generator_id \t source_id \t type_id \t duration \t timestamp
  • 3 and above - Full: event_name \t generator_id \t source_id \t type_id \t duration \t timestamp \t 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 getBinSize(), getCenterX(), 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 getBinSize(), getCenterY(), getDescription(), LoadBuffer(), SaveBuffer(), setCenterY(), and VisionObjectEvent().


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

Tekkotsu v2.2.2
Generated Tue Jan 4 15:45:34 2005 by Doxygen 1.4.0