Developer Documentation
MeshComparePlugin.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
45
46
47#ifndef MESHCOMPAREPLUGIN_HH
48#define MESHCOMPAREPLUGIN_HH
49
55#include <OpenFlipper/BasePlugin/TextureInterface.hh>
59
60#include <ACG/Scenegraph/PointNode.hh>
61
62#include "MeshCompareToolbarWidget.hh"
63
64#include "QChartsPlot.hh"
65
67{
68 Q_OBJECT
69 Q_INTERFACES(BaseInterface)
70 Q_INTERFACES(ToolboxInterface)
71 Q_INTERFACES(LoggingInterface)
72 Q_INTERFACES(ScriptInterface)
73 Q_INTERFACES(BackupInterface)
74 Q_INTERFACES(TextureInterface)
75 Q_INTERFACES(RPCInterface)
76 Q_INTERFACES(PythonInterface)
77
78 Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-MeshCompare")
79
80 signals:
81 //BaseInterface
82 void updateView();
83 void updatedObject(int _id, const UpdateType& _type);
84 void setSlotDescription(QString _slotName, QString _slotDescription,
85 QStringList _parameters, QStringList _descriptions);
86
87 //LoggingInterface
88 void log(Logtype _type, QString _message);
89 void log(QString _message);
90
91 // ToolboxInterface
92 void addToolbox( QString _name , QWidget* _widget ,QIcon* _icon);
93
94 // BackupInterface
95 void createBackup( int _id , QString _name, UpdateType _type = UPDATE_ALL );
96
97 // RPC Interface
98 void pluginExists( QString _pluginName , bool& _exists );
99
100 public:
101
104
105 // BaseInterface
106 QString name() { return (QString("MeshCompare")); };
107 QString description( ) { return (QString("Compare two meshes")); };
108 bool eventFilter(QObject *obj, QEvent *event) override;
109
110 private slots:
111
112 void initializePlugin();
113 void pluginsInitialized();
114
116 void compareButton();
117
119 void slotClear();
120
122 void slotObjectUpdated( int _identifier, const UpdateType& _type );
123
124 void noguiSupported( ) {} ;
125
126 // Scriptable functions
127 public slots:
128
129 QString version() { return QString("1.0"); };
130
143 void compare(int _sourceId,int _targetId,
144 bool _computeDist = true,
145 bool _computeNormal = true,
146 bool _computeGauss = true,
147 bool _computeMean = true,
148 bool _selection_ = false);
149
152
155
158
161
162 private slots:
163
165 void slotClampBox(bool _checked);
166
167 private:
168
177 void visualizeData( const std::vector<double>& _data, double _maxValue, ACG::SceneGraph::PointNode* _pnode);
178
179 private:
182
184 QIcon* toolIcon_;
185
188
191
194
197
198 QChartsPlot* plot_;
199
200};
201
202#endif //MESHCOMPAREPLUGIN_HH
Logtype
Log types for Message Window.
Interface class for backup handling.
Interface class from which all plugins have to be created.
Interface for all Plugins which do logging to the logging window of the framework.
QString name()
Return a name for the plugin.
void slotObjectUpdated(int _identifier, const UpdateType &_type)
Called when an object gets updated.
MeshCompareToolbarWidget * tool_
The toolbar widget of this plugin.
void compare(int _sourceId, int _targetId, bool _computeDist=true, bool _computeNormal=true, bool _computeGauss=true, bool _computeMean=true, bool _selection_=false)
QString description()
Return a description of what the plugin is doing.
double maxGaussCurvatureDev_
Last maximal gauss curvature deviation.
void slotClear()
Clears the visualization.
double lastMaximalDistance()
Get the maximal distance of the last comparison (-1, if no comparison performed so far)
void compareButton()
Triggers comparison of the selected meshes.
double lastMaximalGaussCurvatureDeviation()
Get the maximal gauss curvature deviation of the last comparison (-1, if no comparison performed so f...
double maxMeanCurvatureDev_
Last maximal mean curvature deviation.
void visualizeData(const std::vector< double > &_data, double _maxValue, ACG::SceneGraph::PointNode *_pnode)
Visualize data.
QIcon * toolIcon_
Icon for the toolbar.
double maximalDistance_
Last maximal computed distance.
double maxNormalDeviation_
Last maximal computed normal deviation in degree.
double lastMaximalMeanCurvatureDeviation()
Get the maximal mean curvature deviation of the last comparison (-1, if no comparison performed so fa...
double lastMaximalNormalDeviation()
Get the maximal normal deviation of the last comparison in degree (-1, if no comparison performed so ...
void slotClampBox(bool _checked)
If the checkbox is changed to be checked, the values in the labels will be written into the spin boxe...
Interface class for exporting functions to python.
Interface to call functions across plugins.
Definition: RPCInterface.hh:61
Interface for all Plugins which provide scriptable Functions.
Provide texture support for a plugin.
Plugins can add its own toolbox to the main widget's toolbox area by using this interface.
Update type class.
Definition: UpdateType.hh:59
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.