Commit 13129ea9 authored by Jan Möbius's avatar Jan Möbius
Browse files

First checkin of core part SelectionInterface



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11198 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 1a1071f7
This diff is collapsed.
......@@ -95,6 +95,7 @@
#include "OpenFlipper/BasePlugin/FileInterface.hh"
#include "OpenFlipper/BasePlugin/TypeInterface.hh"
#include "OpenFlipper/BasePlugin/MenuInterface.hh"
#include "OpenFlipper/BasePlugin/SelectionInterface.hh" // -> for SelectionInterface::PrimitiveType
#include "OpenFlipper/BasePlugin/ContextMenuInterface.hh"
#include <OpenFlipper/widgets/coreWidget/CoreWidget.hh>
......@@ -249,6 +250,91 @@ signals:
/// get a multi-texture's sub textures
void getSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures );
/// SelectionInterface: This signal is emitted when a new toolbutton should be added
void addSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName);
/// SelectionInterface: This signal is emitted when a data type should be registered for a selection mode
void registerType(QString _handleName, DataType _type);
/// SelectionInterface: This signal is emitted when a selection plugin should handle a new primitive type
void addPrimitiveType(QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType& _typeHandle);
/// SelectionInterface: This signal is emitted when a custom selection mode is added
void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier);
/// SelectionInterface: This signal is used to add non-interactive operations for a specific primitive type
void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type);
/// SelectionInterface: This signal is emitted when a non-interactive operation has been performed
void selectionOperation(QString _operation);
/// SelectionInterface: This signal is emitted when standard toggle selection is required
void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: This signal is emitted when standard lasso selection is required
void showLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: This signal is emitted when standard volume lasso selection is required
void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: This signal is emitted when standard surface lasso selection is required
void showSurfaceLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: This signal is emitted when standard sphere selection is required
void showSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: This signal is emitted when standard closest boundary selection is required
void showClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// 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 toggle selection has been performed
void toggleSelection(QPoint _position, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard lasso selection has been performed
void lassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard volume lasso selection has been performed
void volumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard surface lasso selection has been performed
void surfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard sphere selection has been performed
void sphereSelection(QPoint _position, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard closest boundary selection has been performed
void closestBoundarySelection(QPoint _position, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: This signal is emitted when standard flood fill selection has been performed
void floodFillSelection(QPoint _position, double _maxAngle, 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);
/// SelectionInterface: This signal is emitted when the active (selected) data types should be fetched
void getActiveDataTypes(SelectionInterface::TypeList& _types);
/// SelectionInterface: This signal is emitted when the active (selected) primitive type should be fetched
void getActivePrimitiveType(SelectionInterface::PrimitiveType& _type);
/// SelectionInterface: This signal is emitted if the current target restriction state is requested
void targetObjectsOnly(bool& _targetsOnly);
/// SelectionInterface: This signal is emitted when a selection should be loaded from a file
void loadSelection(const INIFile& _file);
/// SelectionInterface: This signal is emitted when a selection should be written into a file
void saveSelection(INIFile& _file);
/// SelectionInterface: This signal is emitted when a type selection plugin wants to listen to a key event
void registerKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers);
/// SelectionInterface: This signal is emitted when a key shortcut has been pressed
void keyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers = Qt::NoModifier);
/// If an ini File is opened, this signal is send to Plugins capable of handling ini files
void iniLoad( INIFile&, int );
......@@ -428,6 +514,91 @@ signals:
/// Called when an empty object has been Added
void slotEmptyObjectAdded ( int _id );
/// SelectionInterface: Called when a new selection type button should be added to the toolbar
void slotAddSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName);
/// SelectionInterface: Called when a data type is added for a specific selection type
void slotRegisterType(QString _handleName, DataType _type);
/// SelectionInterface: Called when a new, non-standard primitive type should be handled
void slotAddPrimitiveType(QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType& _typeHandle);
/// SelectionInterface: Add new selection mode for specified type
void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier);
/// SelectionInterface: Called in order to add non-interactive operations for a specific primitive type
void slotAddSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type);
/// SelectionInterface: Called when a non-interactive operation has been performed
void slotSelectionOperation(QString _operation);
/// SelectionInterface: Provide toggle selection operation for specific selection mode
void slotShowToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: Provide lasso selection operation for specific selection mode
void slotShowLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: Provide volume lasso selection operation for specific selection mode
void slotShowVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: Provide surface lasso selection operation for specific selection mode
void slotShowSurfaceLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: Provide sphere selection operation for specific selection mode
void slotShowSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: Provide closest boundary selection operation for specific selection mode
void slotShowClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: Provide flood fill selection operation for specific selection mode
void slotShowFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
/// SelectionInterface: Called when toggle selection operation has been performed
void slotToggleSelection(QPoint _position, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when lasso selection operation has been performed
void slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when volume lasso selection operation has been performed
void slotVolumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when surface lasso selection operation has been performed
void slotSurfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when sphere selection operation has been performed
void slotSphereSelection(QPoint _position, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when closest boundary selection operation has been performed
void slotClosestBoundarySelection(QPoint _position, SelectionInterface::PrimitiveType _currentType, bool _deselect);
/// SelectionInterface: Called when flood fill selection operation has been performed
void slotFloodFillSelection(QPoint _position, double _maxAngle, 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);
/// SelectionInterface: Called when active (selected) data types should be fetched
void slotGetActiveDataTypes(SelectionInterface::TypeList& _types);
/// SelectionInterface: Called when active primitive type should be fetched
void slotGetActivePrimitiveType(SelectionInterface::PrimitiveType& _type);
/// SelectionInterface: Called when target restriction state should be fetched
void slotTargetObjectsOnly(bool& _targetsOnly);
/// SelectionInterface: Called when a selection should be loaded from a file
void slotLoadSelection(const INIFile& _file);
/// SelectionInterface: Called when a selection should be stored into a file
void slotSaveSelection(INIFile& _file);
/// SelectionInterface: Called when a key shortcut is to be registered
void slotRegisterKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers);
/// SelectionInterface: Called when a key event occurred
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers);
/** \brief Called when a plugin requests a list of file-filters
*
......
......@@ -84,6 +84,7 @@
#include "OpenFlipper/BasePlugin/RPCInterface.hh"
#include "OpenFlipper/BasePlugin/ScriptInterface.hh"
#include "OpenFlipper/BasePlugin/SecurityInterface.hh"
#include "OpenFlipper/BasePlugin/SelectionInterface.hh"
#include "OpenFlipper/BasePlugin/TypeInterface.hh"
#include "OpenFlipper/BasePlugin/PluginConnectionInterface.hh"
......@@ -1015,6 +1016,236 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
connect(this , SIGNAL(iniLoadOptionsLast( INIFile& )),
plugin , SLOT( loadIniFileOptionsLast( INIFile& ) ),Qt::DirectConnection);
}
//Check if the plugin supports Selection-Interface
SelectionInterface* selectionPlugin = qobject_cast< SelectionInterface * >(plugin);
if ( selectionPlugin && OpenFlipper::Options::gui() ) {
supported = supported + "SelectionBase ";
if ( checkSignal(plugin,"addSelectionEnvironment(QString,QString,QIcon,QString&)") )
connect(plugin , SIGNAL(addSelectionEnvironment(QString,QString,QIcon,QString&)),
this , SLOT(slotAddSelectionEnvironment(QString,QString,QIcon,QString&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotAddSelectionEnvironment(QString,QString,QIcon,QString&)" ) )
connect(this , SIGNAL(addSelectionEnvironment(QString,QString,QIcon,QString&)),
plugin , SLOT(slotAddSelectionEnvironment(QString,QString,QIcon,QString&)),Qt::DirectConnection);
if ( checkSignal(plugin,"registerType(QString,DataType)") )
connect(plugin , SIGNAL(registerType(QString,DataType)),
this , SLOT(slotRegisterType(QString,DataType)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotRegisterType(QString,DataType)" ) )
connect(this , SIGNAL(registerType(QString,DataType)),
plugin , SLOT(slotRegisterType(QString,DataType)),Qt::DirectConnection);
if ( checkSignal(plugin,"addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)") )
connect(plugin , SIGNAL(addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)),
this , SLOT(slotAddPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotAddPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)" ) )
connect(this , SIGNAL(addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)),
plugin , SLOT(slotAddPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") )
connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)),
this , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)" ) )
connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)),
plugin , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)),Qt::DirectConnection);
if ( checkSignal(plugin,"addSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)") )
connect(plugin , SIGNAL(addSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),
this , SLOT(slotAddSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotAddSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)" ) )
connect(this , SIGNAL(addSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),
plugin , SLOT(slotAddSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSignal(plugin,"selectionOperation(QString)") )
connect(plugin , SIGNAL(selectionOperation(QString)),
this , SLOT(slotSelectionOperation(QString)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotSelectionOperation(QString)" ) )
connect(this , SIGNAL(selectionOperation(QString)),
plugin , SLOT(slotSelectionOperation(QString)),Qt::DirectConnection);
if ( checkSignal(plugin,"showToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
connect(plugin , SIGNAL(showToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
this , SLOT(slotShowToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotShowToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
connect(this , SIGNAL(showToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
plugin , SLOT(slotShowToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSignal(plugin,"showLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
connect(plugin , SIGNAL(showLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
this , SLOT(slotShowLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotShowLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
connect(this , SIGNAL(showLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
plugin , SLOT(slotShowLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSignal(plugin,"showVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
connect(plugin , SIGNAL(showVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
this , SLOT(slotShowVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotShowVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
connect(this , SIGNAL(showVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
plugin , SLOT(slotShowVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSignal(plugin,"showSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
connect(plugin , SIGNAL(showSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
this , SLOT(slotShowSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotShowSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
connect(this , SIGNAL(showSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
plugin , SLOT(slotShowSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSignal(plugin,"showSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
connect(plugin , SIGNAL(showSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
this , SLOT(slotShowSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotShowSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
connect(this , SIGNAL(showSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
plugin , SLOT(slotShowSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSignal(plugin,"showClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
connect(plugin , SIGNAL(showClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
this , SLOT(slotShowClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotShowClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
connect(this , SIGNAL(showClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
plugin , SLOT(slotShowClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
if ( checkSignal(plugin,"showFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
connect(plugin , SIGNAL(showFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
this , SLOT(slotShowFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
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,"toggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(toggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotToggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotToggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(toggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotToggleSelection(QPoint,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"volumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(volumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotVolumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotVolumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(volumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotVolumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"surfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(surfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotSurfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotSurfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(surfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotSurfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"sphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(sphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotSphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotSphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(sphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotSphereSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"closestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(closestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotClosestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotClosestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(closestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotClosestBoundarySelection(QPoint,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"floodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)") )
connect(plugin , SIGNAL(floodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),
this , SLOT(slotFloodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotFloodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)" ) )
connect(this , SIGNAL(floodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),
plugin , SLOT(slotFloodFillSelection(QPoint,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)") )
connect(plugin , SIGNAL(customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)),
this , SLOT(slotCustomSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotCustomSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)" ) )
connect(this , SIGNAL(customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)),
plugin , SLOT(slotCustomSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)),Qt::DirectConnection);
if ( checkSignal(plugin,"getActiveDataTypes(SelectionInterface::TypeList&)") )
connect(plugin , SIGNAL(getActiveDataTypes(SelectionInterface::TypeList&)),
this , SLOT(slotGetActiveDataTypes(SelectionInterface::TypeList&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotGetActiveDataTypes(SelectionInterface::TypeList&)" ) )
connect(this , SIGNAL(getActiveDataTypes(SelectionInterface::TypeList&)),
plugin , SLOT(slotGetActiveDataTypes(SelectionInterface::TypeList&)),Qt::DirectConnection);
if ( checkSignal(plugin,"getActivePrimitiveType(SelectionInterface::PrimitiveType&)") )
connect(plugin , SIGNAL(getActivePrimitiveType(SelectionInterface::PrimitiveType&)),
this , SLOT(slotGetActivePrimitiveType(SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotGetActivePrimitiveType(SelectionInterface::PrimitiveType&)" ) )
connect(this , SIGNAL(getActivePrimitiveType(SelectionInterface::PrimitiveType&)),
plugin , SLOT(slotGetActivePrimitiveType(SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
if ( checkSignal(plugin,"targetObjectsOnly(bool&)") )
connect(plugin , SIGNAL(targetObjectsOnly(bool&)),
this , SLOT(slotTargetObjectsOnly(bool&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotTargetObjectsOnly(bool&)" ) )
connect(this , SIGNAL(targetObjectsOnly(bool&)),
plugin , SLOT(slotTargetObjectsOnly(bool&)),Qt::DirectConnection);
if ( checkSignal(plugin,"loadSelection(const INIFile&)") )
connect(plugin , SIGNAL(loadSelection(const INIFile&)),
this , SLOT(slotLoadSelection(const INIFile&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotLoadSelection(const INIFile&)" ) )
connect(this , SIGNAL(loadSelection(const INIFile&)),
plugin , SLOT(slotLoadSelection(const INIFile&)),Qt::DirectConnection);
if ( checkSignal(plugin,"saveSelection(INIFile&)") )
connect(plugin , SIGNAL(saveSelection(INIFile&)),
this , SLOT(slotSaveSelection(INIFile&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotSaveSelection(INIFile&)" ) )
connect(this , SIGNAL(saveSelection(INIFile&)),
plugin , SLOT(slotSaveSelection(INIFile&)),Qt::DirectConnection);
if ( checkSignal(plugin,"registerKeyShortcut(int,Qt::KeyboardModifiers)") )
connect(plugin , SIGNAL(registerKeyShortcut(int,Qt::KeyboardModifiers)),
this , SLOT(slotRegisterKeyShortcut(int,Qt::KeyboardModifiers)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotRegisterKeyShortcut(int,Qt::KeyboardModifiers)" ) )
connect(this , SIGNAL(registerKeyShortcut(int,Qt::KeyboardModifiers)),
plugin , SLOT(slotRegisterKeyShortcut(int,Qt::KeyboardModifiers)),Qt::DirectConnection);
if ( checkSignal(plugin,"keyShortcutEvent(int,Qt::KeyboardModifiers)") )
connect(plugin , SIGNAL(keyShortcutEvent(int,Qt::KeyboardModifiers)),
this , SLOT(slotKeyShortcutEvent(int,Qt::KeyboardModifiers)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotKeyShortcutEvent(int,Qt::KeyboardModifiers)" ) )
connect(this , SIGNAL(keyShortcutEvent(int,Qt::KeyboardModifiers)),
plugin , SLOT(slotKeyShortcutEvent(int,Qt::KeyboardModifiers)),Qt::DirectConnection);
}
//Check if the plugin supports Texture-Interface
TextureInterface* texturePlugin = qobject_cast< TextureInterface * >(plugin);
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2010 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 9089 $ *
* $Author: kremer $ *
* $Date: 2010-04-21 18:42:47 +0200 (Mi, 21. Apr 2010) $ *
* *
\*===========================================================================*/
//=============================================================================
//
// CLASS Core - IMPLEMENTATION of Comunication with plugins
//
//=============================================================================
//== INCLUDES =================================================================
#include "Core.hh"
//== IMPLEMENTATION ==========================================================
//========================================================================================
// === Selection Communication ============================
//========================================================================================
void Core::slotAddSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName) {
emit addSelectionEnvironment(_modeName, _description, _icon, _handleName);
}
void Core::slotRegisterType(QString _handleName, DataType _type) {
emit registerType(_handleName, _type);
}
void Core::slotAddPrimitiveType(QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType& _typeHandle) {
emit addPrimitiveType(_handleName, _name, _icon, _typeHandle);
}
void Core::slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier) {
emit addCustomSelectionMode(_handleName, _modeName, _description, _icon, _associatedTypes, _customIdentifier);
}
void Core::slotAddSelectionOperations(QString _handleName,QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type) {
emit addSelectionOperations(_handleName, _operationsList, _category, _type);
}
void Core::slotSelectionOperation(QString _operation) {
emit selectionOperation(_operation);
}
void Core::slotShowToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
emit showToggleSelectionMode(_handleName, _show, _associatedTypes);
}
void Core::slotShowLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
emit showLassoSelectionMode(_handleName, _show, _associatedTypes);
}
void Core::slotShowVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
emit showVolumeLassoSelectionMode(_handleName, _show, _associatedTypes);
}
void Core::slotShowSurfaceLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
emit showSurfaceLassoSelectionMode(_handleName, _show, _associatedTypes);
}
void Core::slotShowSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
emit showSphereSelectionMode(_handleName, _show, _associatedTypes);
}
void Core::slotShowClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
emit showClosestBoundarySelectionMode(_handleName, _show, _associatedTypes);
}
void Core::slotShowFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
emit showFloodFillSelectionMode(_handleName, _show, _associatedTypes);
}
void Core::slotToggleSelection(QPoint _position, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
emit toggleSelection(_position, _currentType, _deselect);
}
void Core::slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
emit lassoSelection(_event, _currentType, _deselect);
}
void Core::slotVolumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
emit volumeLassoSelection(_event, _currentType, _deselect);
}
void Core::slotSurfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
emit surfaceLassoSelection(_event, _currentType, _deselect);
}
void Core::slotSphereSelection(QPoint _position, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect) {
emit sphereSelection(_position, _radius, _currentType, _deselect);
}