iRoCS Toolbox  1.1.0
MarkerOrthoViewRenderer.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 MARKERORTHOVIEWRENDERER_HH
26 #define MARKERORTHOVIEWRENDERER_HH
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.hh>
30 #endif
31 
32 #include "MarkerRenderer.hh"
33 
34 #include <blitz/array.h>
35 
37 
38 class OrthoViewWidget;
39 
40 /*======================================================================*/
49 /*======================================================================*/
51 {
52 
53 public:
54 
58 
59 /*======================================================================*/
65 /*======================================================================*/
66  virtual MarkerOrthoViewRendererCache *clone() const = 0;
67 
68 /*======================================================================*/
75 /*======================================================================*/
76  void setActive(bool active);
77 
78 /*======================================================================*/
84 /*======================================================================*/
85  bool active() const;
86 
87 /*======================================================================*/
94 /*======================================================================*/
96 
97 /*======================================================================*/
103 /*======================================================================*/
104  bool showHelperLines() const;
105 
106 /*======================================================================*/
112 /*======================================================================*/
113  void setFontSize(int fontSize);
114 
115 /*======================================================================*/
121 /*======================================================================*/
122  int fontSize() const;
123 
124 /*======================================================================*/
135 /*======================================================================*/
136  virtual void render(QPainter *painter) const = 0;
137 
138 protected:
139 
142 
143 };
144 
145 
147 {
148 
149 Q_OBJECT
150 
151 public:
152 
155  virtual ~MarkerOrthoViewRenderer();
156 
157  virtual MarkerRenderer *clone() const = 0;
158 
159 /*======================================================================*/
166 /*======================================================================*/
167  void setOrthogonalDimension(int orthogonalDimension);
168 
169 /*======================================================================*/
186 /*======================================================================*/
187  virtual void render(QPainter* painter = NULL) const;
188 
189 /*======================================================================*/
208 /*======================================================================*/
209  virtual void render(
210  QXmlStreamWriter &svgStream,
211  blitz::TinyVector<double,3> const &shapePx,
212  blitz::TinyVector<double,3> const &lowerBoundUm,
213  blitz::TinyVector<double,3> const &upperBoundUm,
214  std::string const &font, double fontSizePt,
215  iRoCS::ProgressReporter *pr = NULL) const = 0;
216 
217 public slots:
218 
219 /*======================================================================*/
225 /*======================================================================*/
227  {
228  for (int i = 0; i < 3; ++i) _cache(i)->setFontSize(fontSize);
229  }
230 
231 /*======================================================================*/
250 /*======================================================================*/
251  virtual void updateCache() const;
252 
253 /*======================================================================*/
270 /*======================================================================*/
271  virtual void updateCache(int direction) const;
272 
273 protected:
274 
275 /*======================================================================*/
284 /*======================================================================*/
285  bool _setPenColor(QPainter *painter, bool hilighted = false) const;
286 
287 /*======================================================================*/
297 /*======================================================================*/
298  std::string _getColorString(bool &draw) const;
299 
301 
302  mutable blitz::TinyVector<MarkerOrthoViewRendererCache*,3> _cache;
303 
304 };
305 
306 #endif
void setFontSize(int fontSize)
Set the font size for text drawn by this cache.
bool showHelperLines() const
Get the showHelperLines flag of this cache.
bool active() const
Get the active flag of this cache.
The MarkerOrthoViewRendererCache class specifies the interface to store and replay marker geometry in...
The Marker class specifies the properties of an abstract Marker that can be contained in an Annotatio...
Definition: Marker.hh:56
void setShowHelperLines(bool showHelperLines)
Set the showHelperLines flag of this cache.
void setActive(bool active)
Set the active flag of this cache.
void setFontSize(int fontSize)
Set the font size for text rendering of this Marker.
int fontSize() const
Get the font size for text drawn by this cache.
virtual void render(QPainter *painter) const =0
Render the content of the cache into the given painter.
virtual MarkerOrthoViewRendererCache * clone() const =0
Get a new copy of this cache.
blitz::TinyVector< MarkerOrthoViewRendererCache *, 3 > _cache