Developer Documentation
Loading...
Searching...
No Matches
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#pragma once
43
44#include <QObject>
45#include <QMenuBar>
46
58
59#include <vector>
60#include <utility>
61
63
65{
66 Q_OBJECT
67 Q_INTERFACES(BaseInterface)
68 Q_INTERFACES(MouseInterface)
69 Q_INTERFACES(PickingInterface)
70 Q_INTERFACES(ToolboxInterface)
71 Q_INTERFACES(LoggingInterface)
72 Q_INTERFACES(ScriptInterface)
73 Q_INTERFACES(BackupInterface)
74 Q_INTERFACES(PythonInterface)
75 Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-HoleFilling")
76
77 signals:
78 // BaseInterface
79 void updateView();
80 void updatedObject(int _id, const UpdateType& _type);
81
82 void addPickMode( const std::string& _mode );
83
84 void log(Logtype _type, QString _message);
85 void log(QString _message);
86
87 void createBackup( int _objectid, QString _name, UpdateType _type = UPDATE_ALL);
88
89 void scriptInfo( QString _functionName );
90
91 void setSlotDescription(QString _slotName , QString _slotDescription,
92 QStringList _parameters , QStringList _descriptions);
93
94 // ToolboxInterface
95 void addToolbox( QString _name , QWidget* _widget, QIcon* _icon );
96
97
98 private slots:
99 void slotObjectUpdated( int _identifier, const UpdateType& _type );
100
101 void slotMouseWheelEvent(QWheelEvent * /*_event*/, const std::string & /*_mode*/){};
102
103 void slotMouseEvent( QMouseEvent* /*_event*/ ){};
104
105 // BaseInterface
106 void initializePlugin();
107 void pluginsInitialized() ;
108
109 void detectButton( );
110
111 public :
112
115
116 QString name() { return (QString("HoleFiller")); };
117 QString description( ) { return (QString("Fill Holes or connect meshes")); };
118
119 private slots:
121
122 void slotCellDoubleClicked(int _row , int _col);
123 void slotFillSelection();
124
125 void noguiSupported( ) {} ;
126
127 private :
128
129 void update_menu();
130
132 void getSelectedHoles(std::vector<int>& _holeIds, std::vector<int>& _objIds);
133
136
137 QIcon* toolIcon_;
138
140 std::vector< std::pair< int , int> > holeMapping_;
141
142 //Scripting slots
143 public slots:
144
145 void fillAllHoles(int _objectID);
146
147 void fillHole(int _objectID, int _edgeHandle);
148
149 public slots:
150
151 QString version() { return QString("1.3"); };
152};
153
Logtype
Log types for Message Window.
Interface class for backup handling.
Interface class from which all plugins have to be created.
void slotCellDoubleClicked(int _row, int _col)
Slot for filling holes from double-clicked rows.
QString name()
Return a name for the plugin.
void getSelectedHoles(std::vector< int > &_holeIds, std::vector< int > &_objIds)
get a map from objectID to (selected) holeIDs
void detectButton()
detect holes on all objects
void fillHole(int _objectID, int _edgeHandle)
fill a hole in given object where _edgeHandle is on the boundary
void fillAllHoles(int _objectID)
fill all holes from a given object
void pluginsInitialized()
add PickModes after initialization
HoleFillerToolbarWidget * tool_
Widget for Toolbox.
void slotMouseEvent(QMouseEvent *)
Mouse Event from main application ( Picking Mode )
std::vector< std::pair< int, int > > holeMapping_
map from the index in the table to (object-id, hole-id)
void slotItemSelectionChanged()
slot for displaying selected holes
QString description()
Return a description of what the plugin is doing.
void update_menu()
update the entries in the tableWidget
void slotFillSelection()
Fill all selected holes.
HoleFillerPlugin()
Constructor.
void slotObjectUpdated(int _identifier, const UpdateType &_type)
check for holes if an object has changed
void initializePlugin()
Initialize the toolbox widget.
Interface for all Plugins which do logging to the logging window of the framework.
Interface class for receiving mouse events.
Allow access to picking functions.
Interface class for exporting functions to python.
Interface for all Plugins which provide scriptable Functions.
Plugins can add its own toolbox to the main widget's toolbox area by using this interface.
Update type class.
Definition UpdateType.hh:59
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.