1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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, or (at your option) any later version.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: LightApp_Module.cxx
24 // Created: 6/20/2005 16:30:56 AM
27 #include "LightApp_Module.h"
29 #include "CAM_Application.h"
31 #include "LightApp_Application.h"
32 #include "LightApp_DataModel.h"
33 #include "LightApp_DataObject.h"
34 #include "LightApp_Study.h"
35 #include "LightApp_Preferences.h"
36 #include "LightApp_Selection.h"
37 #include "LightApp_Operation.h"
38 #include "LightApp_SwitchOp.h"
39 #include "LightApp_UpdateFlags.h"
40 #include "LightApp_ShowHideOp.h"
41 #include "LightApp_SelectionMgr.h"
43 #include <SUIT_Study.h>
44 #include <SUIT_DataObject.h>
45 #include <SUIT_DataBrowser.h>
46 #include <SUIT_Operation.h>
47 #include <SUIT_ViewManager.h>
48 #include <SUIT_ResourceMgr.h>
49 #include <SUIT_ShortcutMgr.h>
50 #include <SUIT_Desktop.h>
51 #include <SUIT_TreeModel.h>
52 #include <SUIT_Session.h>
54 #ifndef DISABLE_SALOMEOBJECT
55 #include <SALOME_ListIO.hxx>
58 #ifndef DISABLE_VTKVIEWER
59 #ifndef DISABLE_SALOMEOBJECT
60 #include <SVTK_ViewWindow.h>
61 #include <SVTK_ViewModel.h>
63 #include <VTKViewer_ViewWindow.h>
65 #include <VTKViewer_ViewModel.h>
67 #ifndef DISABLE_OCCVIEWER
68 #include <OCCViewer_ViewWindow.h>
69 #include <OCCViewer_ViewPort3d.h>
70 #ifndef DISABLE_SALOMEOBJECT
71 #include <SOCC_ViewModel.h>
73 #include <OCCViewer_ViewModel.h>
76 #ifndef DISABLE_GLVIEWER
77 #include <GLViewer_ViewFrame.h>
78 #include <GLViewer_ViewPort.h>
80 #ifndef DISABLE_PVVIEWER
81 #include <PVViewer_ViewManager.h>
82 #include <PVViewer_ViewWindow.h>
84 #ifndef DISABLE_PLOT2DVIEWER
85 #include <Plot2d_ViewWindow.h>
86 #include <Plot2d_ViewFrame.h>
87 #ifndef DISABLE_SALOMEOBJECT
88 #include <SPlot2d_ViewModel.h>
90 #include <Plot2d_ViewModel.h>
94 #include <QtxPopupMgr.h>
98 #include <QStringList>
104 LightApp_Module::LightApp_Module( const QString& name )
105 : CAM_Module( name ),
112 myIsFirstActivate( true )
117 LightApp_Module::~LightApp_Module()
123 /*!Initialize module.*/
124 void LightApp_Module::initialize( CAM_Application* app )
126 CAM_Module::initialize( app );
128 SUIT_ResourceMgr* resMgr = app ? app->resourceMgr() : 0;
130 resMgr->raiseTranslators( name() );
134 void LightApp_Module::windows( QMap<int, int>& ) const
139 void LightApp_Module::viewManagers( QStringList& ) const
143 /*!Context menu popup.*/
144 void LightApp_Module::contextMenuPopup( const QString& client, QMenu* menu, QString& /*title*/ )
146 LightApp_Selection* sel = createSelection();
147 sel->init( client, getApp()->selectionMgr() );
149 popupMgr()->setSelection( sel );
150 popupMgr()->setMenu( menu );
151 popupMgr()->updateMenu();
154 /*!Update object browser.
155 * For updating model or whole object browser use update() method can be used.
157 void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel,
158 SUIT_DataObject* theDataObject )
160 bool upd = getApp()->objectBrowser()->autoUpdate();
161 getApp()->objectBrowser()->setAutoUpdate( false );
163 if( theIsUpdateDataModel ){
164 if( CAM_DataModel* aDataModel = dataModel() ){
165 if ( LightApp_DataModel* aModel = dynamic_cast<LightApp_DataModel*>( aDataModel ) ) {
166 //SUIT_DataObject* aParent = NULL;
167 //if(theDataObject && theDataObject != aDataModel->root())
168 // aParent = theDataObject->parent();
170 LightApp_DataObject* anObject = dynamic_cast<LightApp_DataObject*>(theDataObject);
171 LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(getApp()->activeStudy());
172 aModel->update( anObject, aStudy );
177 getApp()->objectBrowser()->setAutoUpdate( upd );
178 getApp()->objectBrowser()->updateTree( 0, false );
182 void LightApp_Module::selectionChanged()
186 /*! \brief If return false, selection will be cleared at module activation
188 bool LightApp_Module::isSelectionCompatible()
190 // return true if selected objects belong to this module
191 bool isCompatible = true;
192 #ifndef DISABLE_SALOMEOBJECT
193 SALOME_ListIO selected;
194 if ( LightApp_SelectionMgr *Sel = getApp()->selectionMgr() )
195 Sel->selectedObjects( selected );
197 LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( getApp()->activeStudy() );
198 LightApp_DataObject* aRoot = dynamic_cast<LightApp_DataObject*>( dataModel()->root() );
199 if ( aStudy && aRoot ) {
201 QString moduleDataType = aRoot->componentDataType();
202 // check data type of selection
203 SALOME_ListIteratorOfListIO It( selected );
204 for ( ; isCompatible && It.More(); It.Next()) {
205 Handle(SALOME_InteractiveObject) io = It.Value();
206 isCompatible = ( aStudy->componentDataType( io->getEntry() ) == moduleDataType );
213 /*!Activate module.*/
214 bool LightApp_Module::activateModule( SUIT_Study* study )
216 bool res = CAM_Module::activateModule( study );
218 if ( !isSelectionCompatible() )// PAL19290, PAL18352
219 getApp()->selectionMgr()->clearSelected();
221 if ( res && application() && application()->resourceMgr() )
222 application()->resourceMgr()->raiseTranslators( name() );
224 connect( application(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
225 this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) );
226 connect( application(), SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
227 this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
229 if ( mySwitchOp == 0 )
230 mySwitchOp = new LightApp_SwitchOp( this );
232 // Enable Display and Erase actions
233 if ( action(myDisplay) )
234 action(myDisplay)->setEnabled(true);
235 if ( action(myErase) )
236 action(myErase)->setEnabled(true);
238 application()->shortcutMgr()->setSectionEnabled( moduleName() );
240 /* BUG 0020498 : The Entry column is always shown at module activation
241 The registration of column is moved into LightApp_Application
243 QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
244 LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
247 SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( getApp()->objectBrowser()->model() );
248 m->registerColumn( getApp()->objectBrowser(), EntryCol, LightApp_DataObject::EntryId );
249 treeModel->setAppropriate( EntryCol, Qtx::Toggled );
252 if ( myIsFirstActivate ) {
253 updateModuleVisibilityState();
254 myIsFirstActivate = false;
260 /*!Deactivate module.*/
261 bool LightApp_Module::deactivateModule( SUIT_Study* study )
266 disconnect( application(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
267 this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) );
268 disconnect( application(), SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
269 this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
271 // abort all operations
272 MapOfOperation::const_iterator anIt;
273 for( anIt = myOperations.begin(); anIt != myOperations.end(); anIt++ ) {
274 anIt.value()->abort();
277 // Disable Display and Erase action
278 if ( action(myDisplay) )
279 action(myDisplay)->setEnabled(false);
280 if ( action(myErase) )
281 action(myErase)->setEnabled(false);
283 application()->shortcutMgr()->setSectionEnabled( moduleName(), false );
285 /* BUG 0020498 : The Entry column is always shown at module activation
286 QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
287 LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
290 SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( getApp()->objectBrowser()->model() );
292 treeModel->setAppropriate( EntryCol, Qtx::Shown );
293 m->unregisterColumn( getApp()->objectBrowser(), EntryCol );
296 return CAM_Module::deactivateModule( study );
299 /*! Redefined to reset internal flags valid for study instance */
300 void LightApp_Module::studyClosed( SUIT_Study* theStudy )
302 CAM_Module::studyClosed( theStudy );
304 myIsFirstActivate = true;
306 LightApp_Application* app = dynamic_cast<LightApp_Application*>(application());
308 SUIT_DataBrowser* ob = app->objectBrowser();
309 if ( ob && ob->model() )
310 disconnect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
311 this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ) );
316 void LightApp_Module::MenuItem()
321 void LightApp_Module::createPreferences()
326 void LightApp_Module::preferencesChanged( const QString&, const QString& )
331 void LightApp_Module::message( const QString& )
335 /*!Gets application.*/
336 LightApp_Application* LightApp_Module::getApp() const
338 return (LightApp_Application*)application();
342 * \brief Update something in accordance with update flags
343 * \param theFlags - update flags
345 * Update viewer or/and object browser etc. in accordance with update flags ( see
346 * LightApp_UpdateFlags enumeration ). Derived modules can redefine this method for their
349 void LightApp_Module::update( const int theFlags )
351 if ( theFlags & UF_Model )
353 if( CAM_DataModel* aDataModel = dataModel() )
354 if( LightApp_DataModel* aModel = dynamic_cast<LightApp_DataModel*>( aDataModel ) )
355 aModel->update( 0, dynamic_cast<LightApp_Study*>( getApp()->activeStudy() ) );
358 if ( theFlags & UF_ObjBrowser )
359 getApp()->objectBrowser()->updateTree( 0 );
361 if ( theFlags & UF_Controls )
363 if ( theFlags & UF_Viewer )
365 if ( SUIT_ViewManager* viewMgr = getApp()->activeViewManager() )
366 if ( SUIT_ViewWindow* viewWnd = viewMgr->getActiveView() )
368 #ifndef DISABLE_VTKVIEWER
369 #ifndef DISABLE_SALOMEOBJECT
370 if ( viewWnd->inherits( "SVTK_ViewWindow" ) )
371 ( (SVTK_ViewWindow*)viewWnd )->Repaint();
373 if ( viewWnd->inherits( "VTKViewer_ViewWindow" ) )
374 ( (VTKViewer_ViewWindow*)viewWnd )->Repaint();
377 #ifndef DISABLE_OCCVIEWER
378 if ( viewWnd->inherits( "OCCViewer_ViewWindow" ) )
379 ( (OCCViewer_ViewWindow*)viewWnd )->getViewPort()->onUpdate();
381 #ifndef DISABLE_PLOT2DVIEWER
382 if ( viewWnd->inherits( "Plot2d_ViewWindow" ) )
383 ( (Plot2d_ViewWindow*)viewWnd )->getViewFrame()->Repaint();
385 #ifndef DISABLE_GLVIEWER
386 if ( viewWnd->inherits( "GLViewer_ViewFrame" ) )
387 ( (GLViewer_ViewFrame*)viewWnd )->getViewPort()->onUpdate();
389 #ifndef DISABLE_PVVIEWER
390 // if ( viewWnd->inherits( "PVViewer_ViewWindow" ) )
391 // ( (PVViewer_ViewWindow*)viewWnd )->getViewPort()->onUpdate();
397 * \brief Updates controls
399 * Updates (i.e. disable/enable) controls states (menus, tool bars etc.). This method is
400 * called from update( UF_Controls ). You may redefine it in concrete module.
402 void LightApp_Module::updateControls()
406 /*!Create new instance of data model and return it.*/
407 CAM_DataModel* LightApp_Module::createDataModel()
409 return new LightApp_DataModel( this );
412 /*!Create and return instance of LightApp_Selection.*/
413 LightApp_Selection* LightApp_Module::createSelection() const
415 return new LightApp_Selection();
419 void LightApp_Module::onModelOpened()
424 void LightApp_Module::onModelSaved()
429 void LightApp_Module::onModelClosed()
433 /*!Gets popup manager.(create if not exist)*/
434 QtxPopupMgr* LightApp_Module::popupMgr()
438 myPopupMgr = new QtxPopupMgr( 0, this );
441 SUIT_Desktop* d = application()->desktop();
444 *disp = createAction( -1, tr( "TOP_SHOW" ), p, tr( "MEN_SHOW" ), tr( "STB_SHOW" ),
445 0, d, false, this, SLOT( onShowHide() ), QString("General:Show object(s)") ),
446 *erase = createAction( -1, tr( "TOP_HIDE" ), p, tr( "MEN_HIDE" ), tr( "STB_HIDE" ),
447 0, d, false, this, SLOT( onShowHide() ) , QString("General:Hide object(s)") ),
448 *dispOnly = createAction( -1, tr( "TOP_DISPLAY_ONLY" ), p, tr( "MEN_DISPLAY_ONLY" ), tr( "STB_DISPLAY_ONLY" ),
449 0, d, false, this, SLOT( onShowHide() ) ),
450 *eraseAll = createAction( -1, tr( "TOP_ERASE_ALL" ), p, tr( "MEN_ERASE_ALL" ), tr( "STB_ERASE_ALL" ),
451 0, d, false, this, SLOT( onShowHide() ) );
452 myDisplay = actionId( disp );
453 myErase = actionId( erase );
454 myDisplayOnly = actionId( dispOnly );
455 myEraseAll = actionId( eraseAll );
457 myPopupMgr->insert( disp, -1, 0 );
458 myPopupMgr->insert( erase, -1, 0 );
459 myPopupMgr->insert( dispOnly, -1, 0 );
460 myPopupMgr->insert( eraseAll, -1, 0 );
461 myPopupMgr->insert( separator(), -1, 0 );
463 QString oneAndNotActive = "( count( $component ) = 1 ) and ( not( activeModule in $component ) )";
464 QString uniform = "true in $canBeDisplayed and %1 and ( activeModule = '%2' )";
465 uniform = uniform.arg( oneAndNotActive ).arg( name() );
466 myPopupMgr->setRule( disp, /*QString( "( not isVisible ) and " ) + */ uniform, QtxPopupMgr::VisibleRule );
467 myPopupMgr->setRule( erase, /*QString( "( isVisible ) and " ) + */ uniform, QtxPopupMgr::VisibleRule );
468 myPopupMgr->setRule( dispOnly, uniform, QtxPopupMgr::VisibleRule );
472 #ifndef DISABLE_OCCVIEWER
473 #ifndef DISABLE_SALOMEOBJECT
474 viewers.append( SOCC_Viewer::Type() );
476 viewers.append( OCCViewer_Viewer::Type() );
479 #ifndef DISABLE_VTKVIEWER
480 #ifndef DISABLE_SALOMEOBJECT
481 viewers.append( SVTK_Viewer::Type() );
483 viewers.append( VTKViewer_Viewer::Type() );
486 #ifndef DISABLE_PLOT2DVIEWER
487 #ifndef DISABLE_SALOMEOBJECT
488 viewers.append( SPlot2d_Viewer::Type() );
490 viewers.append( Plot2d_Viewer::Type() );
494 if( !viewers.isEmpty() )
496 QString strViewers = "{ ", temp = "'%1' ";
497 QStringList::const_iterator anIt = viewers.begin(), aLast = viewers.end();
498 for( ; anIt!=aLast; anIt++ )
499 strViewers+=temp.arg( *anIt );
501 myPopupMgr->setRule( eraseAll, QString( "client in %1" ).arg( strViewers ), QtxPopupMgr::VisibleRule );
507 /*!Gets preferences.*/
508 LightApp_Preferences* LightApp_Module::preferences() const
510 LightApp_Preferences* pref = 0;
512 pref = getApp()->preferences();
516 /*!Add preference to preferences.*/
517 int LightApp_Module::addPreference( const QString& label )
519 LightApp_Preferences* pref = preferences();
523 int catId = pref->addPreference( moduleName(), -1 );
527 return pref->addPreference( label, catId );
530 /*!Add preference to preferences.*/
531 int LightApp_Module::addPreference( const QString& label, const int pId, const int type,
532 const QString& section, const QString& param )
534 LightApp_Preferences* pref = preferences();
538 return pref->addPreference( moduleName(), label, pId, type, section, param );
541 /*!Gets property of preferences.*/
542 QVariant LightApp_Module::preferenceProperty( const int id, const QString& prop ) const
545 LightApp_Preferences* pref = preferences();
547 var = pref->itemProperty( prop, id );
551 /*!Set property of preferences.*/
552 void LightApp_Module::setPreferenceProperty( const int id, const QString& prop, const QVariant& var )
554 LightApp_Preferences* pref = preferences();
556 pref->setItemProperty( prop, var, id );
560 * \brief Starts operation with given identifier
561 * \param id - identifier of operation to be started
563 * Module stores operations in map. This method starts operation by id.
564 * If operation isn't in map, then it will be created by createOperation method
565 * and will be inserted to map
567 void LightApp_Module::startOperation( const int id )
569 LightApp_Operation* op = 0;
570 if( myOperations.contains( id ) && reusableOperation( id ) )
571 op = myOperations[ id ];
574 op = createOperation( id );
577 myOperations.insert( id, op );
578 op->setModule( this );
579 connect( op, SIGNAL( stopped( SUIT_Operation* ) ), this, SLOT( onOperationStopped( SUIT_Operation* ) ) );
580 connect( op, SIGNAL( destroyed() ), this, SLOT( onOperationDestroyed() ) );
586 // be sure that operation has correct study pointer
587 op->setStudy( application() ? application()->activeStudy() : 0 );
593 * \brief Creates operation with given identifier
594 * \param id - identifier of operation to be started
595 * \return Pointer on created operation or NULL if operation is not created
597 * Creates operation with given id. You should not call this method, it will be called
598 * automatically from startOperation. You may redefine this method in concrete module to
601 LightApp_Operation* LightApp_Module::createOperation( const int id ) const
607 return new LightApp_ShowHideOp( LightApp_ShowHideOp::DISPLAY );
608 else if( id==myErase )
609 return new LightApp_ShowHideOp( LightApp_ShowHideOp::ERASE );
610 else if( id==myDisplayOnly )
611 return new LightApp_ShowHideOp( LightApp_ShowHideOp::DISPLAY_ONLY );
612 else if( id==myEraseAll )
613 return new LightApp_ShowHideOp( LightApp_ShowHideOp::ERASE_ALL );
619 * \brief Virtual protected slot called when operation stopped
620 * \param theOp - stopped operation
622 * Virtual protected slot called when operation stopped. Redefine this slot if you want to
623 * perform actions after stopping operation
625 void LightApp_Module::onOperationStopped( SUIT_Operation* /*theOp*/ )
630 * \brief Virtual protected slot called when operation destroyed
631 * \param theOp - destroyed operation
633 * Virtual protected slot called when operation destroyed. Redefine this slot if you want to
634 * perform actions after destroying operation. Base implementation removes pointer on
635 * destroyed operation from the map of operations
637 void LightApp_Module::onOperationDestroyed()
639 const QObject* s = sender();
640 if( s && s->inherits( "LightApp_Operation" ) )
642 const LightApp_Operation* op = ( LightApp_Operation* )s;
643 MapOfOperation::const_iterator anIt = myOperations.begin(),
644 aLast = myOperations.end();
645 for( ; anIt!=aLast; anIt++ )
646 if( anIt.value()==op )
648 myOperations.remove( anIt.key() );
655 Must be redefined in order to use standard displayer mechanism
656 \return displayer of module
658 LightApp_Displayer* LightApp_Module::displayer()
664 SLOT: called on activating of standard operations show/hide
666 void LightApp_Module::onShowHide()
668 if( !sender()->inherits( "QAction" ) || !popupMgr() )
671 QAction* act = ( QAction* )sender();
672 int id = actionId( act );
674 startOperation( id );
678 virtual SLOT: called on view manager adding
680 void LightApp_Module::onViewManagerAdded( SUIT_ViewManager* )
685 virtual SLOT: called on view manager removing
687 void LightApp_Module::onViewManagerRemoved( SUIT_ViewManager* )
692 \brief Returns instance of operation by its id; if there is no operation
693 corresponding to this id, null pointer is returned
694 \param id - operation id
695 \return operation instance
697 LightApp_Operation* LightApp_Module::operation( const int id ) const
699 return myOperations.contains( id ) ? myOperations[id] : 0;
703 virtual method called to manage the same operations
705 bool LightApp_Module::reusableOperation( const int id )
712 \return true if module can copy the current selection
714 bool LightApp_Module::canCopy() const
721 \return true if module can paste previously copied data
723 bool LightApp_Module::canPaste() const
730 \brief Copies the current selection into clipboard
732 void LightApp_Module::copy()
738 \brief Pastes the current data in the clipboard
740 void LightApp_Module::paste()
746 \return true if module allows dragging the given object
748 bool LightApp_Module::isDraggable( const SUIT_DataObject* /*what*/ ) const
755 \return true if module allows dropping one or more objects (currently selected) on the object \c where
757 bool LightApp_Module::isDropAccepted( const SUIT_DataObject* /*where*/ ) const
764 Complete drag-n-drop operation by processing objects \a what being dragged, dropped to the line \a row
765 within the object \a where. The drop action being performed is specified by \a action.
767 void LightApp_Module::dropObjects( const DataObjectList& /*what*/, SUIT_DataObject* /*where*/,
768 const int /*row*/, Qt::DropAction /*action*/ )
773 \brief Return \c true if object can be renamed
775 bool LightApp_Module::renameAllowed( const QString& /*entry*/ ) const
781 Rename object by entry.
782 \param entry entry of the object
783 \param name new name of the object
784 \brief Return \c true if rename operation finished successfully, \c false otherwise.
786 bool LightApp_Module::renameObject( const QString& /*entry*/, const QString& /*name*/ )
792 Update visibility state for data objects
794 void LightApp_Module::updateModuleVisibilityState()
796 // update visibility state of objects
797 LightApp_Application* app = dynamic_cast<LightApp_Application*>(SUIT_Session::session()->activeApplication());
800 SUIT_DataBrowser* ob = app->objectBrowser();
801 if ( !ob || !ob->model() ) return;
803 // connect to click on item
804 connect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
805 this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ), Qt::UniqueConnection );
807 SUIT_DataObject* rootObj = ob->root();
808 if ( !rootObj ) return;
810 DataObjectList listObj = rootObj->children( true );
812 SUIT_ViewModel* vmod = 0;
813 if ( SUIT_ViewManager* vman = app->activeViewManager() )
814 vmod = vman->getViewModel();
815 app->updateVisibilityState( listObj, vmod );
819 * \brief Virtual public slot
821 * This method is called after the object inserted into data view to update their visibility state
822 * This is default implementation
824 void LightApp_Module::onObjectClicked( SUIT_DataObject* theObject, int theColumn )
826 if ( !isActiveModule() ) return;
828 // change visibility of object
829 if ( !theObject || theColumn != SUIT_DataObject::VisibilityId ) return;
831 LightApp_Study* study = dynamic_cast<LightApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
832 if ( !study ) return;
834 LightApp_DataObject* lo = dynamic_cast<LightApp_DataObject*>( theObject );
837 // detect action index (from LightApp level)
840 if ( study->visibilityState( lo->entry() ) == Qtx::ShownState )
842 else if ( study->visibilityState( lo->entry() ) == Qtx::HiddenState )
846 startOperation( id );