Developer Documentation
SelectionBasePlugin Class Reference
Inheritance diagram for SelectionBasePlugin:
SelectionInterface LoadSaveInterface ToolbarInterface ContextMenuInterface ScriptInterface LoggingInterface INIInterface ToolboxInterface PickingInterface KeyInterface MouseInterface BaseInterface

Classes

struct  SelectionEnvironment
 

Public Slots

QString version ()
 

Signals

void updateView ()
 
void log (Logtype _type, QString _message)
 
void log (QString _message)
 
void addToolbar (QToolBar *_toolbar)
 
void toggleSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 
void lassoSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 
void volumeLassoSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 
void surfaceLassoSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 
void sphereSelection (QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 
void closestBoundarySelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 
void floodFillSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 
void componentsSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
 
void customSelection (QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect)
 
void selectionOperation (QString _operation)
 
void loadSelection (const INIFile &_file)
 
void saveSelection (INIFile &_file)
 
void keyShortcutEvent (int _key, Qt::KeyboardModifiers _modifiers=Qt::NoModifier)
 
void addPickMode (const std::string &_mode)
 
void setPickModeMouseTracking (const std::string &_mode, bool _mouseTracking)
 
void setPickModeCursor (const std::string &_mode, QCursor _cursor)
 
void setPickModeToolbar (const std::string &_mode, QToolBar *_toolbar)
 
void registerKey (int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse=false)
 
void addToolbox (QString _name, QWidget *_widget, QIcon *_icon)
 
- 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 PickingInterface
virtual void addPickMode (const std::string &_mode)
 Add a new picking mode to the examiner. More...
 
- Signals inherited from ToolboxInterface
virtual void addToolbox (QString _name, QWidget *_widget)
 Add a toolbox widget to the gui with the given name. More...
 
- Signals inherited from LoggingInterface
virtual void log (Logtype _type, QString _message)=0
 
virtual void log (QString _message)=0
 
- 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 ContextMenuInterface
virtual void addContextMenuItem (QAction *_action, ContextMenuType _type)
 Add an entry for a context Menu. More...
 
- Signals inherited from ToolbarInterface
virtual void addToolbar (QToolBar *_toolbar)
 Adds a Toolbar to the main widget. 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 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

 SelectionBasePlugin ()
 Default constructor.
 
QString name ()
 Return a name for the plugin. More...
 
QString description ()
 Return a description of what the plugin is doing. More...
 
void setSelectionMetaphor (QString _metaphor)
 Enables setting the selection metaphor via scripting The default selection metaphors are: More...
 
void setSelectionPrimitiveType (QString _primitive)
 Enables setting the selection primitive via scripting The default primitives for OpenMesh are: More...
 

Private Slots

void initializePlugin ()
 
void pluginsInitialized ()
 
void slotMouseWheelEvent (QWheelEvent *_event, const std::string &_mode)
 
void slotMouseEvent (QMouseEvent *_event)
 
void slotAddSelectionEnvironment (QString _modeName, QString _description, QString _icon, QString &_handleName)
 
void slotRegisterType (QString _handleName, DataType _type)
 
void slotAddPrimitiveType (QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType &_typeHandle)
 
void slotAddCustomSelectionMode (QString _handleName, QString _modeName, QString _description, QString _icon, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier)
 
void slotAddCustomSelectionMode (QString _handleName, QString _modeName, QString _description, QString _icon, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier, DataType _objectTypeRestriction)
 
void slotAddSelectionOperations (QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type=0u)
 
void slotAddSelectionParameters (QString _handleName, QWidget *_widget, QString _category, SelectionInterface::PrimitiveType _type=0u)
 
void slotShowToggleSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void slotShowLassoSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void slotShowVolumeLassoSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void slotShowSurfaceLassoSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void slotShowSphereSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void slotShowClosestBoundarySelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void slotShowFloodFillSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void slotShowComponentsSelectionMode (QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
 
void slotGetActiveDataTypes (SelectionInterface::TypeList &_types)
 
void slotGetActivePrimitiveType (SelectionInterface::PrimitiveType &_type)
 
void slotTargetObjectsOnly (bool &_targetsOnly)
 
void slotRegisterKeyShortcut (int _key, Qt::KeyboardModifiers _modifiers)
 
void addedEmptyObject (int _id)
 
void objectDeleted (int _id)
 
void slotPickModeChanged (const std::string &_pickmode)
 
void slotKeyEvent (QKeyEvent *_event)
 
void slotKeyReleaseEvent (QKeyEvent *_event)
 
void loadIniFileOptionsLast (INIFile &_ini)
 
void slotMouseToggleSelection (QMouseEvent *_event)
 
void slotMouseLassoSelection (QMouseEvent *_event)
 
void slotMouseVolumeLassoSelection (QMouseEvent *_event)
 
void slotMouseSurfaceLassoSelection (QMouseEvent *_event)
 
void slotMouseSphereSelection (QMouseEvent *_event)
 
void slotMouseBoundarySelection (QMouseEvent *_event)
 
void slotMouseFloodFillSelection (QMouseEvent *_event)
 
void slotMouseComponentsSelection (QMouseEvent *_event)
 
void slotMouseCustomSelection (QMouseEvent *_event)
 
void slotLoadSelectionButton ()
 
void slotSaveSelectionButton ()
 
void slotOperationRequested ()
 
void slotShowAndHideOperations ()
 
void slotShowAndHideParameters ()
 
void slotSelectionEnvironmentRequested (bool _checked)
 
void slotEnterSelectionMode (bool _checked)
 
void updateActivePrimitiveTypes (bool _checked)
 
- 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

QString getUniqueIdentifierName (QString _name, int _num=0)
 Get a unique pickmode name.
 
QString getUniqueHandleName (QString _name, int _num=0)
 Get a unique handle name.
 
bool getSelectionEnvironment (SelectionEnvironment *&env, const QString &_handleName)
 Get a selectionEnvironment by a given name.
 
bool typeExists (DataType _type, int _excludeId=-1)
 Test if at least one object of type _type is in the scene graph.
 
void showSelectionMode (QString _mode, QString _icon, QString _desc, QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier, bool _custom=false, DataType _objectTypeRestriction=DATA_ALL)
 
void selectionModeShowSwitch (bool _show, SelectionEnvironment *&env, HandleAction *toggleSelectionAction_, SelectionInterface::PrimitiveType &_associatedTypes)
 helper function for showSelectionMode
 
bool findObjectType (BaseObjectData *&obj, bool &found, SelectionEnvironment *&env, int _id)
 helper function to find a baseObjectData and selection environment given a specific id
 
SelectionTypeFrameWidgetcreateNewTypeFrame (SelectionEnvironment &_env)
 Create new type frame for tabs widget.
 
void updatePickModeToolBar ()
 Update the pickmode toolbar.
 
void updateTabsOrder ()
 
- 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 void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer. More...
 
- Private Member Functions inherited from MouseInterface
virtual ~MouseInterface ()
 Destructor.
 
- 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 PickingInterface
virtual void addHiddenPickMode (const std::string &_mode)
 Add a new picking mode to the examiner which will be invisible. More...
 
virtual void setPickModeCursor (const std::string &_mode, QCursor _cursor)
 Set the cursor of the given PickMode. More...
 
virtual void setPickModeMouseTracking (const std::string &_mode, bool _mouseTracking)
 Set mouse tracking for the given PickMode. More...
 
virtual void setPickModeToolbar (const std::string &_mode, QToolBar *_toolbar)
 Set the additional toolbar of the given PickMode. More...
 
virtual void removePickModeToolbar (const std::string &_mode)
 Removes the additional toolbar of the given PickMode. More...
 
virtual ~PickingInterface ()
 Destructor.
 
- Private Member Functions inherited from ToolboxInterface
virtual ~ToolboxInterface ()
 Destructor.
 
virtual void addToolbox (QString _name, QWidget *_widget, QIcon *_icon)
 Add a toolbox widget to the gui with the given name and an icon. More...
 
virtual void addToolbox (QString _name, QWidget *_widget, QIcon *_icon, QWidget *_headerAreaWidget)
 Add a toolbox widget to the gui with the given name, icon and header area widget. More...
 
- Private Member Functions inherited from INIInterface
virtual ~INIInterface ()
 Destructor.
 
- Private Member Functions inherited from LoggingInterface
virtual ~LoggingInterface ()
 Destructor.
 
- 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 ContextMenuInterface
virtual ~ContextMenuInterface ()
 Destructor.
 
virtual void addContextMenuItem (QAction *_action, DataType _objectType, ContextMenuType _type)
 Add an entry for a context Menu. More...
 
virtual void hideContextMenu ()
 hide the main context menu
 
- Private Member Functions inherited from ToolbarInterface
virtual ~ToolbarInterface ()
 Destructor.
 
virtual void removeToolbar (QToolBar *_toolbar)
 Remove a Toolbar from the main widget. More...
 
virtual void getToolBar (QString _name, QToolBar *&_toolbar)
 Get a pointer to a Toolbar of the given name or 0 if it does not exist. More...
 
- 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 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 Attributes

QMap< DataType, int > typeCounter_
 Caches the number of available elements of a certain data type for the typeExists function.
 
std::map< QString, SelectionEnvironmentselectionEnvironments_
 
std::map< PrimitiveType, QAction * > primitiveTypeButtons_
 
QToolBar * toolBar_
 
SelectionBaseToolboxWidgettool_
 
QActionGroup * primitivesBarGroup_
 
QToolBar * pickModeToolBar_
 
QActionGroup * selectionModesGroup_
 
HandleActiontoggleSelectionAction_
 
HandleActionlassoSelectionAction_
 
HandleActionvolumeLassoSelectionAction_
 
HandleActionsurfaceLassoSelectionAction_
 
HandleActionsphereSelectionAction_
 
HandleActionboundarySelectionAction_
 
HandleActionfloodFillSelectionAction_
 
HandleActioncomponentsSelectionAction_
 
std::set< std::pair< int, Qt::KeyboardModifiers > > registeredKeys_
 
QString currentPickMode_
 
QString lastPickMode_
 
QString currentSelectionMode_
 
SelectionInterface::PrimitiveType currentPrimitiveType_
 
unsigned int nextFreePrimitiveType_
 
bool deselection_
 
ACG::SceneGraph::MaterialNodesphere_mat_node_
 
ACG::SceneGraph::GlutPrimitiveNodesphere_node_
 
double sphere_radius_
 
ACG::SceneGraph::LineNodeline_node_
 
bool lassoSelection_
 
std::vector< ACG::Vec3dlinePoints_
 
QIcon * toolIcon_
 
DataType availableObjectTypes_
 

Additional Inherited Members

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

Detailed Description

Definition at line 85 of file SelectionBasePlugin.hh.

Member Function Documentation

◆ description()

QString SelectionBasePlugin::description ( )
inlinevirtual

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 110 of file SelectionBasePlugin.hh.

◆ name()

QString SelectionBasePlugin::name ( )
inlinevirtual

Return a name for the plugin.

This Function has to return the name of the plugin.

Implements BaseInterface.

Definition at line 109 of file SelectionBasePlugin.hh.

◆ setSelectionMetaphor()

void SelectionBasePlugin::setSelectionMetaphor ( QString  _metaphor)

Enables setting the selection metaphor via scripting The default selection metaphors are:

  • "sb_toggle"
  • "sb_lasso"
  • "sb_volumelasso"
  • "sb_surfacelasso"
  • "sb_sphere"
  • "sb_closestboundary"
  • "sb_floodfill"
  • "sb_components"

Note that furhter custom methaphors can be defined and used

Definition at line 743 of file SelectionBasePlugin.cc.

◆ setSelectionPrimitiveType()

void SelectionBasePlugin::setSelectionPrimitiveType ( QString  _primitive)

Enables setting the selection primitive via scripting The default primitives for OpenMesh are:

  • "Select Vertices"
  • "Select Halfedges"
  • "Select Edges"
  • "Select Faces" The default primitives for OpenVolumeMesh are:
  • "Select Volume Mesh Vertices"
  • "Select Volume Mesh Edges"
  • "Select Volume Mesh Faces"
  • "Select Volume Mesh Cells"
  • "Column Selection"
  • "Sheet Selection"

Note that further custom primitive types can be defined and used

Definition at line 781 of file SelectionBasePlugin.cc.

◆ showSelectionMode()

void SelectionBasePlugin::showSelectionMode ( QString  _mode,
QString  _icon,
QString  _desc,
QString  _handleName,
bool  _show,
SelectionInterface::PrimitiveType  _associatedTypes,
QString &  _customIdentifier,
bool  _custom = false,
DataType  _objectTypeRestriction = DATA_ALL 
)
private

Show standard selection mode Use this method to show/hide standard selection actions (lasso, floodfill, sphere, etc.)

Definition at line 1061 of file SelectionBasePlugin.cc.


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