SmootherPlugin.hh 2.64 KB
Newer Older
Jan Möbius's avatar
 
Jan Möbius committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//=============================================================================
//
//                               OpenFlipper
//        Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
//                           www.openflipper.org
//
//-----------------------------------------------------------------------------
//
//                                License
//
//  OpenFlipper is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
Jan Möbius's avatar
   
Jan Möbius committed
15
//
Jan Möbius's avatar
 
Jan Möbius committed
16
17
18
19
//  OpenFlipper is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.
Jan Möbius's avatar
   
Jan Möbius committed
20
//
Jan Möbius's avatar
 
Jan Möbius committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//  You should have received a copy of the GNU Lesser General Public License
//  along with OpenFlipper.  If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
//   $Revision$
//   $Author$
//   $Date$
//
//=============================================================================




#ifndef SMOOTHERPLUGIN_HH
#define SMOOTHERPLUGIN_HH

#include <QObject>
#include <QMenuBar>
#include <QSpinBox>

#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/BasePlugin/ToolboxInterface.hh>
#include <ACG/QtWidgets/QtExaminerViewer.hh>
#include <OpenFlipper/common/Types.hh>

class SmootherPlugin : public QObject, BaseInterface, ToolboxInterface
{
   Q_OBJECT
   Q_INTERFACES(BaseInterface)
Jan Möbius's avatar
   
Jan Möbius committed
51
   Q_INTERFACES(ToolboxInterface)
Jan Möbius's avatar
 
Jan Möbius committed
52
53
54

   signals:
     void update_view();
55
     void updated_objects(int);
Jan Möbius's avatar
 
Jan Möbius committed
56
57
58
59

   public :

     ~SmootherPlugin() {};
Jan Möbius's avatar
   
Jan Möbius committed
60

Jan Möbius's avatar
 
Jan Möbius committed
61
62
     bool initializeToolbox(QWidget*& _widget);
     void toolboxActivated( bool /*_activated*/ ){ };
Jan Möbius's avatar
   
Jan Möbius committed
63

Jan Möbius's avatar
 
Jan Möbius committed
64
     QString name() { return (QString("Simple Smoother")); };
Jan Möbius's avatar
   
Jan Möbius committed
65
66
     QString description( ) { return (QString("Smooths the active Mesh")); };

Jan Möbius's avatar
 
Jan Möbius committed
67
   private :
Jan Möbius's avatar
   
Jan Möbius committed
68

Jan Möbius's avatar
 
Jan Möbius committed
69
70
       /// Widget for Toolbox
      QWidget* tool_;
Jan Möbius's avatar
   
Jan Möbius committed
71

Jan Möbius's avatar
 
Jan Möbius committed
72
73
      /// Layout for Toolbox
      QGridLayout* MeshDialogLayout_;
Jan Möbius's avatar
   
Jan Möbius committed
74

Jan Möbius's avatar
 
Jan Möbius committed
75
76
      /// Button for slotTransfer
      QPushButton* smoothButton_;
Jan Möbius's avatar
   
Jan Möbius committed
77

Jan Möbius's avatar
 
Jan Möbius committed
78
79
      /// SpinBox for Number of iterations
      QSpinBox* iterationsSpinbox_;
Jan Möbius's avatar
   
Jan Möbius committed
80

Jan Möbius's avatar
 
Jan Möbius committed
81
      QComboBox* smootherTypeBox_;
Jan Möbius's avatar
   
Jan Möbius committed
82
83


Jan Möbius's avatar
 
Jan Möbius committed
84
85
      /// Property for the active mesh to store original point positions
      OpenMesh::VPropHandleT< TriMesh::Point > orig_pos_;
Jan Möbius's avatar
   
Jan Möbius committed
86

Jan Möbius's avatar
 
Jan Möbius committed
87
      void simpleLaplace();
Jan Möbius's avatar
   
Jan Möbius committed
88

Jan Möbius's avatar
 
Jan Möbius committed
89
90
   private slots:
      void slotSmooth();
Jan Möbius's avatar
   
Jan Möbius committed
91
92
93
94


   public slots:
      QString version() { return QString("1.0"); };
Jan Möbius's avatar
 
Jan Möbius committed
95
96
97
};

#endif //SMOOTHERPLUGIN_HH