Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

NaughtData.h

Go to the documentation of this file.
00001 #ifndef _NAUGHT_DATA_
00002 #define _NAUGHT_DATA_
00003 
00004 #include "CylinderData.h"
00005 #include "Crew/MapBuilderRequest.h"
00006 #include "BaseData.h"
00007 #include "Point.h"
00008 #include "ShapeTypes.h"
00009 #include "SketchTypes.h"   // uchar
00010 #include <map>
00011 
00012 namespace DualCoding {
00013   
00014 class NaughtData : public BaseData {
00015 private:
00016   Point centroid;
00017   float height;
00018   float radius;
00019   
00020 public:
00021   //! Constructor
00022   NaughtData(ShapeSpace& _space, const Point& _centroid, float _height=0, float _radius=0);
00023 
00024   static ShapeType_t getStaticType() { return naughtDataType; }
00025 
00026   DATASTUFF_H(NaughtData);
00027 
00028   //! Centroid. (Virtual in BaseData.)
00029   Point getCentroid() const { return centroid; } 
00030   void setCentroidPt(const Point& other) { centroid.setCoords(other); }
00031 
00032   float getRadius() const { return radius; }
00033   float getHeight() const { return height; }
00034 
00035   virtual bool isMatchFor(const ShapeRoot& other) const;
00036   
00037   virtual bool updateParams(const ShapeRoot& other, bool force=false);
00038 
00039   //! Print information about this shape. (Virtual in BaseData.)
00040   virtual void printParams() const;
00041 
00042   virtual short unsigned int getDimension() const { return 2; }
00043 
00044   //! Transformations. (Virtual in BaseData.)
00045   void applyTransform(const fmat::Transform& Tmat, const ReferenceFrameType_t newref=unspecified);
00046   virtual void projectToGround(const fmat::Transform& camToBase, const PlaneEquation& groundplane);
00047 
00048   virtual Sketch<bool>* render() const;
00049 
00050   // Extracts naughts using regions, similar to how EllipseData does it
00051   static std::vector<Shape<NaughtData> > extractNaughts(const Sketch<bool> &sketch, const fmat::Column<3>& dimensions);
00052 
00053 };
00054 
00055 }
00056 
00057 #endif

DualCoding 5.1CVS
Generated Mon May 9 04:56:26 2016 by Doxygen 1.6.3