Developer Documentation

BaseInterface.hh
Go to the documentation of this file.
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openflipper.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenFlipper. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41
42 #pragma once
43
44 #include <OpenFlipper/common/Types.hh>
45
46
65 class BaseInterface {
66
67 //===========================================================================
72 //===========================================================================
73
74 private slots:
83 virtual void initializePlugin() {};
84
91 virtual void pluginsInitialized() {};
92
101 virtual void pluginsInitialized(QVector<QPair<QString, QString>> const& _pluginOptions) {};
102
103
106 //===========================================================================
112 //===========================================================================
113
114 signals :
122 virtual void updateView() {};
123
133 virtual void blockScenegraphUpdates(bool _block) {};
134
146 virtual void updatedObject(int _objectId) {};
147
160 virtual void updatedObject(int _identifier, const UpdateType& _type) {};
161
169 virtual void nodeVisibilityChanged( int _identifier ) {};
170
171 private slots:
172
185 virtual void slotObjectUpdated( int _identifier ) {};
186
200 virtual void slotObjectUpdated( int _identifier, const UpdateType& _type ) {};
201
208 virtual void slotAllCleared( ) {};
209
217 virtual void slotObjectSelectionChanged( int _identifier ) {};
218
226 virtual void slotVisibilityChanged( int _identifier ) {};
227
235 virtual void slotObjectPropertiesChanged( int _identifier ) {};
236
244 virtual void slotViewChanged() {};
245
256 virtual void slotSceneDrawn() {};
257
262 virtual void slotDrawModeChanged(int _viewerId) {};
265 //===========================================================================
268 //===========================================================================
269 public :
270
275 virtual QString name() = 0;
276
281 virtual QString description() = 0;
282
283 public slots:
291 virtual QString version() { return QString("-1"); };
292
293 signals:
294
305 virtual void setSlotDescription(QString _slotName , QString _slotDescription,
306 QStringList _parameters , QStringList _descriptions) {};
307
310 //===========================================================================
313 //===========================================================================
314 signals:
315
321 virtual void setRenderer(unsigned int _viewer, QString _rendererName) {};
322
328 virtual void getCurrentRenderer(unsigned int _viewer, QString& _rendererName) {};
329
332 public slots :
333
337 virtual void exit(){};
338
343 virtual void noguiSupported( ) {} ;
344
345 public :
346
348 virtual ~BaseInterface() {};
349
350 };
351
352
468 Q_DECLARE_INTERFACE(BaseInterface,"OpenFlipper.BaseInterface/1.0")
469
BaseInterface::~BaseInterface
virtual ~BaseInterface()
Destructor.
Definition: BaseInterface.hh:348
BaseInterface::updateView
virtual void updateView()
Update current view in Main Application.
Definition: BaseInterface.hh:122
BaseInterface::updatedObject
virtual void updatedObject(int _identifier, const UpdateType &_type)
An object has been changed or added by this plugin.
Definition: BaseInterface.hh:160
BaseInterface::setSlotDescription
virtual void setSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
Set a description for a public slot.
Definition: BaseInterface.hh:305
BaseInterface::initializePlugin
virtual void initializePlugin()
Initialize Plugin.
Definition: BaseInterface.hh:83
BaseInterface::slotAllCleared
virtual void slotAllCleared()
Called if the whole scene is cleared.
Definition: BaseInterface.hh:208
BaseInterface::slotObjectSelectionChanged
virtual void slotObjectSelectionChanged(int _identifier)
The active object has changed.
Definition: BaseInterface.hh:217
BaseInterface::slotSceneDrawn
virtual void slotSceneDrawn()
triggered after a scene has been drawn
Definition: BaseInterface.hh:256
BaseInterface::slotDrawModeChanged
virtual void slotDrawModeChanged(int _viewerId)
A viewer changed its draw mode.
Definition: BaseInterface.hh:262
BaseInterface::getCurrentRenderer
virtual void getCurrentRenderer(unsigned int _viewer, QString &_rendererName)
Get the current renderer for the given viewer.
Definition: BaseInterface.hh:328
BaseInterface::slotObjectUpdated
virtual void slotObjectUpdated(int _identifier)
An object has been updated by another plugin.
Definition: BaseInterface.hh:185
BaseInterface::name
virtual QString name()=0
Return a name for the plugin.
BaseInterface::version
virtual QString version()
Return a version string for your plugin.
Definition: BaseInterface.hh:291
BaseInterface::exit
virtual void exit()
Definition: BaseInterface.hh:337
BaseInterface::slotObjectPropertiesChanged
virtual void slotObjectPropertiesChanged(int _identifier)
Object properties have been changed.
Definition: BaseInterface.hh:235
BaseInterface::nodeVisibilityChanged
virtual void nodeVisibilityChanged(int _identifier)
A scenegraph node has been shown or hidden.
Definition: BaseInterface.hh:169
BaseInterface::description
virtual QString description()=0
Return a description of what the plugin is doing.
BaseInterface::pluginsInitialized
virtual void pluginsInitialized(QVector< QPair< QString, QString >> const &_pluginOptions)
Initialize Plugin step 2 alternative.
Definition: BaseInterface.hh:101
UpdateType
Update type class.
Definition: UpdateType.hh:60
BaseInterface::updatedObject
virtual void updatedObject(int _objectId)
An object has been changed or added by this plugin.
Definition: BaseInterface.hh:146
BaseInterface::slotViewChanged
virtual void slotViewChanged()
View has changed.
Definition: BaseInterface.hh:244
BaseInterface::blockScenegraphUpdates
virtual void blockScenegraphUpdates(bool _block)
Tell the core to prevent scenegraph updates.
Definition: BaseInterface.hh:133
BaseInterface::slotVisibilityChanged
virtual void slotVisibilityChanged(int _identifier)
An object has been shown or hidden.
Definition: BaseInterface.hh:226
BaseInterface::setRenderer
virtual void setRenderer(unsigned int _viewer, QString _rendererName)
Set a renderer for the given viewer.
Definition: BaseInterface.hh:321
BaseInterface::noguiSupported
virtual void noguiSupported()
Definition: BaseInterface.hh:343
Types.hh
BaseInterface::pluginsInitialized
virtual void pluginsInitialized()
Initialize Plugin step 2.
Definition: BaseInterface.hh:91
BaseInterface
Interface class from which all plugins have to be created.
Definition: BaseInterface.hh:65
BaseInterface::slotObjectUpdated
virtual void slotObjectUpdated(int _identifier, const UpdateType &_type)
An object has been updated by another plugin.
Definition: BaseInterface.hh:200