OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
pointlist_overlay.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 // Copyright (C) 2003-2010 by the IPLT authors
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the Free
9 // Software Foundation; either version 3.0 of the License, or (at your option)
10 // any later version.
11 // This library is distributed in the hope that it will be useful, but WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 // details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //------------------------------------------------------------------------------
20 
21 /*
22  Authors: Andreas Schenk, Ansgar Philippsen
23 */
24 
25 #ifndef IMG_POINTLIST_OVERLAY_HH
26 #define IMG_POINTLIST_OVERLAY_HH
27 
28 #include <ost/img/point_list.hh>
29 
30 #include <ost/gui/module_config.hh>
31 
33 
34 namespace ost { namespace img { namespace gui {
35 
37 {
38 public:
39  PointlistOverlay(const String& name="Pointlist");
40  // initialize with pointlist
41  PointlistOverlay(const PointList& pl, const String& name="Pointlist");
42 
43  virtual void OnMenuEvent(QAction* e);
44  virtual void OnDraw(QPainter& pnt, DataViewerPanel* dvp, bool is_active);
45  virtual bool OnMouseEvent(QMouseEvent* e, DataViewerPanel* dvp,
46  const QPoint& lastmouse);
47 
48  void Add(const Point& pnt, double scale=1.0);
49  void Add(const PointList& pl, double scale=1.0);
50 
52  void Remove(const Point& pnt);
53 
54  // clear all points
55  void Clear();
56 
57 private:
58  std::vector<std::pair<Point,double> > pointlist_;
59 
60  QAction* a_clr_;
61 
62  void build_();
63 };
64 
65 }}} //ns
66 
67 
68 #endif
list of points
Definition: point_list.hh:39
std::string String
Definition: base.hh:54
#define DLLEXPORT_OST_GUI
ImageStateConstModIPAlgorithm< ClearFnc > Clear
Definition: clear.hh:47
class encapsulating 1D to 3D point
Definition: point.hh:43