Homepage Demos Overview Downloads Tutorials Reference
Credits

ASCIIVisionBehavior.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 
00003 // This is an empty Behavior template file.
00004 // Replace ASCIIVisionBehavior and streams low-resolution ASCII-art of the camera image to sout as appropriate, and go to town!
00005 
00006 #ifndef INCLUDED_ASCIIVisionBehavior_h_
00007 #define INCLUDED_ASCIIVisionBehavior_h_
00008 
00009 #include "Behaviors/BehaviorBase.h"
00010 #include "Events/EventRouter.h"
00011 
00012 //! streams low-resolution ASCII-art of the camera image to sout
00013 class ASCIIVisionBehavior : public BehaviorBase {
00014 public:
00015   //! constructor
00016   ASCIIVisionBehavior() : BehaviorBase("ASCIIVisionBehavior") {}
00017 
00018   static const unsigned int charMapSize=62;  //!< the number of available characters for levels of "gray"
00019   static const char charMap[charMapSize]; //!< the included characters sorted in order of darkness - could be improved... (less is more sometimes)
00020 
00021   virtual void DoStart() {
00022     BehaviorBase::DoStart(); // do this first
00023     erouter->addListener(this,EventBase::visRawCameraEGID);
00024   }
00025 
00026   virtual void DoStop() {
00027     erouter->removeListener(this);
00028     BehaviorBase::DoStop(); // do this last
00029   }
00030 
00031   virtual void processEvent(const EventBase& e);
00032 
00033   static std::string getClassDescription() { return "streams low-resolution ASCII-art of the camera image to sout"; }
00034   virtual std::string getDescription() const { return getClassDescription(); }
00035   
00036 protected:
00037   
00038 };
00039 
00040 /*! @file
00041  * @brief Defines ASCIIVisionBehavior, which streams low-resolution ASCII-art of the camera image to sout
00042  * @author ejt (Creator)
00043  *
00044  * $Author: ejt $
00045  * $Name: tekkotsu-2_2_2 $
00046  * $Revision: 1.5 $
00047  * $State: Exp $
00048  * $Date: 2004/12/23 01:47:06 $
00049  */
00050 
00051 #endif

Tekkotsu v2.2.2
Generated Tue Jan 4 15:43:12 2005 by Doxygen 1.4.0