| Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
AgentData.hGo to the documentation of this file.00001 //-*-c++-*- 00002 #ifndef _AGENTDATA_H_ 00003 #define _AGENTDATA_H_ 00004 00005 #include "BaseData.h" // superclass 00006 #include "Point.h" // Point data member 00007 #include "Measures.h" // coordinate_t; AngPi data member 00008 #include "ShapeTypes.h" // agentDataType 00009 00010 namespace DualCoding { 00011 00012 class ShapeRoot; 00013 class SketchSpace; 00014 template<typename T> class Sketch; 00015 00016 class AgentData : public BaseData { 00017 private: 00018 Point center_pt; 00019 Point orientation_pt; 00020 AngTwoPi orientation; 00021 00022 public: 00023 //! Constructor 00024 AgentData(ShapeSpace& _space, const Point &c); 00025 00026 //! Copy constructor 00027 AgentData(const AgentData& otherData); 00028 00029 static ShapeType_t getStaticType() { return agentDataType; } 00030 00031 // ========================================= 00032 // BEGIN FUNCTIONS 00033 // ========================================= 00034 00035 DATASTUFF_H(AgentData); 00036 00037 //! Centroid. (Virtual in BaseData.) 00038 Point getCentroid() const { return center_pt; } 00039 00040 //! Match agents based on their parameters. (Virtual in BaseData.) 00041 virtual bool isMatchFor(const ShapeRoot& other) const; 00042 00043 //! Print information about this shape. (Virtual in BaseData.) 00044 virtual void printParams() const; 00045 00046 virtual bool updateParams(const ShapeRoot& other, bool force=false); 00047 00048 virtual void projectToGround(const NEWMAT::Matrix& camToBase, 00049 const NEWMAT::ColumnVector& groundplane); 00050 00051 //! Transformations. (Virtual in BaseData.) 00052 virtual void applyTransform(const NEWMAT::Matrix& Tmat); 00053 00054 00055 virtual unsigned short getDimension() const { return 3; } 00056 00057 AngTwoPi getOrientation() const { return orientation; } 00058 00059 protected: 00060 //! Updates orientation according to @param orientation_pt 00061 void updateOrientation(); 00062 00063 private: 00064 friend class MapBuilder; 00065 //! Functions to set property values. 00066 //@{ 00067 void setOrientation(AngTwoPi _orientation); //!< Don't call this; use MapBuilder::setAgent() 00068 void setCentroidPt(const Point &otherPt) { center_pt.setCoords(otherPt); } //!< Don't call this; use MapBuilder::setAgent() 00069 //@} 00070 00071 //! Render into a sketch space and return reference. 00072 virtual Sketch<bool>* render() const; 00073 00074 AgentData& operator=(const AgentData&); //!< don't call 00075 00076 }; 00077 00078 } // namespace 00079 00080 #endif |
|
DualCoding 3.0beta |
Generated Wed Oct 4 00:01:53 2006 by Doxygen 1.4.7 |