Commit c1193eeb authored by Jan Möbius's avatar Jan Möbius

Moved const UpdateType to reference

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13344 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fda68e9b
......@@ -134,7 +134,7 @@ class BaseInterface {
* @param _identifier id of the object or -1 if referring to all or deleted objects.
* @param _type the type states which part of the object (topology, selection, ..) has to be updated
*/
virtual void updatedObject(int _identifier, const UpdateType _type) {};
virtual void updatedObject(int _identifier, const UpdateType& _type) {};
/** \brief A scenegraph node has been shown or hidden
*
......@@ -170,7 +170,7 @@ class BaseInterface {
* @param _identifier Identifier of the updated/new object or -1 if one is deleted.
* @param _type the type states which part of the object (topology, selection, ..) had been updated
*/
virtual void slotObjectUpdated( int _identifier, const UpdateType _type ) {};
virtual void slotObjectUpdated( int _identifier, const UpdateType& _type ) {};
/** \brief Called if the whole scene is cleared
*
......@@ -340,14 +340,14 @@ this change. This functionality is provided by the signals and slots for \ref Ba
\image html updateObject.jpg
If you change data you have to emit one of BaseInterface::updatedObject(int) or BaseInterface::updatedObject(int,const UpdateType).
If you change data you have to emit one of BaseInterface::updatedObject(int) or BaseInterface::updatedObject(int,const UpdateType&).
\n
BaseInterface::updatedObject(int) forces an update of the whole object while BaseInterface::updatedObject(int,const UpdateType)
BaseInterface::updatedObject(int) forces an update of the whole object while BaseInterface::updatedObject(int,const UpdateType&)
can be restricted to a part of the object ( Geometry,Selection, ... ; see UpdateType ) and is therefore faster and should be preferred.
Both signals get the id of the object that has been updated or -1 if all should be updated( you should not use -1 if you know what object changed!).
If the signal is emitted, the core calls BaseInterface::slotObjectUpdated( int , const UpdateType ) of every plugin. You can
If the signal is emitted, the core calls BaseInterface::slotObjectUpdated( int , const UpdateType& ) of every plugin. You can
implement this slot if you need to react on object changes.
After all plugins have been informed, the scene will be redrawn.
......
......@@ -166,7 +166,7 @@ signals:
void signalObjectUpdated(int);
/// When this Signal is emitted all Plugins are informed that some type of update was performed on an object
void signalObjectUpdated(int, const UpdateType);
void signalObjectUpdated(int, const UpdateType&);
/// When this Signal is emitted when a Wheel Event occures
void PluginWheelEvent(QWheelEvent * , const std::string & );
......@@ -397,7 +397,7 @@ signals:
/** Called by the plugins if they changed something in the object list (deleted, added,...)
* @param _identifier Id of the object
*/
void slotObjectUpdated(int _identifier, const UpdateType _type = UPDATE_ALL);
void slotObjectUpdated(int _identifier, const UpdateType& _type = UPDATE_ALL);
/// Called when a plugin changes the visibility of an object
void slotVisibilityChanged(int _id);
......
......@@ -73,7 +73,7 @@
/** This function is called by a plugin if it changed something in the object list (source,target,...). The information is passed to all plugins.
* @param _identifier Id of the updated object
*/
void Core::slotObjectUpdated(int _identifier, UpdateType _type) {
void Core::slotObjectUpdated(int _identifier, const UpdateType& _type) {
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
......
......@@ -840,10 +840,10 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
connect(plugin,SIGNAL(updateView()),this,SLOT(updateView()));
if ( checkSignal(plugin,"updatedObject(int)") && checkSignal(plugin,"updatedObject(int,const UpdateType)") ){
if ( checkSignal(plugin,"updatedObject(int)") && checkSignal(plugin,"updatedObject(int,const UpdateType&)") ){
log(LOGERR,tr("Plugin uses deprecated and(!) new updatedObject. Only new updatedObject will be active."));
connect(plugin,SIGNAL(updatedObject(int,const UpdateType)),this,SLOT(slotObjectUpdated(int,const UpdateType)), Qt::DirectConnection);
connect(plugin,SIGNAL(updatedObject(int,const UpdateType&)),this,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::DirectConnection);
} else {
......@@ -852,14 +852,14 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
connect(plugin,SIGNAL(updatedObject(int)),this,SLOT(slotObjectUpdated(int)), Qt::DirectConnection);
}
if ( checkSignal(plugin,"updatedObject(int,const UpdateType)") )
connect(plugin,SIGNAL(updatedObject(int,const UpdateType)),this,SLOT(slotObjectUpdated(int,const UpdateType)), Qt::DirectConnection);
if ( checkSignal(plugin,"updatedObject(int,const UpdateType&)") )
connect(plugin,SIGNAL(updatedObject(int,const UpdateType&)),this,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::DirectConnection);
}
if ( checkSlot( plugin , "slotObjectUpdated(int)" ) && checkSlot( plugin , "slotObjectUpdated(int,const UpdateType)" ) ){
if ( checkSlot( plugin , "slotObjectUpdated(int)" ) && checkSlot( plugin , "slotObjectUpdated(int,const UpdateType&)" ) ){
log(LOGERR,tr("Plugin uses deprecated and(!) new slotObjectUpdated. Only new slotObjectUpdated will be active."));
connect(this,SIGNAL(signalObjectUpdated(int,const UpdateType)),plugin,SLOT(slotObjectUpdated(int,const UpdateType)), Qt::DirectConnection);
connect(this,SIGNAL(signalObjectUpdated(int,const UpdateType&)),plugin,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::DirectConnection);
} else {
......@@ -868,8 +868,8 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
connect(this,SIGNAL(signalObjectUpdated(int)),plugin,SLOT(slotObjectUpdated(int)), Qt::DirectConnection);
}
if ( checkSlot( plugin , "slotObjectUpdated(int,const UpdateType)" ) )
connect(this,SIGNAL(signalObjectUpdated(int,const UpdateType)),plugin,SLOT(slotObjectUpdated(int,const UpdateType)), Qt::DirectConnection);
if ( checkSlot( plugin , "slotObjectUpdated(int,const UpdateType&)" ) )
connect(this,SIGNAL(signalObjectUpdated(int,const UpdateType&)),plugin,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::DirectConnection);
}
if ( checkSignal(plugin,"objectPropertiesChanged(int)")) {
......
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