Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

AgentData.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef _AGENTDATA_H_
00003 #define _AGENTDATA_H_
00004 
00005 #include "BaseData.h"    // superclass
00006 #include "Point.h"       // Point data member
00007 #include "Shared/Measures.h"    // coordinate_t; AngPi data member
00008 #include "ShapeTypes.h"  // agentDataType
00009 
00010 namespace DualCoding {
00011 
00012 class ShapeRoot;
00013 class SketchSpace;
00014 template<typename T> class Sketch;
00015 
00016 //! Representation of the robot on the world map
00017 class AgentData : public BaseData {
00018 private:
00019   Point center_pt;
00020   Point orientation_pt;
00021   AngTwoPi orientation;
00022 
00023 public:
00024   //! Constructor
00025   AgentData(ShapeSpace& _space, const Point &c);
00026   
00027   //! Copy constructor
00028   AgentData(const AgentData& otherData);
00029   
00030   static ShapeType_t getStaticType() { return agentDataType; }
00031 
00032   // =========================================
00033   // BEGIN FUNCTIONS
00034   // =========================================
00035   
00036   DATASTUFF_H(AgentData);
00037   
00038   //! Centroid. (Virtual in BaseData.)
00039   Point getCentroid() const { return center_pt; }
00040   
00041   //! Match agents based on their parameters.  (Virtual in BaseData.)
00042   virtual bool isMatchFor(const ShapeRoot& other) const;
00043   
00044   //! Print information about this shape. (Virtual in BaseData.)
00045   virtual void printParams() const;
00046   
00047   virtual bool updateParams(const ShapeRoot& other, bool force=false);
00048   
00049   virtual void projectToGround(const NEWMAT::Matrix& camToBase,
00050              const NEWMAT::ColumnVector& groundplane);
00051   
00052   //! Transformations. (Virtual in BaseData.)
00053   virtual void applyTransform(const NEWMAT::Matrix& Tmat, const ReferenceFrameType_t newref=unspecified);  
00054 
00055   virtual unsigned short getDimension() const { return 3; }  
00056 
00057   AngTwoPi getOrientation() const { return orientation; }
00058   
00059 protected:
00060   //! Updates orientation according to #orientation_pt
00061   void updateOrientation();
00062   
00063 private:
00064   friend class MapBuilder;
00065   //! Functions to set property values.
00066   //@{
00067   void setOrientation(AngTwoPi _orientation); //!< Don't call this; use MapBuilder::setAgent()
00068   void setCentroidPt(const Point &otherPt) { center_pt.setCoords(otherPt); }  //!< Don't call this; use MapBuilder::setAgent()
00069   //@}
00070 
00071   //! Render into a sketch space and return reference.
00072   virtual Sketch<bool>* render() const;
00073 
00074   AgentData& operator=(const AgentData&); //!< don't call
00075   
00076 };
00077 
00078 } // namespace
00079 
00080 #endif

DualCoding 4.0
Generated Thu Nov 22 00:52:36 2007 by Doxygen 1.5.4