Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

CylinderData.h

Go to the documentation of this file.
00001 #ifndef _CYLINDER_DATA_
00002 #define _CYLINDER_DATA_
00003 
00004 #include "Crew/MapBuilderRequest.h"
00005 #include "DualCoding/BaseData.h"
00006 #include "DualCoding/Point.h"
00007 #include "DualCoding/ShapeTypes.h"
00008 #include "SketchTypes.h"   // uchar
00009 #include <map>
00010 
00011 namespace DualCoding {
00012   
00013 //! Vertical standing cylinder
00014 class CylinderData: public BaseData {
00015 protected:
00016   Point centroid;
00017   float height;
00018   float radius;
00019   fmat::Quaternion orientation;
00020   
00021 public:
00022   //! Constructor
00023   CylinderData(ShapeSpace& _space, Point _centroid, float _height=0, float _radius=0, fmat::Quaternion _orientation=fmat::Quaternion());
00024 
00025   float getHeight() const { return height; }
00026   float getRadius() const { return radius; }
00027   const fmat::Quaternion getOrientation() const { return orientation; }
00028   
00029   static ShapeType_t getStaticType() { return cylinderDataType; }
00030   DATASTUFF_H(CylinderData);
00031   
00032   virtual bool isMatchFor(const ShapeRoot&) const;
00033   //! return the centroid of the shape in point format
00034   virtual Point getCentroid() const;
00035   virtual bool updateParams(const ShapeRoot&, bool);
00036 
00037   //! Returns the bounding box of the cylinder
00038   virtual BoundingBox2D getBoundingBox() const;
00039 
00040   virtual short unsigned int getDimension() const { return 3; }
00041   virtual void printParams() const;
00042   virtual void applyTransform(const fmat::Transform&, ReferenceFrameType_t);
00043   virtual void projectToGround(const fmat::Transform&, const PlaneEquation&);
00044   virtual Sketch<bool>* render() const;
00045   
00046   //! Import cylinders of specified colors from Sketch<uchar> as a vector of Shape<CylinderData>
00047   static std::vector<Shape<CylinderData> >
00048   extractCylinders(const Sketch<uchar> &sketch, 
00049                    const std::set<color_index>& colors,
00050                    const std::map<color_index,coordinate_t>& assumedHeights,
00051                    const std::map<color_index,int>& minCylinderAreas,
00052                    int maxcylinders,
00053                    std::vector<GazePoint> &addGazePts);
00054 
00055 };
00056   
00057 }
00058 
00059 #endif

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