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

float getDistance () const
 returns the distance (not implemented)

VisionObjectEventsetDistance (float dist)
 sets the distance

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

float _distance
 distance from snout to object in millimeters. (not implemented)


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

float VisionObjectEvent::getCenterY  )  const [inline]
 

returns the y coordinate

Definition at line 22 of file VisionObjectEvent.h.

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

float VisionObjectEvent::getDistance  )  const [inline]
 

returns the distance (not implemented)

Definition at line 25 of file VisionObjectEvent.h.

Referenced by EventLogger::processEvent().

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 15 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 34 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.

VisionObjectEvent& VisionObjectEvent::setDistance float  dist  )  [inline]
 

sets the distance

Definition at line 26 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 36 of file VisionObjectEvent.h.

Referenced by getBinSize(), getCenterX(), 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 37 of file VisionObjectEvent.h.

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

float VisionObjectEvent::_distance [protected]
 

distance from snout to object in millimeters. (not implemented)

Definition at line 38 of file VisionObjectEvent.h.

Referenced by getBinSize(), getDistance(), LoadBuffer(), SaveBuffer(), setDistance(), and VisionObjectEvent().


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

Tekkotsu v2.1
Generated Tue Mar 16 23:22:31 2004 by Doxygen 1.3.5