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 
54 #include <OpenFlipper/BasePlugin/INIInterface.hh>
59 
62 #include <OpenFlipper/INIFile/INIFile.hh>
63 
66 
67 #include <ACG/QtWidgets/QtColorChooserButton.hh>
68 
69 #include "widgets/ConversionDialog.hh"
70 
71 class ParameterWidget;
72 
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:
95 
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);
484 
486  void set_max_angle(const double _a);
488  double get_max_angle();
489 
490 private:
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 
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 
590 
592 
598 
603 
605  double max_angle_;
606 
609 };
610 
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 
void invertEdgeSelection(int objectId)
Unselect all Edges.
Interface class for Plugins which have to store information in ini files.
Definition: INIInterface.hh:60
void convertSelection(const int &_objectId, const QString &_from, const QString &_to, bool _deselect)
Convert the selection on one object.
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a toggle selection.
void colorizeHalfedgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
IdList getModelingVertices(int objectId)
Get a list of all modeling vertices.
void deleteFaceSelection(int _objectId)
Delete face that are currently selected.
void shrinkFaceSelection(int objectId)
Shrink the current face selection.
void selectAllHalfedges(int objectId)
Select all Halfedges.
Update type class.
Definition: UpdateType.hh:60
void set_max_angle(const double _a)
set max angle for flood fill selection
int createMeshFromEdgeSelection(int _objectId)
Create a mesh containing the face selection of the given mesh.
SelectionInterface::PrimitiveType faceType_
Handle to selection environment.
void update_regions(MeshT *_mesh)
Update face selection to correspond to the vertex selection.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void setAllModelingVertices(int objectId)
Set all vertices to be part of the modeling area.
void slotFloodFillSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a flood fill selection.
void slotMouseWheelEvent(QWheelEvent *event, std::string const &mode)
Wheel Event from main application.
void unselectFaces(int objectId, IdList _facesList)
Unselect given faces.
ACG::Vec4f statusColor_
Handle to selection environment.
void saveFlipperModelingSelection(int _objectId, QString _filename)
Save a selection in Flipper Selection Format.
Logtype
Log types for Message Window.
Interface for all plugins which want to Load or Save files and create Objects.
void selectBoundaryHalfedges(int objectId)
Select boundary edges.
void invertHalfedgeSelection(int objectId)
Unselect all Halfedges.
void unselectHalfedges(int objectId, IdList _vertexList)
Unselect given Halfedges.
Interface for all Plugins which provide scriptable Functions.
SelectionInterface::PrimitiveType vertexType_
Primitive type handles:
QtColorChooserButton * colorButtonHandle_
Handle to selection environment.
bool volumeSelection(MeshT *_mesh, int _objectId, ACG::GLState &_state, QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection)
Surface volume selection tool.
void colorizeEdgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
void slotClosestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a closest boundary selection.
void clearFaceSelection(int objectId)
Unselect all faces.
~MeshObjectSelectionPlugin()
Default destructor.
void createMeshFromSelection(MeshT &_mesh, MeshT &_newMesh, PrimitiveType _primitiveType)
Create a new mesh from the selection.
IdList convertEdgesToVertexPairs(int _id, const IdList &_edges)
Convert edge ids to vertex pairs.
void conversion(const QString &_from, const QString &_to, bool _deselect)
Convert the selection on all target objects.
ACG::Vec4f areaColor_
Handle to selection environment.
QPolygon lasso_2Dpoints_
Used for lasso selection tool.
void slotSphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a sphere selection.
void lassoSelect(QRegion &_region, PrimitiveType _primitiveType, bool _deselection)
Lasso selection tool.
void updateColorValues()
Set descriptions for local public slots.
void clearEdgeSelection(int objectId)
Invert the current edge selection.
void unselectVertices(int objectId, IdList _vertexList)
unselect given vertices
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers)
One of the previously registered keys has been pressed.
void selectClosestBoundaryVertices(int _objectId, int _vertexId)
Select all vertices of the boundary close to the given vertex.
void slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a volume lasso selection.
bool deleteSelection(MeshT *_mesh, PrimitiveType _primitiveType)
Delete all selected elements of a mesh.
void colorizeVertexSelection(int _objectId, int _r, int _g, int _b, int a)
Colorize the vertex selection.
void colorizeSelection(MeshT *_mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha)
Colorize the selection.
QtColorChooserButton * colorButtonFeature_
Handle to selection environment.
void conversionRequested()
Show selection conversion dialog.
QtColorChooserButton * colorButtonSelection_
Options.
Interface class for receiving mouse events.
void setColorForSelection(const int _objectId, const PrimitiveType _primitiveType)
Set color for selection.
QVector< QPoint > volumeLassoPoints_
Used for volume lasso tool.
Interface for all Plugins which do logging to the logging window of the framework.
void clearModelingVertices(int objectId)
Clear Modeling Area.
ParameterWidget * parameterWidget_
Handle to selection environment.
IdList getFaceSelection(int objectId)
Return a list of all selected faces.
void selectBoundaryVertices(int _objectId)
Select all boundary vertices of the given object.
void selectVerticesByValue(int _objectId, QString _component, bool _greater, double _value)
Select vertices by their value.
int createMeshFromVertexSelection(int _objectId)
set dihedral angle threshold for edge selection
double max_angle_
Handle to selection environment.
void selectAllVertices(int _objectId)
Select all Vertices.
void closestBoundarySelection(MeshT *_mesh, int _vh, PrimitiveType _primitiveTypes, bool _deselection)
Select all entities that are incident to closest boundary.
void growFaceSelection(int objectId)
Grow the current face selection.
QString description()
Return a description of what the plugin is doing.
void clearHalfedgeSelection(int objectId)
Invert the current edge selection.
void selectHandleVertices(int objectId, IdList _vertexList)
Set vertices to be part of the handle area.
IdList convertHalfedgesToVertexPairs(int _id, const IdList &_halfedges)
Convert halfedge ids to vertex pairs.
void selectAllEdges(int objectId)
Select all Edges.
IdList getHalfedgeSelection(int objectId)
Return a list of all selected edges.
QtColorChooserButton * colorButtonArea_
Handle to selection environment.
void toggleMeshSelection(int _objectId, MeshT *_mesh, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Toggle mesh selection.
void unselectEdges(int objectId, IdList _edgeList)
Unselect given Edges.
SelectionInterface::PrimitiveType edgeType_
Handle to selection environment.
void update_dihedral_angle_threshold_from_ui()
set dihedral angle threshold for edge selection
void selectModelingVertices(int objectId, IdList _vertexList)
Set vertices to be part of the modeling area.
void unselectHandleVertices(int objectId, IdList _vertexList)
Remove vertices from handle area.
void setAllHandleVertices(int objectId)
Set all vertices to be part of the handle area.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
Definition: DataTypes.hh:179
void colorizeFaceSelection(int objectId, int r, int g, int b, int a)
Colorize the face selection.
void clearVertexSelection(int _objectId)
Unselect all vertices.
IdList convertVertexPairsToHalfedges(int _id, const IdList &_vertices)
Inverse of function above.
void invertVertexSelection(int _objectId)
Invert the current vertex selection.
void selectHalfedges(int objectId, IdList _vertexList)
Select given Halfedges.
ACG::Vec4f handleColor_
Handle to selection environment.
void selectBoundaryEdges(int objectId)
select boundary edges
Interface class from which all plugins have to be created.
QString environmentHandle_
Handle to selection environment.
void slotSaveSelection(INIFile &_file)
Save selection for all objects in the scene.
bool initializeOptionsWidget(QWidget *&_widget)
Initialize the Options Widget.
void setDefaultColorValues()
sets the default color values for selection/handle/region/feature nodes for all objects of this type ...
void deleteEdgeSelection(int _objectId)
Delete edges that are currently selected.
SelectionInterface::PrimitiveType allSupportedTypes_
Handle to selection environment.
void invertFaceSelection(int objectId)
Invert the current face selection.
double get_max_angle()
get max angle for flood fill selection
void componentsMeshSelection(MeshT *_mesh, int _objectId, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Connected component mesh selection.
void selectAllFaces(int objectId)
Select all faces.
void slotLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a lasso selection.
Keyboard Event Interface.
Definition: KeyInterface.hh:59
MeshObjectSelectionPlugin()
Default constructor.
IdList getHandleVertices(int objectId)
Get a list of all handle vertices.
Interface for all plugins which want to use selection functions.
Traverse the scenegraph and call the selection function for all mesh nodes.
Predefined datatypes.
Definition: DataTypes.hh:83
Options Dialog interface.
int createMeshFromFaceSelection(int _objectId)
Create a mesh containing the face selection of the given mesh.
IdList getVertexSelection(int _objectId)
Return a list of all selected vertices.
void slotSelectionOperation(QString _operation)
A specific operation is requested.
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) ...
void updateSlotDescriptions()
Set descriptions for local public slots.
void set_dihedral_angle_threshold(const double _a)
set dihedral angle threshold for edge selection
void growVertexSelection(int _objectId)
Grow the current vertex selection.
void loadFlipperModelingSelection(int _objectId, QString _filename)
Load a selection from an Flipper selection file for the given object.
void selectBoundaryFaces(int objectId)
Select all boundary faces of the given object.
void slotLoadSelection(const INIFile &_file)
Load selection for specific objects in the scene.
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.
void clearHandleVertices(int objectId)
Clear handle Area.
void deleteVertexSelection(int _objectId)
Delete vertices and faces that are currently selected.
double get_dihedral_angle_threshold()
get dihedral angle threshold for edge selection
void selectEdges(int objectId, IdList _edgeList, const double _dihedral_angle_threshold=0.0)
Select given Edges.
ACG::Vec4f featureColor_
Handle to selection environment.
IdList getEdgeSelection(int objectId)
Return a list of all selected edges.
Interface class for backup handling.
Interface class for exporting functions to python.
void traceEdgePath(int objectId, double threshold)
Trace Edge Path.
void selectFaces(int objectId, IdList _facesList)
Select given faces.
double dihedral_angle_threshold_
Handle to selection environment.
SelectionInterface::PrimitiveType halfedgeType_
Handle to selection environment.
IdList convertVertexPairsToEdges(int _id, const IdList &_vertices)
Inverse of function above.
void slotComponentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a connected components selection.
Class for the handling of simple configuration files.
Definition: INIFile.hh:99
void addedEmptyObject(int _id)
An empty object has been added.
void shrinkVertexSelection(int _objectId)
Shrink the current vertex selection.
ConversionDialog * conversionDialog_
Handle to selection environment.
void unselectModelingVertices(int objectId, IdList _vertexList)
Remove vertices from modeling area.
void selectVertices(int objectId, IdList _vertexList)
select given vertices