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 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 
51 
52 
53 #ifndef MESHCOMPAREPLUGIN_HH
54 #define MESHCOMPAREPLUGIN_HH
55 
61 #include <OpenFlipper/BasePlugin/TextureInterface.hh>
64 
65 #include <ACG/Scenegraph/PointNode.hh>
66 
67 #include "MeshCompareToolbarWidget.hh"
68 
69 #ifdef WITH_QWT
70  #include "QwtFunctionPlot.hh"
71 #endif
72 
74 {
75  Q_OBJECT
76  Q_INTERFACES(BaseInterface)
77  Q_INTERFACES(ToolboxInterface)
78  Q_INTERFACES(LoggingInterface)
79  Q_INTERFACES(ScriptInterface)
80  Q_INTERFACES(BackupInterface)
81  Q_INTERFACES(TextureInterface)
82  Q_INTERFACES(RPCInterface)
83 
84 #if QT_VERSION >= 0x050000
85  Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-MeshCompare")
86 #endif
87 
88  signals:
89  //BaseInterface
90  void updateView();
91  void updatedObject(int _id, const UpdateType& _type);
92  void setSlotDescription(QString _slotName, QString _slotDescription,
93  QStringList _parameters, QStringList _descriptions);
94 
95  //LoggingInterface
96  void log(Logtype _type, QString _message);
97  void log(QString _message);
98 
99  // ToolboxInterface
100  void addToolbox( QString _name , QWidget* _widget ,QIcon* _icon);
101 
102  // BackupInterface
103  void createBackup( int _id , QString _name, UpdateType _type = UPDATE_ALL );
104 
105  // RPC Interface
106  void pluginExists( QString _pluginName , bool& _exists );
107 
108  public:
109 
112 
113  // BaseInterface
114  QString name() { return (QString("Mesh Compare")); };
115  QString description( ) { return (QString("Compare two meshes")); };
116 
117  private slots:
118 
119  void initializePlugin();
120  void pluginsInitialized();
121 
123  void compareButton();
124 
126  void slotClear();
127 
129  void slotObjectUpdated( int _identifier, const UpdateType& _type );
130 
131  void noguiSupported( ) {} ;
132 
133  // Scriptable functions
134  public slots:
135 
136  QString version() { return QString("1.0"); };
137 
149  void compare(int _sourceId,int _targetId,
150  bool _computeDist = true,
151  bool _computeNormal = true,
152  bool _computeGauss = true ,
153  bool _computeMean = true);
154 
156  double lastMaximalDistance() { return maximalDistance_; };
157 
160 
163 
166 
167  private slots:
168 
170  void slotClampBox(bool _checked);
171 
172  private:
173 
182  void visualizeData( const std::vector<double>& _data, double _maxValue, ACG::SceneGraph::PointNode* _pnode);
183 
184  private:
187 
190 
193 
196 
199 
200  #ifdef WITH_QWT
201  QwtFunctionPlot* plot_;
202  #endif
203 
204 };
205 
206 #endif //MESHCOMPAREPLUGIN_HH
void slotClampBox(bool _checked)
If the checkbox is changed to be checked, the values in the labels will be written into the spin boxe...
double maximalDistance_
Last maximal computed distance.
void slotClear()
Clears the visualization.
Logtype
Log types for Message Window.
double maxGaussCurvatureDev_
Last maximal gauss curvature deviation.
double lastMaximalGaussCurvatureDeviation()
Get the maximal gauss curvature deviation of the last comparison (-1, if no comparison performed so f...
void compareButton()
Triggers comparison of the selected meshes.
void visualizeData(const std::vector< double > &_data, double _maxValue, ACG::SceneGraph::PointNode *_pnode)
Visualize data.
QString description()
Return a description of what the plugin is doing.
Interface for all Plugins which provide scriptable Functions.
Interface class from which all plugins have to be created.
Update type class.
Definition: UpdateType.hh:70
Plugins can add its own toolbox to the main widget&#39;s toolbox area by using this interface.
Interface for all Plugins which do logging to the logging window of the framework.
double lastMaximalMeanCurvatureDeviation()
Get the maximal mean curvature deviation of the last comparison (-1, if no comparison performed so fa...
Provide texture support for a plugin.
void slotObjectUpdated(int _identifier, const UpdateType &_type)
Called when an object gets updated.
double maxNormalDeviation_
Last maximal computed normal deviation in degree.
MeshCompareToolbarWidget * tool_
The toolbar widget of this plugin.
double lastMaximalNormalDeviation()
Get the maximal normal deviation of the last comparison in degree (-1, if no comparison performed so ...
QString name()
Return a name for the plugin.
double maxMeanCurvatureDev_
Last maximal mean curvature deviation.
double lastMaximalDistance()
Get the maximal distance of the last comparison (-1, if no comparison performed so far) ...
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void compare(int _sourceId, int _targetId, bool _computeDist=true, bool _computeNormal=true, bool _computeGauss=true, bool _computeMean=true)
Interface to call functions across plugins.
Definition: RPCInterface.hh:71
Interface class for backup handling.