Developer Documentation
TypePolyhedralMesh.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: 13492 $ *
45 * $LastChangedBy: kremer $ *
46 * $Date: 2012-01-25 12:32:02 +0100 (Mi, 25 Jan 2012) $ *
47 * *
48 \*===========================================================================*/
49 
50 #ifndef TYPEPOLYHEDRALMESH_HH
51 #define TYPEPOLYHEDRALMESH_HH
52 
53 #include <QObject>
54 
64 
66 Q_OBJECT
67 Q_INTERFACES(BaseInterface)
68 Q_INTERFACES(LoadSaveInterface)
69 Q_INTERFACES(TypeInterface)
70 Q_INTERFACES(KeyInterface)
71 Q_INTERFACES(LoggingInterface)
72 Q_INTERFACES(ContextMenuInterface)
73 Q_INTERFACES(OptionsInterface)
74 
75 #if QT_VERSION >= 0x050000
76  Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-TypePolyhedralMesh")
77 #endif
78 
79 signals:
80  // Logging interface
81  void log(Logtype _type, QString _message);
82  void log(QString _message);
83 
84  // LoadSave Interface
85  void emptyObjectAdded(int _id);
86 
87  // ContextMenuInterface
88  void addContextMenuItem(QAction* /*_action*/, DataType /*_objectType*/, ContextMenuType /*_type*/);
89 
90 private slots:
91 
92  void noguiSupported() {}
93 
94  void pluginsInitialized();
95 
96  void slot_change_shrinkage();
97 
98  void slotKeyEvent(QKeyEvent* _event);
99 
100  void slotObjectUpdated(int _identifier, const UpdateType & _type);
101 
102  void objectDeleted(int _identifier);
103 
104  void slot_update_planes_in_scenegraph_node(int _deletedObject = -1);
105 
106  void switchRendering();
107 
108  void setTranslucencyFactor();
109 
110  // OptionsInterface
111  void applyOptions();
112 
113 public:
114 
115  // OptionsInterface
116  bool initializeOptionsWidget(QWidget*& _widget);
117 
119  }
120 
122 
123  QString name() {
124  return (QString("TypePolyhedralMesh"));
125  }
126 
127  QString description() {
128  return (QString(tr("Register Polyhedral Mesh Type")));
129  }
130 
131  bool registerType();
132 
133 public slots:
134 
135  QString version() {
136  return QString("1.0");
137  }
138 
139  // Type Interface
140  int addEmpty();
141 
142  DataType supportedType() {
143  return DATA_POLYHEDRAL_MESH;
144  }
145 
146 
147 private:
148 
149  QAction* render_switch_;
150 
151  QAction* translucency_factor_action_;
152 
153 private: // Options
154 
155  QWidget* optionsWidget_;
156  QDoubleSpinBox* scalingFactorSpinBox_;
157  QDoubleSpinBox* translucencyFactorSpinBox_;
158  QCheckBox* renderBoundaryCheckBox_;
159  const QString scalingFactorSettingName_;
160  const QString translucencyFactorSettingName_;
161  const QString renderBoundarySettingName_;
162 };
163 
164 #endif //TYPEPOLYHEDRALMESH_HH
Options Dialog interface.
Interface class for creating custom context menus.
Predefined datatypes.
Definition: DataTypes.hh:96
Logtype
Log types for Message Window.
Keyboard Event Interface.
Definition: KeyInterface.hh:76
#define DATA_POLYHEDRAL_MESH
Interface class for type definitions.
bool initializeOptionsWidget(QWidget *&_widget)
Initialize the Options Widget.
Interface class from which all plugins have to be created.
Update type class.
Definition: UpdateType.hh:70
Interface for all Plugins which do logging to the logging window of the framework.
QString name()
Return a name for the plugin.
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.