OpenWalnut  1.5.0dev
WPropertyTransferFunctionWidget.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WPROPERTYTRANSFERFUNCTIONWIDGET_H
26 #define WPROPERTYTRANSFERFUNCTIONWIDGET_H
27 
28 #include <string>
29 
30 #include <QLineEdit>
31 #include <QSlider>
32 #include <QHBoxLayout>
33 
34 #include "WPropertyWidget.h"
35 
36 #include "transferFunction/WTransferFunctionWidget.h"
37 #include "core/common/WTransferFunction.h"
38 
39 /**
40  * Implements a property widget for WPropDouble.
41  */
43 {
44  Q_OBJECT
45 public:
46  /**
47  * Constructor. Creates a new widget appropriate for the specified property.
48  *
49  * \param property the property to handle
50  * \param parent the parent widget.
51  * \param propertyGrid the grid used to layout the labels and property widgets
52  */
53  WPropertyTransferFunctionWidget( WPropTransferFunction property, QGridLayout* propertyGrid, QWidget* parent = 0 );
54 
55  /**
56  * Destructor.
57  */
59 
60 protected:
61  /**
62  * Called when the gui has new data
63  * \param tf New transfer function
64  */
65  virtual void guiUpdate( const WTransferFunction& tf );
66 
67  /**
68  * Called whenever the widget should update.
69  */
70  virtual void update();
71 
72  /**
73  * The integer property represented by this widget.
74  */
75  //WPropDouble m_doubleProperty;
76  WPropTransferFunction m_transferFunctionProperty;
77 
78  /**
79  * The slider allowing modification of the integer value
80  */
81  //QSlider m_slider;
82 
83  /**
84  * The edit field showing the value of the slider
85  */
86  //QLineEdit m_edit;
87 
88  /**
89  * Layout used to position the label and the checkbox
90  */
91  QHBoxLayout m_layout;
92 
93  /**
94  * The current minimum value.
95  */
96  double m_min;
97 
98  /**
99  * The current maximum value.
100  */
101  double m_max;
102 
103  /**
104  * Used to show the property as text.
105  */
106  //QLabel m_asText;
107 
108  /**
109  * The layout used for the pure output (information properties)
110  */
111  QHBoxLayout m_infoLayout;
112 
113  /** the current transfer function */
115 
116  /** the previously used transfer function */
118 
119  /**
120  * internal synchronization flag
121  */
122  bool modifying;
123 };
124 
125 #endif // WPROPERTYTRANSFERFUNCTIONWIDGET_H
126 
Implements a property widget for WPropDouble.
virtual void update()
Called whenever the widget should update.
double m_max
The current maximum value.
virtual void guiUpdate(const WTransferFunction &tf)
Called when the gui has new data.
bool modifying
internal synchronization flag
QHBoxLayout m_infoLayout
Used to show the property as text.
WTransferFunctionWidget m_transferFunction
the current transfer function
WTransferFunction lastTransferFunction
the previously used transfer function
WPropTransferFunction m_transferFunctionProperty
The integer property represented by this widget.
WPropertyTransferFunctionWidget(WPropTransferFunction property, QGridLayout *propertyGrid, QWidget *parent=0)
Constructor.
QHBoxLayout m_layout
The slider allowing modification of the integer value.
double m_min
The current minimum value.
Class building the base for all widgets representing properties.
A widget that holds a scene to display and modify the transfer function.
A class that stores a 1D transfer function which consists of a linear interpolation of alpha and colo...
The class managing the widget that wants to receive updates whenever a change occurrs.