| Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
ShapeSpace.hGo to the documentation of this file.00001 //-*-c++-*- 00002 #ifndef _SHAPESPACE_H_ 00003 #define _SHAPESPACE_H_ 00004 00005 #include <vector> 00006 #include <iostream> 00007 00008 #include "Vision/colors.h" 00009 #include "Shared/newmat/newmat.h" 00010 00011 #include "Measures.h" 00012 #include "ShapeTypes.h" 00013 00014 namespace DualCoding { 00015 00016 //**************** 00017 // 00018 // ShapeSpace holds a collection of data objects, e.g., AgentData, 00019 // LineData, EllipseData 00020 00021 class BaseData; 00022 class ShapeRoot; 00023 class Point; 00024 class SketchSpace; 00025 class LineData; 00026 template<typename T> class Shape; 00027 class Shape<LineData>; 00028 00029 //! Holds a collection of diverse shapes such as LineData or EllipseData 00030 00031 class ShapeSpace { 00032 private: 00033 friend class SketchSpace; 00034 friend class ShapeRoot; 00035 friend class VisualRoutinesBehavior; 00036 // friend class WorldMapBuilder; 00037 00038 public: 00039 string name; //!< Name of the ShapeSpace 00040 00041 private: 00042 SketchSpace* dualSpace; 00043 int id_counter; 00044 vector<ShapeRoot> shapeCache; 00045 ShapeRoot& addShape(BaseData* p); 00046 ReferenceFrameType_t refFrameType; 00047 00048 public: 00049 00050 //! Constructor for ShapeSpace; requires dual SketchSpace. 00051 ShapeSpace(SketchSpace* dualSkS, int init_id=70000, string const _name="", 00052 ReferenceFrameType_t _refFrameType=camcentric); 00053 00054 ~ShapeSpace(void); 00055 00056 SketchSpace& getDualSpace(void) const { return *dualSpace; } 00057 ReferenceFrameType_t getRefFrameType() const { return refFrameType; } 00058 00059 void importShapes(std::vector<ShapeRoot>& foreign_shapes); 00060 BaseData* importShape(const ShapeRoot& foreign_shape); 00061 00062 void deleteShape(ShapeRoot &b); 00063 void deleteShapes(std::vector<ShapeRoot>& shapes_vec); 00064 00065 void clear(); 00066 00067 std::vector<ShapeRoot>& allShapes(void) { return shapeCache; } 00068 const std::vector<ShapeRoot>& allShapes(void) const { return shapeCache; } 00069 std::vector<ShapeRoot> allShapes(ShapeType_t type); 00070 std::vector<ShapeRoot> allShapes(rgb color); 00071 00072 // Coerce a ShapeSpace into a vector of ShapeRoots it contains 00073 operator std::vector<ShapeRoot>&() { return shapeCache; } 00074 std::vector<ShapeRoot>::iterator begin() { return shapeCache.begin(); } 00075 std::vector<ShapeRoot>::iterator end() { return shapeCache.end(); } 00076 00077 std::string getShapeListForGUI(void); 00078 00079 00080 void printParams(void); 00081 void printSummary(void); 00082 00083 //! Transformation and Location Utilities 00084 //@{ 00085 void applyTransform(const NEWMAT::Matrix& Tmat); 00086 00087 Point getCentroid(void); 00088 00089 Point getCentroidOfSubset(const std::vector<ShapeRoot>& subset); 00090 //@} 00091 00092 private: 00093 ShapeSpace(const ShapeSpace&); //!< never call this 00094 ShapeSpace& operator=(const ShapeSpace&); //!< never call this 00095 00096 }; 00097 00098 } // namespace 00099 00100 #endif |
|
DualCoding 3.0beta |
Generated Wed Oct 4 00:01:54 2006 by Doxygen 1.4.7 |