Developer Documentation

MeshObjectSelectionPlugin.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
46 #include <OpenFlipper/BasePlugin/BaseInterface.hh>
47 #include <OpenFlipper/BasePlugin/KeyInterface.hh>
48 #include <OpenFlipper/BasePlugin/MouseInterface.hh>
49 #include <OpenFlipper/BasePlugin/LoggingInterface.hh>
50 #include <OpenFlipper/BasePlugin/ToolboxInterface.hh>
51 #include <OpenFlipper/BasePlugin/ToolbarInterface.hh>
52 #include <OpenFlipper/BasePlugin/LoadSaveInterface.hh>
53 #include <OpenFlipper/BasePlugin/BackupInterface.hh>
54 #include <OpenFlipper/BasePlugin/INIInterface.hh>
55 #include <OpenFlipper/BasePlugin/ScriptInterface.hh>
56 #include <OpenFlipper/BasePlugin/SelectionInterface.hh>
57 #include <OpenFlipper/BasePlugin/OptionsInterface.hh>
58 #include <OpenFlipper/BasePlugin/PythonInterface.hh>
59
60 #include <OpenFlipper/common/Types.hh>
61 #include <OpenFlipper/BasePlugin/PluginFunctions.hh>
62 #include <OpenFlipper/INIFile/INIFile.hh>
63
64 #include <ObjectTypes/PolyMesh/PolyMesh.hh>
65 #include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
66
67 #include <ACG/QtWidgets/QtColorChooserButton.hh>
68
69 #include "widgets/ConversionDialog.hh"
70
71 class ParameterWidget;
72
73 class MeshObjectSelectionPlugin : public QObject, BaseInterface, KeyInterface, LoadSaveInterface,
74 INIInterface, BackupInterface, ScriptInterface, LoggingInterface, SelectionInterface,
75 MouseInterface, OptionsInterface, PythonInterface
76 {
77 Q_OBJECT
78 Q_INTERFACES(BaseInterface)
79 Q_INTERFACES(KeyInterface)
80 Q_INTERFACES(MouseInterface)
81 Q_INTERFACES(INIInterface)
82 Q_INTERFACES(BackupInterface)
83 Q_INTERFACES(ScriptInterface)
84 Q_INTERFACES(LoggingInterface)
85 Q_INTERFACES(LoadSaveInterface)
86 Q_INTERFACES(SelectionInterface)
87 Q_INTERFACES(OptionsInterface)
88 Q_INTERFACES(PythonInterface)
89
90 Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-SelectionMeshObject")
91
92 public:
94 MeshObjectSelectionPlugin();
95
97 ~MeshObjectSelectionPlugin();
98
99 friend class SelectVolumeAction;
100
101 signals:
102
103 // BaseInterface
104 void updateView();
105 void updatedObject(int, const UpdateType&);
106 void nodeVisibilityChanged(int _identifier);
107 void setSlotDescription(QString _slotName, QString _slotDescription,
108 QStringList _parameters, QStringList _descriptions);
109
110 // BackupInterface
111 void createBackup( int _objectid, QString _name, UpdateType _type = UPDATE_ALL);
112
113 // LoggingInterface
114 void log(Logtype _type, QString _message);
115 void log(QString _message);
116
117 // SelectionInterface
118 void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
119 void registerType(QString _handleName, DataType _type);
120 void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
121 void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u);
122 void addSelectionParameters(QString _handleName, QWidget* _widget, QString _category, SelectionInterface::PrimitiveType _type = 0u);
123
124 void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
125
126 void showLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
127 void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
128 void showSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
129 void showClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
130 void showFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
131 void showComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
132
133 void getActiveDataTypes(SelectionInterface::TypeList& _types);
134 void getActivePrimitiveType(SelectionInterface::PrimitiveType& _type);
135 void targetObjectsOnly(bool& _targetsOnly);
136
137 void registerKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers = Qt::NoModifier);
138
139 // LoadSaveInterface
140 void deleteObject(int _objectId);
141 void addEmptyObject( DataType _type, int& _id);
142
143 // ScriptInterface
144 void scriptInfo(QString _functionName);
145
146 public slots:
147
148 // SelectionInterface
149 void loadSelection(int _objId, const QString& _filename);
150
151 private slots:
152
153 // INIInterface
154 void loadIniFile(INIFile& _ini, int _id);
155 void saveIniFile(INIFile& _ini, int _id);
156
157 // BaseInterface
158 void initializePlugin();
159 void pluginsInitialized();
160 void noguiSupported() {};
161
162 // SelectionInterface
163 void slotSelectionOperation(QString _operation);
164 void slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
165
166 void slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
167 void slotVolumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
168 void slotSphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
169 void slotClosestBoundarySelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
170 void slotFloodFillSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
171 void slotComponentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
172
173 void slotLoadSelection(const INIFile& _file);
174 void slotSaveSelection(INIFile& _file);
175
176 void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers);
177
178 // MouseInterface
179 void slotMouseWheelEvent(QWheelEvent* event, std::string const& mode);
180
181 // LoadSaveInterface
182 void addedEmptyObject( int _id );
183
184 public:
185
186 // OptionsInterface
187 bool initializeOptionsWidget(QWidget*& _widget);
188
189 private slots:
190 void applyOptions();
191
192 // BaseInterface
193 QString name() {
194 return (QString(tr("MeshObjectSelection")));
195 };
196
197 QString description() {
198 return (QString(tr("Allows to select parts of Mesh Objects")));
199 };
200
201 //===========================================================================
204 //===========================================================================
205 private:
206
207 // update and saves new color values for area node/selecion noe etc.
208 void updateColorValues();
209
211 void updateSlotDescriptions();
212
214 void setColorForSelection(const int _objectId, const PrimitiveType _primitiveType);
215
218 //===========================================================================
221 //===========================================================================
222 private slots:
223
225 void conversionRequested();
226
228 void setDefaultColorValues();
229
232 public slots:
233
234 QString version() {
235 return QString("1.0");
236 };
237
238 // Is vertex type active? (for use in plugins that need mesh selection)
239 bool vertexTypeActive() {
240 SelectionInterface::PrimitiveType t = 0u;
241 emit getActivePrimitiveType(t);
242 return (t & vertexType_) > 0;
243 }
244
245 // Is vertex type active? (for use in plugins that need mesh selection)
246 bool edgeTypeActive() {
247 SelectionInterface::PrimitiveType t = 0u;
248 emit getActivePrimitiveType(t);
249 return (t & edgeType_) > 0;
250 }
251
252 // Is face type active? (for use in plugins that need mesh selection)
253 bool faceTypeActive() {
254 SelectionInterface::PrimitiveType t = 0u;
255 emit getActivePrimitiveType(t);
256 return (t & faceType_) > 0;
257 }
258
259 //===========================================================================
262 //===========================================================================
263 public slots:
264
265 //==========================================
266 // VERTEX OPERATIONS
267 //==========================================
268
270 void selectVertices(int objectId, IdList _vertexList);
271
273 void unselectVertices(int objectId, IdList _vertexList);
274
276 void selectAllVertices(int _objectId);
277
279 void clearVertexSelection(int _objectId);
280
282 void invertVertexSelection(int _objectId);
283
285 void selectBoundaryVertices(int _objectId);
286
288 void selectClosestBoundaryVertices(int _objectId, int _vertexId);
289
291 void shrinkVertexSelection(int _objectId);
292
294 void growVertexSelection(int _objectId);
295
297 IdList getVertexSelection(int _objectId);
298
300 void deleteVertexSelection(int _objectId);
301
302 int createMeshFromVertexSelection( int _objectId);
303
305 void colorizeVertexSelection(int _objectId, int _r, int _g, int _b, int a);
306
307 //==========================================
308
310 void selectHandleVertices(int objectId, IdList _vertexList);
311
313 void unselectHandleVertices(int objectId, IdList _vertexList);
314
316 void clearHandleVertices(int objectId);
317
319 void setAllHandleVertices(int objectId);
320
322 IdList getHandleVertices(int objectId);
323
325 void loadFlipperModelingSelection(int _objectId, QString _filename);
326
328 void saveFlipperModelingSelection(int _objectId, QString _filename);
329
330 //==========================================
331
333 void selectModelingVertices(int objectId, IdList _vertexList);
334
336 void unselectModelingVertices(int objectId, IdList _vertexList);
337
339 void selectVerticesByValue(int _objectId, QString _component, bool _greater, double _value );
340
342 void clearModelingVertices(int objectId);
343
345 void setAllModelingVertices(int objectId);
346
348 IdList getModelingVertices(int objectId);
349
350 //==========================================
351 // EDGE OPERATIONS
352 //==========================================
353
355 void selectEdges(int objectId, IdList _edgeList, const double _dihedral_angle_threshold = 0.0);
356
358 void unselectEdges(int objectId, IdList _edgeList);
359
361 void selectAllEdges(int objectId);
362
364 void invertEdgeSelection(int objectId);
365
367 void clearEdgeSelection(int objectId);
368
370 void selectBoundaryEdges(int objectId);
371
373 void deleteEdgeSelection(int _objectId);
374
376 IdList getEdgeSelection(int objectId);
377
379 IdList convertEdgesToVertexPairs(int _id, const IdList& _edges);
380
382 IdList convertVertexPairsToEdges(int _id, const IdList& _vertices);
383
385 int createMeshFromEdgeSelection( int _objectId);
386
388 void colorizeEdgeSelection(int objectId, int r, int g, int b, int a);
389
391 void traceEdgePath(int objectId, double threshold);
392
393 //==========================================
394 // HALFEDGE OPERATIONS
395 //==========================================
396
398 void selectHalfedges(int objectId, IdList _vertexList);
399
401 void unselectHalfedges(int objectId, IdList _vertexList);
402
404 void selectAllHalfedges(int objectId);
405
407 void invertHalfedgeSelection(int objectId);
408
410 void clearHalfedgeSelection(int objectId);
411
413 void selectBoundaryHalfedges(int objectId);
414
416 IdList getHalfedgeSelection(int objectId);
417
419 IdList convertHalfedgesToVertexPairs(int _id, const IdList& _halfedges);
420
422 IdList convertVertexPairsToHalfedges(int _id, const IdList& _vertices);
423
425 void colorizeHalfedgeSelection(int objectId, int r, int g, int b, int a);
426
427 //==========================================
428 // FACE OPERATIONS
429 //==========================================
430
432 void selectFaces(int objectId, IdList _facesList);
433
435 void unselectFaces(int objectId, IdList _facesList);
436
438 void selectAllFaces(int objectId);
439
441 void clearFaceSelection(int objectId);
442
444 void invertFaceSelection(int objectId);
445
447 void deleteFaceSelection(int _objectId);
448
450 void selectBoundaryFaces(int objectId);
451
453 void shrinkFaceSelection(int objectId);
454
456 void growFaceSelection(int objectId);
457
459 IdList getFaceSelection(int objectId);
460
462 int createMeshFromFaceSelection( int _objectId);
463
465 void colorizeFaceSelection(int objectId, int r, int g, int b, int a);
466
467 //===========================================================================
468
470 void lassoSelect(QRegion& _region, PrimitiveType _primitiveType, bool _deselection);
471
473 void convertSelection(const int& _objectId ,const QString& _from, const QString& _to, bool _deselect);
474
476 void conversion(const QString& _from, const QString& _to, bool _deselect);
477
478
479 public:
481 void set_dihedral_angle_threshold(const double _a);
483 double get_dihedral_angle_threshold();
484
486 void set_max_angle(const double _a);
488 double get_max_angle();
489
490 private:
491 void update_dihedral_angle_threshold_from_ui();
492
495 //===========================================================================
498 //===========================================================================
499
500 private:
501
503 template<typename MeshT>
504 bool deleteSelection(MeshT* _mesh, PrimitiveType _primitiveType);
505
507 template<typename MeshT>
508 void update_regions(MeshT* _mesh);
509
511 template<typename MeshT>
512 void toggleMeshSelection(int _objectId, MeshT* _mesh, uint _fh, ACG::Vec3d& _hit_point, PrimitiveType _primitiveType);
513
515 template<typename MeshT>
516 void paintSphereSelection(MeshT* _mesh, int _objectId, int _target_idx,
517 typename MeshT::Point _hitpoint, double _radius,
518 PrimitiveType _primitiveTypes, bool _deselection);
519
521 template<class MeshT>
522 bool volumeSelection(MeshT* _mesh, int _objectId, ACG::GLState& _state,
523 QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection);
524
526 template<class MeshT>
527 void closestBoundarySelection(MeshT* _mesh, int _vh,
528 PrimitiveType _primitiveTypes, bool _deselection);
529
531 template<class MeshT>
532 void floodFillSelection(MeshT* _mesh, int _objectId, uint _fh,
533 double _maxAngle, PrimitiveType _primitiveTypes, bool _deselection);
534
536 template<typename MeshT>
537 void componentsMeshSelection(MeshT* _mesh, int _objectId, uint _fh,
538 ACG::Vec3d& _hit_point, PrimitiveType _primitiveType);
539
541 template<class MeshT>
542 void colorizeSelection(MeshT* _mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha);
543
545 template< class MeshT >
546 void createMeshFromSelection( MeshT& _mesh, MeshT& _newMesh, PrimitiveType _primitiveType);
547
549 template< class MeshT >
550 void selectVerticesByValue(MeshT* _mesh, QString _component, bool _greater, double _value);
551
554 //===========================================================================
557 //===========================================================================
558 private:
559
561 int createMeshFromSelection( int _objectId , PrimitiveType _primitiveType);
562
565 //===========================================================================
568 //===========================================================================
569
570 private:
571
573 QString environmentHandle_;
574
576 SelectionInterface::PrimitiveType vertexType_;
577 SelectionInterface::PrimitiveType edgeType_;
578 SelectionInterface::PrimitiveType halfedgeType_;
579 SelectionInterface::PrimitiveType faceType_;
580
581 SelectionInterface::PrimitiveType allSupportedTypes_;
582
584 QPolygon lasso_2Dpoints_;
585
587 QVector<QPoint> volumeLassoPoints_;
588
589 ConversionDialog* conversionDialog_;
590
591 ParameterWidget* parameterWidget_;
592
594 QtColorChooserButton* colorButtonSelection_;
595 QtColorChooserButton* colorButtonArea_;
596 QtColorChooserButton* colorButtonHandle_;
597 QtColorChooserButton* colorButtonFeature_;
598
599 ACG::Vec4f statusColor_;
600 ACG::Vec4f areaColor_;
601 ACG::Vec4f handleColor_;
602 ACG::Vec4f featureColor_;
603
604 double dihedral_angle_threshold_;
605 double max_angle_;
606
609 };
610
612 class SelectVolumeAction
613 {
614 public:
615
616 SelectVolumeAction(QRegion&_region, MeshObjectSelectionPlugin* _plugin,
617 unsigned int _type, bool _deselection, ACG::GLState& _state) :
618 state_(_state), region_(_region), plugin_(_plugin), type_(_type), deselection_(_deselection) {};
619
620 void enter(BaseNode* /*_node*/) {};
621
622 void leave(BaseNode* /*_node*/) {};
623
624 bool operator()(BaseNode* _node);
625
626 private:
627 ACG::GLState& state_;
628 QRegion& region_;
629 MeshObjectSelectionPlugin* plugin_;
630 unsigned int type_;
631 bool deselection_;
632 };
633 //=============================================================================
634 #if defined(INCLUDE_TEMPLATES) && !defined(MESHOBJECTSELECTIONPLUGINT_CC)
635 #define MESHOBJECTSELECTIONPLUGINT_TEMPLATES
636 #include "MeshObjectSelectionPluginT_impl.hh"
637 #endif
638
MeshObjectSelectionPlugin::invertEdgeSelection
void invertEdgeSelection(int objectId)
Unselect all Edges.
Definition: EdgeSelection.cc:171
INIInterface
Interface class for Plugins which have to store information in ini files.
Definition: INIInterface.hh:60
MeshObjectSelectionPlugin::convertSelection
void convertSelection(const int &_objectId, const QString &_from, const QString &_to, bool _deselect)
Convert the selection on one object.
Definition: MeshObjectSelectionPlugin.cc:865
MeshObjectSelectionPlugin::slotToggleSelection
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a toggle selection.
Definition: MeshObjectSelectionPlugin.cc:1230
MeshObjectSelectionPlugin::colorizeHalfedgeSelection
void colorizeHalfedgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
Definition: HalfedgeSelection.cc:353
MeshObjectSelectionPlugin::getModelingVertices
IdList getModelingVertices(int objectId)
Get a list of all modeling vertices.
Definition: VertexSelection.cc:647
MeshObjectSelectionPlugin::deleteFaceSelection
void deleteFaceSelection(int _objectId)
Delete face that are currently selected.
Definition: FaceSelection.cc:193
MeshObjectSelectionPlugin::shrinkFaceSelection
void shrinkFaceSelection(int objectId)
Shrink the current face selection.
Definition: FaceSelection.cc:246
MeshObjectSelectionPlugin::selectAllHalfedges
void selectAllHalfedges(int objectId)
Select all Halfedges.
Definition: HalfedgeSelection.cc:124
UpdateType
Update type class.
Definition: UpdateType.hh:60
MeshObjectSelectionPlugin::set_max_angle
void set_max_angle(const double _a)
set max angle for flood fill selection
Definition: MeshObjectSelectionPlugin.cc:2292
MeshObjectSelectionPlugin::createMeshFromEdgeSelection
int createMeshFromEdgeSelection(int _objectId)
Create a mesh containing the face selection of the given mesh.
Definition: EdgeSelection.cc:240
MeshObjectSelectionPlugin::faceType_
SelectionInterface::PrimitiveType faceType_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:579
MeshObjectSelectionPlugin::update_regions
void update_regions(MeshT *_mesh)
Update face selection to correspond to the vertex selection.
UPDATE_ALL
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
MeshObjectSelectionPlugin::setAllModelingVertices
void setAllModelingVertices(int objectId)
Set all vertices to be part of the modeling area.
Definition: VertexSelection.cc:625
MeshObjectSelectionPlugin::slotFloodFillSelection
void slotFloodFillSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a flood fill selection.
Definition: MeshObjectSelectionPlugin.cc:1410
TriangleMesh.hh
MeshObjectSelectionPlugin::slotMouseWheelEvent
void slotMouseWheelEvent(QWheelEvent *event, std::string const &mode)
Wheel Event from main application.
Definition: MeshObjectSelectionPlugin.cc:1834
MeshObjectSelectionPlugin::unselectFaces
void unselectFaces(int objectId, IdList _facesList)
Unselect given faces.
Definition: FaceSelection.cc:91
MeshObjectSelectionPlugin::statusColor_
ACG::Vec4f statusColor_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:599
MeshObjectSelectionPlugin::saveFlipperModelingSelection
void saveFlipperModelingSelection(int _objectId, QString _filename)
Save a selection in Flipper Selection Format.
Definition: VertexSelection.cc:754
Logtype
Logtype
Log types for Message Window.
Definition: LoggingInterface.hh:92
MouseInterface.hh
LoadSaveInterface
Interface for all plugins which want to Load or Save files and create Objects.
Definition: LoadSaveInterface.hh:59
MeshObjectSelectionPlugin::selectBoundaryHalfedges
void selectBoundaryHalfedges(int objectId)
Select boundary edges.
Definition: HalfedgeSelection.cc:193
MeshObjectSelectionPlugin::invertHalfedgeSelection
void invertHalfedgeSelection(int objectId)
Unselect all Halfedges.
Definition: HalfedgeSelection.cc:170
MeshObjectSelectionPlugin::unselectHalfedges
void unselectHalfedges(int objectId, IdList _vertexList)
Unselect given Halfedges.
Definition: HalfedgeSelection.cc:91
ScriptInterface
Interface for all Plugins which provide scriptable Functions.
Definition: ScriptInterface.hh:58
MeshObjectSelectionPlugin::vertexType_
SelectionInterface::PrimitiveType vertexType_
Primitive type handles:
Definition: MeshObjectSelectionPlugin.hh:576
MeshObjectSelectionPlugin::colorButtonHandle_
QtColorChooserButton * colorButtonHandle_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:596
OptionsInterface.hh
MeshObjectSelectionPlugin::volumeSelection
bool volumeSelection(MeshT *_mesh, int _objectId, ACG::GLState &_state, QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection)
Surface volume selection tool.
Definition: MeshObjectSelectionPluginT_impl.hh:390
LoggingInterface.hh
MeshObjectSelectionPlugin::colorizeEdgeSelection
void colorizeEdgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
Definition: EdgeSelection.cc:382
MeshObjectSelectionPlugin::slotClosestBoundarySelection
void slotClosestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a closest boundary selection.
Definition: MeshObjectSelectionPlugin.cc:1370
MeshObjectSelectionPlugin::clearFaceSelection
void clearFaceSelection(int objectId)
Unselect all faces.
Definition: FaceSelection.cc:147
MeshObjectSelectionPlugin::~MeshObjectSelectionPlugin
~MeshObjectSelectionPlugin()
Default destructor.
Definition: MeshObjectSelectionPlugin.cc:127
PluginFunctions.hh
MeshObjectSelectionPlugin::createMeshFromSelection
void createMeshFromSelection(MeshT &_mesh, MeshT &_newMesh, PrimitiveType _primitiveType)
Create a new mesh from the selection.
Definition: MeshObjectSelectionPluginT_impl.hh:876
MeshObjectSelectionPlugin::convertEdgesToVertexPairs
IdList convertEdgesToVertexPairs(int _id, const IdList &_edges)
Convert edge ids to vertex pairs.
Definition: EdgeSelection.cc:271
MeshObjectSelectionPlugin::conversion
void conversion(const QString &_from, const QString &_to, bool _deselect)
Convert the selection on all target objects.
Definition: MeshObjectSelectionPlugin.cc:1220
MeshObjectSelectionPlugin::areaColor_
ACG::Vec4f areaColor_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:600
MeshObjectSelectionPlugin::lasso_2Dpoints_
QPolygon lasso_2Dpoints_
Used for lasso selection tool.
Definition: MeshObjectSelectionPlugin.hh:584
MeshObjectSelectionPlugin::slotSphereSelection
void slotSphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a sphere selection.
Definition: MeshObjectSelectionPlugin.cc:1343
MeshObjectSelectionPlugin::lassoSelect
void lassoSelect(QRegion &_region, PrimitiveType _primitiveType, bool _deselection)
Lasso selection tool.
Definition: MeshObjectSelectionPlugin.cc:1885
MeshObjectSelectionPlugin::updateColorValues
void updateColorValues()
Set descriptions for local public slots.
Definition: MeshObjectSelectionPlugin.cc:2156
MeshObjectSelectionPlugin::clearEdgeSelection
void clearEdgeSelection(int objectId)
Invert the current edge selection.
Definition: EdgeSelection.cc:148
MeshObjectSelectionPlugin::unselectVertices
void unselectVertices(int objectId, IdList _vertexList)
unselect given vertices
Definition: VertexSelection.cc:91
MeshObjectSelectionPlugin::slotKeyShortcutEvent
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers)
One of the previously registered keys has been pressed.
Definition: MeshObjectSelectionPlugin.cc:1746
ParameterWidget
Definition: ParameterWidget.hh:44
MeshObjectSelectionPlugin::selectClosestBoundaryVertices
void selectClosestBoundaryVertices(int _objectId, int _vertexId)
Select all vertices of the boundary close to the given vertex.
Definition: VertexSelection.cc:218
MeshObjectSelectionPlugin::slotVolumeLassoSelection
void slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a volume lasso selection.
Definition: MeshObjectSelectionPlugin.cc:1312
MeshObjectSelectionPlugin
Definition: MeshObjectSelectionPlugin.hh:73
MeshObjectSelectionPlugin::deleteSelection
bool deleteSelection(MeshT *_mesh, PrimitiveType _primitiveType)
Delete all selected elements of a mesh.
Definition: MeshObjectSelectionPluginT_impl.hh:57
MeshObjectSelectionPlugin::colorizeVertexSelection
void colorizeVertexSelection(int _objectId, int _r, int _g, int _b, int a)
Colorize the vertex selection.
Definition: VertexSelection.cc:341
MeshObjectSelectionPlugin::colorizeSelection
void colorizeSelection(MeshT *_mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha)
Colorize the selection.
Definition: MeshObjectSelectionPluginT_impl.hh:802
MeshObjectSelectionPlugin::colorButtonFeature_
QtColorChooserButton * colorButtonFeature_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:597
MeshObjectSelectionPlugin::conversionRequested
void conversionRequested()
Show selection conversion dialog.
Definition: MeshObjectSelectionPlugin.cc:848
MeshObjectSelectionPlugin::colorButtonSelection_
QtColorChooserButton * colorButtonSelection_
Options.
Definition: MeshObjectSelectionPlugin.hh:594
MouseInterface
Interface class for receiving mouse events.
Definition: MouseInterface.hh:61
MeshObjectSelectionPlugin::setColorForSelection
void setColorForSelection(const int _objectId, const PrimitiveType _primitiveType)
Set color for selection.
Definition: MeshObjectSelectionPlugin.cc:827
MeshObjectSelectionPlugin::volumeLassoPoints_
QVector< QPoint > volumeLassoPoints_
Used for volume lasso tool.
Definition: MeshObjectSelectionPlugin.hh:587
LoggingInterface
Interface for all Plugins which do logging to the logging window of the framework.
Definition: LoggingInterface.hh:112
MeshObjectSelectionPlugin::clearModelingVertices
void clearModelingVertices(int objectId)
Clear Modeling Area.
Definition: VertexSelection.cc:602
MeshObjectSelectionPlugin::parameterWidget_
ParameterWidget * parameterWidget_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:591
MeshObjectSelectionPlugin::getFaceSelection
IdList getFaceSelection(int objectId)
Return a list of all selected faces.
Definition: FaceSelection.cc:292
MeshObjectSelectionPlugin::selectBoundaryVertices
void selectBoundaryVertices(int _objectId)
Select all boundary vertices of the given object.
Definition: VertexSelection.cc:195
MeshObjectSelectionPlugin::selectVerticesByValue
void selectVerticesByValue(int _objectId, QString _component, bool _greater, double _value)
Select vertices by their value.
Definition: VertexSelection.cc:577
MeshObjectSelectionPlugin::createMeshFromVertexSelection
int createMeshFromVertexSelection(int _objectId)
set dihedral angle threshold for edge selection
Definition: VertexSelection.cc:334
MeshObjectSelectionPlugin::max_angle_
double max_angle_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:605
MeshObjectSelectionPlugin::selectAllVertices
void selectAllVertices(int _objectId)
Select all Vertices.
Definition: VertexSelection.cc:126
MeshObjectSelectionPlugin::closestBoundarySelection
void closestBoundarySelection(MeshT *_mesh, int _vh, PrimitiveType _primitiveTypes, bool _deselection)
Select all entities that are incident to closest boundary.
Definition: MeshObjectSelectionPluginT_impl.hh:473
MeshObjectSelectionPlugin::growFaceSelection
void growFaceSelection(int objectId)
Grow the current face selection.
Definition: FaceSelection.cc:269
MeshObjectSelectionPlugin::description
QString description()
Return a description of what the plugin is doing.
Definition: MeshObjectSelectionPlugin.hh:197
ACG::GLState
Definition: GLState.hh:213
MeshObjectSelectionPlugin::clearHalfedgeSelection
void clearHalfedgeSelection(int objectId)
Invert the current edge selection.
Definition: HalfedgeSelection.cc:147
MeshObjectSelectionPlugin::selectHandleVertices
void selectHandleVertices(int objectId, IdList _vertexList)
Set vertices to be part of the handle area.
Definition: VertexSelection.cc:368
MeshObjectSelectionPlugin::convertHalfedgesToVertexPairs
IdList convertHalfedgesToVertexPairs(int _id, const IdList &_halfedges)
Convert halfedge ids to vertex pairs.
Definition: HalfedgeSelection.cc:241
QtColorChooserButton
Definition: QtColorChooserButton.hh:48
BaseInterface.hh
MeshObjectSelectionPlugin::selectAllEdges
void selectAllEdges(int objectId)
Select all Edges.
Definition: EdgeSelection.cc:125
MeshObjectSelectionPlugin::getHalfedgeSelection
IdList getHalfedgeSelection(int objectId)
Return a list of all selected edges.
Definition: HalfedgeSelection.cc:216
MeshObjectSelectionPlugin::colorButtonArea_
QtColorChooserButton * colorButtonArea_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:595
MeshObjectSelectionPlugin::toggleMeshSelection
void toggleMeshSelection(int _objectId, MeshT *_mesh, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Toggle mesh selection.
Definition: MeshObjectSelectionPluginT_impl.hh:146
MeshObjectSelectionPlugin::unselectEdges
void unselectEdges(int objectId, IdList _edgeList)
Unselect given Edges.
Definition: EdgeSelection.cc:92
MeshObjectSelectionPlugin::edgeType_
SelectionInterface::PrimitiveType edgeType_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:577
MeshObjectSelectionPlugin::update_dihedral_angle_threshold_from_ui
void update_dihedral_angle_threshold_from_ui()
set dihedral angle threshold for edge selection
Definition: MeshObjectSelectionPlugin.cc:2302
MeshObjectSelectionPlugin::selectModelingVertices
void selectModelingVertices(int objectId, IdList _vertexList)
Set vertices to be part of the modeling area.
Definition: VertexSelection.cc:509
MeshObjectSelectionPlugin::unselectHandleVertices
void unselectHandleVertices(int objectId, IdList _vertexList)
Remove vertices from handle area.
Definition: VertexSelection.cc:404
KeyInterface.hh
MeshObjectSelectionPlugin::setAllHandleVertices
void setAllHandleVertices(int objectId)
Set all vertices to be part of the handle area.
Definition: VertexSelection.cc:460
IdList
std::vector< int > IdList
Standard Type for id Lists used for scripting.
Definition: DataTypes.hh:179
MeshObjectSelectionPlugin::colorizeFaceSelection
void colorizeFaceSelection(int objectId, int r, int g, int b, int a)
Colorize the face selection.
Definition: FaceSelection.cc:315
MeshObjectSelectionPlugin::clearVertexSelection
void clearVertexSelection(int _objectId)
Unselect all vertices.
Definition: VertexSelection.cc:149
ToolbarInterface.hh
LoadSaveInterface.hh
MeshObjectSelectionPlugin::convertVertexPairsToHalfedges
IdList convertVertexPairsToHalfedges(int _id, const IdList &_vertices)
Inverse of function above.
Definition: HalfedgeSelection.cc:287
MeshObjectSelectionPlugin::invertVertexSelection
void invertVertexSelection(int _objectId)
Invert the current vertex selection.
Definition: VertexSelection.cc:172
ConversionDialog
Definition: ConversionDialog.hh:47
MeshObjectSelectionPlugin::selectHalfedges
void selectHalfedges(int objectId, IdList _vertexList)
Select given Halfedges.
Definition: HalfedgeSelection.cc:58
MeshObjectSelectionPlugin::handleColor_
ACG::Vec4f handleColor_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:601
MeshObjectSelectionPlugin::selectBoundaryEdges
void selectBoundaryEdges(int objectId)
select boundary edges
Definition: EdgeSelection.cc:194
BaseInterface
Interface class from which all plugins have to be created.
Definition: BaseInterface.hh:65
MeshObjectSelectionPlugin::environmentHandle_
QString environmentHandle_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:573
MeshObjectSelectionPlugin::slotSaveSelection
void slotSaveSelection(INIFile &_file)
Save selection for all objects in the scene.
Definition: MeshObjectSelectionPlugin.cc:1720
ToolboxInterface.hh
MeshObjectSelectionPlugin::initializeOptionsWidget
bool initializeOptionsWidget(QWidget *&_widget)
Initialize the Options Widget.
Definition: MeshObjectSelectionPlugin.cc:2199
MeshObjectSelectionPlugin::setDefaultColorValues
void setDefaultColorValues()
sets the default color values for selection/handle/region/feature nodes for all objects of this type ...
Definition: MeshObjectSelectionPlugin.cc:2189
MeshObjectSelectionPlugin::deleteEdgeSelection
void deleteEdgeSelection(int _objectId)
Delete edges that are currently selected.
Definition: EdgeSelection.cc:217
MeshObjectSelectionPlugin::allSupportedTypes_
SelectionInterface::PrimitiveType allSupportedTypes_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:581
MeshObjectSelectionPlugin::invertFaceSelection
void invertFaceSelection(int objectId)
Invert the current face selection.
Definition: FaceSelection.cc:170
SelectionInterface.hh
MeshObjectSelectionPlugin::get_max_angle
double get_max_angle()
get max angle for flood fill selection
Definition: MeshObjectSelectionPlugin.cc:2297
BackupInterface.hh
PythonInterface.hh
MeshObjectSelectionPlugin::componentsMeshSelection
void componentsMeshSelection(MeshT *_mesh, int _objectId, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Connected component mesh selection.
Definition: MeshObjectSelectionPluginT_impl.hh:644
MeshObjectSelectionPlugin::selectAllFaces
void selectAllFaces(int objectId)
Select all faces.
Definition: FaceSelection.cc:124
MeshObjectSelectionPlugin::slotLassoSelection
void slotLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a lasso selection.
Definition: MeshObjectSelectionPlugin.cc:1285
Types.hh
KeyInterface
Keyboard Event Interface.
Definition: KeyInterface.hh:59
MeshObjectSelectionPlugin::MeshObjectSelectionPlugin
MeshObjectSelectionPlugin()
Default constructor.
Definition: MeshObjectSelectionPlugin.cc:110
MeshObjectSelectionPlugin::getHandleVertices
IdList getHandleVertices(int objectId)
Get a list of all handle vertices.
Definition: VertexSelection.cc:483
SelectionInterface
Interface for all plugins which want to use selection functions.
Definition: SelectionInterface.hh:67
SelectVolumeAction
Traverse the scenegraph and call the selection function for all mesh nodes.
Definition: MeshObjectSelectionPlugin.hh:612
DataType
Predefined datatypes.
Definition: DataTypes.hh:83
ACG::SceneGraph::BaseNode
Definition: BaseNode.hh:104
OptionsInterface
Options Dialog interface.
Definition: OptionsInterface.hh:58
MeshObjectSelectionPlugin::createMeshFromFaceSelection
int createMeshFromFaceSelection(int _objectId)
Create a mesh containing the face selection of the given mesh.
Definition: FaceSelection.cc:216
OpenMesh::VectorT
Definition: Vector11T.hh:83
MeshObjectSelectionPlugin::getVertexSelection
IdList getVertexSelection(int _objectId)
Return a list of all selected vertices.
Definition: VertexSelection.cc:287
MeshObjectSelectionPlugin::slotSelectionOperation
void slotSelectionOperation(QString _operation)
A specific operation is requested.
Definition: MeshObjectSelectionPlugin.cc:444
MeshObjectSelectionPlugin::floodFillSelection
void floodFillSelection(MeshT *_mesh, int _objectId, uint _fh, double _maxAngle, PrimitiveType _primitiveTypes, bool _deselection)
Select all entities that are connected (and do not exceed the maximum dihedral angle) ...
Definition: MeshObjectSelectionPluginT_impl.hh:555
MeshObjectSelectionPlugin::updateSlotDescriptions
void updateSlotDescriptions()
Set descriptions for local public slots.
Definition: MeshObjectSelectionPlugin.cc:309
MeshObjectSelectionPlugin::set_dihedral_angle_threshold
void set_dihedral_angle_threshold(const double _a)
set dihedral angle threshold for edge selection
Definition: MeshObjectSelectionPlugin.cc:2282
MeshObjectSelectionPlugin::growVertexSelection
void growVertexSelection(int _objectId)
Grow the current vertex selection.
Definition: VertexSelection.cc:264
MeshObjectSelectionPlugin::loadFlipperModelingSelection
void loadFlipperModelingSelection(int _objectId, QString _filename)
Load a selection from an Flipper selection file for the given object.
Definition: VertexSelection.cc:670
MeshObjectSelectionPlugin::selectBoundaryFaces
void selectBoundaryFaces(int objectId)
Select all boundary faces of the given object.
Definition: FaceSelection.cc:222
MeshObjectSelectionPlugin::slotLoadSelection
void slotLoadSelection(const INIFile &_file)
Load selection for specific objects in the scene.
Definition: MeshObjectSelectionPlugin.cc:1675
MeshObjectSelectionPlugin::paintSphereSelection
void paintSphereSelection(MeshT *_mesh, int _objectId, int _target_idx, typename MeshT::Point _hitpoint, double _radius, PrimitiveType _primitiveTypes, bool _deselection)
Use the event to paint selection with a sphere.
Definition: MeshObjectSelectionPluginT_impl.hh:254
MeshObjectSelectionPlugin::clearHandleVertices
void clearHandleVertices(int objectId)
Clear handle Area.
Definition: VertexSelection.cc:437
MeshObjectSelectionPlugin::deleteVertexSelection
void deleteVertexSelection(int _objectId)
Delete vertices and faces that are currently selected.
Definition: VertexSelection.cc:311
MeshObjectSelectionPlugin::get_dihedral_angle_threshold
double get_dihedral_angle_threshold()
get dihedral angle threshold for edge selection
Definition: MeshObjectSelectionPlugin.cc:2287
MeshObjectSelectionPlugin::selectEdges
void selectEdges(int objectId, IdList _edgeList, const double _dihedral_angle_threshold=0.0)
Select given Edges.
Definition: EdgeSelection.cc:58
MeshObjectSelectionPlugin::featureColor_
ACG::Vec4f featureColor_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:602
MeshObjectSelectionPlugin::getEdgeSelection
IdList getEdgeSelection(int objectId)
Return a list of all selected edges.
Definition: EdgeSelection.cc:246
BackupInterface
Interface class for backup handling.
Definition: BackupInterface.hh:59
PythonInterface
Interface class for exporting functions to python.
Definition: PythonInterface.hh:58
MeshObjectSelectionPlugin::traceEdgePath
void traceEdgePath(int objectId, double threshold)
Trace Edge Path.
Definition: EdgeSelection.cc:459
PolyMesh.hh
MeshObjectSelectionPlugin::selectFaces
void selectFaces(int objectId, IdList _facesList)
Select given faces.
Definition: FaceSelection.cc:58
MeshObjectSelectionPlugin::dihedral_angle_threshold_
double dihedral_angle_threshold_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:604
MeshObjectSelectionPlugin::halfedgeType_
SelectionInterface::PrimitiveType halfedgeType_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:578
MeshObjectSelectionPlugin::convertVertexPairsToEdges
IdList convertVertexPairsToEdges(int _id, const IdList &_vertices)
Inverse of function above.
Definition: EdgeSelection.cc:317
MeshObjectSelectionPlugin::slotComponentsSelection
void slotComponentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a connected components selection.
Definition: MeshObjectSelectionPlugin.cc:1472
INIFile
Class for the handling of simple configuration files.
Definition: INIFile.hh:99
ScriptInterface.hh
MeshObjectSelectionPlugin::addedEmptyObject
void addedEmptyObject(int _id)
An empty object has been added.
Definition: MeshObjectSelectionPlugin.cc:2255
MeshObjectSelectionPlugin::shrinkVertexSelection
void shrinkVertexSelection(int _objectId)
Shrink the current vertex selection.
Definition: VertexSelection.cc:241
MeshObjectSelectionPlugin::conversionDialog_
ConversionDialog * conversionDialog_
Handle to selection environment.
Definition: MeshObjectSelectionPlugin.hh:589
MeshObjectSelectionPlugin::unselectModelingVertices
void unselectModelingVertices(int objectId, IdList _vertexList)
Remove vertices from modeling area.
Definition: VertexSelection.cc:544
MeshObjectSelectionPlugin::selectVertices
void selectVertices(int objectId, IdList _vertexList)
select given vertices
Definition: VertexSelection.cc:58