Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

VisionEvent Class Reference

#include <VisionEvent.h>

Inheritance diagram for VisionEvent:

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 22 of file VisionEvent.h.

Public Member Functions

 VisionEvent ()
 Constructor.

 VisionEvent (EventTypeID_t tid, unsigned int sid)
 Constructor, pass a type id and source id.

 VisionEvent (EventTypeID_t tid, unsigned int sid, float cenX, float cenY)
 Constructor, pass the type id, source id, center X and center Y.

float getCenterX () const
 returns the x coordinate

VisionEventsetCenterX (float cenX)
 sets the x coordinate

float getCenterY () const
 returns the y coordinate

VisionEventsetCenterY (float cenY)
 sets the y coordinate

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

VisionEventsetDistance (float dist)
 sets the distance

int getProperty () const
 returns the property

VisionEventsetProperty (int property)
 sets the property

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.

int _property
 some property, depending on the SID


Constructor & Destructor Documentation

VisionEvent::VisionEvent  )  [inline]
 

Constructor.

Definition at line 25 of file VisionEvent.h.

References _cenX, _cenY, _distance, _property, EventBase::statusETID, and EventBase::visionEGID.

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

Constructor, pass a type id and source id.

Definition at line 27 of file VisionEvent.h.

References _cenX, _cenY, _distance, _property, and EventBase::visionEGID.

VisionEvent::VisionEvent 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 29 of file VisionEvent.h.

References _cenX, _cenY, _distance, _property, and EventBase::visionEGID.


Member Function Documentation

virtual unsigned int VisionEvent::getBinSize  )  const [inline, 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 43 of file VisionEvent.h.

References _cenX, _cenY, _distance, _property, LoadSave::creatorSize(), and EventBase::getBinSize().

float VisionEvent::getCenterX  )  const [inline]
 

returns the x coordinate

Definition at line 31 of file VisionEvent.h.

References _cenX.

float VisionEvent::getCenterY  )  const [inline]
 

returns the y coordinate

Definition at line 34 of file VisionEvent.h.

References _cenY.

float VisionEvent::getDistance  )  const [inline]
 

returns the distance (not implemented)

Definition at line 37 of file VisionEvent.h.

References _distance.

int VisionEvent::getProperty  )  const [inline]
 

returns the property

Definition at line 40 of file VisionEvent.h.

References _property.

virtual unsigned int VisionEvent::LoadBuffer const char  buf[],
unsigned int  len
[inline, 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 53 of file VisionEvent.h.

References _cenX, _cenY, _distance, _property, LoadSave::checkCreator(), LoadSave::decode(), and EventBase::LoadBuffer().

virtual unsigned int VisionEvent::SaveBuffer char  buf[],
unsigned int  len
const [inline, 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 71 of file VisionEvent.h.

References _cenX, _cenY, _distance, _property, LoadSave::encode(), EventBase::SaveBuffer(), and LoadSave::saveCreator().

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

sets the x coordinate

Definition at line 32 of file VisionEvent.h.

References _cenX.

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

sets the y coordinate

Definition at line 35 of file VisionEvent.h.

References _cenY.

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

sets the distance

Definition at line 38 of file VisionEvent.h.

References _distance.

VisionEvent& VisionEvent::setProperty int  property  )  [inline]
 

sets the property

Definition at line 41 of file VisionEvent.h.

References _property.


Member Data Documentation

float VisionEvent::_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 90 of file VisionEvent.h.

float VisionEvent::_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 91 of file VisionEvent.h.

float VisionEvent::_distance [protected]
 

distance from snout to object in millimeters.

Definition at line 92 of file VisionEvent.h.

int VisionEvent::_property [protected]
 

some property, depending on the SID

Definition at line 93 of file VisionEvent.h.


The documentation for this class was generated from the following file:
Tekkotsu v1.4
Generated Sat Jul 19 00:09:14 2003 by Doxygen 1.3.2