00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #include "Core.hh"
00056
00057 #include <QToolBox>
00058
00059 #include "OpenFlipper/BasePlugin/BaseInterface.hh"
00060 #include "OpenFlipper/BasePlugin/ToolboxInterface.hh"
00061 #include "OpenFlipper/BasePlugin/TextureInterface.hh"
00062
00063 #include "OpenFlipper/BasePlugin/PluginFunctions.hh"
00064
00065
00066
00067
00068
00069
00070
00074 void Core::slotObjectUpdated(int _identifier) {
00075 if ( OpenFlipper::Options::doSlotDebugging() ) {
00076 if ( sender() != 0 ) {
00077 if ( sender()->metaObject() != 0 ) {
00078 emit log(LOGINFO,"updatedObject( " + QString::number(_identifier) + tr(" ) called by ") +
00079 QString( sender()->metaObject()->className() ) );
00080 }
00081 } else {
00082 emit log(LOGINFO,"updatedObject( " + QString::number(_identifier) + tr(" ) called by Core") );
00083 }
00084 }
00085
00086
00087 OpenFlipper::Options::redrawDisabled(true);
00088
00089
00090 BaseObject* object = 0;
00091 if ( _identifier != -1 ) {
00092 if ( !PluginFunctions::getObject(_identifier,object) ) {
00093 emit log(LOGERR,tr("updated_objects called for non existing object with id : ") + QString::number(_identifier) );
00094 return;
00095 }
00096 }
00097
00098
00099 emit signalObjectUpdated(_identifier);
00100
00101 if ( object != 0 )
00102 object->update();
00103
00104
00105 OpenFlipper::Options::redrawDisabled(false);
00106
00107
00108
00109 resetScenegraph(false);
00110
00111 updateView();
00112 }
00113
00114 void Core::slotVisibilityChanged( int _id ) {
00115
00116
00117 emit visibilityChanged( _id );
00118
00119
00120 resetScenegraph(false);
00121
00122 updateView();
00123 }
00124
00127 void Core::slotObjectSelectionChanged( int _id )
00128 {
00129
00130 emit objectSelectionChanged(_id);
00131
00132
00133
00134 }
00135
00136 void Core::slotObjectPropertiesChanged( int _id )
00137 {
00138 emit objectPropertiesChanged(_id);
00139 }
00140
00141
00142
00143
00144
00145
00149 void Core::slotAddTexture( QString _textureName , QString _filename, uint _dimension, int _id) {
00150 emit addTexture(_textureName , _filename,_dimension,_id);
00151 }
00152
00156 void Core::slotAddTexture( QString _textureName , QString _filename, uint _dimension) {
00157 emit addTexture(_textureName , _filename,_dimension);
00158 }
00159
00163 void Core::slotUpdateTexture( QString _name , int _identifier){
00164
00165 if ( OpenFlipper::Options::doSlotDebugging() ) {
00166 if ( sender() != 0 ) {
00167 if ( sender()->metaObject() != 0 ) {
00168 emit log(LOGINFO,"slotUpdateTexture( " + _name + " , " + QString::number(_identifier) + tr(" ) called by ") +
00169 QString( sender()->metaObject()->className() ) );
00170 }
00171 }
00172 }
00173
00174 emit updateTexture(_name, _identifier);
00175 }
00176
00177
00178 void Core::slotMultiTextureAdded( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId ) {
00179 emit addMultiTexture( _textureGroup , _name , _filename , _id , _textureId );
00180 }
00181
00185 void Core::slotUpdateAllTextures( ){
00186 emit updateAllTextures();
00187 }
00188
00192 void Core::slotSetTextureMode(QString _textureName, QString _mode, int _id) {
00193
00194 if ( OpenFlipper::Options::doSlotDebugging() ) {
00195 if ( sender() != 0 ) {
00196 if ( sender()->metaObject() != 0 ) {
00197 emit log(LOGINFO,"slotSetTextureMode( " + _textureName + " , " + _mode + " , " + QString::number(_id) + tr(" ) called by ") +
00198 QString( sender()->metaObject()->className() ) );
00199 }
00200 }
00201 }
00202
00203 emit setTextureMode(_textureName,_mode,_id);
00204 }
00205
00209 void Core::slotSetTextureMode(QString _textureName ,QString _mode) {
00210
00211 if ( OpenFlipper::Options::doSlotDebugging() ) {
00212 if ( sender() != 0 ) {
00213 if ( sender()->metaObject() != 0 ) {
00214 emit log(LOGINFO,"slotSetTextureMode( " + _textureName + " , " + _mode + tr(" ) called by ") +
00215 QString( sender()->metaObject()->className() ) );
00216 }
00217 }
00218 }
00219
00220 emit setTextureMode(_textureName,_mode);
00221 }
00222
00226 void Core::slotTextureUpdated( QString _textureName , int _identifier ) {
00227 if ( OpenFlipper::Options::doSlotDebugging() ) {
00228 if ( sender() != 0 ) {
00229 if ( sender()->metaObject() != 0 ) {
00230 emit log(LOGINFO,"slotTextureUpdated( " + _textureName + " , " + QString::number(_identifier) + tr(" ) called by ") +
00231 QString( sender()->metaObject()->className() ) );
00232 }
00233 }
00234 }
00235 emit updatedTextures(_textureName,_identifier);
00236 }
00237
00240 void Core::slotSwitchTexture( QString _textureName, int _id ) {
00241 emit switchTexture(_textureName, _id);
00242 }
00243
00246 void Core::slotSwitchTexture( QString _textureName ) {
00247 emit switchTexture(_textureName);
00248 }
00249
00250
00253 void Core::slotTextureChangeImage( QString _textureName , QImage& _image ) {
00254 emit textureChangeImage( _textureName ,_image );
00255 }
00256
00259 void Core::slotTextureChangeImage( QString _textureName , QImage& _image , int _id ) {
00260 emit textureChangeImage( _textureName , _image , _id );
00261 }
00262
00263
00264
00265
00266
00268 void Core::backupRequest( int _id , QString _name ) {
00269 emit createBackup( _id , _name , nextBackupId_);
00270 ++nextBackupId_;
00271 }
00272
00273
00274
00275
00276
00277