Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 /*===========================================================================*\
43  * *
44  * $Revision$ *
45  * $Author$ *
46  * $Date$ *
47  * *
48 \*===========================================================================*/
49 
50 #ifndef MESHOBJECTSELECTIONPLUGIN_HH
51 #define MESHOBJECTSELECTIONPLUGIN_HH
52 
53 #include <QObject>
54 
63 #include <OpenFlipper/BasePlugin/INIInterface.hh>
67 
70 #include <OpenFlipper/INIFile/INIFile.hh>
71 
74 
75 #include <ACG/QtWidgets/QtColorChooserButton.hh>
76 
77 #include "ConversionDialog.hh"
78 
82 {
83  Q_OBJECT
84  Q_INTERFACES(BaseInterface)
85  Q_INTERFACES(KeyInterface)
86  Q_INTERFACES(MouseInterface)
87  Q_INTERFACES(INIInterface)
88  Q_INTERFACES(BackupInterface)
89  Q_INTERFACES(ScriptInterface)
90  Q_INTERFACES(LoggingInterface)
91  Q_INTERFACES(LoadSaveInterface)
92  Q_INTERFACES(SelectionInterface)
93  Q_INTERFACES(OptionsInterface)
94 
95 #if QT_VERSION >= 0x050000
96  Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-SelectionMeshObject")
97 #endif
98 
99 public:
102 
105 
106  friend class SelectVolumeAction;
107 
108 signals:
109 
110  // BaseInterface
111  void updateView();
112  void updatedObject(int, const UpdateType&);
113  void nodeVisibilityChanged(int _identifier);
114  void setSlotDescription(QString _slotName, QString _slotDescription,
115  QStringList _parameters, QStringList _descriptions);
116 
117  // BackupInterface
118  void createBackup( int _objectid, QString _name, UpdateType _type = UPDATE_ALL);
119 
120  // LoggingInterface
121  void log(Logtype _type, QString _message);
122  void log(QString _message);
123 
124  // SelectionInterface
125  void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
126  void registerType(QString _handleName, DataType _type);
127  void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
128  void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u);
129 
130  void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
131 
132  void showLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
133  void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
134  void showSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
135  void showClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
136  void showFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
137  void showComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
138 
139  void getActiveDataTypes(SelectionInterface::TypeList& _types);
140  void getActivePrimitiveType(SelectionInterface::PrimitiveType& _type);
141  void targetObjectsOnly(bool& _targetsOnly);
142 
143  void registerKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers = Qt::NoModifier);
144 
145  // LoadSaveInterface
146  void deleteObject(int _objectId);
147  void addEmptyObject( DataType _type, int& _id);
148 
149  // ScriptInterface
150  void scriptInfo(QString _functionName);
151 
152 public slots:
153 
154  // SelectionInterface
155  void loadSelection(int _objId, const QString& _filename);
156 
157 private slots:
158 
159  // INIInterface
160  void loadIniFile(INIFile& _ini, int _id);
161  void saveIniFile(INIFile& _ini, int _id);
162 
163  // BaseInterface
164  void initializePlugin();
165  void pluginsInitialized();
166  void noguiSupported() {};
167 
168  // SelectionInterface
169  void slotSelectionOperation(QString _operation);
170  void slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
171 
172  void slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
173  void slotVolumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
174  void slotSphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
175  void slotClosestBoundarySelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
176  void slotFloodFillSelection(QMouseEvent* _event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect);
177  void slotComponentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
178 
179  void slotLoadSelection(const INIFile& _file);
180  void slotSaveSelection(INIFile& _file);
181 
182  void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers);
183 
184  // MouseInterface
185  void slotMouseWheelEvent(QWheelEvent* event, std::string const& mode);
186 
187  // LoadSaveInterface
188  void addedEmptyObject( int _id );
189 
190 public:
191 
192  // OptionsInterface
193  bool initializeOptionsWidget(QWidget*& _widget);
194 
195 private slots:
196  void applyOptions();
197 
198  // BaseInterface
199  QString name() {
200  return (QString(tr("Mesh Object Selection")));
201  };
202 
203  QString description() {
204  return (QString(tr("Allows to select parts of Mesh Objects")));
205  };
206 
207  //===========================================================================
210  //===========================================================================
211 private:
212 
213  // update and saves new color values for area node/selecion noe etc.
214  void updateColorValues();
215 
217  void updateSlotDescriptions();
218 
220  void setColorForSelection(const int _objectId, const PrimitiveType _primitiveType);
221 
224  //===========================================================================
227  //===========================================================================
228 private slots:
229 
231  void conversionRequested();
232 
234  void setDefaultColorValues();
235 
238 public slots:
239 
240  QString version() {
241  return QString("1.0");
242  };
243 
244  // Is vertex type active? (for use in plugins that need mesh selection)
245  bool vertexTypeActive() {
246  SelectionInterface::PrimitiveType t = 0u;
247  emit getActivePrimitiveType(t);
248  return (t & vertexType_) > 0;
249  }
250 
251  // Is vertex type active? (for use in plugins that need mesh selection)
252  bool edgeTypeActive() {
253  SelectionInterface::PrimitiveType t = 0u;
254  emit getActivePrimitiveType(t);
255  return (t & edgeType_) > 0;
256  }
257 
258  // Is face type active? (for use in plugins that need mesh selection)
259  bool faceTypeActive() {
260  SelectionInterface::PrimitiveType t = 0u;
261  emit getActivePrimitiveType(t);
262  return (t & faceType_) > 0;
263  }
264 
265  //===========================================================================
268  //===========================================================================
269 public slots:
270 
271  //==========================================
272  // VERTEX OPERATIONS
273  //==========================================
274 
276  void selectVertices(int objectId, IdList _vertexList);
277 
279  void unselectVertices(int objectId, IdList _vertexList);
280 
282  void selectAllVertices(int _objectId);
283 
285  void clearVertexSelection(int _objectId);
286 
288  void invertVertexSelection(int _objectId);
289 
291  void selectBoundaryVertices(int _objectId);
292 
294  void selectClosestBoundaryVertices(int _objectId, int _vertexId);
295 
297  void shrinkVertexSelection(int _objectId);
298 
300  void growVertexSelection(int _objectId);
301 
303  IdList getVertexSelection(int _objectId);
304 
306  void deleteVertexSelection(int _objectId);
307 
308  int createMeshFromVertexSelection( int _objectId);
309 
311  void colorizeVertexSelection(int _objectId, int _r, int _g, int _b, int a);
312 
313  //==========================================
314 
316  void selectHandleVertices(int objectId, IdList _vertexList);
317 
319  void unselectHandleVertices(int objectId, IdList _vertexList);
320 
322  void clearHandleVertices(int objectId);
323 
325  void setAllHandleVertices(int objectId);
326 
328  IdList getHandleVertices(int objectId);
329 
331  void loadFlipperModelingSelection(int _objectId, QString _filename);
332 
334  void saveFlipperModelingSelection(int _objectId, QString _filename);
335 
336  //==========================================
337 
339  void selectModelingVertices(int objectId, IdList _vertexList);
340 
342  void unselectModelingVertices(int objectId, IdList _vertexList);
343 
345  void selectVerticesByValue(int _objectId, QString _component, bool _greater, double _value );
346 
348  void clearModelingVertices(int objectId);
349 
351  void setAllModelingVertices(int objectId);
352 
354  IdList getModelingVertices(int objectId);
355 
356  //==========================================
357  // EDGE OPERATIONS
358  //==========================================
359 
361  void selectEdges(int objectId, IdList _vertexList);
362 
364  void unselectEdges(int objectId, IdList _vertexList);
365 
367  void selectAllEdges(int objectId);
368 
370  void invertEdgeSelection(int objectId);
371 
373  void clearEdgeSelection(int objectId);
374 
376  void selectBoundaryEdges(int objectId);
377 
379  void deleteEdgeSelection(int _objectId);
380 
382  IdList getEdgeSelection(int objectId);
383 
385  IdList convertEdgesToVertexPairs(int _id, const IdList& _edges);
386 
388  IdList convertVertexPairsToEdges(int _id, const IdList& _vertices);
389 
391  int createMeshFromEdgeSelection( int _objectId);
392 
394  void colorizeEdgeSelection(int objectId, int r, int g, int b, int a);
395 
397  void traceEdgePath(int objectId, double threshold);
398 
399  //==========================================
400  // HALFEDGE OPERATIONS
401  //==========================================
402 
404  void selectHalfedges(int objectId, IdList _vertexList);
405 
407  void unselectHalfedges(int objectId, IdList _vertexList);
408 
410  void selectAllHalfedges(int objectId);
411 
413  void invertHalfedgeSelection(int objectId);
414 
416  void clearHalfedgeSelection(int objectId);
417 
419  void selectBoundaryHalfedges(int objectId);
420 
422  IdList getHalfedgeSelection(int objectId);
423 
425  IdList convertHalfedgesToVertexPairs(int _id, const IdList& _halfedges);
426 
428  IdList convertVertexPairsToHalfedges(int _id, const IdList& _vertices);
429 
431  void colorizeHalfedgeSelection(int objectId, int r, int g, int b, int a);
432 
433  //==========================================
434  // FACE OPERATIONS
435  //==========================================
436 
438  void selectFaces(int objectId, IdList _facesList);
439 
441  void unselectFaces(int objectId, IdList _facesList);
442 
444  void selectAllFaces(int objectId);
445 
447  void clearFaceSelection(int objectId);
448 
450  void invertFaceSelection(int objectId);
451 
453  void deleteFaceSelection(int _objectId);
454 
456  void selectBoundaryFaces(int objectId);
457 
459  void shrinkFaceSelection(int objectId);
460 
462  void growFaceSelection(int objectId);
463 
465  IdList getFaceSelection(int objectId);
466 
468  int createMeshFromFaceSelection( int _objectId);
469 
471  void colorizeFaceSelection(int objectId, int r, int g, int b, int a);
472 
473  //===========================================================================
474 
476  void lassoSelect(QRegion& _region, PrimitiveType _primitiveType, bool _deselection);
477 
479  void convertSelection(const int& _objectId ,const QString& _from, const QString& _to, bool _deselect);
480 
482  void conversion(const QString& _from, const QString& _to, bool _deselect);
483 
486  //===========================================================================
489  //===========================================================================
490 
491 private:
492 
494  template<typename MeshT>
495  bool deleteSelection(MeshT* _mesh, PrimitiveType _primitiveType);
496 
498  template<typename MeshT>
499  void update_regions(MeshT* _mesh);
500 
502  template<typename MeshT>
503  void toggleMeshSelection(int _objectId, MeshT* _mesh, uint _fh, ACG::Vec3d& _hit_point, PrimitiveType _primitiveType);
504 
506  template<typename MeshT>
507  void paintSphereSelection(MeshT* _mesh, int _objectId, int _target_idx,
508  typename MeshT::Point _hitpoint, double _radius,
509  PrimitiveType _primitiveTypes, bool _deselection);
510 
512  template<class MeshT>
513  bool volumeSelection(MeshT* _mesh, int _objectId, ACG::GLState& _state,
514  QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection);
515 
517  template<class MeshT>
518  void closestBoundarySelection(MeshT* _mesh, int _vh,
519  PrimitiveType _primitiveTypes, bool _deselection);
520 
522  template<class MeshT>
523  void floodFillSelection(MeshT* _mesh, int _objectId, uint _fh,
524  double _maxAngle, PrimitiveType _primitiveTypes, bool _deselection);
525 
527  template<typename MeshT>
528  void componentsMeshSelection(MeshT* _mesh, int _objectId, uint _fh,
529  ACG::Vec3d& _hit_point, PrimitiveType _primitiveType);
530 
532  template<class MeshT>
533  void colorizeSelection(MeshT* _mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha);
534 
536  template< class MeshT >
537  void createMeshFromSelection( MeshT& _mesh, MeshT& _newMesh, PrimitiveType _primitiveType);
538 
540  template< class MeshT >
541  void selectVerticesByValue(MeshT* _mesh, QString _component, bool _greater, double _value);
542 
545  //===========================================================================
548  //===========================================================================
549 private:
550 
552  int createMeshFromSelection( int _objectId , PrimitiveType _primitiveType);
553 
556  //===========================================================================
559  //===========================================================================
560 
561 private:
562 
565 
567  SelectionInterface::PrimitiveType vertexType_;
568  SelectionInterface::PrimitiveType edgeType_;
569  SelectionInterface::PrimitiveType halfedgeType_;
570  SelectionInterface::PrimitiveType faceType_;
571 
572  SelectionInterface::PrimitiveType allSupportedTypes_;
573 
575  QPolygon lasso_2Dpoints_;
576 
578  QVector<QPoint> volumeLassoPoints_;
579 
581 
587 
592 
595 };
596 
599 {
600 public:
601 
602  SelectVolumeAction(QRegion&_region, MeshObjectSelectionPlugin* _plugin,
603  unsigned int _type, bool _deselection, ACG::GLState& _state) :
604  state_(_state), region_(_region), plugin_(_plugin), type_(_type), deselection_(_deselection) {};
605 
606  void enter(BaseNode* /*_node*/) {};
607 
608  void leave(BaseNode* /*_node*/) {};
609 
610  bool operator()(BaseNode* _node);
611 
612 private:
613  ACG::GLState& state_;
614  QRegion& region_;
615  MeshObjectSelectionPlugin* plugin_;
616  unsigned int type_;
617  bool deselection_;
618 };
619 //=============================================================================
620 #if defined(INCLUDE_TEMPLATES) && !defined(MESHOBJECTSELECTIONPLUGINT_CC)
621 #define MESHOBJECTSELECTIONPLUGINT_TEMPLATES
622 #include "MeshObjectSelectionPluginT.cc"
623 #endif
624 
625 //=============================================================================
626 #endif // MESHOBJECTSELECTIONPLUGIN_HH defined
627 //=============================================================================
void colorizeHalfedgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
QPolygon lasso_2Dpoints_
Used for lasso selection tool.
void lassoSelect(QRegion &_region, PrimitiveType _primitiveType, bool _deselection)
Lasso selection tool.
void loadFlipperModelingSelection(int _objectId, QString _filename)
Load a selection from an Flipper selection file for the given object.
void colorizeSelection(MeshT *_mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha)
Colorize the selection.
Interface class from which all plugins have to be created.
void deleteFaceSelection(int _objectId)
Delete face that are currently selected.
void slotClosestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a closest boundary selection.
void selectHandleVertices(int objectId, IdList _vertexList)
Set vertices to be part of the handle area.
~MeshObjectSelectionPlugin()
Default destructor.
void selectBoundaryVertices(int _objectId)
Select all boundary vertices of the given object.
QtColorChooserButton * colorButtonHandle_
Handle to selection environment.
Keyboard Event Interface.
Definition: KeyInterface.hh:76
Interface class for Plugins which have to store information in ini files.
Definition: INIInterface.hh:81
void selectEdges(int objectId, IdList _vertexList)
Select given Edges.
void setAllModelingVertices(int objectId)
Set all vertices to be part of the modeling area.
void slotLoadSelection(const INIFile &_file)
Load selection for specific objects in the scene.
Logtype
Log types for Message Window.
IdList convertVertexPairsToEdges(int _id, const IdList &_vertices)
Inverse of function above.
void slotSelectionOperation(QString _operation)
A specific operation is requested.
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.
SelectionInterface::PrimitiveType faceType_
Handle to selection environment.
bool deleteSelection(MeshT *_mesh, PrimitiveType _primitiveType)
Delete all selected elements of a mesh.
void unselectModelingVertices(int objectId, IdList _vertexList)
Remove vertices from modeling area.
void slotSaveSelection(INIFile &_file)
Save selection for all objects in the scene.
void selectAllEdges(int objectId)
Select all Edges.
Update type class.
Definition: UpdateType.hh:70
void selectBoundaryHalfedges(int objectId)
Select boundary edges.
void slotFloodFillSelection(QMouseEvent *_event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a flood fill selection.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void selectAllFaces(int objectId)
Select all faces.
IdList getHandleVertices(int objectId)
Get a list of all handle vertices.
bool volumeSelection(MeshT *_mesh, int _objectId, ACG::GLState &_state, QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection)
Surface volume selection tool.
Interface for all plugins which want to use selection functions.
void colorizeFaceSelection(int objectId, int r, int g, int b, int a)
Colorize the face selection.
void createMeshFromSelection(MeshT &_mesh, MeshT &_newMesh, PrimitiveType _primitiveType)
Create a new mesh from the selection.
int createMeshFromEdgeSelection(int _objectId)
Create a mesh containing the face selection of the given mesh.
void setDefaultColorValues()
sets the default color values for selection/handle/region/feature nodes for all objects of this type ...
void conversion(const QString &_from, const QString &_to, bool _deselect)
Convert the selection on all target objects.
ACG::Vec4f featureColor_
Handle to selection environment.
IdList convertHalfedgesToVertexPairs(int _id, const IdList &_halfedges)
Convert halfedge ids to vertex pairs.
bool initializeOptionsWidget(QWidget *&_widget)
Initialize the Options Widget.
void colorizeEdgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
Interface for all Plugins which do logging to the logging window of the framework.
void selectModelingVertices(int objectId, IdList _vertexList)
Set vertices to be part of the modeling area.
void selectVerticesByValue(int _objectId, QString _component, bool _greater, double _value)
Select vertices by their value.
void slotComponentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a connected components selection.
Options Dialog interface.
QtColorChooserButton * colorButtonSelection_
Options.
void growFaceSelection(int objectId)
Grow the current face selection.
void selectFaces(int objectId, IdList _facesList)
Select given faces.
ConversionDialog * conversionDialog_
Handle to selection environment.
Traverse the scenegraph and call the selection function for all mesh nodes.
QVector< QPoint > volumeLassoPoints_
Used for volume lasso tool.
void unselectHandleVertices(int objectId, IdList _vertexList)
Remove vertices from handle area.
void shrinkFaceSelection(int objectId)
Shrink the current face selection.
void setAllHandleVertices(int objectId)
Set all vertices to be part of the handle area.
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 slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a volume lasso selection.
void saveFlipperModelingSelection(int _objectId, QString _filename)
Save a selection in Flipper Selection Format.
Class for the handling of simple configuration files.
Definition: INIFile.hh:105
bool operator()(BaseNode *_node)
Traverse the scenegraph and call the selection function for all mesh nodes.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
Definition: DataTypes.hh:192
void selectHalfedges(int objectId, IdList _vertexList)
Select given Halfedges.
void clearHandleVertices(int objectId)
Clear handle Area.
void unselectVertices(int objectId, IdList _vertexList)
unselect given vertices
void invertHalfedgeSelection(int objectId)
Unselect all Halfedges.
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers)
One of the previously registered keys has been pressed.
void convertSelection(const int &_objectId, const QString &_from, const QString &_to, bool _deselect)
Convert the selection on one object.
void selectAllHalfedges(int objectId)
Select all Halfedges.
int createMeshFromFaceSelection(int _objectId)
Create a mesh containing the face selection of the given mesh.
Interface for all Plugins which provide scriptable Functions.
void deleteVertexSelection(int _objectId)
Delete vertices and faces that are currently selected.
IdList getHalfedgeSelection(int objectId)
Return a list of all selected edges.
void growVertexSelection(int _objectId)
Grow the current vertex selection.
IdList getModelingVertices(int objectId)
Get a list of all modeling vertices.
QString description()
Return a description of what the plugin is doing.
void updateSlotDescriptions()
Set descriptions for local public slots.
void selectAllVertices(int _objectId)
Select all Vertices.
void unselectFaces(int objectId, IdList _facesList)
Unselect given faces.
IdList convertEdgesToVertexPairs(int _id, const IdList &_edges)
Convert edge ids to vertex pairs.
Interface for all plugins which want to Load or Save files and create Objects.
SelectionInterface::PrimitiveType edgeType_
Handle to selection environment.
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a toggle selection.
void componentsMeshSelection(MeshT *_mesh, int _objectId, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Connected component mesh selection.
void colorizeVertexSelection(int _objectId, int _r, int _g, int _b, int a)
Colorize the vertex selection.
void clearHalfedgeSelection(int objectId)
Invert the current edge selection.
IdList getFaceSelection(int objectId)
Return a list of all selected faces.
void slotMouseWheelEvent(QWheelEvent *event, std::string const &mode)
Wheel Event from main application.
void shrinkVertexSelection(int _objectId)
Shrink the current vertex selection.
QString environmentHandle_
Handle to selection environment.
void updateColorValues()
Set descriptions for local public slots.
void invertFaceSelection(int objectId)
Invert the current face selection.
void clearFaceSelection(int objectId)
Unselect all faces.
void selectBoundaryFaces(int objectId)
Select all boundary faces of the given object.
SelectionInterface::PrimitiveType vertexType_
Primitive type handles:
void setColorForSelection(const int _objectId, const PrimitiveType _primitiveType)
Set color for selection.
void invertEdgeSelection(int objectId)
Unselect all Edges.
void selectClosestBoundaryVertices(int _objectId, int _vertexId)
Select all vertices of the boundary close to the given vertex.
Interface class for backup handling.
void conversionRequested()
Show selection conversion dialog.
void slotSphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a sphere selection.
Interface class for receiving mouse events.
void selectVertices(int objectId, IdList _vertexList)
select given vertices
SelectionInterface::PrimitiveType halfedgeType_
Handle to selection environment.
Predefined datatypes.
Definition: DataTypes.hh:96
ACG::Vec4f statusColor_
Handle to selection environment.
void addedEmptyObject(int _id)
An empty object has been added.
void traceEdgePath(int objectId, double threshold)
Trace Edge Path.
void unselectHalfedges(int objectId, IdList _vertexList)
Unselect given Halfedges.
void update_regions(MeshT *_mesh)
Update face selection to correspond to the vertex selection.
int createMeshFromVertexSelection(int _objectId)
select given vertices
void clearVertexSelection(int _objectId)
Unselect all vertices.
QtColorChooserButton * colorButtonFeature_
Handle to selection environment.
MeshObjectSelectionPlugin()
Default constructor.
SelectionInterface::PrimitiveType allSupportedTypes_
Handle to selection environment.
void invertVertexSelection(int _objectId)
Invert the current vertex selection.
void deleteEdgeSelection(int _objectId)
Delete edges that are currently selected.
void slotLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a lasso selection.
ACG::Vec4f areaColor_
Handle to selection environment.
void selectBoundaryEdges(int objectId)
select boundary edges
void toggleMeshSelection(int _objectId, MeshT *_mesh, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Toggle mesh selection.
void clearModelingVertices(int objectId)
Clear Modeling Area.
IdList getVertexSelection(int _objectId)
Return a list of all selected vertices.
IdList convertVertexPairsToHalfedges(int _id, const IdList &_vertices)
Inverse of function above.
void clearEdgeSelection(int objectId)
Invert the current edge selection.
void unselectEdges(int objectId, IdList _vertexList)
Unselect given Edges.
IdList getEdgeSelection(int objectId)
Return a list of all selected edges.
void closestBoundarySelection(MeshT *_mesh, int _vh, PrimitiveType _primitiveTypes, bool _deselection)
Select all entities that are incident to closest boundary.
QtColorChooserButton * colorButtonArea_
Handle to selection environment.
ACG::Vec4f handleColor_
Handle to selection environment.