| Homepage | Demos | Overview | Downloads | Tutorials | 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 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 isAdmissible() const { return true; } 00045 00046 virtual bool updateParams(const ShapeRoot& other, bool force=false); 00047 00048 //! Print information about this shape. (Virtual in BaseData.) 00049 virtual void printParams() const; 00050 00051 //! Transformations. (Virtual in BaseData.) 00052 void applyTransform(const NEWMAT::Matrix& Tmat); 00053 00054 //! Project to ground 00055 virtual void projectToGround(const NEWMAT::Matrix& camToBase, 00056 const NEWMAT::ColumnVector& groundplane); 00057 00058 //! Extraction. 00059 static std::vector<ShapeRoot> extractPoints(const Sketch<bool>& sketch); 00060 00061 virtual unsigned short getDimension() const { return 0; } 00062 00063 PointData& operator=(const PointData&); 00064 operator Point&() { return the_point; }; 00065 operator const Point&() const { return the_point; }; 00066 00067 private: 00068 //! Render into a sketch space and return reference. (Private.) 00069 Sketch<bool>* render() const; 00070 //@} 00071 00072 }; 00073 00074 } // namespace 00075 00076 #endif |
|
DualCoding 3.0beta |
Generated Wed Oct 4 00:01:54 2006 by Doxygen 1.4.7 |