Homepage Demos Overview Downloads Tutorials Reference
Credits

VisionObjectEvent.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_VisionObjectEvent_h
00003 #define INCLUDED_VisionObjectEvent_h
00004 
00005 #include "EventBase.h"
00006 
00007 //! Extends EventBase to also include location in the visual field and distance (though distance is not implimented yet)
00008 class VisionObjectEvent : public EventBase {
00009  public:
00010   //! Constructor
00011   VisionObjectEvent() : EventBase(EventBase::visObjEGID,(unsigned int)-1,EventBase::statusETID,0),_cenX(0),_cenY(0),_distance()/*,_property(-1)*/ {}
00012   //! Constructor, pass a type id and source id
00013   VisionObjectEvent(EventTypeID_t tid, unsigned int sid) : EventBase(EventBase::visObjEGID,sid,tid,0),_cenX(0),_cenY(0),_distance()/*,_property(-1)*/ {}
00014   //! Constructor, pass the type id, source id, center X and center Y
00015   VisionObjectEvent(EventTypeID_t tid, unsigned int sid, float cenX, float cenY) : EventBase(EventBase::visObjEGID,sid,tid,0),_cenX(cenX),_cenY(cenY),_distance()/*,_property(-1)*/ {}
00016   //! destructor
00017   virtual ~VisionObjectEvent() {}
00018   
00019   float getCenterX() const { return _cenX;} //!< returns the x coordinate
00020   VisionObjectEvent& setCenterX(float cenX) { _cenX=cenX; return *this;} //!< sets the x coordinate
00021   
00022   float getCenterY() const { return _cenY;} //!< returns the y coordinate
00023   VisionObjectEvent& setCenterY(float cenY) { _cenY=cenY; return *this;} //!< sets the y coordinate
00024 
00025   float getDistance() const { return _distance;} //!< returns the distance (not implemented)
00026   VisionObjectEvent& setDistance(float dist) { _distance=dist; return *this;} //!< sets the distance
00027 
00028   //int getProperty() const { return _property;} //!< returns the property (for future use)
00029   //VisionObjectEvent& setProperty(int property) { _property=property; return *this;} //!< sets the property
00030       
00031   virtual unsigned int getBinSize() const;
00032   virtual unsigned int LoadBuffer(const char buf[], unsigned int len);
00033   virtual unsigned int SaveBuffer(char buf[], unsigned int len) const;
00034 
00035  protected:
00036   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
00037   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
00038   float _distance; //!< distance from snout to object in millimeters. (not implemented)
00039   //int _property; //!< some property, depending on the SID (for future use)
00040 };
00041 
00042 /*! @file
00043  * @brief Provides information about objects recognized in the camera image
00044  * @author alokl (Creator)
00045  *
00046  * $Author: ejt $
00047  * $Name: tekkotsu-2_1 $
00048  * $Revision: 1.2 $
00049  * $State: Exp $
00050  * $Date: 2003/12/08 00:21:05 $
00051  */
00052 
00053 #endif

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