iRoCS Toolbox  1.1.0
OpenGlRenderingSettingsWidget.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 OPENGLRENDERINGSETTINGSWIDGET_HH
26 #define OPENGLRENDERINGSETTINGSWIDGET_HH
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.hh>
30 #endif
31 
32 #include <blitz/array.h>
33 
34 #include <QtGui/QWidget>
35 
39 class BoolControlElement;
41 class IntControlElement;
44 class QDial;
45 
46 class ChannelSpecs;
47 
48 class OpenGlRenderingSettingsWidget : public QWidget
49 {
50 
51  Q_OBJECT
52 
53  public:
54 
55  enum RenderingState { Solid = 0, Wireframe = 1, Dots = 2 };
56 
58  OpenGlRenderingViewWidget *view, QWidget *parent = 0,
59  Qt::WindowFlags f = 0);
60 
62 
63  blitz::TinyVector<unsigned char,3> backgroundColor() const;
66  bool backFaceCullingEnabled() const;
67  bool lightEnabled() const;
68  float ambientFactor() const;
69  float materialShininess() const;
70  double latitudeSamplingUm() const;
71  int longitudeSampling() const;
72 
74  double zMin() const;
75  double zMax() const;
76  double rMin() const;
77  double rMax() const;
78  double phiMin() const;
79  double phiMax() const;
80 
81 signals:
82 
83  // This signal indicates, that the OpenGl renderer needs to be reinitialized
84  // and should trigger an intializeGL() and updateGL()
85  void renderingStateChanged();
86 
87  // This signal is emitted, when the content to render changed, therefore
88  // it only needs to trigger an updateGL()
89  void clippingStateChanged();
90 
91 private slots:
92 
93  void _setLiveUpdateEnabled(bool enable);
94 
95 private:
96 
98 
99  BoolControlElement *p_liveUpdateControl;
100  ColorControlElement *p_backgroundColorControl;
101  StringSelectionControlElement *p_frontFaceRenderingControl;
102  StringSelectionControlElement *p_backFaceRenderingControl;
103  BoolControlElement *p_backFaceCullingControl;
104  BoolControlElement *p_lightControl;
105  DoubleControlElement *p_ambientFactorControl;
106  DoubleControlElement *p_materialShininessControl;
107  DoubleControlElement *p_latitudeSamplingControl;
108  IntControlElement *p_longitudeSamplingControl;
109 
110  ChannelSelectionControlElement *p_channelControl;
111  DoubleRangeControlElement *p_zRangeControl;
112  DoubleRangeControlElement *p_rRangeControl;
113  QDial *p_phiMin, *p_phiMax;
114 
115 };
116 
117 #endif
OpenGlRenderingSettingsWidget(OpenGlRenderingViewWidget *view, QWidget *parent=0, Qt::WindowFlags f=0)
blitz::TinyVector< unsigned char, 3 > backgroundColor() const
RenderingState backFaceRendering() const
double latitudeSamplingUm() const
RenderingState frontFaceRendering() const
ChannelSpecs * clippingChannel() const