Commit 2f23cf72 authored by Jan Möbius's avatar Jan Möbius

Changed selection interface

The qicons have been replaced by QString. The path to the icon has to be given now
This avoids the problem of qpixmap creation in the selection plugins, when no gui is present
Added deprecation warning, to informa about deprecated plugin interface usage

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15791 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 325db4fe
......@@ -97,7 +97,7 @@ class SelectionInterface {
\code
emit addSelectionEnvironment("Mesh Object Selections", "Select Triangle Mesh Primitives.",
QIcon(someIconPath + "mesh_selection.png"), environmentHandle_);
someIconPath + "mesh_selection.png", environmentHandle_);
\endcode
* Now, our handle to the newly created environment is in environmentHandle_.
* We should now see a new tab widget in the selection base tool box
......@@ -118,9 +118,9 @@ class SelectionInterface {
* we want to enable selection for the three of them:
\code
emit addPrimitiveType(environmentHandle_, "Select Vertices", QIcon(iconPath + "vertexType.png"), vertexType_);
emit addPrimitiveType(environmentHandle_, "Select Edges", QIcon(iconPath + "edgeType.png"), edgeType_);
emit addPrimitiveType(environmentHandle_, "Select Faces", QIcon(iconPath + "faceType.png"), faceType_);
emit addPrimitiveType(environmentHandle_, "Select Vertices", iconPath + "vertexType.png", vertexType_);
emit addPrimitiveType(environmentHandle_, "Select Edges", iconPath + "edgeType.png", edgeType_);
emit addPrimitiveType(environmentHandle_, "Select Faces", iconPath + "faceType.png", faceType_);
\endcode
*
......@@ -149,10 +149,10 @@ class SelectionInterface {
*
* @param _modeName The name of the selection mode, e.g. "Mesh Selection"
* @param _description The description for the selection mode (also tooltip)
* @param _icon The icon for this mode (basically a type icon)
* @param _icon Path to the icon for this mode (basically a type icon)
* @param _handleName The handle of the recently added selection environment. Needed for referencing
*/
virtual void addSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName) {};
virtual void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName) {};
/** \brief Register data type for a selection environment
*
......@@ -174,10 +174,10 @@ class SelectionInterface {
*
* @param _handleName The handle of the selection environment to which this type should be added
* @param _name The name of the primitive type, e.g. "B-Spline Surface Control Point"
* @param _icon The icon for the primitive type
* @param _icon Path to the icon for the primitive type
* @param _typeHandle The returned handle to the added primitive type
*/
virtual void addPrimitiveType(QString _handleName, QString _name, QIcon _icon, PrimitiveType& _typeHandle) {};
virtual void addPrimitiveType(QString _handleName, QString _name, QString _icon, PrimitiveType& _typeHandle) {};
/** @} */
......@@ -205,7 +205,7 @@ class SelectionInterface {
emit showToggleSelectionMode(environmentHandle_, true, vertexType_ | edgeType_ | faceType_);
emit showVolumeLassoSelectionMode(environmentHandle_, true, vertexType_ | edgeType_ | faceType_);
emit addCustomSelectionMode(environmentHandle_, "My Custom Selection", "Description of my mode", QIcon(someIconFile), vertexType_ | edgeType_);
emit addCustomSelectionMode(environmentHandle_, "My Custom Selection", "Description of my mode", someIconFile, vertexType_ | edgeType_);
\endcode
*
......@@ -342,11 +342,11 @@ class SelectionInterface {
* @param _handleName The handle of the selection environment in which this mode should be available
* @param _modeName The name of this mode (also button caption)
* @param _description A brief description of what the selection mode does
* @param _icon An icon which is used for this selection mode
* @param _icon Path to an icon which is used for this selection mode
* @param _associatedTypes Make this mode available only for the specified types (OR'ed)
* @param _customIdentifier Holds the identifier of the custom selection modes
*/
virtual void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
virtual void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
PrimitiveType _associatedTypes, QString& _customIdentifier) {};
/** \brief Add a custom interactive selection mode
......@@ -363,12 +363,12 @@ class SelectionInterface {
* @param _handleName The handle of the selection environment in which this mode should be available
* @param _modeName The name of this mode (also button caption)
* @param _description A brief description of what the selection mode does
* @param _icon An icon which is used for this selection mode
* @param _icon Path to an icon which is used for this selection mode
* @param _associatedTypes Make this mode available only for the specified types (OR'ed)
* @param _customIdentifier Holds the identifier of the custom selection modes
* @param _objectTypeRestriction Restrict the mode to this specific data type
*/
virtual void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
virtual void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
PrimitiveType _associatedTypes, QString& _customIdentifier,
DataType _objectTypeRestriction) {};
......@@ -993,10 +993,10 @@ class SelectionInterface {
*
* @param _modeName User visible name of the selection mode
* @param _description Description of the mode
* @param _icon Icon displayed in the selection toolbar
* @param _icon Path to an icon displayed in the selection toolbar
* @param _handleName Handle of the selection mode
*/
virtual void slotAddSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName) {};
virtual void slotAddSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName) {};
/** \brief Do not use. Implemented in SelectionBasePlugin
*
......@@ -1011,10 +1011,10 @@ class SelectionInterface {
*
* @param _handleName Handle of the selection mode
* @param _name User visible name of the selection mode
* @param _icon Icon displayed in the selection toolbar
* @param _icon Path to an icon displayed in the selection toolbar
* @param _typeHandle Handle for the type
*/
virtual void slotAddPrimitiveType(QString _handleName, QString _name, QIcon _icon, PrimitiveType& _typeHandle) {};
virtual void slotAddPrimitiveType(QString _handleName, QString _name, QString _icon, PrimitiveType& _typeHandle) {};
/** \brief Do not use. Implemented in SelectionBasePlugin
*
......@@ -1023,11 +1023,11 @@ class SelectionInterface {
* @param _handleName Handle of the selection mode
* @param _modeName User visible name of the selection mode
* @param _description Description of the mode
* @param _icon Icon displayed in the selection toolbar
* @param _icon Path to an icon displayed in the selection toolbar
* @param _associatedTypes primitive types supported by this mode
* @param _customIdentifier Identifier of this mode
*/
virtual void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
virtual void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
PrimitiveType _associatedTypes, QString& _customIdentifier) {};
/** \brief Do not use. Implemented in SelectionBasePlugin
......@@ -1035,12 +1035,12 @@ class SelectionInterface {
* @param _handleName Handle of the selection mode
* @param _modeName User visible name of the selection mode
* @param _description Description of the mode
* @param _icon Icon displayed in the selection toolbar
* @param _icon Path to an icon displayed in the selection toolbar
* @param _associatedTypes primitive types supported by this mode
* @param _customIdentifier Identifier of this mode
* @param _objectTypeRestriction Object types supported by this mode
*/
virtual void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
virtual void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
PrimitiveType _associatedTypes, QString& _customIdentifier,
DataType _objectTypeRestriction) {};
......@@ -1187,6 +1187,6 @@ all UI control elements and and the rendering of the selection tools whereas the
type selection plugins manage the real selection of their entities as well as scripting functions.
*/
Q_DECLARE_INTERFACE(SelectionInterface,"OpenFlipper.SelectionInterface/1.0")
Q_DECLARE_INTERFACE(SelectionInterface,"OpenFlipper.SelectionInterface/1.1")
#endif // SELECTIONINTERFACE_HH
......@@ -247,18 +247,18 @@ signals:
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);
void addSelectionEnvironment(QString _modeName, QString _description, QString _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);
void addPrimitiveType(QString _handleName, QString _name, QString _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,
void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier);
void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
DataType _objectTypeRestriction);
......@@ -491,13 +491,13 @@ signals:
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);
void slotAddSelectionEnvironment(QString _modeName, QString _description, QString _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);
void slotAddPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
/** \brief SelectionInterface: Add new selection mode for specified type
*
......@@ -508,7 +508,7 @@ signals:
* @param _associatedTypes primitive types supported by this mode
* @param _customIdentifier Identifier of this mode
*/
void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier);
/** \brief SelectionInterface: Add new selection mode for specified type
......@@ -521,7 +521,7 @@ signals:
* @param _customIdentifier Identifier of this mode
* @param _objectTypeRestriction Object types supported by this mode
*/
void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
DataType _objectTypeRestriction);
......
......@@ -1224,45 +1224,90 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
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);
log(LOGERR,tr("Plugin uses deprecated addSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!"));
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,"addSelectionEnvironment(QString,QString,QString,QString&)") )
connect(plugin , SIGNAL(addSelectionEnvironment(QString,QString,QString,QString&)),
this , SLOT(slotAddSelectionEnvironment(QString,QString,QString,QString&)),Qt::DirectConnection);
// ===============
if ( checkSlot(plugin,"slotAddSelectionEnvironment(QString,QString,QIcon,QString&)") )
log(LOGERR,tr("Plugin uses deprecated slotAddSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!"));
if ( checkSlot( plugin , "slotAddSelectionEnvironment(QString,QString,QString,QString&)" ) )
connect(this , SIGNAL(addSelectionEnvironment(QString,QString,QString,QString&)),
plugin , SLOT(slotAddSelectionEnvironment(QString,QString,QString,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);
log(LOGERR,tr("Plugin uses deprecated addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&) , Replace the qicon by the path to the icon!"));
if ( checkSignal(plugin,"addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)") )
connect(plugin , SIGNAL(addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),
this , SLOT(slotAddPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
// ===============
if ( checkSlot(plugin,"slotAddPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)") )
log(LOGERR,tr("Plugin uses deprecated slotAddPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&) , Replace the qicon by the path to the icon!"));
if ( checkSlot( plugin , "slotAddPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)" ) )
connect(this , SIGNAL(addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),
plugin , SLOT(slotAddPrimitiveType(QString,QString,QString,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);
log(LOGERR,tr("Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!"));
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)") )
connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),
this , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),Qt::DirectConnection);
// ===============
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
log(LOGERR,tr("Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!"));
if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)),
this , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)),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 ( checkSlot(plugin,"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") )
log(LOGERR,tr("Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!"));
if ( checkSlot( plugin , "slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)" ) )
connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)),
plugin , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)" ) )
connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),
plugin , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),Qt::DirectConnection);
// ===============
if ( checkSlot(plugin,"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
log(LOGERR,tr("Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!"));
if ( checkSlot( plugin , "slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)" ) )
connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)),
plugin , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)),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);
......
......@@ -57,7 +57,7 @@
// === Selection Communication ============================
//========================================================================================
void Core::slotAddSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName) {
void Core::slotAddSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName) {
emit addSelectionEnvironment(_modeName, _description, _icon, _handleName);
}
......@@ -65,16 +65,16 @@ void Core::slotRegisterType(QString _handleName, DataType _type) {
emit registerType(_handleName, _type);
}
void Core::slotAddPrimitiveType(QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType& _typeHandle) {
void Core::slotAddPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle) {
emit addPrimitiveType(_handleName, _name, _icon, _typeHandle);
}
void Core::slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
void Core::slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier) {
emit addCustomSelectionMode(_handleName, _modeName, _description, _icon, _associatedTypes, _customIdentifier);
}
void Core::slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
void Core::slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
DataType _objectTypeRestriction) {
emit addCustomSelectionMode(_handleName, _modeName, _description, _icon, _associatedTypes, _customIdentifier, _objectTypeRestriction);
......
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