PolygonDrawer.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // C++ Interface: PolygonDrawer
  3. //
  4. // Description:
  5. //
  6. //
  7. // Author: Marcel Brueckner <brueckner [at] informatik [dot] uni-jena [dot] de>, (C) 2008
  8. //
  9. // Copyright: See COPYING file that comes with this distribution
  10. //
  11. //
  12. #ifndef IMAGEDISPLAY_POLYGONDRAWER_H
  13. #define IMAGEDISPLAY_POLYGONDRAWER_H
  14. #include <core/imagedisplay/ImageDisplay.h>
  15. #include <core/image/CoordT.h>
  16. #include <fstream>
  17. namespace NICE {
  18. class PolygonDrawer : public ImageDisplay {
  19. Q_OBJECT;
  20. public:
  21. PolygonDrawer ( QWidget* parent = NULL, const char* name = NULL,
  22. Qt::WFlags flags = 0 );
  23. virtual ~PolygonDrawer(void);
  24. inline const std::vector < CoordT<double> >& getPolygon (void) const {
  25. return m_points;
  26. }
  27. inline void clearPolygon (void) {
  28. m_points.clear();
  29. updateGL();
  30. }
  31. protected:
  32. virtual void paintGLObjects(void);
  33. virtual void mousePressEvent(QMouseEvent* event);
  34. private:
  35. virtual void contextMenuEvent(QContextMenuEvent* event);
  36. //! points of the polygon
  37. std::vector < CoordT<double> > m_points;
  38. };
  39. }
  40. #endif