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