Commit e36f5989 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 0f101415
......@@ -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);
......
......@@ -91,45 +91,45 @@ void BSplineCurveSelectionPlugin::initializePlugin() {
void BSplineCurveSelectionPlugin::pluginsInitialized() {
// Create new selection environment for skeletons
// and register skeleton data type for the environment.
QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
emit addSelectionEnvironment("B-Spline Curve Selections", "Select B-Spline curve primitives.",
QIcon(iconPath + "bsplinecurve.png"), environmentHandle_);
iconPath + "bsplinecurve.png", environmentHandle_);
// Register mesh object types
emit registerType(environmentHandle_, DATA_BSPLINE_CURVE);
emit addPrimitiveType(environmentHandle_, "Select Control Points", QIcon(iconPath + CONTROL_POINT_TYPE), controlPointType_);
emit addPrimitiveType(environmentHandle_, "Select Knots", QIcon(iconPath + KNOT_TYPE), knotType_);
emit addPrimitiveType(environmentHandle_, "Select Control Points", iconPath + CONTROL_POINT_TYPE, controlPointType_);
emit addPrimitiveType(environmentHandle_, "Select Knots", iconPath + KNOT_TYPE, knotType_);
allSupportedTypes_ = controlPointType_ | knotType_;
// Determine, which selection modes are requested
emit showToggleSelectionMode(environmentHandle_, true, allSupportedTypes_);
emit showVolumeLassoSelectionMode(environmentHandle_, true, allSupportedTypes_);
QStringList generalOperations;
generalOperations.append(G_CP_MODE);
generalOperations.append(G_K_MODE);
// Define control point and knot operations
QStringList controlPointOperations;
controlPointOperations.append(CP_SELECT_ALL);
controlPointOperations.append(CP_DESELECT_ALL);
controlPointOperations.append(CP_INVERT);
controlPointOperations.append(CP_DELETE);
QStringList knotOperations;
knotOperations.append(K_SELECT_ALL);
knotOperations.append(K_DESELECT_ALL);
knotOperations.append(K_INVERT);
knotOperations.append(K_DELETE);
emit addSelectionOperations(environmentHandle_, generalOperations, "Selection Operations");
emit addSelectionOperations(environmentHandle_, controlPointOperations, "Control Point Operations", controlPointType_);
emit addSelectionOperations(environmentHandle_, knotOperations, "Knot Operations", knotType_);
// Register key shortcuts:
// Select (a)ll
......
......@@ -101,9 +101,9 @@ signals:
void scriptInfo(QString _functionName);
// SelectionInterface
void addSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName);
void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
void registerType(QString _handleName, DataType _type);
void addPrimitiveType(QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u);
void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
......
......@@ -97,13 +97,13 @@ void BSplineSurfaceSelectionPlugin::pluginsInitialized() {
QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
emit addSelectionEnvironment("B-Spline Surface Selections", "Select B-Spline surface primitives.",
QIcon(iconPath + "bsplinesurface.png"), environmentHandle_);
iconPath + "bsplinesurface.png", environmentHandle_);
// Register mesh object types
emit registerType(environmentHandle_, DATA_BSPLINE_SURFACE);
emit addPrimitiveType(environmentHandle_, "Select Control Points", QIcon(iconPath + CONTROL_POINT_TYPE), controlPointType_);
emit addPrimitiveType(environmentHandle_, "Select Knots", QIcon(iconPath + KNOT_TYPE), knotType_);
emit addPrimitiveType(environmentHandle_, "Select Control Points", iconPath + CONTROL_POINT_TYPE, controlPointType_);
emit addPrimitiveType(environmentHandle_, "Select Knots", iconPath + KNOT_TYPE, knotType_);
allSupportedTypes_ = controlPointType_ | knotType_;
......
......@@ -101,9 +101,9 @@ signals:
void scriptInfo(QString _functionName);
// SelectionInterface
void addSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName);
void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
void registerType(QString _handleName, DataType _type);
void addPrimitiveType(QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u);
void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
......
......@@ -152,12 +152,12 @@ Q_INTERFACES(SelectionInterface)
void slotMouseEvent(QMouseEvent* _event);
// SelectionInterface
void slotAddSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName);
void slotAddSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
void slotRegisterType(QString _handleName, DataType _type);
void slotAddPrimitiveType(QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType& _typeHandle);
void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QIcon _icon,
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, QIcon _icon,
void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
DataType _objectTypeRestriction);
......@@ -262,7 +262,7 @@ Q_INTERFACES(SelectionInterface)
/// Show standard selection mode
/// Use this method to show/hide standard selection actions (lasso, floodfill, sphere, etc.)
void showSelectionMode(QString _mode, QIcon _icon, QString _desc,
void showSelectionMode(QString _mode, QString _icon, QString _desc,
QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes,
QString& _customIdentifier, bool _custom = false, DataType _objectTypeRestriction = DATA_ALL);
......
......@@ -145,17 +145,17 @@ void MeshObjectSelectionPlugin::pluginsInitialized() {
QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
emit addSelectionEnvironment("Mesh Object Selections", "Select mesh object primitives such as vertices, (half-)edges and faces.",
QIcon(iconPath + "selections.png"), environmentHandle_);
iconPath + "selections.png", environmentHandle_);
// Register mesh object types
emit registerType(environmentHandle_, DATA_POLY_MESH);
emit registerType(environmentHandle_, DATA_TRIANGLE_MESH);
// Register mesh primitive types
emit addPrimitiveType(environmentHandle_, "Select Vertices", QIcon(iconPath + VERTEX_TYPE), vertexType_);
emit addPrimitiveType(environmentHandle_, "Select Edges", QIcon(iconPath + EDGE_TYPE), edgeType_);
emit addPrimitiveType(environmentHandle_, "Select Halfedges", QIcon(iconPath + HEDGE_TYPE), halfedgeType_);
emit addPrimitiveType(environmentHandle_, "Select Faces", QIcon(iconPath + FACE_TYPE), faceType_);
emit addPrimitiveType(environmentHandle_, "Select Vertices", iconPath + VERTEX_TYPE, vertexType_);
emit addPrimitiveType(environmentHandle_, "Select Edges", iconPath + EDGE_TYPE, edgeType_);
emit addPrimitiveType(environmentHandle_, "Select Halfedges", iconPath + HEDGE_TYPE, halfedgeType_);
emit addPrimitiveType(environmentHandle_, "Select Faces", iconPath + FACE_TYPE, faceType_);
// Combine all supported types
allSupportedTypes_ = (vertexType_ | edgeType_ | halfedgeType_ | faceType_);
......
......@@ -104,9 +104,9 @@ signals:
void log(QString _message);
// SelectionInterface
void addSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName);
void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
void registerType(QString _handleName, DataType _type);
void addPrimitiveType(QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u);
void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
......
......@@ -82,12 +82,12 @@ void ObjectSelectionPlugin::pluginsInitialized() {
QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
emit addSelectionEnvironment("Object Selections", "Select objects.",
QIcon(iconPath + OBJECT_TYPE), environmentHandle_);
iconPath + OBJECT_TYPE, environmentHandle_);
// Register mesh object types
emit registerType(environmentHandle_, DATA_ALL);
emit addPrimitiveType(environmentHandle_, "Select Objects", QIcon(iconPath + OBJECT_TYPE), objectType_);
emit addPrimitiveType(environmentHandle_, "Select Objects", iconPath + OBJECT_TYPE, objectType_);
// Determine, which selection modes are requested
emit showToggleSelectionMode(environmentHandle_, true, objectType_);
......
......@@ -97,9 +97,9 @@ signals:
void scriptInfo(QString _functionName);
// SelectionInterface
void addSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName);
void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
void registerType(QString _handleName, DataType _type);
void addPrimitiveType(QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u);
void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
......
......@@ -90,13 +90,13 @@ void PolyLineSelectionPlugin::pluginsInitialized() {
QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
emit addSelectionEnvironment("PolyLine Selections", "Select polyline primitives.",
QIcon(iconPath + "polyline_type.png"), environmentHandle_);
iconPath + "polyline_type.png", environmentHandle_);
// Register mesh object types
emit registerType(environmentHandle_, DATA_POLY_LINE);
emit addPrimitiveType(environmentHandle_, "Select Polyline Vertices", QIcon(iconPath + VERTEX_TYPE), vertexType_);
emit addPrimitiveType(environmentHandle_, "Select Polyline Edges", QIcon(iconPath + EDGE_TYPE), edgeType_);
emit addPrimitiveType(environmentHandle_, "Select Polyline Vertices", iconPath + VERTEX_TYPE, vertexType_);
emit addPrimitiveType(environmentHandle_, "Select Polyline Edges", iconPath + EDGE_TYPE, edgeType_);
allSupportedTypes_ = vertexType_ | edgeType_;
......
......@@ -101,9 +101,9 @@ signals:
void scriptInfo(QString _functionName);
// SelectionInterface
void addSelectionEnvironment(QString _modeName, QString _description, QIcon _icon, QString& _handleName);
void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
void registerType(QString _handleName, DataType _type);
void addPrimitiveType(QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u);
void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
......
......@@ -96,13 +96,13 @@ void SplatCloudObjectSelectionPlugin::pluginsInitialized()
QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
emit addSelectionEnvironment( "SplatCloud Object Selections", "Select SplatCloud object primitives (vertices/points).", QIcon( iconPath + "selections.png" ), environmentHandle_ );
emit addSelectionEnvironment( "SplatCloud Object Selections", "Select SplatCloud object primitives (vertices/points).", iconPath + "selections.png" , environmentHandle_ );
// Register SplatCloud object type
emit registerType( environmentHandle_, DATA_SPLATCLOUD );
// Register SplatCloud primitive types
emit addPrimitiveType( environmentHandle_, "Select Splats", QIcon( iconPath + VERTEX_TYPE ), vertexType_ );
emit addPrimitiveType( environmentHandle_, "Select Splats", iconPath + VERTEX_TYPE , vertexType_ );
// Combine all supported types
allSupportedTypes_ = vertexType_;
......
......@@ -109,9 +109,9 @@ signals:
void log( Logtype _type, QString _message );
//-- Selection Interface --
void addSelectionEnvironment( QString _modeName, QString _description, QIcon _icon, QString &_handleName );
void addSelectionEnvironment( QString _modeName, QString _description, QString _icon, QString &_handleName );
void registerType( QString _handleName, DataType _type );
void addPrimitiveType( QString _handleName, QString _name, QIcon _icon, SelectionInterface::PrimitiveType &_typeHandle );
void addPrimitiveType( QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType &_typeHandle );
void addSelectionOperations( QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u );
void showToggleSelectionMode ( QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes );
......
......@@ -105,7 +105,7 @@ void VolumeMeshSelectionPlugin::pluginsInitialized() {
emit
addSelectionEnvironment("VolumeMesh Selections", "Select volume mesh primitives.",
QIcon(iconPath + "datacontrol-boundingBox.png"), environmentHandle_);
iconPath + "datacontrol-boundingBox.png", environmentHandle_);
// Register mesh object types
emit
......@@ -113,22 +113,17 @@ void VolumeMeshSelectionPlugin::pluginsInitialized() {
emit
registerType(environmentHandle_, DATA_HEXAHEDRAL_MESH);
emit
addPrimitiveType