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>
58 
59 #include <ACG/Scenegraph/PointNode.hh>
60 
61 #include "MeshCompareToolbarWidget.hh"
62 
63 #ifdef WITH_QWT
64  #include "QwtFunctionPlot.hh"
65 #endif
66 
68 {
69  Q_OBJECT
70  Q_INTERFACES(BaseInterface)
71  Q_INTERFACES(ToolboxInterface)
72  Q_INTERFACES(LoggingInterface)
73  Q_INTERFACES(ScriptInterface)
74  Q_INTERFACES(BackupInterface)
75  Q_INTERFACES(TextureInterface)
76  Q_INTERFACES(RPCInterface)
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("Mesh Compare")); };
107  QString description( ) { return (QString("Compare two meshes")); };
108 
109  private slots:
110 
111  void initializePlugin();
112  void pluginsInitialized();
113 
115  void compareButton();
116 
118  void slotClear();
119 
121  void slotObjectUpdated( int _identifier, const UpdateType& _type );
122 
123  void noguiSupported( ) {} ;
124 
125  // Scriptable functions
126  public slots:
127 
128  QString version() { return QString("1.0"); };
129 
141  void compare(int _sourceId,int _targetId,
142  bool _computeDist = true,
143  bool _computeNormal = true,
144  bool _computeGauss = true ,
145  bool _computeMean = true);
146 
148  double lastMaximalDistance() { return maximalDistance_; };
149 
152 
155 
158 
159  private slots:
160 
162  void slotClampBox(bool _checked);
163 
164  private:
165 
174  void visualizeData( const std::vector<double>& _data, double _maxValue, ACG::SceneGraph::PointNode* _pnode);
175 
176  private:
179 
182 
185 
188 
191 
192  #ifdef WITH_QWT
193  QwtFunctionPlot* plot_;
194  #endif
195 
196 };
197 
198 #endif //MESHCOMPAREPLUGIN_HH
Update type class.
Definition: UpdateType.hh:60
Interface to call functions across plugins.
Definition: RPCInterface.hh:61
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void slotObjectUpdated(int _identifier, const UpdateType &_type)
Called when an object gets updated.
Logtype
Log types for Message Window.
QString description()
Return a description of what the plugin is doing.
void compare(int _sourceId, int _targetId, bool _computeDist=true, bool _computeNormal=true, bool _computeGauss=true, bool _computeMean=true)
Interface for all Plugins which provide scriptable Functions.
Provide texture support for a plugin.
double maxMeanCurvatureDev_
Last maximal mean curvature deviation.
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.
double lastMaximalGaussCurvatureDeviation()
Get the maximal gauss curvature deviation of the last comparison (-1, if no comparison performed so f...
double maxNormalDeviation_
Last maximal computed normal deviation in degree.
double maximalDistance_
Last maximal computed distance.
double lastMaximalNormalDeviation()
Get the maximal normal deviation of the last comparison in degree (-1, if no comparison performed so ...
Plugins can add its own toolbox to the main widget&#39;s toolbox area by using this interface.
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.
Interface class from which all plugins have to be created.
void slotClear()
Clears the visualization.
void compareButton()
Triggers comparison of the selected meshes.
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) ...
Interface class for backup handling.
double maxGaussCurvatureDev_
Last maximal gauss curvature deviation.
double lastMaximalMeanCurvatureDeviation()
Get the maximal mean curvature deviation of the last comparison (-1, if no comparison performed so fa...