Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SplatCloudRenderingControlPlugin.hh
1 //================================================================
2 //
3 /*===========================================================================*\
4 * *
5 * OpenFlipper *
6  * Copyright (c) 2001-2015, RWTH-Aachen University *
7  * Department of Computer Graphics and Multimedia *
8  * All rights reserved. *
9  * www.openflipper.org *
10  * *
11  *---------------------------------------------------------------------------*
12  * This file is part of OpenFlipper. *
13  *---------------------------------------------------------------------------*
14  * *
15  * Redistribution and use in source and binary forms, with or without *
16  * modification, are permitted provided that the following conditions *
17  * are met: *
18  * *
19  * 1. Redistributions of source code must retain the above copyright notice, *
20  * this list of conditions and the following disclaimer. *
21  * *
22  * 2. Redistributions in binary form must reproduce the above copyright *
23  * notice, this list of conditions and the following disclaimer in the *
24  * documentation and/or other materials provided with the distribution. *
25  * *
26  * 3. Neither the name of the copyright holder nor the names of its *
27  * contributors may be used to endorse or promote products derived from *
28  * this software without specific prior written permission. *
29  * *
30  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
31  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
32  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
33  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
34  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
35  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
36  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
37  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
38  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
39  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
40  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
41 * *
42 \*===========================================================================*/
43 
44 /*===========================================================================*\
45 * *
46 * $Revision: 12588 $ *
47 * $LastChangedBy: moebius $ *
48 * $Date: 2011-10-13 12:41:04 +0200 (Do, 13 Okt 2011) $ *
49 * *
50 \*===========================================================================*/
51 
52 
53 //================================================================
54 //
55 // CLASS SplatCloudRenderingControlPlugin
56 //
57 // This class represents an OpenFlipper plugin controlling the rendering of SplatClouds.
58 //
59 //================================================================
60 
61 
62 #ifndef SPLATCLOUDRENDERINGCONTROLPLUGIN_HH
63 #define SPLATCLOUDRENDERINGCONTROLPLUGIN_HH
64 
65 
66 //== INCLUDES ====================================================
67 
68 
69 #include <QObject>
70 
77 
79 
80 
81 //== CLASS DEFINITION ============================================
82 
83 
85 {
86  Q_OBJECT
87  Q_INTERFACES( BaseInterface )
88  Q_INTERFACES( LoadSaveInterface )
89  Q_INTERFACES( ToolboxInterface )
90  Q_INTERFACES( ContextMenuInterface )
91  Q_INTERFACES( ViewModeInterface )
92  Q_INTERFACES( LoggingInterface )
93 
94 #if QT_VERSION >= 0x050000
95  Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-SplatCloudRenderingControl")
96 #endif
97 
98 signals:
99 
100  //-- Base Interface --
101  void updatedObject( int _objectId, const UpdateType &_type );
102 
103  //-- Toolbox Interface --
104  void addToolbox( QString _name, QWidget *_widget, QIcon *_icon );
105 
106  //-- ContextMenu Interface--
107  void addContextMenuItem( QAction *_action, DataType _objectType, ContextMenuType _type );
108 
109  //-- ViewMode Interface--
110  void defineViewModeToolboxes ( QString _mode, QStringList _usedWidgets );
111  void defineViewModeToolbars ( QString _mode, QStringList _usedToolbars );
112  void defineViewModeContextMenus( QString _mode, QStringList _usedContextMenus );
113  void defineViewModeIcon ( QString _mode, QString _iconName );
114 
115  //-- Logging Interface --
116  void log( QString _message );
117  void log( Logtype _type, QString _message );
118 
119 public:
120 
122 
123  //-- Base Interface --
124  QString name() { return QString( "SplatCloud Rendering Control Plugin" ); }
125  QString description() { return QString( "Control over rendering of SplatClouds" ); }
126 
127 private:
128 
129  // toolbox options
130  QDoubleSpinBox *toolboxPointsizeScale_;
131  QSpinBox *toolboxDefaultColorR_;
132  QSpinBox *toolboxDefaultColorG_;
133  QSpinBox *toolboxDefaultColorB_;
134  QDoubleSpinBox *toolboxDefaultNormalX_;
135  QDoubleSpinBox *toolboxDefaultNormalY_;
136  QDoubleSpinBox *toolboxDefaultNormalZ_;
137  QDoubleSpinBox *toolboxDefaultPointsize_;
138 
139  // context menu options
140  QAction *contextScaleAction_;
141  QAction *contextCullingAction_;
142  QAction *contextDefaultsAction_;
143  QAction *contextReloadShadersAction_;
144  QAction *contextRebuildVBOAction_;
145 
146  // context menu scale widget options
147  QWidget *contextScaleWidget_;
148  QDoubleSpinBox *contextScaleWidgetPointsizeScale_;
149 
150  // context menu defaults widget options
151  QWidget *contextDefaultsWidget_;
152  QSpinBox *contextDefaultsWidgetDefaultColorR_;
153  QSpinBox *contextDefaultsWidgetDefaultColorG_;
154  QSpinBox *contextDefaultsWidgetDefaultColorB_;
155  QDoubleSpinBox *contextDefaultsWidgetDefaultNormalX_;
156  QDoubleSpinBox *contextDefaultsWidgetDefaultNormalY_;
157  QDoubleSpinBox *contextDefaultsWidgetDefaultNormalZ_;
158  QDoubleSpinBox *contextDefaultsWidgetDefaultPointsize_;
159 
160 private slots:
161 
162  //-- Base Interface --
163  void initializePlugin();
164 
165  //-- LoadSave Interface --
166  void addedEmptyObject( int _objectId );
167 
168  //-- ContextMenu Interface --
169  void slotUpdateContextMenu( int _objectId );
170 
171  // slot called when a toolbox option changed value
172  void slotToolboxPointsizeScaleValueChanged();
173  void slotToolboxDefaultColorValueChanged();
174  void slotToolboxDefaultNormalValueChanged();
175  void slotToolboxDefaultPointsizeValueChanged();
176 
177  // slots called when a toolbox button was clicked
178  void slotToolboxEnableBackfaceCullingButtonClicked();
179  void slotToolboxDisableBackfaceCullingButtonClicked();
180  void slotToolboxReloadShadersButtonClicked();
181  void slotToolboxRebuildVBOsButtonClicked();
182 
183  // slots called when a context menu action was triggered
184  void slotContextScaleActionTriggered();
185  void slotContextCullingActionTriggered();
186  void slotContextReloadShadersActionTriggered();
187  void slotContextRebuildVBOActionTriggered();
188  void slotContextDefaultsActionTriggered();
189 
190  // slots called when a context menu scale widget option changed value
191  void slotContextScaleWidgetPointsizeScaleValueChanged();
192 
193  // slots called when a context menu defaults widget option changed value
194  void slotContextDefaultsWidgetDefaultColorValueChanged();
195  void slotContextDefaultsWidgetDefaultNormalValueChanged();
196  void slotContextDefaultsWidgetDefaultPointsizeValueChanged();
197 
198 public slots:
199 
200  // -- Base Interface --
201  QString version() { return QString( "1.0" ); }
202 };
203 
204 
205 //================================================================
206 
207 
208 #endif // SPLATCLOUDRENDERINGCONTROLPLUGIN_HH
Interface class from which all plugins have to be created.
Logtype
Log types for Message Window.
Update type class.
Definition: UpdateType.hh:70
Interface for all Plugins which do logging to the logging window of the framework.
Interface for all plugins which want to Load or Save files and create Objects.
QString description()
Return a description of what the plugin is doing.
QString name()
Return a name for the plugin.
Interface class for creating custom context menus.
Plugins can add its own toolbox to the main widget's toolbox area by using this interface.
Predefined datatypes.
Definition: DataTypes.hh:96
Interface class for adding view modes to the ui.