iRoCS Toolbox  1.1.0
SurfaceMarker.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * This file belongs to the iRoCS Toolbox.
4  *
5  * Copyright (C) 2015 Thorsten Falk
6  *
7  * Image Analysis Lab, University of Freiburg, Germany
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  **************************************************************************/
24 
25 #ifndef SURFACEMARKER_HH
26 #define SURFACEMARKER_HH
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.hh>
30 #endif
31 
32 #include "PointMarker.hh"
33 
35 
37 {
38 
39  Q_OBJECT
40 
41 public:
42 
44  AnnotationChannelSpecs* channel, QWidget* parent = 0);
46 
47 };
48 
49 
51 {
52 
53  Q_OBJECT
54 
55 public:
56 
58  AnnotationChannelSpecs* channel, QWidget* parent = 0);
59  virtual ~SurfaceMarkerControlWidget();
60 
61 };
62 
63 
64 class SurfaceMarker : public PointMarker
65 {
66 
67  Q_OBJECT
68 
69 public:
70 
72  blitz::TinyVector<double,3> const& position = 0.0,
73  atb::SurfaceGeometry const * const surface = NULL,
74  AnnotationChannelSpecs *channel = NULL);
75  SurfaceMarker(const SurfaceMarker& marker);
76  virtual ~SurfaceMarker();
77 
78  SurfaceMarker &operator=(const SurfaceMarker& marker);
79 
80  virtual Marker::MarkerType markerType() const;
81  virtual bool inherits(Marker::MarkerType type) const;
82 
83  virtual MarkerRenderer *addRenderer(ViewWidget* view);
84 
85  atb::SurfaceGeometry const &surface() const;
86  atb::SurfaceGeometry &surface();
87  std::vector<atb::SurfaceGeometry::VertexT> const &vertices() const;
88  std::vector<atb::SurfaceGeometry::VertexT> &vertices();
89  std::vector<atb::SurfaceGeometry::NormalT> const &normals() const;
90  std::vector<atb::SurfaceGeometry::NormalT> &normals();
91  std::vector<atb::SurfaceGeometry::IndexT> const &indices() const;
92  std::vector<atb::SurfaceGeometry::IndexT> &indices();
93 
94  void setVertices(std::vector<atb::SurfaceGeometry::VertexT> const &vertices);
95  void setNormals(std::vector<atb::SurfaceGeometry::NormalT> const & normals);
96  void setIndices(std::vector<atb::SurfaceGeometry::IndexT> const &indices);
97 
98  static void save(
99  AnnotationChannelSpecs const *channel,
100  BlitzH5File &outFile, std::string const &group,
101  iRoCS::ProgressReporter *pr = NULL);
102  static void load(
103  AnnotationChannelSpecs *channel,
104  BlitzH5File const &inFile, std::string const &group,
105  iRoCS::ProgressReporter *pr = NULL);
106 
107  virtual void writeCSVHeader(std::ofstream &out) const;
108  virtual void saveCSV(std::ofstream &out) const;
109  virtual void loadFromMap(std::map<std::string,std::string> const &values);
110 
111  virtual bool occupiesPositionUm(
112  blitz::TinyVector<double,3> const &positionUm) const;
113 
114 private:
115 
116  virtual void _updateBoundingBox() const;
117 
118  atb::SurfaceGeometry _surface;
119 
120 };
121 
122 #endif
Storage and rendering of Triangulated surfaces.
virtual ~SurfaceMarkerPresetWidget()
SurfaceMarkerPresetWidget(AnnotationChannelSpecs *channel, QWidget *parent=0)
The SurfaceGeometry struct provides data structures required for the storage of triangulated surface ...
MarkerType
Marker.hh "liblabelling_qt4/Marker.hh".
Definition: Marker.hh:73