Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
PointData.hGo to the documentation of this file.00001 //-*-c++-*- 00002 #ifndef _POINTDATA_H_ 00003 #define _POINTDATA_H_ 00004 00005 #include <vector> 00006 #include <iostream> 00007 #include <string> 00008 00009 #include "Shared/newmat/newmat.h" 00010 00011 #include "BaseData.h" // superclass 00012 #include "Point.h" // Point data member 00013 #include "ShapeTypes.h" // pointDataType 00014 00015 namespace DualCoding { 00016 00017 class ShapeRoot; 00018 class SketchSpace; 00019 template<typename T> class Sketch; 00020 00021 class PointData : public BaseData { 00022 public: 00023 Point the_point; 00024 00025 //! Constructor 00026 PointData(ShapeSpace& _space, const Point &c); 00027 00028 static ShapeType_t getStaticType() { return pointDataType; } 00029 00030 DATASTUFF_H(PointData); 00031 00032 //! Centroid. (Virtual in BaseData.) 00033 virtual Point getCentroid() const { return the_point; } 00034 00035 BoundingBox getBoundingBox() const { 00036 return BoundingBox(the_point.coordX(),the_point.coordY(),the_point.coordX(),the_point.coordY()); 00037 } 00038 00039 //! Match points based on their parameters. (Virtual in BaseData.) 00040 virtual bool isMatchFor(const ShapeRoot& other) const; 00041 00042 virtual void mergeWith(const ShapeRoot& other); 00043 00044 virtual bool updateParams(const ShapeRoot& other, bool force=false); 00045 00046 //! Print information about this shape. (Virtual in BaseData.) 00047 virtual void printParams() const; 00048 00049 //! Transformations. (Virtual in BaseData.) 00050 virtual void applyTransform(const NEWMAT::Matrix& Tmat, const ReferenceFrameType_t newref=unspecified); 00051 00052 //! Project to ground 00053 virtual void projectToGround(const NEWMAT::Matrix& camToBase, 00054 const NEWMAT::ColumnVector& groundplane); 00055 00056 //! Extraction. 00057 static std::vector<ShapeRoot> extractPoints(const Sketch<bool>& sketch); 00058 00059 virtual unsigned short getDimension() const { return 0; } 00060 00061 PointData& operator=(const PointData&); 00062 operator Point&() { return the_point; }; 00063 operator const Point&() const { return the_point; }; 00064 00065 private: 00066 //! Render into a sketch space and return reference. (Private.) 00067 virtual Sketch<bool>* render() const; 00068 //@} 00069 00070 }; 00071 00072 } // namespace 00073 00074 #endif |
DualCoding 4.0 |
Generated Thu Nov 22 00:52:36 2007 by Doxygen 1.5.4 |