00001 #ifndef SIGEL_ROBOT_SIG_GEOMETRY_H 00002 #define SIGEL_ROBOT_SIG_GEOMETRY_H 00003 00004 namespace SIGEL_Robot { class SIG_Geometry; } 00005 00006 #include <qstring.h> 00007 #include <qvector.h> 00008 #include <pointvector.h> 00009 #include <matrix.h> 00010 #include "SIGEL_Robot/SIG_Robot.h" 00011 #include "SIGEL_Robot/SIG_Polygon.h" 00012 #include "SIGEL_Robot/SIG_GeometryIterator.h" 00013 #include "SIGEL_Robot/SIG_Body.h" 00014 00015 namespace SIGEL_Robot { 00026 class SIG_Geometry { 00027 friend class SIG_GeometryIterator; 00028 friend class SIG_Polygon; 00029 private: 00030 QVector<SIG_Polygon> polygons; 00031 QVector<DL_vector> vertices; 00032 00033 protected: 00039 void addPolygon (SIG_Polygon *p); 00046 SIG_Polygon const *getPolygon (int i) const; 00047 00048 public: 00054 SIG_Geometry (); 00062 SIG_Geometry (const SIG_Geometry *geom); 00070 SIG_Geometry (QTextStream & tx); 00074 ~SIG_Geometry (void); 00075 00090 int getOrAddVertex (DL_vector vertex); 00094 QVector<DL_vector> const & getVertices (void) const; 00098 int getNumVertices (void) const; 00107 DL_vector getVertex (int i) const; 00112 int getNumPolygons (void) const; 00118 void translate (DL_vector dir); 00127 void rotate (DL_matrix mat); 00128 00132 void writeToFileTransfer (QTextStream & tx) const; 00133 }; 00134 } 00135 00136 #endif