00001 /******************************************************************************* 00002 * VectorObject2D.h 00003 * 00004 * (C) 2007 AG Aktives Sehen <agas@uni-koblenz.de> 00005 * Universitaet Koblenz-Landau 00006 * 00007 * Additional information: 00008 * $Id: $ 00009 *******************************************************************************/ 00010 00011 #ifndef VectorObject2D_H 00012 #define VectorObject2D_H 00013 00014 #include "Workers/Math/Point2D.h" 00015 #include <vector> 00016 00017 //#include "Architecture/Serializer/ExtendedOutStream.h" TODO ged rid of these? 00018 //#include "Architecture/Serializer/ExtendedInStream.h" 00019 00025 class VectorObject2D 00026 { 00027 00028 public: 00029 00030 enum StyleT { 00031 Lines, 00032 Dots 00033 }; 00034 00035 static const unsigned short ClassVersion; 00036 00037 VectorObject2D( const std::vector<Point2D> vertices, float r, float g, float b, float lineWidth=1.0, StyleT style=Lines ); 00038 00039 ~VectorObject2D(); 00040 00041 void paintGl(); 00042 00043 inline std::vector<Point2D>& vertices() { return m_Vertices; } 00044 inline float r() { return m_R; } 00045 inline float g() { return m_G; } 00046 inline float b() { return m_B; } 00047 inline float lineWidth() { return m_LineWidth; } 00048 inline StyleT style() { return m_Style; } 00049 00050 inline void setVertices( std::vector<Point2D>& vertices ) { m_Vertices=vertices; } 00051 inline void setColor( float r, float g, float b ) { m_R=r; m_G=g; m_B=b; } 00052 inline void setLineWidth( float lineWidth ) { m_LineWidth=lineWidth; } 00053 inline void setStyle( StyleT style ) { m_Style=style; } 00054 00055 // /** @brief Serialize to stream */ 00056 // void storer( ExtendedOutStream& extStrm ) const; 00057 00058 // /** @brief Deserialize from stream */ 00059 // VectorObject2D( ExtendedInStream& extStrm, unsigned short sourceVersion ); 00060 00061 private: 00062 00063 std::vector<Point2D> m_Vertices; 00064 float m_R; 00065 float m_G; 00066 float m_B; 00067 float m_LineWidth; 00068 StyleT m_Style; 00069 }; 00070 00071 #endif