Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HoleFillerPlugin.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 #ifndef HOLEFILLINGPLUGIN_HH
51 #define HOLEFILLINGPLUGIN_HH
52
53 #include <QObject>
54 #include <QMenuBar>
55
56 #include <OpenFlipper/BasePlugin/BaseInterface.hh>
57 #include <OpenFlipper/BasePlugin/MouseInterface.hh>
58 #include <OpenFlipper/BasePlugin/PickingInterface.hh>
59 #include <OpenFlipper/BasePlugin/ToolboxInterface.hh>
60 #include <OpenFlipper/BasePlugin/LoggingInterface.hh>
61 #include <OpenFlipper/BasePlugin/ScriptInterface.hh>
62 #include <OpenFlipper/BasePlugin/BackupInterface.hh>
63 #include <OpenFlipper/common/Types.hh>
64 #include <ObjectTypes/PolyMesh/PolyMesh.hh>
65 #include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
66
67 #include "holefillerToolbar.hh"
68
69 #include <vector>
70 #include <utility>
71
72 class HoleFillerPlugin : public QObject, BaseInterface, MouseInterface, PickingInterface, ToolboxInterface, LoggingInterface, ScriptInterface, BackupInterface
73 {
74 Q_OBJECT
75 Q_INTERFACES(BaseInterface)
76 Q_INTERFACES(MouseInterface)
77 Q_INTERFACES(PickingInterface)
78 Q_INTERFACES(ToolboxInterface)
79 Q_INTERFACES(LoggingInterface)
80 Q_INTERFACES(ScriptInterface)
81 Q_INTERFACES(BackupInterface)
82 #if QT_VERSION >= 0x050000
83 Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-HoleFilling")
84 #endif
85
86 signals:
87 // BaseInterface
88 void updateView();
89 void updatedObject(int _id, const UpdateType& _type);
90
91 void addPickMode( const std::string& _mode );
92
93 void log(Logtype _type, QString _message);
94 void log(QString _message);
95
96 void createBackup( int _objectid, QString _name, UpdateType _type = UPDATE_ALL);
97
98 void scriptInfo( QString _functionName );
99
100 void setSlotDescription(QString _slotName , QString _slotDescription,
101 QStringList _parameters , QStringList _descriptions);
102
103 // ToolboxInterface
104 void addToolbox( QString _name , QWidget* _widget, QIcon* _icon );
105
106
107 private slots:
108 void slotObjectUpdated( int _identifier, const UpdateType& _type );
109
110 void slotMouseWheelEvent(QWheelEvent * /*_event*/, const std::string & /*_mode*/){};
111
112 void slotMouseEvent( QMouseEvent* /*_event*/ ){};
113
114 // BaseInterface
115 void initializePlugin();
116 void pluginsInitialized() ;
117
118 void detectButton( );
119
120 public :
121
122 ~HoleFillerPlugin() {};
123
124 HoleFillerPlugin();
125
126 QString name() { return (QString("Hole Filler")); };
127 QString description( ) { return (QString("Fill Holes or connect meshes")); };
128
129 private slots:
130 void slotItemSelectionChanged();
131
132 void slotCellDoubleClicked(int _row , int _col);
133 void slotFillSelection();
134 private :
135
136 void update_menu();
137
139 void getSelectedHoles(std::vector<int>& _holeIds, std::vector<int>& _objIds);
140
142 HoleFillerToolbarWidget* tool_;
143
145 std::vector< std::pair< int , int> > holeMapping_;
146
147 //Scripting slots
148 public slots:
149
150 void fillAllHoles(int _objectID);
151
152 void fillHole(int _objectID, int _edgeHandle);
153
154 public slots:
155
156 QString version() { return QString("1.3"); };
157 };
158
159 #endif //HOLEFILLINGPLUGIN_HH
HoleFillerPlugin
Definition: HoleFillerPlugin.hh:72
BaseInterface
Interface class from which all plugins have to be created.
Definition: BaseInterface.hh:76
HoleFillerPlugin::pluginsInitialized
void pluginsInitialized()
add PickModes after initialization
Definition: HoleFillerPlugin.cc:90
Logtype
Logtype
Log types for Message Window.
Definition: LoggingInterface.hh:103
HoleFillerPlugin::slotItemSelectionChanged
void slotItemSelectionChanged()
slot for displaying selected holes
Definition: HoleFillerPlugin.cc:186
BackupInterface.hh
HoleFillerPlugin::slotFillSelection
void slotFillSelection()
Fill all selected holes.
Definition: HoleFillerPlugin.cc:120
TriangleMesh.hh
HoleFillerPlugin::slotMouseEvent
void slotMouseEvent(QMouseEvent *)
Mouse Event from main application ( Picking Mode )
Definition: HoleFillerPlugin.hh:112
UpdateType
Update type class.
Definition: UpdateType.hh:70
UPDATE_ALL
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
HoleFillerPlugin::slotCellDoubleClicked
void slotCellDoubleClicked(int _row, int _col)
Slot for filling holes from double-clicked rows.
Definition: HoleFillerPlugin.cc:250
HoleFillerPlugin::detectButton
void detectButton()
detect holes on all objects
Definition: HoleFillerPlugin.cc:310
HoleFillerPlugin::update_menu
void update_menu()
update the entries in the tableWidget
Definition: HoleFillerPlugin.cc:388
LoggingInterface.hh
LoggingInterface
Interface for all Plugins which do logging to the logging window of the framework.
Definition: LoggingInterface.hh:123
MouseInterface.hh
HoleFillerPlugin::HoleFillerPlugin
HoleFillerPlugin()
Constructor.
Definition: HoleFillerPlugin.cc:64
HoleFillerPlugin::holeMapping_
std::vector< std::pair< int, int > > holeMapping_
map from the index in the table to (object-id, hole-id)
Definition: HoleFillerPlugin.hh:145
HoleFillerPlugin::slotObjectUpdated
void slotObjectUpdated(int _identifier, const UpdateType &_type)
check for holes if an object has changed
Definition: HoleFillerPlugin.cc:347
HoleFillerPlugin::fillHole
void fillHole(int _objectID, int _edgeHandle)
fill a hole in given object where _edgeHandle is on the boundary
Definition: HoleFillerPlugin.cc:563
ScriptInterface
Interface for all Plugins which provide scriptable Functions.
Definition: ScriptInterface.hh:67
HoleFillerPlugin::name
QString name()
Return a name for the plugin.
Definition: HoleFillerPlugin.hh:126
PolyMesh.hh
HoleFillerPlugin::description
QString description()
Return a description of what the plugin is doing.
Definition: HoleFillerPlugin.hh:127
PickingInterface
Allow access to picking functions.
Definition: PickingInterface.hh:81
PickingInterface.hh
BackupInterface
Interface class for backup handling.
Definition: BackupInterface.hh:75
HoleFillerToolbarWidget
Definition: holefillerToolbar.hh:53
ScriptInterface.hh
BaseInterface.hh
MouseInterface
Interface class for receiving mouse events.
Definition: MouseInterface.hh:75
HoleFillerPlugin::fillAllHoles
void fillAllHoles(int _objectID)
fill all holes from a given object
Definition: HoleFillerPlugin.cc:517
ToolboxInterface
Plugins can add its own toolbox to the main widget's toolbox area by using this interface.
Definition: ToolboxInterface.hh:85
HoleFillerPlugin::getSelectedHoles
void getSelectedHoles(std::vector< int > &_holeIds, std::vector< int > &_objIds)
get a map from objectID to (selected) holeIDs
Definition: HoleFillerPlugin.cc:105
Types.hh
ToolboxInterface.hh
HoleFillerPlugin::tool_
HoleFillerToolbarWidget * tool_
Widget for Toolbox.
Definition: HoleFillerPlugin.hh:142
HoleFillerPlugin::initializePlugin
void initializePlugin()
Initialize the toolbox widget.
Definition: HoleFillerPlugin.cc:71