Salome HOME
Copy/paste functionality for images, polylines and calculation cases.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Module.cxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include "HYDROGUI_Module.h"
24
25 #include "HYDROGUI.h"
26 #include "HYDROGUI_DataModel.h"
27 #include "HYDROGUI_Displayer.h"
28 #include "HYDROGUI_GVSelector.h"
29 #include "HYDROGUI_InputPanel.h"
30 #include "HYDROGUI_ObjSelector.h"
31 #include "HYDROGUI_Operations.h"
32 #include "HYDROGUI_PrsImage.h"
33 #include "HYDROGUI_Tool.h"
34 #include "HYDROGUI_UpdateFlags.h"
35
36 #include <HYDROData_Image.h>
37
38 #include <HYDROOperations_Factory.h>
39
40 #include <GraphicsView_ViewFrame.h>
41 #include <GraphicsView_ViewManager.h>
42 #include <GraphicsView_ViewPort.h>
43 #include <GraphicsView_Viewer.h>
44
45 #include <ImageComposer_CutOperator.h>
46 #include <ImageComposer_CropOperator.h>
47 #include <ImageComposer_FuseOperator.h>
48
49 #include <LightApp_Application.h>
50 #include <LightApp_GVSelector.h>
51 #include <LightApp_SelectionMgr.h>
52 #include <LightApp_UpdateFlags.h>
53
54 #include <SALOME_Event.h>
55
56 #include <SUIT_Desktop.h>
57 #include <SUIT_Study.h>
58 #include <SUIT_ViewManager.h>
59
60 #include <QAction>
61 #include <QApplication>
62 #include <QGraphicsSceneMouseEvent>
63 #include <QMenu>
64
65 static int ViewManagerId = 0;
66
67 extern "C" HYDRO_EXPORT CAM_Module* createModule()
68 {
69   return new HYDROGUI_Module();
70 }
71
72 extern "C" HYDRO_EXPORT char* getModuleVersion()
73 {
74   return (char*)HYDRO_VERSION;
75 }
76
77 HYDROGUI_Module::HYDROGUI_Module()
78 : LightApp_Module( "HYDRO" ),
79   myDisplayer( 0 ),
80   myIsUpdateEnabled( true )
81 {
82 }
83
84 HYDROGUI_Module::~HYDROGUI_Module()
85 {
86 }
87
88 int HYDROGUI_Module::getStudyId() const
89 {
90   LightApp_Application* anApp = getApp();
91   return anApp ? anApp->activeStudy()->id() : 0;
92 }
93
94 void HYDROGUI_Module::initialize( CAM_Application* theApp )
95 {
96   LightApp_Module::initialize( theApp );
97
98   createActions();
99   createUndoRedoActions();
100   createMenus();
101   createPopups();
102   createToolbars();
103
104   setMenuShown( false );
105   setToolShown( false );
106
107   myDisplayer = new HYDROGUI_Displayer( this );
108 }
109
110 bool HYDROGUI_Module::activateModule( SUIT_Study* theStudy )
111 {
112   bool aRes = LightApp_Module::activateModule( theStudy );
113
114   LightApp_Application* anApp = getApp();
115   SUIT_Desktop* aDesktop = anApp->desktop();
116
117   getApp()->setEditEnabled( false ); // hide SalomeApp copy/paste actions
118
119   setMenuShown( true );
120   setToolShown( true );
121
122 #ifndef DISABLE_PYCONSOLE
123   aDesktop->tabifyDockWidget( HYDROGUI_Tool::WindowDock( anApp->getWindow( LightApp_Application::WT_PyConsole ) ), 
124                               HYDROGUI_Tool::WindowDock( anApp->getWindow( LightApp_Application::WT_LogWindow ) ) );
125 #endif
126
127   update( UF_All );
128
129   updateCommandsStatus();
130
131   return aRes;
132 }
133
134 bool HYDROGUI_Module::deactivateModule( SUIT_Study* theStudy )
135 {
136   ViewManagerMapIterator anIter( myViewManagerMap );
137   while( anIter.hasNext() )
138     if( SUIT_ViewManager* aViewManager = anIter.next().value().first )
139       getApp()->removeViewManager( aViewManager );
140   myViewManagerMap.clear();
141
142   myObjectStateMap.clear();
143
144   // clear the data model's list of copying objects
145   HYDROGUI_DataModel::changeCopyingObjects( HYDROData_SequenceOfObjects() );
146
147   setMenuShown( false );
148   setToolShown( false );
149
150   getApp()->setEditEnabled( true ); // show SalomeApp copy/paste actions
151
152   return LightApp_Module::deactivateModule( theStudy );
153 }
154
155 void HYDROGUI_Module::windows( QMap<int, int>& theMap ) const
156 {
157   theMap.clear();
158   theMap.insert( LightApp_Application::WT_LogWindow,     Qt::BottomDockWidgetArea );
159 #ifndef DISABLE_PYCONSOLE
160   theMap.insert( LightApp_Application::WT_PyConsole,     Qt::BottomDockWidgetArea );
161 #endif
162   theMap.insert( LightApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea   );
163 }
164
165 void HYDROGUI_Module::viewManagers( QStringList& theTypesList ) const
166 {
167   theTypesList << GraphicsView_Viewer::Type();
168 }
169
170 void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
171                                         QMenu* theMenu,
172                                         QString& theTitle )
173 {
174   HYDROGUI_DataModel* aModel = getDataModel();
175
176   size_t aViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( this );
177
178   bool anIsSelection = false;
179   bool anIsVisibleInSelection = false;
180   bool anIsHiddenInSelection = false;
181
182   bool anIsImage = false;
183   bool anIsImportedImage = false;
184   bool anIsCompositeImage = false;
185   bool anIsFusedImage = false;
186   bool anIsCutImage = false;
187   bool anIsSplittedImage = false;
188   bool anIsMustBeUpdatedImage = false;
189   bool anIsPolyline = false;
190   bool anIsCalculation = false;
191   bool anIsVisualState = false;
192
193   HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( this );
194   for( Standard_Integer anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ )
195   {
196     Handle(HYDROData_Object) anObject = aSeq.Value( anIndex );
197     if( !anObject.IsNull() )
198     {
199       anIsSelection = true;
200
201       bool aVisibility = isObjectVisible( aViewId, anObject );
202       anIsVisibleInSelection |= aVisibility;
203       anIsHiddenInSelection |= !aVisibility;
204
205       if( anObject->GetKind() == KIND_IMAGE )
206       {
207         anIsImage = true;
208         Handle(HYDROData_Image) anImage = Handle(HYDROData_Image)::DownCast( anObject );
209         if( !anImage.IsNull() )
210         {
211           anIsImportedImage = anImage->HasTrsfPoints() && !anImage->IsSelfSplitted();
212           anIsCompositeImage = anImage->NbReferences() > 0;
213           if( HYDROOperations_Factory* aFactory = HYDROOperations_Factory::Factory() )
214           {
215             if( ImageComposer_Operator* anOperator = aFactory->Operator( anImage ) )
216             {
217               QString anOperatorName = anOperator->name();
218               if( anOperatorName == ImageComposer_FuseOperator::Type() )
219                 anIsFusedImage = true;
220               else if( anOperatorName == ImageComposer_CutOperator::Type() )
221                 anIsCutImage = true;
222               else if( anOperatorName == ImageComposer_CropOperator::Type() )
223                 anIsSplittedImage = true;
224             }
225           }
226           anIsMustBeUpdatedImage = anImage->MustBeUpdated();
227         }
228       }
229       else if( anObject->GetKind() == KIND_POLYLINE )
230         anIsPolyline = true;
231       else if( anObject->GetKind() == KIND_CALCULATION )
232         anIsCalculation = true;
233       else if( anObject->GetKind() == KIND_VISUAL_STATE )
234         anIsVisualState = true;
235     }
236   }
237
238   if( aSeq.IsEmpty() )
239   {
240     theMenu->addAction( action( SaveVisualStateId ) );
241     theMenu->addSeparator();
242   }
243
244   if( anIsSelection && anIsMustBeUpdatedImage )
245   {
246     theMenu->addAction( action( UpdateImageId ) );
247     theMenu->addSeparator();
248   }
249
250   if( anIsSelection && aSeq.Length() == 1 )
251   {
252     if( anIsImage )
253     {
254       if( anIsImportedImage )
255         theMenu->addAction( action( EditImportedImageId ) );
256       else if( anIsCompositeImage )
257       {
258         if( anIsFusedImage )
259           theMenu->addAction( action( EditFusedImageId ) );
260         else if( anIsCutImage )
261           theMenu->addAction( action( EditCutImageId ) );
262         else if( anIsSplittedImage )
263           theMenu->addAction( action( EditSplittedImageId ) );
264       }
265
266       theMenu->addAction( action( ObserveImageId ) );
267       theMenu->addAction( action( ExportImageId ) );
268       theMenu->addSeparator();
269     }
270     else if( anIsPolyline )
271     {
272       theMenu->addAction( action( EditPolylineId ) );
273       theMenu->addSeparator();
274     }
275     else if( anIsCalculation )
276     {
277       theMenu->addAction( action( EditCalculationId ) );
278       theMenu->addSeparator();
279     }
280     else if( anIsVisualState )
281     {
282       theMenu->addAction( action( SaveVisualStateId ) );
283       theMenu->addAction( action( LoadVisualStateId ) );
284       theMenu->addSeparator();
285     }
286   }
287
288   if( anIsSelection )
289   {
290     theMenu->addAction( action( DeleteId ) );
291     theMenu->addSeparator();
292   }
293
294   if( anIsSelection && ( anIsImage || anIsPolyline ) )
295   {
296     if( anIsHiddenInSelection )
297       theMenu->addAction( action( ShowId ) );
298     theMenu->addAction( action( ShowOnlyId ) );
299     if( anIsVisibleInSelection )
300       theMenu->addAction( action( HideId ) );
301     theMenu->addSeparator();
302   }
303
304   theMenu->addAction( action( ShowAllId ) );
305   theMenu->addAction( action( HideAllId ) );
306   theMenu->addSeparator();
307 }
308
309 void HYDROGUI_Module::update( const int flags )
310 {
311   if( !isUpdateEnabled() )
312     return;
313
314   QApplication::setOverrideCursor( Qt::WaitCursor );
315
316   // To prevent calling this method recursively
317   // from one of the methods called below
318   setUpdateEnabled( false );
319
320   if( ( flags & UF_Viewer ) )
321     updateGV( flags & UF_GV_Init,
322               flags & UF_GV_Forced );
323
324   if( ( flags & UF_Model ) && getDataModel() && getApp() )
325   {
326     getDataModel()->update( getStudyId() );
327
328     // Temporary workaround to prevent breaking
329     // the selection in the object browser.
330     // Note: processEvents() should be called after updateGV(),
331     // otherwise the application crashes from time to time.
332     qApp->processEvents(); 
333     getApp()->updateObjectBrowser( true );
334   }
335
336   // Object browser is currently updated by using UF_Model flag
337   //if( ( flags & UF_ObjBrowser ) && getApp() )
338   //  getApp()->updateObjectBrowser( true );
339
340   if( ( flags & UF_Controls ) && getApp() )
341     getApp()->updateActions();
342
343   setUpdateEnabled( true );
344
345   QApplication::restoreOverrideCursor();
346 }
347
348 void HYDROGUI_Module::updateCommandsStatus()
349 {
350   LightApp_Module::updateCommandsStatus();
351
352   updateUndoRedoControls();
353
354   action( CopyId )->setEnabled( getDataModel()->canCopy() );
355   action( PasteId )->setEnabled( getDataModel()->canPaste() );
356 }
357
358 void HYDROGUI_Module::selectionChanged()
359 {
360   LightApp_Module::selectionChanged();
361   updateCommandsStatus();
362 }
363
364 HYDROGUI_DataModel* HYDROGUI_Module::getDataModel() const
365 {
366   return (HYDROGUI_DataModel*)dataModel();
367 }
368
369 HYDROGUI_Displayer* HYDROGUI_Module::getDisplayer() const
370 {
371   return myDisplayer;
372 }
373
374 GraphicsView_Viewer* HYDROGUI_Module::getViewer( const int theId ) const
375 {
376   if( myViewManagerMap.contains( theId ) )
377   {
378     ViewManagerInfo anInfo = myViewManagerMap[ theId ];
379     GraphicsView_ViewManager* aViewManager =
380       dynamic_cast<GraphicsView_ViewManager*>( anInfo.first );
381     if( aViewManager )
382       return aViewManager->getViewer();
383   }
384   return NULL;
385 }
386
387 int HYDROGUI_Module::getViewManagerId( SUIT_ViewManager* theViewManager )
388 {
389   ViewManagerMapIterator anIter( myViewManagerMap );
390   while( anIter.hasNext() )
391   {
392     int anId = anIter.next().key();
393     const ViewManagerInfo& anInfo = anIter.value();
394     if( anInfo.first == theViewManager )
395       return anId;
396   }
397   return -1;
398 }
399
400 HYDROGUI_Module::ViewManagerRole HYDROGUI_Module::getViewManagerRole( SUIT_ViewManager* theViewManager )
401 {
402   int anId = getViewManagerId( theViewManager );
403   if( anId != -1 )
404   {
405     const ViewManagerInfo& anInfo = myViewManagerMap[ anId ];
406     return anInfo.second;
407   }
408   return VMR_Unknown;
409 }
410
411 void HYDROGUI_Module::setViewManagerRole( SUIT_ViewManager* theViewManager,
412                                           const ViewManagerRole theRole )
413 {
414   int anId = getViewManagerId( theViewManager );
415   if( anId != -1 )
416   {
417     ViewManagerInfo& anInfo = myViewManagerMap[ anId ];
418     anInfo.second = theRole;
419   }
420 }
421
422 bool HYDROGUI_Module::isObjectVisible( const int theViewId,
423                                        const Handle(HYDROData_Object)& theObject )
424 {
425   if( theObject.IsNull() )
426     return false;
427
428   ViewId2Name2ObjectStateMap::const_iterator anIter1 = myObjectStateMap.find( theViewId );
429   if( anIter1 != myObjectStateMap.end() )
430   {
431     const Name2ObjectStateMap& aName2ObjectStateMap = anIter1.value();
432     Name2ObjectStateMap::const_iterator anIter2 = aName2ObjectStateMap.find( theObject->GetName());
433     if( anIter2 != aName2ObjectStateMap.end() )
434     {
435       const ObjectState& anObjectState = anIter2.value();
436       return anObjectState.Visibility;
437     }
438   }
439   return false;
440 }
441
442 void HYDROGUI_Module::setObjectVisible( const int theViewId,
443                                         const Handle(HYDROData_Object)& theObject,
444                                         const bool theState )
445 {
446   if( !theObject.IsNull() )
447   {
448     Name2ObjectStateMap& aName2ObjectStateMap = myObjectStateMap[ theViewId ];
449     ObjectState& anObjectState = aName2ObjectStateMap[ theObject->GetName() ];
450     anObjectState.Visibility = theState;
451   }
452 }
453
454 CAM_DataModel* HYDROGUI_Module::createDataModel()
455 {
456   return new HYDROGUI_DataModel( this );
457 }
458
459 void HYDROGUI_Module::customEvent( QEvent* e )
460 {
461   int aType = e->type();
462   if ( aType == NewViewEvent )
463   {
464     SALOME_CustomEvent* ce = ( SALOME_CustomEvent* )e;
465     if( GraphicsView_ViewFrame* aViewFrame = ( GraphicsView_ViewFrame* )ce->data() )
466     {
467       if( GraphicsView_Viewer* aViewer = dynamic_cast<GraphicsView_Viewer*>( aViewFrame->getViewer() ) )
468       {
469         if( GraphicsView_ViewPort* aViewPort = aViewer->getActiveViewPort() )
470         {
471           aViewPort->setInteractionFlag( GraphicsView_ViewPort::TraceBoundingRect );
472           aViewPort->setInteractionFlag( GraphicsView_ViewPort::ImmediateContextMenu );
473           aViewPort->setInteractionFlag( GraphicsView_ViewPort::ImmediateSelection );
474
475           //ouv: temporarily commented
476           //aViewPort->setViewLabelPosition( GraphicsView_ViewPort::VLP_BottomLeft, true );
477         }
478
479         SUIT_ViewManager* aViewManager = aViewer->getViewManager();
480         ViewManagerRole aRole = getViewManagerRole( aViewManager );
481         if( aRole != VMR_TransformImage )
482           update( UF_Viewer );
483
484         aViewer->activateTransform( GraphicsView_Viewer::FitAll );
485       }
486     }
487   }
488 }
489
490 bool HYDROGUI_Module::eventFilter( QObject* theObj, QEvent* theEvent )
491 {
492   QEvent::Type aType = theEvent->type();
493   if( theObj->inherits( "GraphicsView_ViewFrame" ) )
494   {
495     if( aType == QEvent::Show )
496     {
497       SALOME_CustomEvent* e = new SALOME_CustomEvent( NewViewEvent );
498       e->setData( theObj );
499       QApplication::postEvent( this, e );
500       theObj->removeEventFilter( this );
501     }
502   }
503   return LightApp_Module::eventFilter( theObj, theEvent );
504 }
505
506 void HYDROGUI_Module::onViewManagerAdded( SUIT_ViewManager* theViewManager )
507 {
508   LightApp_Module::onViewManagerAdded( theViewManager );
509
510   if( theViewManager->getType() == GraphicsView_Viewer::Type() )
511   { 
512     createSelector( theViewManager ); // replace the default selector
513
514     connect( theViewManager, SIGNAL( viewCreated( SUIT_ViewWindow* ) ),
515              this, SLOT( onViewCreated( SUIT_ViewWindow* ) ) );
516   }
517
518   ViewManagerInfo anInfo( theViewManager, VMR_General );
519   myViewManagerMap.insert( ViewManagerId++, anInfo );
520 }
521
522 void HYDROGUI_Module::onViewManagerRemoved( SUIT_ViewManager* theViewManager )
523 {
524   LightApp_Module::onViewManagerRemoved( theViewManager );
525
526   createSelector( theViewManager ); // replace the default selector
527
528   int anId = getViewManagerId( theViewManager );
529   if( anId != -1 )
530     myViewManagerMap.remove( anId );
531 }
532
533 void HYDROGUI_Module::onViewCreated( SUIT_ViewWindow* theViewWindow )
534 {
535   if( theViewWindow && theViewWindow->inherits( "GraphicsView_ViewFrame" ) )
536   {
537     if( GraphicsView_ViewFrame* aViewFrame = dynamic_cast<GraphicsView_ViewFrame*>( theViewWindow ) )
538     {
539       aViewFrame->installEventFilter( this );
540
541       GraphicsView_ViewPort* aViewPort = aViewFrame->getViewPort();
542
543       connect( aViewPort, SIGNAL( vpMouseEvent( QGraphicsSceneMouseEvent* ) ),
544                this, SLOT( onViewPortMouseEvent( QGraphicsSceneMouseEvent* ) ) );
545       return;
546     }
547   }
548 }
549
550 void HYDROGUI_Module::onViewPortMouseEvent( QGraphicsSceneMouseEvent* theEvent )
551 {
552   if( GraphicsView_ViewPort* aViewPort = qobject_cast<GraphicsView_ViewPort*>( sender() ) )
553   {
554     SUIT_ViewManager* aViewManager = 0;
555
556     QObject* aParent = aViewPort;
557     while( aParent = aParent->parent() )
558     {
559       if( GraphicsView_ViewFrame* aViewFrame = dynamic_cast<GraphicsView_ViewFrame*>( aParent ) )
560       {
561         if( GraphicsView_Viewer* aViewer = aViewFrame->getViewer() )
562         {
563           aViewManager = aViewer->getViewManager();
564           break;
565         }
566       }
567     }
568
569     if( !aViewManager )
570       return;
571
572     double aMouseX = theEvent->scenePos().x();
573     double aMouseY = theEvent->scenePos().y();
574
575     ViewManagerRole aRole = getViewManagerRole( aViewManager );
576     if( aRole == VMR_General )
577     {
578       int aXDeg = 0, aYDeg = 0;
579       int aXMin = 0, aYMin = 0;
580       double aXSec = 0, aYSec = 0;
581       HYDROGUI_Tool::DoubleToLambert( aMouseX, aXDeg, aXMin, aXSec );
582       HYDROGUI_Tool::DoubleToLambert( aMouseY, aYDeg, aYMin, aYSec );
583
584       QString aDegSymbol( QChar( 0x00B0 ) );
585       QString aXStr = QString( "%1%2 %3' %4\"" ).arg( aXDeg ).arg( aDegSymbol ).arg( aXMin ).arg( aXSec );
586       QString aYStr = QString( "%1%2 %3' %4\"" ).arg( aYDeg ).arg( aDegSymbol ).arg( aYMin ).arg( aYSec );
587
588       aViewPort->setViewLabelText( QString( "X: %1\nY: %2" ).arg( aXStr ).arg( aYStr ) );
589     }
590     else if( aRole == VMR_TransformImage )
591       aViewPort->setViewLabelText( QString( "X: %1\nY: %2" ).arg( (int)aMouseX ).arg( (int)aMouseY ) );
592   }
593 }
594
595 void HYDROGUI_Module::updateGV( const bool theIsInit,
596                                 const bool theIsForced )
597 {
598   if( !getDisplayer() )
599     return;
600
601   QList<int> aViewManagerIdList;
602
603   // currently, all views are updated
604   ViewManagerMapIterator anIter( myViewManagerMap );
605   while( anIter.hasNext() )
606   {
607     int anId = anIter.next().key();
608     aViewManagerIdList.append( anId );
609   }
610
611   QListIterator<int> anIdIter( aViewManagerIdList );
612   while( anIdIter.hasNext() )
613     getDisplayer()->UpdateAll( anIdIter.next(), theIsInit, theIsForced );
614 }
615
616 void HYDROGUI_Module::createSelector( SUIT_ViewManager* theViewManager )
617 {
618   if( !theViewManager )
619     return;
620
621   LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr();
622   if( !aSelectionMgr )
623     return;
624
625   QString aViewType = theViewManager->getType();
626   if( aViewType != GraphicsView_Viewer::Type() )
627     return;
628
629   GraphicsView_ViewManager* aViewManager =
630     dynamic_cast<GraphicsView_ViewManager*>( theViewManager );
631   if( !aViewManager )
632     return;
633
634   QList<SUIT_Selector*> aSelectorList;
635   aSelectionMgr->selectors( aViewType, aSelectorList );
636
637   // disable all alien selectors
638   QList<SUIT_Selector*>::iterator anIter, anIterEnd = aSelectorList.end();
639   for( anIter = aSelectorList.begin(); anIter != anIterEnd; anIter++ )
640   {
641     SUIT_Selector* aSelector = *anIter;
642     if( aSelector && !dynamic_cast<HYDROGUI_GVSelector*>( aSelector ) )
643       aSelector->setEnabled( false );
644   }
645
646   new HYDROGUI_GVSelector( this, aViewManager->getViewer(), aSelectionMgr );
647 }
648
649 bool HYDROGUI_Module::setUpdateEnabled( const bool theState )
650 {
651   bool aPrevState = myIsUpdateEnabled;
652   myIsUpdateEnabled = theState;
653   return aPrevState;
654 }
655
656 bool HYDROGUI_Module::isUpdateEnabled() const
657 {
658   return myIsUpdateEnabled;
659 }