Commit 84381653 authored by Mike Kremer's avatar Mike Kremer

Added standard selection mode "connected components" to SelectionInterface and...

Added standard selection mode "connected components" to SelectionInterface and selection base plugin.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11500 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 66ea4abb
......@@ -314,6 +314,19 @@ class SelectionInterface {
*/
virtual void showFloodFillSelectionMode(QString _handleName, bool _show, PrimitiveType _associatedTypes) {};
/** \brief Show connected components selection mode in a specified selection environment
*
* Show or hide the connected components selection mode for the specified selection environment.
* Note that per default no interactive selection mode will be available.
* One will always have to explicitly add the required selection modes for
* each selection environment.
*
* @param _handleName The handle of the selection environment in which this mode should be available
* @param _show Indicates whether the mode should be available or not
* @param _associatedTypes Make this mode available only for the specified types (OR'ed)
*/
virtual void showComponentsSelectionMode(QString _handleName, bool _show, PrimitiveType _associatedTypes) {};
/** \brief Add a custom interactive selection mode
*
* If a plugin should provide an interactive selection mode other than the
......@@ -746,6 +759,18 @@ class SelectionInterface {
*/
virtual void slotFloodFillSelection(QMouseEvent* _event, double _maxAngle, PrimitiveType _currentType, bool _deselect) {};
/** \brief 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.
*
* @param _event The mouse event that currently is performed
* @param _currentType The currently active primitive type
* @param _deselect True if entities should be deselected
*/
virtual void slotComponentsSelection(QMouseEvent* _event, PrimitiveType _currentType, bool _deselect) {};
/** \brief Called whenever the user performs a custom selection
*
* This has to be implemented by each type selection plugin if this
......@@ -784,7 +809,7 @@ class SelectionInterface {
/** \brief Emitted by selection base plugin whenever the user performs a toggle selection
*
* This connects to slotToggleSelection(QPoint,QString) which has to be implemented
* This connects to slotToggleSelection() which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _event The mouse event that currently is performed
......@@ -795,7 +820,7 @@ class SelectionInterface {
/** \brief Emitted by selection base plugin whenever the user performs a lasso selection
*
* This connects to slotLassoSelection(QMouseEvent*,QString) which has to be implemented
* This connects to slotLassoSelection() which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _event The mouse event that currently is performed
......@@ -806,7 +831,7 @@ class SelectionInterface {
/** \brief Emitted by selection base plugin whenever the user performs a volume lasso selection
*
* This connects to slotVolumeLassoSelection(QMouseEvent*,QString) which has to be implemented
* This connects to slotVolumeLassoSelection() which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _event The mouse event that currently is performed
......@@ -817,7 +842,7 @@ class SelectionInterface {
/** \brief Emitted by selection base plugin whenever the user performs a surface lasso selection
*
* This connects to slotSurfaceLassoSelection(QMouseEvent*,QString) which has to be implemented
* This connects to slotSurfaceLassoSelection() which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _event The mouse event that currently is performed
......@@ -828,7 +853,7 @@ class SelectionInterface {
/** \brief Emitted by selection base plugin whenever the user performs a sphere selection
*
* This connects to slotSphereSelection(QPoint,QString) which has to be implemented
* This connects to slotSphereSelection() which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _event The mouse event that currently is performed
......@@ -840,7 +865,7 @@ class SelectionInterface {
/** \brief Emitted by selection base plugin whenever the user performs a closest boundary selection
*
* This connects to slotClosestBoundarySelection(QPoint,QString) which has to be implemented
* This connects to slotClosestBoundarySelection() which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _event The mouse event that currently is performed
......@@ -851,7 +876,7 @@ class SelectionInterface {
/** \brief Emitted by selection base plugin whenever the user performs a flood fill selection
*
* This connects to slotFloodFillSelection(QPoint,QString) which has to be implemented
* This connects to slotFloodFillSelection() which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _event The mouse event that currently is performed
......@@ -861,6 +886,17 @@ class SelectionInterface {
*/
virtual void floodFillSelection(QMouseEvent* _event, double _maxAngle, PrimitiveType _currentType, bool _deselect) {};
/** \brief Emitted by selection base plugin whenever the user performs a connected components selection
*
* This connects to slotComponentsSelection() which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _event The mouse event that currently is performed
* @param _currentType The currently active primitive type
* @param _deselect True if entities should be deselected
*/
virtual void componentsSelection(QMouseEvent* _event, PrimitiveType _currentType, bool _deselect) {};
/** \brief Emitted by selection base plugin whenever the user performs a custom selection
*
* This connects to slotCustomSelection(QMouseEvent*,QString) which has to be implemented
......@@ -930,6 +966,7 @@ class SelectionInterface {
virtual void slotShowSphereSelectionMode(QString _handleName, bool _show, PrimitiveType _associatedTypes) {};
virtual void slotShowClosestBoundarySelectionMode(QString _handleName, bool _show, PrimitiveType _associatedTypes) {};
virtual void slotShowFloodFillSelectionMode(QString _handleName, bool _show, PrimitiveType _associatedTypes) {};
virtual void slotComponentsSelectionMode(QString _handleName, bool _show, PrimitiveType _associatedTypes) {};
virtual void slotRegisterKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers) {};
......
......@@ -282,6 +282,9 @@ signals:
/// SelectionInterface: This signal is emitted when standard flood fill selection is required
void showFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: This signal is emitted when standard connected components selection is required
void showComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: This signal is emitted when standard toggle selection has been performed
void toggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
......@@ -304,6 +307,9 @@ signals:
/// SelectionInterface: This signal is emitted when standard flood fill selection has been performed
void floodFillSelection(QMouseEvent* _event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard connected components selection has been performed
void componentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when a custom selection operation has been performed
void customSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect);
......@@ -524,6 +530,9 @@ signals:
/// SelectionInterface: Provide flood fill selection operation for specific selection mode
void slotShowFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: Provide connected components selection operation for specific selection mode
void slotShowComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: Called when toggle selection operation has been performed
void slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
......@@ -545,6 +554,9 @@ signals:
/// SelectionInterface: Called when flood fill selection operation has been performed
void slotFloodFillSelection(QMouseEvent* _event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when connected components selection operation has been performed
void slotComponentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when custom selection operation has been performed
void slotCustomSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect);
......
......@@ -1152,6 +1152,14 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
if ( checkSlot( plugin , "slotShowFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
connect(this , SIGNAL(showFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
plugin , SLOT(slotShowFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSignal(plugin,"showComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
connect(plugin , SIGNAL(showComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
this , SLOT(slotShowComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotShowComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
connect(this , SIGNAL(showComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
plugin , SLOT(slotShowComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSignal(plugin,"toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
......@@ -1208,6 +1216,14 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
if ( checkSlot( plugin , "slotFloodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(floodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotFloodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"componentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(componentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotComponentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotComponentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(componentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotComponentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)") )
connect(plugin , SIGNAL(customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)),
......
......@@ -110,6 +110,10 @@ void Core::slotShowFloodFillSelectionMode(QString _handleName, bool _show, Selec
emit showFloodFillSelectionMode(_handleName, _show, _associatedTypes);
}
void Core::slotShowComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
emit showComponentsSelectionMode(_handleName, _show, _associatedTypes);
}
void Core::slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
emit toggleSelection(_event, _currentType, _deselect);
}
......@@ -138,6 +142,10 @@ void Core::slotFloodFillSelection(QMouseEvent* _event, double _maxAngle, Selecti
emit floodFillSelection(_event, _maxAngle, _currentType, _deselect);
}
void Core::slotComponentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
emit componentsSelection(_event, _currentType, _deselect);
}
void Core::slotCustomSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect) {
emit customSelection(_event, _currentType, _customIdentifier, _deselect);
}
......@@ -168,4 +176,4 @@ void Core::slotRegisterKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers) {
void Core::slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers) {
emit keyShortcutEvent(_key, _modifiers);
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment