Developer Documentation
Loading...
Searching...
No Matches
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//
47// CLASS SplatCloudRenderingControlPlugin
48//
49// This class represents an OpenFlipper plugin controlling the rendering of SplatClouds.
50//
51//================================================================
52
53
54#ifndef SPLATCLOUDRENDERINGCONTROLPLUGIN_HH
55#define SPLATCLOUDRENDERINGCONTROLPLUGIN_HH
56
57
58//== INCLUDES ====================================================
59
60
61#include <QObject>
62#include <QDoubleSpinBox>
63#include <QSpinBox>
64
71
73
74
75//== CLASS DEFINITION ============================================
76
77
79{
80 Q_OBJECT
81 Q_INTERFACES( BaseInterface )
82 Q_INTERFACES( LoadSaveInterface )
83 Q_INTERFACES( ToolboxInterface )
84 Q_INTERFACES( ContextMenuInterface )
85 Q_INTERFACES( ViewModeInterface )
86 Q_INTERFACES( LoggingInterface )
87
88 Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-SplatCloudRenderingControl")
89
90signals:
91
92 //-- Base Interface --
93 void updatedObject( int _objectId, const UpdateType &_type );
94
95 //-- Toolbox Interface --
96 void addToolbox( QString _name, QWidget *_widget, QIcon *_icon );
97
98 //-- ContextMenu Interface--
99 void addContextMenuItem( QAction *_action, DataType _objectType, ContextMenuType _type );
100
101 //-- ViewMode Interface--
102 void defineViewModeToolboxes ( QString _mode, QStringList _usedWidgets );
103 void defineViewModeToolbars ( QString _mode, QStringList _usedToolbars );
104 void defineViewModeContextMenus( QString _mode, QStringList _usedContextMenus );
105 void defineViewModeIcon ( QString _mode, QString _iconName );
106
107 //-- Logging Interface --
108 void log( QString _message );
109 void log( Logtype _type, QString _message );
110
111public:
112
115
116 //-- Base Interface --
117 QString name() { return QString( "SplatCloud Rendering Control Plugin" ); }
118 QString description() { return QString( "Control over rendering of SplatClouds" ); }
119
120private:
121
122 // toolbox options
123 QDoubleSpinBox *toolboxPointsizeScale_;
124 QSpinBox *toolboxDefaultColorR_;
125 QSpinBox *toolboxDefaultColorG_;
126 QSpinBox *toolboxDefaultColorB_;
127 QDoubleSpinBox *toolboxDefaultNormalX_;
128 QDoubleSpinBox *toolboxDefaultNormalY_;
129 QDoubleSpinBox *toolboxDefaultNormalZ_;
130 QDoubleSpinBox *toolboxDefaultPointsize_;
131
132 // context menu options
133 QAction *contextScaleAction_;
134 QAction *contextCullingAction_;
135 QAction *contextDefaultsAction_;
136 QAction *contextReloadShadersAction_;
137 QAction *contextRebuildVBOAction_;
138 QIcon* toolboxIcon_;
139
140 // context menu scale widget options
141 QWidget *contextScaleWidget_;
142 QDoubleSpinBox *contextScaleWidgetPointsizeScale_;
143
144 // context menu defaults widget options
145 QWidget *contextDefaultsWidget_;
146 QSpinBox *contextDefaultsWidgetDefaultColorR_;
147 QSpinBox *contextDefaultsWidgetDefaultColorG_;
148 QSpinBox *contextDefaultsWidgetDefaultColorB_;
149 QDoubleSpinBox *contextDefaultsWidgetDefaultNormalX_;
150 QDoubleSpinBox *contextDefaultsWidgetDefaultNormalY_;
151 QDoubleSpinBox *contextDefaultsWidgetDefaultNormalZ_;
152 QDoubleSpinBox *contextDefaultsWidgetDefaultPointsize_;
153
154private slots:
155
156 //-- Base Interface --
157 void initializePlugin();
158
159 //-- LoadSave Interface --
160 void addedEmptyObject( int _objectId );
161
162 //-- ContextMenu Interface --
163 void slotUpdateContextMenu( int _objectId );
164
165 // slot called when a toolbox option changed value
166 void slotToolboxPointsizeScaleValueChanged();
167 void slotToolboxDefaultColorValueChanged();
168 void slotToolboxDefaultNormalValueChanged();
169 void slotToolboxDefaultPointsizeValueChanged();
170
171 // slots called when a toolbox button was clicked
172 void slotToolboxEnableBackfaceCullingButtonClicked();
173 void slotToolboxDisableBackfaceCullingButtonClicked();
174 void slotToolboxReloadShadersButtonClicked();
175 void slotToolboxRebuildVBOsButtonClicked();
176 void slotToolboxPointSizeButtonClicked();
177 void slotToolboxGeometryShaderButtonClicked();
178
179 // slots called when a context menu action was triggered
180 void slotContextScaleActionTriggered();
181 void slotContextCullingActionTriggered();
182 void slotContextReloadShadersActionTriggered();
183 void slotContextRebuildVBOActionTriggered();
184 void slotContextDefaultsActionTriggered();
185
186 // slots called when a context menu scale widget option changed value
187 void slotContextScaleWidgetPointsizeScaleValueChanged();
188
189 // slots called when a context menu defaults widget option changed value
190 void slotContextDefaultsWidgetDefaultColorValueChanged();
191 void slotContextDefaultsWidgetDefaultNormalValueChanged();
192 void slotContextDefaultsWidgetDefaultPointsizeValueChanged();
193
194public slots:
195
196 // -- Base Interface --
197 QString version() { return QString( "1.0" ); }
198};
199
200
201//================================================================
202
203
204#endif // SPLATCLOUDRENDERINGCONTROLPLUGIN_HH
Logtype
Log types for Message Window.
Interface class from which all plugins have to be created.
Interface class for creating custom context menus.
Predefined datatypes.
Definition DataTypes.hh:83
Interface for all plugins which want to Load or Save files and create Objects.
Interface for all Plugins which do logging to the logging window of the framework.
QString name()
Return a name for the plugin.
QString description()
Return a description of what the plugin is doing.
Plugins can add its own toolbox to the main widget's toolbox area by using this interface.
Update type class.
Definition UpdateType.hh:59
Interface class for adding view modes to the ui.