Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TypeSplatCloud.hh
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 /*===========================================================================*\
43 * *
44 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 //================================================================
51 //
52 // CLASS TypeSplatCloudPlugin
53 //
54 // This class represents an OpenFlipper plugin for a new node named SplatCloud.
55 //
56 //================================================================
57 
58 
59 #ifndef TYPESPLATCLOUDPLUGIN_HH
60 #define TYPESPLATCLOUDPLUGIN_HH
61 
62 
63 //== INCLUDES ====================================================
64 
65 
66 #include <QObject>
67 
73 
75 
79 
80 
81 //== CLASS DEFINITION ============================================
82 
83 
85 {
86  Q_OBJECT
87  Q_INTERFACES( BaseInterface )
88  Q_INTERFACES( LoadSaveInterface )
89  Q_INTERFACES( LoggingInterface )
90  Q_INTERFACES( TypeInterface )
91  Q_INTERFACES( RPCInterface )
92 
93 #if QT_VERSION >= 0x050000
94  Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-TypeSplatCloud")
95 #endif
96 
97 signals:
98 
99  //-- Type Interface --
100  void emptyObjectAdded( int _objectId );
101 
102  //-- LoadSave Interface --
103  void addEmptyObject( DataType _type, int &_objectId );
104  void deleteObject( int _objectId );
105 
106  //-- Logging Interface --
107  void log( QString _message );
108  void log( Logtype _type, QString _message );
109 
110 public slots:
111 
112  //-- Base Interface --
113  QString version() { return QString( "1.0" ); };
114 
115  //-- Type Interface --
116  int addEmpty();
118  void generateBackup( int _objectId, QString _name, UpdateType _type );
119 
120 private slots:
121 
122  // -- Base Inferface --
123  void noguiSupported() { }
124  void slotViewChanged();
125  void slotObjectPropertiesChanged( int _objectId );
126  void slotObjectUpdated ( int _objectId, const UpdateType &_updateType );
127 
128  //-- LoadSave Interface --
129  void objectDeleted( int _objectId );
130 
131 public:
132 
133  // standard constructor/destructor
135  ~TypeSplatCloudPlugin() { }
136 
137  //-- Base Interface --
138  QString name() { return QString( "TypeSplatCloud" ); };
139  QString description() { return QString( tr( "Register SplatCloud type" ) ); };
140 
141  // -- Type Interface --
142  bool registerType();
143 
144 private:
145 
146  // ungroup group-object
147  void ungroupGroupObject( GroupObject *_groupObject );
148 
149  // get group-objects
150  GroupObject *getCamerasGroupObject ( const SplatCloud_CameraManager &_cameraManager );
151  GroupObject *getClustersGroupObject( const SplatCloud_ClusterManager &_clusterManager );
152 
153  // ungroup objects
154  void ungroupCameraObjects ( const SplatCloud_CameraManager &_cameraManager );
155  void ungroupClusterObjects( const SplatCloud_ClusterManager &_clusterManager );
156 
157  // group objects
158  void groupCameraObjects ( const SplatCloud_CameraManager &_cameraManager );
159  void groupClusterObjects( const SplatCloud_ClusterManager &_clusterManager );
160 
161  // add objects
162  void addCameraObjects ( SplatCloudObject *_splatCloudObject );
163  void addClusterObjects ( SplatCloudObject *_splatCloudObject );
164 
165  // free objects
166  void freeCameraObjects ( SplatCloudObject *_splatCloudObject );
167  void freeClusterObjects( SplatCloudObject *_splatCloudObject );
168 
169  // erase camera
170  void eraseCamera( CameraObject *_cameraObject );
171 
172  ACG::SceneGraph::DrawModes::DrawMode splatsDrawMode_;
174 };
175 
176 
177 //================================================================
178 
179 
180 #endif // TYPESPLATCLOUDPLUGIN_HH
Interface to call functions across plugins.
Definition: RPCInterface.hh:71
void generateBackup(int _objectId, QString _name, UpdateType _type)
This slot should be implemented in a TypePlugin to generate type specific backups.
QString description()
Return a description of what the plugin is doing.
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.
Update type class.
Definition: UpdateType.hh:70
Interface class for type definitions.
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
int addEmpty()
Create an empty object.
Interface class from which all plugins have to be created.
Logtype
Log types for Message Window.
Predefined datatypes.
Definition: DataTypes.hh:96
#define DATA_SPLATCLOUD
Definition: SplatCloud.hh:65
QString name()
Return a name for the plugin.