Developer Documentation

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
65 #include <OpenFlipper/BasePlugin/BaseInterface.hh>
66 #include <OpenFlipper/BasePlugin/LoadSaveInterface.hh>
67 #include <OpenFlipper/BasePlugin/ToolboxInterface.hh>
68 #include <OpenFlipper/BasePlugin/ContextMenuInterface.hh>
69 #include <OpenFlipper/BasePlugin/ViewModeInterface.hh>
70 #include <OpenFlipper/BasePlugin/LoggingInterface.hh>
71
72 #include <OpenFlipper/common/Types.hh>
73
74
75 //== CLASS DEFINITION ============================================
76
77
78 class SplatCloudRenderingControlPlugin : public QObject, BaseInterface, LoadSaveInterface, ToolboxInterface, ContextMenuInterface, ViewModeInterface, LoggingInterface
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
90 signals:
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
111 public:
112
113 SplatCloudRenderingControlPlugin();
114
115 //-- Base Interface --
116 QString name() { return QString( "SplatCloud Rendering Control Plugin" ); }
117 QString description() { return QString( "Control over rendering of SplatClouds" ); }
118
119 private:
120
121 // toolbox options
122 QDoubleSpinBox *toolboxPointsizeScale_;
123 QSpinBox *toolboxDefaultColorR_;
124 QSpinBox *toolboxDefaultColorG_;
125 QSpinBox *toolboxDefaultColorB_;
126 QDoubleSpinBox *toolboxDefaultNormalX_;
127 QDoubleSpinBox *toolboxDefaultNormalY_;
128 QDoubleSpinBox *toolboxDefaultNormalZ_;
129 QDoubleSpinBox *toolboxDefaultPointsize_;
130
131 // context menu options
132 QAction *contextScaleAction_;
133 QAction *contextCullingAction_;
134 QAction *contextDefaultsAction_;
135 QAction *contextReloadShadersAction_;
136 QAction *contextRebuildVBOAction_;
137
138 // context menu scale widget options
139 QWidget *contextScaleWidget_;
140 QDoubleSpinBox *contextScaleWidgetPointsizeScale_;
141
142 // context menu defaults widget options
143 QWidget *contextDefaultsWidget_;
144 QSpinBox *contextDefaultsWidgetDefaultColorR_;
145 QSpinBox *contextDefaultsWidgetDefaultColorG_;
146 QSpinBox *contextDefaultsWidgetDefaultColorB_;
147 QDoubleSpinBox *contextDefaultsWidgetDefaultNormalX_;
148 QDoubleSpinBox *contextDefaultsWidgetDefaultNormalY_;
149 QDoubleSpinBox *contextDefaultsWidgetDefaultNormalZ_;
150 QDoubleSpinBox *contextDefaultsWidgetDefaultPointsize_;
151
152 private slots:
153
154 //-- Base Interface --
155 void initializePlugin();
156
157 //-- LoadSave Interface --
158 void addedEmptyObject( int _objectId );
159
160 //-- ContextMenu Interface --
161 void slotUpdateContextMenu( int _objectId );
162
163 // slot called when a toolbox option changed value
164 void slotToolboxPointsizeScaleValueChanged();
165 void slotToolboxDefaultColorValueChanged();
166 void slotToolboxDefaultNormalValueChanged();
167 void slotToolboxDefaultPointsizeValueChanged();
168
169 // slots called when a toolbox button was clicked
170 void slotToolboxEnableBackfaceCullingButtonClicked();
171 void slotToolboxDisableBackfaceCullingButtonClicked();
172 void slotToolboxReloadShadersButtonClicked();
173 void slotToolboxRebuildVBOsButtonClicked();
174 void slotToolboxPointSizeButtonClicked();
175 void slotToolboxGeometryShaderButtonClicked();
176
177 // slots called when a context menu action was triggered
178 void slotContextScaleActionTriggered();
179 void slotContextCullingActionTriggered();
180 void slotContextReloadShadersActionTriggered();
181 void slotContextRebuildVBOActionTriggered();
182 void slotContextDefaultsActionTriggered();
183
184 // slots called when a context menu scale widget option changed value
185 void slotContextScaleWidgetPointsizeScaleValueChanged();
186
187 // slots called when a context menu defaults widget option changed value
188 void slotContextDefaultsWidgetDefaultColorValueChanged();
189 void slotContextDefaultsWidgetDefaultNormalValueChanged();
190 void slotContextDefaultsWidgetDefaultPointsizeValueChanged();
191
192 public slots:
193
194 // -- Base Interface --
195 QString version() { return QString( "1.0" ); }
196 };
197
198
199 //================================================================
200
201
202 #endif // SPLATCLOUDRENDERINGCONTROLPLUGIN_HH
ToolboxInterface.hh
LoadSaveInterface.hh
ToolboxInterface
Plugins can add its own toolbox to the main widget&#39;s toolbox area by using this interface.
Definition: ToolboxInterface.hh:68
SplatCloudRenderingControlPlugin
Definition: SplatCloudRenderingControlPlugin.hh:78
Logtype
Logtype
Log types for Message Window.
Definition: LoggingInterface.hh:92
DataType
Predefined datatypes.
Definition: DataTypes.hh:83
LoggingInterface
Interface for all Plugins which do logging to the logging window of the framework.
Definition: LoggingInterface.hh:112
ViewModeInterface
Interface class for adding view modes to the ui.
Definition: ViewModeInterface.hh:60
LoggingInterface.hh
SplatCloudRenderingControlPlugin::description
QString description()
Return a description of what the plugin is doing.
Definition: SplatCloudRenderingControlPlugin.hh:117
ContextMenuType
ContextMenuType
Definition: ContextMenuInterface.hh:56
UpdateType
Update type class.
Definition: UpdateType.hh:60
SplatCloudRenderingControlPlugin::name
QString name()
Return a name for the plugin.
Definition: SplatCloudRenderingControlPlugin.hh:116
Types.hh
ContextMenuInterface.hh
ContextMenuInterface
Interface class for creating custom context menus.
Definition: ContextMenuInterface.hh:85
ViewModeInterface.hh
BaseInterface
Interface class from which all plugins have to be created.
Definition: BaseInterface.hh:65
BaseInterface.hh
LoadSaveInterface
Interface for all plugins which want to Load or Save files and create Objects.
Definition: LoadSaveInterface.hh:59