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  void slotIndexSelection(int _key);
173 
174  void slotLoadSelection(const INIFile& _file);
175  void slotSaveSelection(INIFile& _file);
176 
177  void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers);
178 
179  // MouseInterface
180  void slotMouseWheelEvent(QWheelEvent* event, std::string const& mode);
181 
182  // LoadSaveInterface
183  void addedEmptyObject( int _id );
184 
185 public:
186 
187  // OptionsInterface
188  bool initializeOptionsWidget(QWidget*& _widget);
189 
190 private slots:
191  void applyOptions();
192 
193  // BaseInterface
194  QString name() {
195  return (QString(tr("MeshObjectSelection")));
196  };
197 
198  QString description() {
199  return (QString(tr("Allows to select parts of Mesh Objects")));
200  };
201 
202  //===========================================================================
205  //===========================================================================
206 private:
207 
208  // update and saves new color values for area node/selecion noe etc.
209  void updateColorValues();
210 
212  void updateSlotDescriptions();
213 
215  void setColorForSelection(const int _objectId, const PrimitiveType _primitiveType);
216 
219  //===========================================================================
222  //===========================================================================
223 private slots:
224 
226  void conversionRequested();
227 
229  void setDefaultColorValues();
230 
233 public slots:
234 
235  QString version() {
236  return QString("1.0");
237  };
238 
239  // Is vertex type active? (for use in plugins that need mesh selection)
240  bool vertexTypeActive() {
241  SelectionInterface::PrimitiveType t = 0u;
242  emit getActivePrimitiveType(t);
243  return (t & vertexType_) > 0;
244  }
245 
246  // Is vertex type active? (for use in plugins that need mesh selection)
247  bool edgeTypeActive() {
248  SelectionInterface::PrimitiveType t = 0u;
249  emit getActivePrimitiveType(t);
250  return (t & edgeType_) > 0;
251  }
252 
253  // Is face type active? (for use in plugins that need mesh selection)
254  bool faceTypeActive() {
255  SelectionInterface::PrimitiveType t = 0u;
256  emit getActivePrimitiveType(t);
257  return (t & faceType_) > 0;
258  }
259 
260  //===========================================================================
263  //===========================================================================
264 public slots:
265 
266  //==========================================
267  // VERTEX OPERATIONS
268  //==========================================
269 
271  void selectVertices(int objectId, IdList _vertexList);
272 
274  bool selectVertex(int _objectId, int _idx, bool _fly_to_vertex);
275 
277  void unselectVertices(int objectId, IdList _vertexList);
278 
280  void selectAllVertices(int _objectId);
281 
283  void clearVertexSelection(int _objectId);
284 
286  void invertVertexSelection(int _objectId);
287 
289  void selectBoundaryVertices(int _objectId);
290 
292  void selectClosestBoundaryVertices(int _objectId, int _vertexId);
293 
295  void shrinkVertexSelection(int _objectId);
296 
298  void growVertexSelection(int _objectId);
299 
301  IdList getVertexSelection(int _objectId);
302 
304  void deleteVertexSelection(int _objectId);
305 
306  int createMeshFromVertexSelection( int _objectId);
307 
309  void colorizeVertexSelection(int _objectId, int _r, int _g, int _b, int a);
310 
311  //==========================================
312 
314  void selectHandleVertices(int objectId, IdList _vertexList);
315 
317  void unselectHandleVertices(int objectId, IdList _vertexList);
318 
320  void clearHandleVertices(int objectId);
321 
323  void setAllHandleVertices(int objectId);
324 
326  IdList getHandleVertices(int objectId);
327 
329  void loadFlipperModelingSelection(int _objectId, QString _filename);
330 
332  void saveFlipperModelingSelection(int _objectId, QString _filename);
333 
334  //==========================================
335 
337  void selectModelingVertices(int objectId, IdList _vertexList);
338 
340  void unselectModelingVertices(int objectId, IdList _vertexList);
341 
343  void selectVerticesByValue(int _objectId, QString _component, bool _greater, double _value );
344 
346  void clearModelingVertices(int objectId);
347 
349  void setAllModelingVertices(int objectId);
350 
352  IdList getModelingVertices(int objectId);
353 
354  //==========================================
355  // EDGE OPERATIONS
356  //==========================================
357 
359  void selectEdges(int objectId, IdList _edgeList, const double _dihedral_angle_threshold = 0.0);
360 
362  bool selectEdge(int _objectId, int _idx, bool _fly_to_edge);
363 
365  void unselectEdges(int objectId, IdList _edgeList);
366 
368  void selectAllEdges(int objectId);
369 
371  void invertEdgeSelection(int objectId);
372 
374  void clearEdgeSelection(int objectId);
375 
377  void selectBoundaryEdges(int objectId);
378 
380  void deleteEdgeSelection(int _objectId);
381 
383  IdList getEdgeSelection(int objectId);
384 
386  IdList convertEdgesToVertexPairs(int _id, const IdList& _edges);
387 
389  IdList convertVertexPairsToEdges(int _id, const IdList& _vertices);
390 
392  int createMeshFromEdgeSelection( int _objectId);
393 
395  void colorizeEdgeSelection(int objectId, int r, int g, int b, int a);
396 
398  void traceEdgePath(int objectId, double threshold);
399 
400  //==========================================
401  // HALFEDGE OPERATIONS
402  //==========================================
403 
405  void selectHalfedges(int objectId, IdList _vertexList);
406 
408  bool selectHalfedge(int _objectId, int _idx, bool _fly_to_halfedge);
409 
411  void unselectHalfedges(int objectId, IdList _vertexList);
412 
414  void selectAllHalfedges(int objectId);
415 
417  void invertHalfedgeSelection(int objectId);
418 
420  void clearHalfedgeSelection(int objectId);
421 
423  void selectBoundaryHalfedges(int objectId);
424 
426  IdList getHalfedgeSelection(int objectId);
427 
429  IdList convertHalfedgesToVertexPairs(int _id, const IdList& _halfedges);
430 
432  IdList convertVertexPairsToHalfedges(int _id, const IdList& _vertices);
433 
435  void colorizeHalfedgeSelection(int objectId, int r, int g, int b, int a);
436 
437  //==========================================
438  // FACE OPERATIONS
439  //==========================================
440 
442  void selectFaces(int objectId, IdList _facesList);
443 
445  bool selectFace(int _objectId, int _idx, bool _fly_to_face);
446 
448  void unselectFaces(int objectId, IdList _facesList);
449 
451  void selectAllFaces(int objectId);
452 
454  void clearFaceSelection(int objectId);
455 
457  void invertFaceSelection(int objectId);
458 
460  void deleteFaceSelection(int _objectId);
461 
463  void selectBoundaryFaces(int objectId);
464 
466  void shrinkFaceSelection(int objectId);
467 
469  void growFaceSelection(int objectId);
470 
472  IdList getFaceSelection(int objectId);
473 
475  int createMeshFromFaceSelection( int _objectId);
476 
478  void colorizeFaceSelection(int objectId, int r, int g, int b, int a);
479 
480  //===========================================================================
481 
483  void lassoSelect(QRegion& _region, PrimitiveType _primitiveType, bool _deselection);
484 
486  void convertSelection(const int& _objectId ,const QString& _from, const QString& _to, bool _deselect);
487 
489  void conversion(const QString& _from, const QString& _to, bool _deselect);
490 
491 public:
492  template <typename HandleT>
493  bool selectElement(int _objectId, HandleT _handle, bool _fly_to_element);
494 
495 private:
496  template <typename MeshObjectT, typename HandleT>
497  void getFlightData(MeshObjectT& _mesh_object, HandleT _handle,
498  OpenMesh::Vec3d& center, OpenMesh::Vec3d& normal, bool& handle_valid);
499 
500 
501 public:
503  void set_dihedral_angle_threshold(const double _a);
506 
508  void set_max_angle(const double _a);
510  double get_max_angle();
511 
512 private:
514 
517  //===========================================================================
520  //===========================================================================
521 
522 private:
523 
525  template<typename MeshT>
526  bool deleteSelection(MeshT* _mesh, PrimitiveType _primitiveType);
527 
529  template<typename MeshT>
530  void update_regions(MeshT* _mesh);
531 
533  template<typename MeshT>
534  void toggleMeshSelection(int _objectId, MeshT* _mesh, uint _fh, ACG::Vec3d& _hit_point, PrimitiveType _primitiveType);
535 
537  template<typename MeshT>
538  void paintSphereSelection(MeshT* _mesh, int _objectId, int _target_idx,
539  typename MeshT::Point _hitpoint, double _radius,
540  PrimitiveType _primitiveTypes, bool _deselection);
541 
543  template<class MeshT>
544  bool volumeSelection(MeshT* _mesh, int _objectId, ACG::GLState& _state,
545  QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection);
546 
548  template<class MeshT>
549  void closestBoundarySelection(MeshT* _mesh, int _vh,
550  PrimitiveType _primitiveTypes, bool _deselection);
551 
553  template<class MeshT>
554  void floodFillSelection(MeshT* _mesh, int _objectId, uint _fh,
555  double _maxAngle, PrimitiveType _primitiveTypes, bool _deselection);
556 
558  template<typename MeshT>
559  void componentsMeshSelection(MeshT* _mesh, int _objectId, uint _fh,
560  ACG::Vec3d& _hit_point, PrimitiveType _primitiveType);
561 
563  template<class MeshT>
564  void colorizeSelection(MeshT* _mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha);
565 
567  template< class MeshT >
568  void createMeshFromSelection( MeshT& _mesh, MeshT& _newMesh, PrimitiveType _primitiveType);
569 
571  template< class MeshT >
572  void selectVerticesByValue(MeshT* _mesh, QString _component, bool _greater, double _value);
573 
576  //===========================================================================
579  //===========================================================================
580 private:
581 
583  int createMeshFromSelection( int _objectId , PrimitiveType _primitiveType);
584 
587  //===========================================================================
590  //===========================================================================
591 
592 private:
593 
596 
598  SelectionInterface::PrimitiveType vertexType_;
599  SelectionInterface::PrimitiveType edgeType_;
600  SelectionInterface::PrimitiveType halfedgeType_;
601  SelectionInterface::PrimitiveType faceType_;
602 
603  SelectionInterface::PrimitiveType allSupportedTypes_;
604 
606  QPolygon lasso_2Dpoints_;
607 
609  QVector<QPoint> volumeLassoPoints_;
610 
612 
614 
620 
625 
627  double max_angle_;
628 
631 };
632 
635 {
636 public:
637 
638  SelectVolumeAction(QRegion&_region, MeshObjectSelectionPlugin* _plugin,
639  unsigned int _type, bool _deselection, ACG::GLState& _state) :
640  state_(_state), region_(_region), plugin_(_plugin), type_(_type), deselection_(_deselection) {};
641 
642  void enter(BaseNode* /*_node*/) {};
643 
644  void leave(BaseNode* /*_node*/) {};
645 
646  bool operator()(BaseNode* _node);
647 
648 private:
649  ACG::GLState& state_;
650  QRegion& region_;
651  MeshObjectSelectionPlugin* plugin_;
652  unsigned int type_;
653  bool deselection_;
654 };
655 //=============================================================================
656 #if defined(INCLUDE_TEMPLATES) && !defined(MESHOBJECTSELECTIONPLUGINT_CC)
657 #define MESHOBJECTSELECTIONPLUGINT_TEMPLATES
658 #include "MeshObjectSelectionPluginT_impl.hh"
659 #endif
660 
void unselectModelingVertices(int objectId, IdList _vertexList)
Remove vertices from modeling area.
void slotSelectionOperation(QString _operation)
A specific operation is requested.
void selectEdges(int objectId, IdList _edgeList, const double _dihedral_angle_threshold=0.0)
Select given Edges.
void selectBoundaryFaces(int objectId)
Select all boundary faces of the given object.
void selectHandleVertices(int objectId, IdList _vertexList)
Set vertices to be part of the handle area.
void deleteEdgeSelection(int _objectId)
Delete edges that are currently selected.
QVector< QPoint > volumeLassoPoints_
Used for volume lasso tool.
void conversion(const QString &_from, const QString &_to, bool _deselect)
Convert the selection on all target objects.
void selectBoundaryEdges(int objectId)
select boundary edges
void updateColorValues()
Set descriptions for local public slots.
ConversionDialog * conversionDialog_
Handle to selection environment.
void shrinkVertexSelection(int _objectId)
Shrink the current vertex selection.
void setDefaultColorValues()
sets the default color values for selection/handle/region/feature nodes for all objects of this type ...
void unselectFaces(int objectId, IdList _facesList)
Unselect given faces.
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers)
One of the previously registered keys has been pressed.
Interface class for exporting functions to python.
void selectVerticesByValue(int _objectId, QString _component, bool _greater, double _value)
Select vertices by their value.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void saveFlipperModelingSelection(int _objectId, QString _filename)
Save a selection in Flipper Selection Format.
void unselectHandleVertices(int objectId, IdList _vertexList)
Remove vertices from handle area.
Options Dialog interface.
ACG::Vec4f handleColor_
Handle to selection environment.
void invertFaceSelection(int objectId)
Invert the current face selection.
void growFaceSelection(int objectId)
Grow the current face selection.
Interface class for receiving mouse events.
void unselectHalfedges(int objectId, IdList _vertexList)
Unselect given Halfedges.
int createMeshFromEdgeSelection(int _objectId)
Create a mesh containing the face selection of the given mesh.
void setAllHandleVertices(int objectId)
Set all vertices to be part of the handle area.
double get_dihedral_angle_threshold()
get dihedral angle threshold for edge selection
double dihedral_angle_threshold_
Handle to selection environment.
QPolygon lasso_2Dpoints_
Used for lasso selection tool.
void slotFloodFillSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a flood fill selection.
void selectModelingVertices(int objectId, IdList _vertexList)
Set vertices to be part of the modeling area.
void selectAllEdges(int objectId)
Select all Edges.
void slotMouseWheelEvent(QWheelEvent *event, std::string const &mode)
Wheel Event from main application.
IdList convertVertexPairsToEdges(int _id, const IdList &_vertices)
Inverse of function above.
Logtype
Log types for Message Window.
int createMeshFromVertexSelection(int _objectId)
set dihedral angle threshold for edge selection
void slotLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a lasso selection.
QtColorChooserButton * colorButtonArea_
Handle to selection environment.
void selectAllHalfedges(int objectId)
Select all Halfedges.
ACG::Vec4f statusColor_
Handle to selection environment.
bool deleteSelection(MeshT *_mesh, PrimitiveType _primitiveType)
Delete all selected elements of a mesh.
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a toggle selection.
ACG::Vec4f featureColor_
Handle to selection environment.
Predefined datatypes.
Definition: DataTypes.hh:83
void slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a volume lasso selection.
Interface for all Plugins which do logging to the logging window of the framework.
bool selectFace(int _objectId, int _idx, bool _fly_to_face)
Select face with id _idx and maybe fly to it.
void invertHalfedgeSelection(int objectId)
Unselect all Halfedges.
QtColorChooserButton * colorButtonHandle_
Handle to selection environment.
SelectionInterface::PrimitiveType faceType_
Handle to selection environment.
void deleteFaceSelection(int _objectId)
Delete face that are currently selected.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
Definition: DataTypes.hh:181
SelectionInterface::PrimitiveType vertexType_
Primitive type handles:
void slotSaveSelection(INIFile &_file)
Save selection for all objects in the scene.
void invertVertexSelection(int _objectId)
Invert the current vertex selection.
double max_angle_
Handle to selection environment.
void convertSelection(const int &_objectId, const QString &_from, const QString &_to, bool _deselect)
Convert the selection on one object.
void getFlightData(MeshObjectT &_mesh_object, HandleT _handle, OpenMesh::Vec3d &center, OpenMesh::Vec3d &normal, bool &handle_valid)
set dihedral angle threshold for edge selection
QString description()
Return a description of what the plugin is doing.
void unselectVertices(int objectId, IdList _vertexList)
unselect given vertices
void slotComponentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a connected components selection.
void setAllModelingVertices(int objectId)
Set all vertices to be part of the modeling area.
void selectBoundaryVertices(int _objectId)
Select all boundary vertices of the given object.
IdList getHandleVertices(int objectId)
Get a list of all handle vertices.
void addedEmptyObject(int _id)
An empty object has been added.
void slotSphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a sphere selection.
void update_dihedral_angle_threshold_from_ui()
set dihedral angle threshold for edge selection
QString environmentHandle_
Handle to selection environment.
QtColorChooserButton * colorButtonSelection_
Options.
IdList convertHalfedgesToVertexPairs(int _id, const IdList &_halfedges)
Convert halfedge ids to vertex pairs.
void deleteVertexSelection(int _objectId)
Delete vertices and faces that are currently selected.
IdList getModelingVertices(int objectId)
Get a list of all modeling vertices.
void traceEdgePath(int objectId, double threshold)
Trace Edge Path.
void colorizeEdgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
void selectBoundaryHalfedges(int objectId)
Select boundary edges.
void set_dihedral_angle_threshold(const double _a)
set dihedral angle threshold for edge selection
void slotLoadSelection(const INIFile &_file)
Load selection for specific objects in the scene.
double get_max_angle()
get max angle for flood fill selection
void selectVertices(int objectId, IdList _vertexList)
select given vertices
void clearHalfedgeSelection(int objectId)
Invert the current edge selection.
IdList convertVertexPairsToHalfedges(int _id, const IdList &_vertices)
Inverse of function above.
void unselectEdges(int objectId, IdList _edgeList)
Unselect given Edges.
Interface for all plugins which want to use selection functions.
Update type class.
Definition: UpdateType.hh:59
bool selectVertex(int _objectId, int _idx, bool _fly_to_vertex)
select vertex with id _idx and maybe fly to it
MeshObjectSelectionPlugin()
Default constructor.
IdList getFaceSelection(int objectId)
Return a list of all selected faces.
QtColorChooserButton * colorButtonFeature_
Handle to selection environment.
SelectionInterface::PrimitiveType edgeType_
Handle to selection environment.
void createMeshFromSelection(MeshT &_mesh, MeshT &_newMesh, PrimitiveType _primitiveType)
Create a new mesh from the selection.
IdList getHalfedgeSelection(int objectId)
Return a list of all selected edges.
void colorizeSelection(MeshT *_mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha)
Colorize the selection.
void selectFaces(int objectId, IdList _facesList)
Select given faces.
bool selectEdge(int _objectId, int _idx, bool _fly_to_edge)
Select edge with id _idx and maybe fly to it.
void selectClosestBoundaryVertices(int _objectId, int _vertexId)
Select all vertices of the boundary close to the given vertex.
void componentsMeshSelection(MeshT *_mesh, int _objectId, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Connected component mesh selection.
void clearHandleVertices(int objectId)
Clear handle Area.
Keyboard Event Interface.
Definition: KeyInterface.hh:59
Interface class for Plugins which have to store information in ini files.
Definition: INIInterface.hh:60
bool selectElement(int _objectId, HandleT _handle, bool _fly_to_element)
set dihedral angle threshold for edge selection
SelectionInterface::PrimitiveType halfedgeType_
Handle to selection environment.
void updateSlotDescriptions()
Set descriptions for local public slots.
Class for the handling of simple configuration files.
Definition: INIFile.hh:99
SelectionInterface::PrimitiveType allSupportedTypes_
Handle to selection environment.
IdList getVertexSelection(int _objectId)
Return a list of all selected vertices.
void set_max_angle(const double _a)
set max angle for flood fill selection
void shrinkFaceSelection(int objectId)
Shrink the current face selection.
void closestBoundarySelection(MeshT *_mesh, int _vh, PrimitiveType _primitiveTypes, bool _deselection)
Select all entities that are incident to closest boundary.
void setColorForSelection(const int _objectId, const PrimitiveType _primitiveType)
Set color for selection.
void clearModelingVertices(int objectId)
Clear Modeling Area.
int createMeshFromFaceSelection(int _objectId)
Create a mesh containing the face selection of the given mesh.
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.
Interface for all Plugins which provide scriptable Functions.
ParameterWidget * parameterWidget_
Handle to selection environment.
bool volumeSelection(MeshT *_mesh, int _objectId, ACG::GLState &_state, QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection)
Surface volume selection tool.
void selectAllVertices(int _objectId)
Select all Vertices.
IdList convertEdgesToVertexPairs(int _id, const IdList &_edges)
Convert edge ids to vertex pairs.
bool selectHalfedge(int _objectId, int _idx, bool _fly_to_halfedge)
Select halfedge with id _idx and maybe fly to it.
void selectHalfedges(int objectId, IdList _vertexList)
Select given Halfedges.
void selectAllFaces(int objectId)
Select all faces.
void conversionRequested()
Show selection conversion dialog.
void clearFaceSelection(int objectId)
Unselect all faces.
void toggleMeshSelection(int _objectId, MeshT *_mesh, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
Toggle mesh selection.
void slotClosestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
Called whenever the user performs a closest boundary selection.
~MeshObjectSelectionPlugin()
Default destructor.
void colorizeHalfedgeSelection(int objectId, int r, int g, int b, int a)
Colorize the edge selection.
void lassoSelect(QRegion &_region, PrimitiveType _primitiveType, bool _deselection)
Lasso selection tool.
IdList getEdgeSelection(int objectId)
Return a list of all selected edges.
void invertEdgeSelection(int objectId)
Unselect all Edges.
void update_regions(MeshT *_mesh)
Update face selection to correspond to the vertex selection.
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 clearVertexSelection(int _objectId)
Unselect all vertices.
Interface class from which all plugins have to be created.
void clearEdgeSelection(int objectId)
Invert the current 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.
Interface class for backup handling.
void colorizeVertexSelection(int _objectId, int _r, int _g, int _b, int a)
Colorize the vertex selection.
ACG::Vec4f areaColor_
Handle to selection environment.
Traverse the scenegraph and call the selection function for all mesh nodes.
Interface for all plugins which want to Load or Save files and create Objects.
bool initializeOptionsWidget(QWidget *&_widget)
Initialize the Options Widget.
void colorizeFaceSelection(int objectId, int r, int g, int b, int a)
Colorize the face selection.