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 x1, float x2, float y1, float y2, float rx, float ry)
 Constructor, pass the type id, source id, left, right, top, bottom, x range, and y range.
virtual ~VisionObjectEvent ()
 destructor
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.
Attribute Accessors
float getLeft () const
 returns the initial x coordinate of the Bounding Box
VisionObjectEventsetLeft (float x1)
 sets the initial x coordinate of the Bounding Box
float getRight () const
 returns the final x coordinate of the Bounding Box
VisionObjectEventsetRight (float x2)
 sets the final x coordinate of the Bounding Box
float getTop () const
 returns the initial y coordinate of the Bounding Box
VisionObjectEventsetTop (float y1)
 sets the initial y coordinate of the Bounding Box
float getBottom () const
 returns the final y coordinate of the Bounding Box
VisionObjectEventsetBottom (float y2)
 sets the final y coordinate of the Bounding Box
Calculated Attributes
float getCenterX () const
 returns the center along x
float getCenterY () const
 returns the center along y
float getWidth () const
 return width along x
float getHeight () const
 return height along y
float getArea () const
 returns the final x coordinate of the Bounding Box
Object out of bounds Detection Functions
bool isClippedLeft () const
 returns _clipLeft
bool isClippedRight () const
 returns _clipRight
bool isClippedTop () const
 returns _clipTop
bool isClippedBottom () const
 returns _clipBottom
void setClipping (bool left, bool right, bool top, bool bottom)
 sets clipping boundaries

Protected Attributes

float _x1
 a value representing location in visual field - from -1 if on the left edge to 1 if it's on the right edge
float _x2
 a value representing location in visual field - from -1 if on the bottom edge to 1 if it's on the top edge
float _y1
 top boundary, in approximate range (+/- 160/208) for ERS-7; actual values vary depending on aspect ratio to keep square coordinates
float _y2
 top boundary, in approximate range (+/- 160/208) for ERS-7; actual values vary depending on aspect ratio to keep square coordinates
bool _clipLeft
 flag to indicate left boundary is on or beyond the camera image's boundary
bool _clipRight
 flag to indicate right boundary is on or beyond the camera image's boundary
bool _clipTop
 flag to indicate top boundary is on or beyond the camera image's boundary
bool _clipBottom
 flag to indicate bottom boundary is on or beyond the camera image's boundary


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 17 of file VisionObjectEvent.h.

VisionObjectEvent::VisionObjectEvent EventTypeID_t  tid,
unsigned int  sid,
float  x1,
float  x2,
float  y1,
float  y2,
float  rx,
float  ry
[inline]
 

Constructor, pass the type id, source id, left, right, top, bottom, x range, and y range.

Definition at line 23 of file VisionObjectEvent.h.

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

destructor

Definition at line 29 of file VisionObjectEvent.h.


Member Function Documentation

float VisionObjectEvent::getArea  )  const [inline]
 

returns the final x coordinate of the Bounding Box

Definition at line 50 of file VisionObjectEvent.h.

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 16 of file VisionObjectEvent.cc.

float VisionObjectEvent::getBottom  )  const [inline]
 

returns the final y coordinate of the Bounding Box

Definition at line 41 of file VisionObjectEvent.h.

float VisionObjectEvent::getCenterX  )  const [inline]
 

returns the center along x

Definition at line 46 of file VisionObjectEvent.h.

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

float VisionObjectEvent::getCenterY  )  const [inline]
 

returns the center along y

Definition at line 47 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 7 of file VisionObjectEvent.cc.

float VisionObjectEvent::getHeight  )  const [inline]
 

return height along y

Definition at line 49 of file VisionObjectEvent.h.

float VisionObjectEvent::getLeft  )  const [inline]
 

returns the initial x coordinate of the Bounding Box

Definition at line 32 of file VisionObjectEvent.h.

float VisionObjectEvent::getRight  )  const [inline]
 

returns the final x coordinate of the Bounding Box

Definition at line 35 of file VisionObjectEvent.h.

float VisionObjectEvent::getTop  )  const [inline]
 

returns the initial y coordinate of the Bounding Box

Definition at line 38 of file VisionObjectEvent.h.

float VisionObjectEvent::getWidth  )  const [inline]
 

return width along x

Definition at line 48 of file VisionObjectEvent.h.

bool VisionObjectEvent::isClippedBottom  )  const [inline]
 

returns _clipBottom

Definition at line 57 of file VisionObjectEvent.h.

bool VisionObjectEvent::isClippedLeft  )  const [inline]
 

returns _clipLeft

Definition at line 54 of file VisionObjectEvent.h.

bool VisionObjectEvent::isClippedRight  )  const [inline]
 

returns _clipRight

Definition at line 55 of file VisionObjectEvent.h.

bool VisionObjectEvent::isClippedTop  )  const [inline]
 

returns _clipTop

Definition at line 56 of file VisionObjectEvent.h.

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 27 of file VisionObjectEvent.cc.

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 46 of file VisionObjectEvent.cc.

VisionObjectEvent& VisionObjectEvent::setBottom float  y2  )  [inline]
 

sets the final y coordinate of the Bounding Box

Definition at line 42 of file VisionObjectEvent.h.

void VisionObjectEvent::setClipping bool  left,
bool  right,
bool  top,
bool  bottom
[inline]
 

sets clipping boundaries

Definition at line 58 of file VisionObjectEvent.h.

VisionObjectEvent& VisionObjectEvent::setLeft float  x1  )  [inline]
 

sets the initial x coordinate of the Bounding Box

Definition at line 33 of file VisionObjectEvent.h.

VisionObjectEvent& VisionObjectEvent::setRight float  x2  )  [inline]
 

sets the final x coordinate of the Bounding Box

Definition at line 36 of file VisionObjectEvent.h.

VisionObjectEvent& VisionObjectEvent::setTop float  y1  )  [inline]
 

sets the initial y coordinate of the Bounding Box

Definition at line 39 of file VisionObjectEvent.h.


Member Data Documentation

bool VisionObjectEvent::_clipBottom [protected]
 

flag to indicate bottom boundary is on or beyond the camera image's boundary

Definition at line 75 of file VisionObjectEvent.h.

Referenced by isClippedBottom(), setClipping(), and VisionObjectEvent().

bool VisionObjectEvent::_clipLeft [protected]
 

flag to indicate left boundary is on or beyond the camera image's boundary

Definition at line 72 of file VisionObjectEvent.h.

Referenced by isClippedLeft(), setClipping(), and VisionObjectEvent().

bool VisionObjectEvent::_clipRight [protected]
 

flag to indicate right boundary is on or beyond the camera image's boundary

Definition at line 73 of file VisionObjectEvent.h.

Referenced by isClippedRight(), setClipping(), and VisionObjectEvent().

bool VisionObjectEvent::_clipTop [protected]
 

flag to indicate top boundary is on or beyond the camera image's boundary

Definition at line 74 of file VisionObjectEvent.h.

Referenced by isClippedTop(), setClipping(), and VisionObjectEvent().

float VisionObjectEvent::_x1 [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 68 of file VisionObjectEvent.h.

Referenced by getArea(), getBinSize(), getCenterX(), getDescription(), getHeight(), getLeft(), getWidth(), LoadBuffer(), SaveBuffer(), setLeft(), and VisionObjectEvent().

float VisionObjectEvent::_x2 [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 69 of file VisionObjectEvent.h.

Referenced by getArea(), getBinSize(), getCenterX(), getDescription(), getHeight(), getRight(), getWidth(), LoadBuffer(), SaveBuffer(), setRight(), and VisionObjectEvent().

float VisionObjectEvent::_y1 [protected]
 

top boundary, in approximate range (+/- 160/208) for ERS-7; actual values vary depending on aspect ratio to keep square coordinates

Definition at line 70 of file VisionObjectEvent.h.

Referenced by getArea(), getBinSize(), getCenterY(), getDescription(), getTop(), LoadBuffer(), SaveBuffer(), setTop(), and VisionObjectEvent().

float VisionObjectEvent::_y2 [protected]
 

top boundary, in approximate range (+/- 160/208) for ERS-7; actual values vary depending on aspect ratio to keep square coordinates

Definition at line 71 of file VisionObjectEvent.h.

Referenced by getArea(), getBinSize(), getBottom(), getCenterY(), getDescription(), LoadBuffer(), SaveBuffer(), setBottom(), and VisionObjectEvent().


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

Tekkotsu v2.3
Generated Sat Jan 29 02:27:42 2005 by Doxygen 1.4.0