diff --git a/PropertyVisPlugin.cc b/PropertyVisPlugin.cc index b77e7d4df8f0d6288c454a39ab0e1cdb3ed6912c..df4b51a84bc9cf7a4bc6a86dbb99dc08f2aac044 100644 --- a/PropertyVisPlugin.cc +++ b/PropertyVisPlugin.cc @@ -139,6 +139,28 @@ void PropertyVisPlugin::slotVisualizeProperty( int _id, const QString& _propname } } +void PropertyVisPlugin::slotClear(int _id, const QString &_propname) +{ + PropertyModel* model = PropertyModelFactory::Instance().getModel(_id); + + if (model != 0) + { + model->gatherProperties(); + QModelIndex idx = model->indexFromPlainPropName(_propname); + + if (idx.isValid()) + { + QModelIndexList list; + list.append(idx); + + model->clear(list); + + emit updateView(); + emit updatedObject( _id, UPDATE_COLOR ); + } + } +} + QScriptValue PropertyVisPlugin::getPropertyVisualizer(int _id, const QString &_propname) { PropertyModel* model = PropertyModelFactory::Instance().getModel(_id); diff --git a/PropertyVisPlugin.hh b/PropertyVisPlugin.hh index 8a17d0b1654bb34bcfab41aeda64605fda9d984e..590eb07ae7ece1e4ec075b3a67cfa165b960831e 100644 --- a/PropertyVisPlugin.hh +++ b/PropertyVisPlugin.hh @@ -149,7 +149,16 @@ private slots: public slots: + /// Visualise a property on object _id with the given name. + /// Note that for multiple properties with the same name (i.e., different + /// data types or entity types), there is no guarantee which one is used. void slotVisualizeProperty( int _id, const QString& _propname ); + + /// Remove visualisation of a property on object _id with the given name. + /// Note that for multiple properties with the same name (i.e., different + /// data types or entity types), there is no guarantee which one is used. + void slotClear( int _id, const QString& _propname ); + QScriptValue getPropertyVisualizer( int _id, const QString& _propname );