Developer Documentation
MeshObjectSelectionPlugin Class Reference
Inheritance diagram for MeshObjectSelectionPlugin:
PythonInterface OptionsInterface MouseInterface SelectionInterface LoggingInterface ScriptInterface BackupInterface INIInterface LoadSaveInterface KeyInterface BaseInterface

Public Slots

void loadSelection (int _objId, const QString &_filename)
 
QString version ()
 

Signals

void updateView ()
 
void updatedObject (int, const UpdateType &)
 
void nodeVisibilityChanged (int _identifier)
 
void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 
void createBackup (int _objectid, QString _name, UpdateType _type=UPDATE_ALL)
 
void log (Logtype _type, QString _message)
 
void log (QString _message)
 
void addSelectionEnvironment (QString _modeName, QString _description, QString _icon, QString &_handleName)
 
void registerType (QString _handleName, DataType _type)
 
void addPrimitiveType (QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType &_typeHandle)
 
void addSelectionOperations (QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type=0u)
 
void addSelectionParameters (QString _handleName, QWidget *_widget, QString _category, SelectionInterface::PrimitiveType _type=0u)
 
void showToggleSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void showLassoSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void showVolumeLassoSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void showSphereSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void showClosestBoundarySelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void showFloodFillSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void showComponentsSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void getActiveDataTypes (SelectionInterface::TypeList &_types)
 
void getActivePrimitiveType (SelectionInterface::PrimitiveType &_type)
 
void targetObjectsOnly (bool &_targetsOnly)
 
void registerKeyShortcut (int _key, Qt::KeyboardModifiers _modifiers=Qt::NoModifier)
 
void deleteObject (int _objectId)
 
void addEmptyObject (DataType _type, int &_id)
 
void scriptInfo (QString _functionName)
 
- Signals inherited from BaseInterface
virtual void updateView ()
 Update current view in Main Application. More...
 
virtual void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 Set a description for a public slot. More...
 
virtual void setRenderer (unsigned int _viewer, QString _rendererName)
 Set a renderer for the given viewer. More...
 
- Signals inherited from KeyInterface
virtual void registerKey (int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse=false)
 Register a key-combination for your plugin. More...
 
- Signals inherited from LoadSaveInterface
virtual void save (int _id, QString _filename)
 Save object to a file. More...
 
virtual void load (QString _filename, DataType _type, int &_id)
 Load object from file with a specific DataType. More...
 
- Signals inherited from BackupInterface
virtual void createBackup (int _objectid, QString _name, UpdateType _type=UPDATE_ALL)
 Tell Backup Plugin to create a backup. More...
 
virtual void aboutToRestore (int _objectid)
 Backup Plugin tells other Plugins that a restore will happen. More...
 
virtual void generateBackup (int _id, QString _name, UpdateType _type)
 This signal is emitted by a BackupPlugin and tells a TypePlugin to generate a backup. More...
 
- Signals inherited from ScriptInterface
virtual void scriptInfo (QString _functionWithParameters)
 Emit this signal if a scriptable function is executed. More...
 
virtual void getScriptingEngine (QScriptEngine *&_engine)
 
virtual void executeScript (QString _script)
 
virtual void getAvailableFunctions (QStringList &_functions)
 
- Signals inherited from LoggingInterface
virtual void log (Logtype _type, QString _message)=0
 
virtual void log (QString _message)=0
 
- Signals inherited from SelectionInterface
virtual void addSelectionEnvironment (QString _modeName, QString _description, QString _icon, QString &_handleName)
 Add a selection environment in order to provide selection functions for specific data type(s) More...
 
virtual void showToggleSelectionMode (QString _handleName, bool _show, PrimitiveType _associatedTypes)
 Show toggle selection mode in a specified selection environment. More...
 
virtual void addSelectionOperations (QString _handleName, QStringList _operationsList, QString _category, PrimitiveType _type=0u)
 Add non-interactive selection operations for a specific primitive type. More...
 
virtual void selectionOperation (QString _operation)
 Emitted by selection base plugin when a non-interactive selection operation is requested. More...
 
virtual void registerKeyShortcut (int _key, Qt::KeyboardModifiers _modifiers=Qt::NoModifier)
 Register key shortcut. More...
 

Public Member Functions

 MeshObjectSelectionPlugin ()
 Default constructor.
 
 ~MeshObjectSelectionPlugin ()
 Default destructor.
 
bool initializeOptionsWidget (QWidget *&_widget)
 Initialize the Options Widget. More...
 
bool vertexTypeActive ()
 
bool edgeTypeActive ()
 
bool faceTypeActive ()
 
template<typename MeshType >
void update_regions (MeshType *_mesh)
 Update face selection to correspond to the vertex selection. More...
 

Private Slots

void loadIniFile (INIFile &_ini, int _id)
 
void saveIniFile (INIFile &_ini, int _id)
 
void initializePlugin ()
 
void pluginsInitialized ()
 
void noguiSupported ()
 
void applyOptions ()
 
QString name ()
 
Private slots
void conversionRequested ()
 Show selection conversion dialog.
 
void setDefaultColorValues ()
 sets the default color values for selection/handle/region/feature nodes for all objects of this type
 
- Private Slots inherited from BaseInterface
virtual void exit ()
 
virtual QString version ()
 Return a version string for your plugin. More...
 
- Private Slots inherited from KeyInterface
virtual void slotKeyEvent (QKeyEvent *_event)
 Key Event from Main App. More...
 
- Private Slots inherited from SelectionInterface
virtual void loadSelection (int _objId, const QString &_filename)
 Scripting slot for loading selections. More...
 

Private Member Functions

void slotSelectionOperation (QString _operation)
 A specific operation is requested. More...
 
void slotToggleSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 Called whenever the user performs a toggle selection. More...
 
void slotLassoSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 Called whenever the user performs a lasso selection. More...
 
void slotVolumeLassoSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 Called whenever the user performs a volume lasso selection. More...
 
void slotSphereSelection (QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 Called whenever the user performs a sphere selection. More...
 
void slotClosestBoundarySelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 Called whenever the user performs a closest boundary selection. More...
 
void slotFloodFillSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 Called whenever the user performs a flood fill selection. More...
 
void slotComponentsSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 Called whenever the user performs a connected components selection. More...
 
void slotIndexSelection (int _key)
 
void slotLoadSelection (const INIFile &_file)
 Load selection for specific objects in the scene. More...
 
void slotSaveSelection (INIFile &_file)
 Save selection for all objects in the scene. More...
 
void slotKeyShortcutEvent (int _key, Qt::KeyboardModifiers _modifiers)
 One of the previously registered keys has been pressed. More...
 
void slotMouseWheelEvent (QWheelEvent *event, std::string const &mode)
 Wheel Event from main application. More...
 
void addedEmptyObject (int _id)
 An empty object has been added. More...
 
QString description ()
 Return a description of what the plugin is doing. More...
 
Private methods
void updateColorValues ()
 Set descriptions for local public slots.
 
void updateSlotDescriptions ()
 Set descriptions for local public slots.
 
void setColorForSelection (const int _objectId, const PrimitiveType _primitiveType)
 Set color for selection.
 
Template Functions
template<typename MeshT >
bool deleteSelection (MeshT *_mesh, PrimitiveType _primitiveType)
 Delete all selected elements of a mesh. More...
 
template<typename MeshT >
void update_regions (MeshT *_mesh)
 Update face selection to correspond to the vertex selection.
 
template<typename MeshT >
void toggleMeshSelection (int _objectId, MeshT *_mesh, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
 Toggle mesh selection. More...
 
template<typename MeshT >
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. More...
 
template<class MeshT >
bool volumeSelection (MeshT *_mesh, int _objectId, ACG::GLState &_state, QRegion *_region, PrimitiveType _primitiveTypes, bool _deselection)
 Surface volume selection tool. More...
 
template<class MeshT >
void closestBoundarySelection (MeshT *_mesh, int _vh, PrimitiveType _primitiveTypes, bool _deselection)
 Select all entities that are incident to closest boundary. More...
 
template<class MeshT >
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) More...
 
template<typename MeshT >
void componentsMeshSelection (MeshT *_mesh, int _objectId, uint _fh, ACG::Vec3d &_hit_point, PrimitiveType _primitiveType)
 Connected component mesh selection. More...
 
template<class MeshT >
void colorizeSelection (MeshT *_mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha)
 Colorize the selection. More...
 
template<class MeshT >
void createMeshFromSelection (MeshT &_mesh, MeshT &_newMesh, PrimitiveType _primitiveType)
 Create a new mesh from the selection. More...
 
template<class MeshT >
void selectVerticesByValue (MeshT *_mesh, QString _component, bool _greater, double _value)
 Select vertices by value.
 
Private helper function
int createMeshFromSelection (int _objectId, PrimitiveType _primitiveType)
 Create a mesh containing the selection of the given mesh.
 
- Private Member Functions inherited from BaseInterface
virtual void noguiSupported ()
 
virtual ~BaseInterface ()
 Destructor.
 
virtual void blockScenegraphUpdates (bool _block)
 Tell the core to prevent scenegraph updates. More...
 
virtual void updatedObject (int _objectId)
 An object has been changed or added by this plugin. More...
 
virtual void updatedObject (int _identifier, const UpdateType &_type)
 An object has been changed or added by this plugin. More...
 
virtual void nodeVisibilityChanged (int _identifier)
 A scenegraph node has been shown or hidden. More...
 
virtual QString name ()=0
 Return a name for the plugin. More...
 
virtual void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer. More...
 
- Private Member Functions inherited from KeyInterface
virtual void slotKeyReleaseEvent (QKeyEvent *_event)
 Key Release Event from Main App. More...
 
virtual ~KeyInterface ()
 Destructor.
 
- Private Member Functions inherited from LoadSaveInterface
virtual ~LoadSaveInterface ()
 Destructor.
 
virtual void addEmptyObject (DataType _type, int &_id)
 
virtual void copyObject (int _oldId, int &_newId)
 
virtual void emptyObjectAdded (int _id)
 DEPRECATED HERE (Moved to Type Interface)! Emit this signal if an empty object has been created. More...
 
virtual void deleteObject (int _id)
 Delete an object
This signal can be called from any thread.
. More...
 
virtual void deleteAllObjects ()
 Delete all Objects. More...
 
virtual void getAllFileFilters (QStringList &_filters)
 Get all file filters that are registered. More...
 
- Private Member Functions inherited from INIInterface
virtual ~INIInterface ()
 Destructor.
 
- Private Member Functions inherited from BackupInterface
virtual void createBackup (IdList _objectids, QString _name, std::vector< UpdateType > _types)
 Tell Backup Plugin to create a group backup. More...
 
virtual void undo (int _objectid)
 Tell Backup Plugin to undo the last action of an object. More...
 
virtual void redo (int _objectid)
 Tell Backup Plugin to redo the last action on an object. More...
 
virtual void undo ()
 Tell Backup Plugin to undo the last action. More...
 
virtual void redo ()
 Tell Backup Plugin to redo the last action. More...
 
virtual ~BackupInterface ()
 Destructor.
 
virtual void restored (int _objectid)
 Backup Plugin tells other Plugins that a restore has happened. More...
 
- Private Member Functions inherited from ScriptInterface
virtual ~ScriptInterface ()
 Destructor.
 
virtual void executeFileScript (QString _filename)
 
virtual void getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
 
- Private Member Functions inherited from LoggingInterface
virtual ~LoggingInterface ()
 Destructor.
 
- Private Member Functions inherited from SelectionInterface
virtual ~SelectionInterface ()
 Destructor.
 
virtual void registerType (QString _handleName, DataType _type)
 Register data type for a selection environment. More...
 
virtual void addPrimitiveType (QString _handleName, QString _name, QString _icon, PrimitiveType &_typeHandle)
 Provide selection for primitives other than the standard ones. More...
 
virtual void showLassoSelectionMode (QString _handleName, bool _show, PrimitiveType _associatedTypes)
 Show lasso selection mode in a specified selection environment. More...
 
virtual void showVolumeLassoSelectionMode (QString _handleName, bool _show, PrimitiveType _associatedTypes)
 Show volume lasso selection mode in a specified selection environment. More...
 
virtual void showSurfaceLassoSelectionMode (QString _handleName, bool _show, PrimitiveType _associatedTypes)
 Show surface lasso selection mode in a specified selection environment. More...
 
virtual void showSphereSelectionMode (QString _handleName, bool _show, PrimitiveType _associatedTypes)
 Show sphere selection mode in a specified selection environment. More...
 
virtual void showClosestBoundarySelectionMode (QString _handleName, bool _show, PrimitiveType _associatedTypes)
 Show closest boundary selection mode in a specified selection environment. More...
 
virtual void showFloodFillSelectionMode (QString _handleName, bool _show, PrimitiveType _associatedTypes)
 Show flood fill selection mode in a specified selection environment. More...
 
virtual void showComponentsSelectionMode (QString _handleName, bool _show, PrimitiveType _associatedTypes)
 Show connected components selection mode in a specified selection environment. More...
 
virtual void addCustomSelectionMode (QString _handleName, QString _modeName, QString _description, QString _icon, PrimitiveType _associatedTypes, QString &_customIdentifier)
 Add a custom interactive selection mode. More...
 
virtual void addCustomSelectionMode (QString _handleName, QString _modeName, QString _description, QString _icon, PrimitiveType _associatedTypes, QString &_customIdentifier, DataType _objectTypeRestriction)
 Add a custom interactive selection mode. More...
 
virtual void getActiveDataTypes (TypeList &_types)
 Get the data types that the currently active selection environment supports. More...
 
virtual void getActivePrimitiveType (PrimitiveType &_type)
 Get the primitive type that is selected. More...
 
virtual void targetObjectsOnly (bool &_targetsOnly)
 Indicates whether selection should be performed on target objects only. More...
 
virtual void addSelectionParameters (QString _handleName, QWidget *_widget, QString _category, PrimitiveType _type=0u)
 Add interactive selection parameters for a specific primitive type. More...
 
virtual void toggleSelection (QMouseEvent *_event, PrimitiveType _currentType, bool _deselect)
 Emitted by selection base plugin whenever the user performs a toggle selection. More...
 
virtual void lassoSelection (QMouseEvent *_event, PrimitiveType _currentType, bool _deselect)
 Emitted by selection base plugin whenever the user performs a lasso selection. More...
 
virtual void volumeLassoSelection (QMouseEvent *_event, PrimitiveType _currentType, bool _deselect)
 Emitted by selection base plugin whenever the user performs a volume lasso selection. More...
 
virtual void surfaceLassoSelection (QMouseEvent *_event, PrimitiveType _currentType, bool _deselect)
 Emitted by selection base plugin whenever the user performs a surface lasso selection. More...
 
virtual void sphereSelection (QMouseEvent *_event, double _radius, PrimitiveType _currentType, bool _deselect)
 Emitted by selection base plugin whenever the user performs a sphere selection. More...
 
virtual void closestBoundarySelection (QMouseEvent *_event, PrimitiveType _currentType, bool _deselect)
 Emitted by selection base plugin whenever the user performs a closest boundary selection. More...
 
virtual void floodFillSelection (QMouseEvent *_event, PrimitiveType _currentType, bool _deselect)
 Emitted by selection base plugin whenever the user performs a flood fill selection. More...
 
virtual void componentsSelection (QMouseEvent *_event, PrimitiveType _currentType, bool _deselect)
 Emitted by selection base plugin whenever the user performs a connected components selection. More...
 
virtual void customSelection (QMouseEvent *_event, PrimitiveType _currentType, QString _customIdentifier, bool _deselect)
 Emitted by selection base plugin whenever the user performs a custom selection. More...
 
virtual void loadSelection (const INIFile &_file)
 Load selections from ini-file. More...
 
virtual void saveSelection (INIFile &_file)
 Save selections into ini-file. More...
 
virtual void keyShortcutEvent (int _key, Qt::KeyboardModifiers _modifiers=Qt::NoModifier)
 Key shortcut event happened. More...
 
- Private Member Functions inherited from MouseInterface
virtual ~MouseInterface ()
 Destructor.
 
- Private Member Functions inherited from OptionsInterface
virtual ~OptionsInterface ()
 Destructor.
 
virtual void applyOptions ()=0
 Apply changes to options. More...
 
- Private Member Functions inherited from PythonInterface
virtual ~PythonInterface ()
 Destructor.
 

Private Attributes

Member variables
QString environmentHandle_
 Handle to selection environment.
 
SelectionInterface::PrimitiveType vertexType_
 Primitive type handles:
 
SelectionInterface::PrimitiveType edgeType_
 Handle to selection environment.
 
SelectionInterface::PrimitiveType halfedgeType_
 Handle to selection environment.
 
SelectionInterface::PrimitiveType faceType_
 Handle to selection environment.
 
SelectionInterface::PrimitiveType allSupportedTypes_
 Handle to selection environment.
 
QPolygon lasso_2Dpoints_
 Used for lasso selection tool.
 
QVector< QPoint > volumeLassoPoints_
 Used for volume lasso tool.
 
ConversionDialogconversionDialog_
 Handle to selection environment.
 
ParameterWidgetparameterWidget_
 Handle to selection environment.
 
QtColorChooserButtoncolorButtonSelection_
 Options.
 
QtColorChooserButtoncolorButtonArea_
 Handle to selection environment.
 
QtColorChooserButtoncolorButtonHandle_
 Handle to selection environment.
 
QtColorChooserButtoncolorButtonFeature_
 Handle to selection environment.
 
ACG::Vec4f statusColor_
 Handle to selection environment.
 
ACG::Vec4f areaColor_
 Handle to selection environment.
 
ACG::Vec4f handleColor_
 Handle to selection environment.
 
ACG::Vec4f featureColor_
 Handle to selection environment.
 
double dihedral_angle_threshold_
 Handle to selection environment.
 
double max_angle_
 Handle to selection environment.
 

Friends

class SelectVolumeAction
 

Scriptable slots

template<typename HandleT >
bool selectElement (int _objectId, HandleT _handle, bool _fly_to_element)
 set dihedral angle threshold for edge selection
 
void set_dihedral_angle_threshold (const double _a)
 set dihedral angle threshold for edge selection
 
double get_dihedral_angle_threshold ()
 get dihedral angle threshold for edge selection
 
void set_max_angle (const double _a)
 set max angle for flood fill selection
 
double get_max_angle ()
 get max angle for flood fill selection
 
void selectVertices (int objectId, IdList _vertexList)
 select given vertices
 
bool selectVertex (int _objectId, int _idx, bool _fly_to_vertex)
 select vertex with id _idx and maybe fly to it
 
void unselectVertices (int objectId, IdList _vertexList)
 unselect given vertices
 
void selectAllVertices (int _objectId)
 Select all Vertices.
 
void clearVertexSelection (int _objectId)
 Unselect all vertices.
 
void invertVertexSelection (int _objectId)
 Invert the current vertex selection.
 
void selectBoundaryVertices (int _objectId)
 Select all boundary vertices of the given object.
 
void selectClosestBoundaryVertices (int _objectId, int _vertexId)
 Select all vertices of the boundary close to the given vertex.
 
void shrinkVertexSelection (int _objectId)
 Shrink the current vertex selection.
 
void growVertexSelection (int _objectId)
 Grow the current vertex selection.
 
IdList getVertexSelection (int _objectId)
 Return a list of all selected vertices.
 
void deleteVertexSelection (int _objectId)
 Delete vertices and faces that are currently selected.
 
int createMeshFromVertexSelection (int _objectId)
 set dihedral angle threshold for edge selection
 
void colorizeVertexSelection (int _objectId, int _r, int _g, int _b, int a)
 Colorize the vertex selection. More...
 
void selectHandleVertices (int objectId, IdList _vertexList)
 Set vertices to be part of the handle area.
 
void unselectHandleVertices (int objectId, IdList _vertexList)
 Remove vertices from handle area.
 
void clearHandleVertices (int objectId)
 Clear handle Area.
 
void setAllHandleVertices (int objectId)
 Set all vertices to be part of the handle area.
 
IdList getHandleVertices (int objectId)
 Get a list of all handle vertices.
 
void loadFlipperModelingSelection (int _objectId, QString _filename)
 Load a selection from an Flipper selection file for the given object.
 
void saveFlipperModelingSelection (int _objectId, QString _filename)
 Save a selection in Flipper Selection Format.
 
void selectModelingVertices (int objectId, IdList _vertexList)
 Set vertices to be part of the modeling area.
 
void unselectModelingVertices (int objectId, IdList _vertexList)
 Remove vertices from modeling area.
 
void selectVerticesByValue (int _objectId, QString _component, bool _greater, double _value)
 Select vertices by their value. More...
 
void clearModelingVertices (int objectId)
 Clear Modeling Area.
 
void setAllModelingVertices (int objectId)
 Set all vertices to be part of the modeling area.
 
IdList getModelingVertices (int objectId)
 Get a list of all modeling vertices.
 
void selectEdges (int objectId, IdList _edgeList, const double _dihedral_angle_threshold=0.0)
 Select given Edges.
 
bool selectEdge (int _objectId, int _idx, bool _fly_to_edge)
 Select edge with id _idx and maybe fly to it.
 
void unselectEdges (int objectId, IdList _edgeList)
 Unselect given Edges.
 
void selectAllEdges (int objectId)
 Select all Edges.
 
void invertEdgeSelection (int objectId)
 Unselect all Edges.
 
void clearEdgeSelection (int objectId)
 Invert the current edge selection.
 
void selectBoundaryEdges (int objectId)
 select boundary edges
 
void deleteEdgeSelection (int _objectId)
 Delete edges that are currently selected.
 
IdList getEdgeSelection (int objectId)
 Return a list of all selected edges.
 
IdList convertEdgesToVertexPairs (int _id, const IdList &_edges)
 Convert edge ids to vertex pairs.
 
IdList convertVertexPairsToEdges (int _id, const IdList &_vertices)
 Inverse of function above.
 
int createMeshFromEdgeSelection (int _objectId)
 Create a mesh containing the face selection of the given mesh.
 
void colorizeEdgeSelection (int objectId, int r, int g, int b, int a)
 Colorize the edge selection.
 
void traceEdgePath (int objectId, double threshold)
 Trace Edge Path.
 
void selectHalfedges (int objectId, IdList _vertexList)
 Select given Halfedges.
 
bool selectHalfedge (int _objectId, int _idx, bool _fly_to_halfedge)
 Select halfedge with id _idx and maybe fly to it.
 
void unselectHalfedges (int objectId, IdList _vertexList)
 Unselect given Halfedges.
 
void selectAllHalfedges (int objectId)
 Select all Halfedges.
 
void invertHalfedgeSelection (int objectId)
 Unselect all Halfedges.
 
void clearHalfedgeSelection (int objectId)
 Invert the current edge selection.
 
void selectBoundaryHalfedges (int objectId)
 Select boundary edges.
 
IdList getHalfedgeSelection (int objectId)
 Return a list of all selected edges.
 
IdList convertHalfedgesToVertexPairs (int _id, const IdList &_halfedges)
 Convert halfedge ids to vertex pairs.
 
IdList convertVertexPairsToHalfedges (int _id, const IdList &_vertices)
 Inverse of function above.
 
void colorizeHalfedgeSelection (int objectId, int r, int g, int b, int a)
 Colorize the edge selection. More...
 
void selectFaces (int objectId, IdList _facesList)
 Select given faces.
 
bool selectFace (int _objectId, int _idx, bool _fly_to_face)
 Select face with id _idx and maybe fly to it.
 
void unselectFaces (int objectId, IdList _facesList)
 Unselect given faces.
 
void selectAllFaces (int objectId)
 Select all faces.
 
void clearFaceSelection (int objectId)
 Unselect all faces.
 
void invertFaceSelection (int objectId)
 Invert the current face selection.
 
void deleteFaceSelection (int _objectId)
 Delete face that are currently selected.
 
void selectBoundaryFaces (int objectId)
 Select all boundary faces of the given object.
 
void shrinkFaceSelection (int objectId)
 Shrink the current face selection.
 
void growFaceSelection (int objectId)
 Grow the current face selection.
 
IdList getFaceSelection (int objectId)
 Return a list of all selected faces.
 
int createMeshFromFaceSelection (int _objectId)
 Create a mesh containing the face selection of the given mesh.
 
void colorizeFaceSelection (int objectId, int r, int g, int b, int a)
 Colorize the face selection. More...
 
void lassoSelect (QRegion &_region, PrimitiveType _primitiveType, bool _deselection)
 Lasso selection tool.
 
void convertSelection (const int &_objectId, const QString &_from, const QString &_to, bool _deselect)
 Convert the selection on one object.
 
void conversion (const QString &_from, const QString &_to, bool _deselect)
 Convert the selection on all target objects.
 
template<typename MeshObjectT , typename HandleT >
void getFlightData (MeshObjectT &_mesh_object, HandleT _handle, OpenMesh::Vec3d &center, OpenMesh::Vec3d &normal, bool &handle_valid)
 set dihedral angle threshold for edge selection
 
void update_dihedral_angle_threshold_from_ui ()
 set dihedral angle threshold for edge selection
 

Additional Inherited Members

- Private Types inherited from SelectionInterface
typedef std::vector< DataTypeTypeList
 
typedef unsigned int PrimitiveType
 

Detailed Description

Definition at line 73 of file MeshObjectSelectionPlugin.hh.

Member Function Documentation

◆ addedEmptyObject()

void MeshObjectSelectionPlugin::addedEmptyObject ( int  _id)
privatevirtual

An empty object has been added.

Slot is called if an empty object has been added by the core.
This slot will be executed on the main thread.

Parameters
_idId of the new object

Reimplemented from LoadSaveInterface.

Definition at line 2330 of file MeshObjectSelectionPlugin.cc.

◆ closestBoundarySelection()

template<class MeshT >
void MeshObjectSelectionPlugin::closestBoundarySelection ( MeshT *  _mesh,
int  _vh,
PrimitiveType  _primitiveTypes,
bool  _deselection 
)
private

Select all entities that are incident to closest boundary.

select primitives of the closest boundary

Parameters
_mesha mesh
_vhhandle of the vertex that was picked
_primitiveTypesthe currently active primitive types
_deselectiontrue if primitives should be deselected

Definition at line 474 of file MeshObjectSelectionPluginT_impl.hh.

◆ colorizeFaceSelection

void MeshObjectSelectionPlugin::colorizeFaceSelection ( int  objectId,
int  r,
int  g,
int  b,
int  a 
)
slot

Colorize the face selection.

colorize the face selection

Definition at line 322 of file FaceSelection.cc.

◆ colorizeHalfedgeSelection

void MeshObjectSelectionPlugin::colorizeHalfedgeSelection ( int  objectId,
int  r,
int  g,
int  b,
int  a 
)
slot

Colorize the edge selection.

colorize the halfedge selection

Definition at line 360 of file HalfedgeSelection.cc.

◆ colorizeSelection()

template<typename MeshT >
void MeshObjectSelectionPlugin::colorizeSelection ( MeshT *  _mesh,
PrimitiveType  _primitiveTypes,
int  _red,
int  _green,
int  _blue,
int  _alpha 
)
private

Colorize the selection.

Colorize a selection.

Parameters
_mesha mesh
_primitiveTypesselection types
_redrgba color
_greenrgba color
_bluergba color
_alphargba color

Definition at line 803 of file MeshObjectSelectionPluginT_impl.hh.

◆ colorizeVertexSelection

void MeshObjectSelectionPlugin::colorizeVertexSelection ( int  _objectId,
int  _r,
int  _g,
int  _b,
int  a 
)
slot

Colorize the vertex selection.

colorize the vertex selection

Definition at line 348 of file VertexSelection.cc.

◆ componentsMeshSelection()

template<class MeshT >
void MeshObjectSelectionPlugin::componentsMeshSelection ( MeshT *  _mesh,
int  _objectId,
uint  _fh,
ACG::Vec3d _hit_point,
PrimitiveType  _primitiveType 
)
private

Connected component mesh selection.

Select a complete connected component.

Parameters
_mesha mesh
_objectIdObject Id to work on
_fhhandle of the face that was picked
_hit_pointpoint that was picked
_primitiveTypeprimitive types to be selected

Definition at line 645 of file MeshObjectSelectionPluginT_impl.hh.

◆ createMeshFromSelection()

template<class MeshT >
void MeshObjectSelectionPlugin::createMeshFromSelection ( MeshT &  _mesh,
MeshT &  _newMesh,
PrimitiveType  _primitiveType 
)
private

Create a new mesh from the selection.

Parameters
_meshA mesh
_newMeshThe resulting mesh containing only the selected elements
_primitiveTypeWhich primitive should be used for selection (vertices,faces,edges,...)

Definition at line 877 of file MeshObjectSelectionPluginT_impl.hh.

◆ deleteSelection()

template<typename MeshT >
bool MeshObjectSelectionPlugin::deleteSelection ( MeshT *  _mesh,
PrimitiveType  _primitiveType 
)
private

Delete all selected elements of a mesh.

Parameters
_mesha mesh
_primitiveTypebitmask of active primitive types
Returns
returns true if the mesh was changed(i.e there was something selected that was deleted)

Definition at line 58 of file MeshObjectSelectionPluginT_impl.hh.

◆ description()

QString MeshObjectSelectionPlugin::description ( )
inlineprivatevirtual

Return a description of what the plugin is doing.

This function has to return a basic description of the plugin

Implements BaseInterface.

Definition at line 198 of file MeshObjectSelectionPlugin.hh.

◆ floodFillSelection()

template<class MeshT >
void MeshObjectSelectionPlugin::floodFillSelection ( MeshT *  _mesh,
int  _objectId,
uint  _fh,
double  _maxAngle,
PrimitiveType  _primitiveTypes,
bool  _deselection 
)
private

Select all entities that are connected (and do not exceed the maximum dihedral angle)

Select all primitves of a planar region surrounding the faceHandle.

Parameters
_mesha mesh
_objectIdobject id to work on
_fhhandle of the face that was picked
_maxAnglethe maximum dihedral angle over which the flood fill selection passes
_primitiveTypesthe currently active primitive types
_deselectiontrue if primitives should be deselected

Definition at line 556 of file MeshObjectSelectionPluginT_impl.hh.

◆ initializeOptionsWidget()

bool MeshObjectSelectionPlugin::initializeOptionsWidget ( QWidget *&  _widget)
virtual

Initialize the Options Widget.

Initialize the options widget (create a widget and return a pointer to it )

Example :
_widget = new QWidget();

In the widget you can add anything you want.

use the slot applyOptions() to save the values of options currently entered in your widget.

Parameters
_widgetPointer to the new Widget
Returns
Return true if a widget has been created

Implements OptionsInterface.

Definition at line 2274 of file MeshObjectSelectionPlugin.cc.

◆ paintSphereSelection()

template<class MeshT >
void MeshObjectSelectionPlugin::paintSphereSelection ( MeshT *  _mesh,
int  _objectId,
int  _target_idx,
typename MeshT::Point  _hitpoint,
double  _radius,
PrimitiveType  _primitiveType,
bool  _deselection 
)
private

Use the event to paint selection with a sphere.

paint selection with a sphere

Parameters
_mesha mesh
_objectIdobject id to work on
_target_idxhandle of the face that was hit by the mouse picking
_hitpointpoint where the mouse picking hit
_radiusRadius of the selection sphere
_primitiveTypeprimitive types to be selected
_deselectiontrue, if entities should be deselected

Definition at line 255 of file MeshObjectSelectionPluginT_impl.hh.

◆ selectVerticesByValue

void MeshObjectSelectionPlugin::selectVerticesByValue ( int  _objectId,
QString  _component,
bool  _greater,
double  _value 
)
slot

Select vertices by their value.

Todo:
emit scriptinfo

Definition at line 584 of file VertexSelection.cc.

◆ slotClosestBoundarySelection()

void MeshObjectSelectionPlugin::slotClosestBoundarySelection ( QMouseEvent *  _event,
SelectionInterface::PrimitiveType  _currentType,
bool  _deselect 
)
privatevirtual

Called whenever the user performs a closest boundary selection.

This has to be implemented by each type selection plugin if this interactive selection mode should be provided. The metaphor behind it is that the user clicks on an object and the primitives at the closest boundary get selected.

Parameters
_eventThe mouse event that currently is performed
_currentTypeThe currently active primitive type
_deselectTrue if entities should be deselected

Reimplemented from SelectionInterface.

Definition at line 1379 of file MeshObjectSelectionPlugin.cc.

◆ slotComponentsSelection()

void MeshObjectSelectionPlugin::slotComponentsSelection ( QMouseEvent *  _event,
SelectionInterface::PrimitiveType  _currentType,
bool  _deselect 
)
privatevirtual

Called whenever the user performs a connected components selection.

This has to be implemented by each type selection plugin if this interactive selection mode should be provided. The metaphor behind it is that the user clicks on an object and all primitives that are connected to the clicked primitive are selected as well.

Parameters
_eventThe mouse event that currently is performed
_currentTypeThe currently active primitive type
_deselectTrue if entities should be deselected

Reimplemented from SelectionInterface.

Definition at line 1481 of file MeshObjectSelectionPlugin.cc.

◆ slotFloodFillSelection()

void MeshObjectSelectionPlugin::slotFloodFillSelection ( QMouseEvent *  _event,
SelectionInterface::PrimitiveType  _currentType,
bool  _deselect 
)
privatevirtual

Called whenever the user performs a flood fill selection.

This has to be implemented by each type selection plugin if this interactive selection mode should be provided. The metaphor behind it is that the user clicks on an object and all primitives close to this point get selected, if the angle between the clicked point and the next point does not differ more than the specified angle.

Parameters
_eventThe mouse event that currently is performed
_currentTypeThe currently active primitive type
_deselectTrue if entities should be deselected

Reimplemented from SelectionInterface.

Definition at line 1419 of file MeshObjectSelectionPlugin.cc.

◆ slotKeyShortcutEvent()

void MeshObjectSelectionPlugin::slotKeyShortcutEvent ( int  _key,
Qt::KeyboardModifiers  _modifiers 
)
privatevirtual

One of the previously registered keys has been pressed.

This slot is called whenever the user has pressed one of the registered keys. Note that this is actually handled by the selection base plugin since the different plugins might want to register the same key multiple times.

Parameters
_keyThe pressed key
_modifiersIndicates whether mod-keys have been pressed synchronously

Reimplemented from SelectionInterface.

Definition at line 1817 of file MeshObjectSelectionPlugin.cc.

◆ slotLassoSelection()

void MeshObjectSelectionPlugin::slotLassoSelection ( QMouseEvent *  _event,
SelectionInterface::PrimitiveType  _currentType,
bool  _deselect 
)
privatevirtual

Called whenever the user performs a lasso selection.

This has to be implemented by each type selection plugin if this interactive selection mode should be provided. The metaphor behind it is that the user draws a polygonal line and all primitives which are visible get selected.

Parameters
_eventThe mouse event that currently is performed
_currentTypeThe currently active primitive type
_deselectTrue if entities should be deselected

Reimplemented from SelectionInterface.

Definition at line 1294 of file MeshObjectSelectionPlugin.cc.

◆ slotLoadSelection()

void MeshObjectSelectionPlugin::slotLoadSelection ( const INIFile _file)
privatevirtual

Load selection for specific objects in the scene.

OpenFlipper allows for saving of selections in an INI file (implemented by the different selection plugins by overriding function slotSaveSelection()). So this slot is called each time such INI file is about to be loaded.

Parameters
_fileThe file from which one can read the selection data

Reimplemented from SelectionInterface.

Definition at line 1746 of file MeshObjectSelectionPlugin.cc.

◆ slotMouseWheelEvent()

void MeshObjectSelectionPlugin::slotMouseWheelEvent ( QWheelEvent *  _event,
std::string const &  _mode 
)
privatevirtual

Wheel Event from main application.

This slot is called if a wheel event occurred in the Viewer and is extended by the current Mode set in the Viewer. You can add additional Picking Modes to the Viewer by using the picking interface. This slot will only get called in pickingMode.

Parameters
_eventMouse event
_modeName of the current Picking Mode.

Reimplemented from MouseInterface.

Definition at line 1909 of file MeshObjectSelectionPlugin.cc.

◆ slotSaveSelection()

void MeshObjectSelectionPlugin::slotSaveSelection ( INIFile _file)
privatevirtual

Save selection for all objects in the scene.

Override this slot in order to save selections for a specific data type. These selections are then stored within an INI file and can be loaded via slotLoadSelection().

Parameters
_fileThe file into which one can store selection data

Reimplemented from SelectionInterface.

Definition at line 1791 of file MeshObjectSelectionPlugin.cc.

◆ slotSelectionOperation()

void MeshObjectSelectionPlugin::slotSelectionOperation ( QString  _operation)
privatevirtual

A specific operation is requested.

This slot is called each time the user has pressed one of the operations buttons (for the various primitive types) offered in the tool box.

Parameters
_operationThe identifier of the operation just as registered via addSelectionOperations

Reimplemented from SelectionInterface.

Definition at line 453 of file MeshObjectSelectionPlugin.cc.

◆ slotSphereSelection()

void MeshObjectSelectionPlugin::slotSphereSelection ( QMouseEvent *  _event,
double  _radius,
SelectionInterface::PrimitiveType  _currentType,
bool  _deselect 
)
privatevirtual

Called whenever the user performs a sphere selection.

This has to be implemented by each type selection plugin if this interactive selection mode should be provided. The metaphor behind it is that the user draws the selection with a sphere. All primitives inside the current sphere get selected.

Parameters
_eventThe mouse event that currently is performed
_radiusThe current radius of the selection sphere
_currentTypeThe currently active primitive type
_deselectTrue if entities should be deselected

Reimplemented from SelectionInterface.

Definition at line 1352 of file MeshObjectSelectionPlugin.cc.

◆ slotToggleSelection()

void MeshObjectSelectionPlugin::slotToggleSelection ( QMouseEvent *  _event,
SelectionInterface::PrimitiveType  _currentType,
bool  _deselect 
)
privatevirtual

Called whenever the user performs a toggle selection.

This has to be implemented by each type selection plugin if this interactive selection mode should be provided.

Parameters
_eventThe mouse event that occurred
_currentTypeThe currently active primitive type
_deselectTrue if entities should be deselected

Reimplemented from SelectionInterface.

Definition at line 1239 of file MeshObjectSelectionPlugin.cc.

◆ slotVolumeLassoSelection()

void MeshObjectSelectionPlugin::slotVolumeLassoSelection ( QMouseEvent *  _event,
SelectionInterface::PrimitiveType  _currentType,
bool  _deselect 
)
privatevirtual

Called whenever the user performs a volume lasso selection.

This has to be implemented by each type selection plugin if this interactive selection mode should be provided. The metaphor behind it is that the user draws a polygonal line and all primitives which are insinde the volume spanned by the eye position and the polygon get selected.

Parameters
_eventThe mouse event that currently is performed
_currentTypeThe currently active primitive type
_deselectTrue if entities should be deselected

Reimplemented from SelectionInterface.

Definition at line 1321 of file MeshObjectSelectionPlugin.cc.

◆ toggleMeshSelection()

template<class MeshT >
void MeshObjectSelectionPlugin::toggleMeshSelection ( int  _objectId,
MeshT *  _mesh,
uint  _fh,
ACG::Vec3d _hit_point,
PrimitiveType  _primitiveType 
)
private

Toggle mesh selection.

Toggle the selection state of mesh primitives.

Parameters
_objectIdid of the object that encapsulates the mesh
_mesha mesh
_fhhandle of the face that was picked
_hit_pointpoint that was picked
_primitiveTypeprimitive types to be selected

Definition at line 147 of file MeshObjectSelectionPluginT_impl.hh.

◆ update_regions()

template<typename MeshType >
void MeshObjectSelectionPlugin::update_regions ( MeshType *  _mesh)

Update face selection to correspond to the vertex selection.

Parameters
_mesha mesh

Definition at line 107 of file MeshObjectSelectionPluginT_impl.hh.

◆ volumeSelection()

template<class MeshT >
bool MeshObjectSelectionPlugin::volumeSelection ( MeshT *  _mesh,
int  _objectId,
ACG::GLState _state,
QRegion *  _region,
PrimitiveType  _primitiveType,
bool  _deselection 
)
private

Surface volume selection tool.

Select all primitves that are projected to the given region.

Parameters
_mesha mesh
_objectIdobject id to work on
_statecurrent gl state
_regionregion
_primitiveTypeprimitive types to be selected
_deselectiontrue, if entities should be deselected
Returns
true, if something was selected

Definition at line 391 of file MeshObjectSelectionPluginT_impl.hh.


The documentation for this class was generated from the following files: