1 // Copyright (C) 2009-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 #include "utilities.h"
26 #include <QtxWorkstack.h>
27 #include <STD_TabDesktop.h>
28 #include <STD_MDIDesktop.h>
29 #include <STD_SDIDesktop.h>
31 #include <SalomeApp_Tools.h>
33 #include "SOCC_ViewModel.h"
34 #include <OCCViewer_ViewManager.h>
35 #include <OCCViewer_ViewModel.h>
36 #include <OCCViewer_ViewWindow.h>
38 #include <SUIT_OverrideCursor.h>
39 #include <SUIT_MessageBox.h>
40 #include <SUIT_Session.h>
41 #include <SUIT_Selector.h>
42 #include <SUIT_Desktop.h>
43 #include <SUIT_ViewManager.h>
44 #include <SVTK_View.h>
46 #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
47 #include "HEXABLOCKGUI_OccGraphicView.hxx"
48 #include "HEXABLOCKGUI_SalomeTools.hxx"
49 #include "HEXABLOCKGUI_DocumentSelectionModel.hxx"
50 #include "HEXABLOCKGUI_DocumentModel.hxx"
51 #include "HEXABLOCKGUI_DocumentItem.hxx"
52 #include "HEXABLOCKGUI.hxx"
55 #include <SVTK_Selector.h>
56 #include <SVTK_ViewModel.h>
59 #include <SalomeApp_Study.h>
60 #include <SalomeApp_Application.h>
61 #include <SALOME_Actor.h>
62 #include <SALOME_ListIO.hxx>
63 #include <SALOME_ListIteratorOfListIO.hxx>
64 #include <AIS_ListIteratorOfListOfInteractive.hxx>
70 #include <OCCViewer_ViewModel.h>
71 #include <SVTK_ViewModel.h>
72 #include <SalomeApp_Study.h>
73 #include <SalomeApp_Application.h>
74 #include <LightApp_SelectionMgr.h>
75 #include <SALOME_ListIteratorOfListIO.hxx>
77 #include <TopExp_Explorer.hxx>
78 #include <TopoDS_Iterator.hxx>
79 #include <TopTools_MapOfShape.hxx>
80 #include <TopTools_IndexedMapOfShape.hxx>
81 #include <TColStd_IndexedMapOfInteger.hxx>
86 using namespace HEXABLOCK::GUI;
89 // //===========================================================================
91 // //===========================================================================
93 SelectionModel::SelectionModel( QAbstractItemModel * model ):
94 QItemSelectionModel( model )
99 SelectionModel::~SelectionModel()
101 disconnect( HEXABLOCKGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( salomeSelectionChanged() ) );
105 QModelIndex SelectionModel::indexBy( int role, const QString& value )
107 QModelIndex eltIndex; // element (vertex, edge, quad) of model
108 const QAbstractItemModel* theModel = model();
109 if ( !theModel ) return eltIndex;
110 QModelIndexList theIndexes = theModel->match( theModel->index(0, 0),
114 Qt::MatchRecursive | Qt::MatchContains );//Qt::MatchFixedString );
115 if ( theIndexes.count()>0 )
116 eltIndex = theIndexes[0] ;
121 QModelIndex SelectionModel::indexBy( int role, const QVariant& var )
123 QModelIndex eltIndex; // element (vertex, edge, quad) of model
124 const QAbstractItemModel* theModel = model();
125 if ( !theModel ) return eltIndex;
126 QModelIndexList theIndexes = theModel->match( theModel->index(0, 0),
130 Qt::MatchRecursive /*| Qt::MatchContains*/ );//Qt::MatchFixedString );
131 if ( theIndexes.count()>0 )
132 eltIndex = theIndexes[0] ;
136 QModelIndex SelectionModel::indexOf( const QString& anEntry, int role )
138 QModelIndex eltIndex; // element (vertex, edge, quad) of model
139 const QAbstractItemModel* theModel = model();
140 if ( !theModel ) return eltIndex;
142 QModelIndexList theIndexes = theModel->match( theModel->index(0, 0),
146 Qt::MatchRecursive | Qt::MatchContains );//Qt::MatchFixedString );
147 if ( theIndexes.count()>0 )
148 eltIndex = theIndexes[0] ;
153 QModelIndexList SelectionModel::indexListOf( const QString& anEntry, int role )
155 QModelIndexList theIndexes; // element (vertex, edge, quad) of model
156 const QAbstractItemModel* theModel = model();
157 if ( !theModel ) return theIndexes;
158 theIndexes = theModel->match( theModel->index(0, 0),
162 Qt::MatchRecursive | Qt::MatchContains );//Qt::MatchFixedString );
166 void SelectionModel::salomeSelectionChanged()
168 // clear highlights and selections in the trees
169 PatternDataSelectionModel* pdsm = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel();
170 PatternBuilderSelectionModel* pbsm = HEXABLOCKGUI::currentDocGView->getPatternBuilderSelectionModel();
171 PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
172 pdsm->clearSelection();
173 pbsm->clearSelection();
174 pgsm->clearSelection();
175 pdsm->unhighlightTreeItems();
176 pgsm->unhighlightTreeItems();
179 SALOME_ListIO selectedObjects;
180 Handle(SALOME_InteractiveObject) anIObject;
182 switch (HEXABLOCKGUI::getActiveViewType())
184 case HEXABLOCKGUI::VTK:
186 HEXABLOCKGUI::currentDocGView->getSelected(selectedObjects);
187 if ( selectedObjects.IsEmpty() )
189 anIObject = selectedObjects.First();
190 vtkSelectionChanged( anIObject );
193 case HEXABLOCKGUI::OCC:
194 HEXABLOCKGUI::currentOccGView->getSelected(selectedObjects);
195 if ( selectedObjects.IsEmpty() )
197 anIObject = selectedObjects.First();
198 geomSelectionChanged( anIObject );
202 MESSAGE("* Unknown selection exception!");
207 QModelIndexList SelectionModel::getSelectionFromModel(const Handle(SALOME_InteractiveObject)& anIObject)
209 QModelIndexList selectedIndexes;
211 //verify if the IOBject is valid and from VTK selection
212 bool fromVTK = ( strcmp("HEXABLOCK", anIObject->getComponentDataType()) == 0 );
213 if ( !fromVTK || !anIObject->hasEntry() || HEXABLOCKGUI::currentDocGView->getViewWindow() == NULL)
214 return selectedIndexes;
216 QString anIOEntry = anIObject->getEntry();
220 //extract vtk selection from the model -----------
221 if ( GetNameOfSelectedElements( HEXABLOCKGUI::currentDocGView->getViewWindow(), anIObject, aText ) <= 0 )
222 return selectedIndexes;
224 Document_Actor* docActor = dynamic_cast<Document_Actor*>( findActorByEntry( HEXABLOCKGUI::currentDocGView->getViewWindow(),
225 anIOEntry.toLatin1() ) );
226 if ( !docActor ) return selectedIndexes;
227 QStringList idList = aText.split(" ");
228 foreach( const QString& id, idList )
232 //find selection in the model
233 anhexaElemsId = docActor->hexaElemsId[ id.toInt() ];
234 anIOEntry = QString::number( anhexaElemsId );
236 selectedIndexes << indexOf( anIOEntry, HEXA_ENTRY_ROLE );
239 return selectedIndexes;
242 // //===========================================================================
243 // PatternDataSelectionModel
244 // //===========================================================================
246 PatternDataSelectionModel::PatternDataSelectionModel( QAbstractItemModel * model ):
247 SelectionModel( model )
249 connect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
250 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ), Qt::UniqueConnection );
251 connect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
252 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ), Qt::UniqueConnection );
256 PatternDataSelectionModel::~PatternDataSelectionModel()
258 disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
259 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
260 disconnect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
261 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
265 void PatternDataSelectionModel::onCurrentChanged( const QModelIndex & current, const QModelIndex & previous )
267 //Setting the selection mode of the selected item from the treeview
268 HEXABLOCKGUI::currentDocGView->setSelectionMode( current );
269 HEXABLOCKGUI::currentOccGView->setSelectionMode( current );
272 void PatternDataSelectionModel::highlightTreeItems(QModelIndexList& indexes,
273 Qt::GlobalColor bgColor,
274 Qt::GlobalColor fgColor, bool only)
276 if (indexes.count() == 0)
280 unhighlightTreeItems();
283 QAbstractItemModel* theModel = (QAbstractItemModel*) model();
284 QMap<int, QVariant> roles;
285 roles[Qt::BackgroundRole] = bgColor;
286 roles[Qt::ForegroundRole] = fgColor;
287 foreach( const QModelIndex& anItemIndex, indexes )
289 if (anItemIndex.isValid())
291 theModel->setItemData(anItemIndex, roles);
292 currentHighlightedItems << anItemIndex;
296 // * scroll to the first highlighted item in the tree
297 HEXABLOCKGUI* module = HEXABLOCKGUI::getInstance();
298 if (module != NULL && indexes[0].isValid())
299 module->getPatternDataTreeView()->scrollTo(indexes[0]);
302 void PatternDataSelectionModel::unhighlightTreeItems(bool clearSelected)
306 if (currentHighlightedItems.count() == 0)
309 QAbstractItemModel* theModel = (QAbstractItemModel*) model();
310 QMap<int, QVariant> roles;
311 roles[Qt::BackgroundRole] = Qt::white;
312 roles[Qt::ForegroundRole] = Qt::darkGreen;
313 foreach( const QModelIndex& anItemIndex, currentHighlightedItems)
315 if (anItemIndex.isValid())
316 theModel->setItemData(anItemIndex, roles);
318 currentHighlightedItems.clear();
321 QModelIndexList PatternDataSelectionModel::getGeomAssociations(const QModelIndex& dataIndex)
323 QModelIndexList geomIndexList;
324 DocumentModel *docModel = NULL;
325 const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
326 PatternGeomSelectionModel* pGSModel = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
329 docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() );
331 if (docModel == NULL || pGSModel == NULL)
332 return geomIndexList;
334 HEXA_NS::Vertex* vertex = docModel->getHexaPtr<HEXA_NS::Vertex*>(dataIndex);
335 HEXA_NS::Edge* edge = docModel->getHexaPtr<HEXA_NS::Edge*>(dataIndex);
336 HEXA_NS::Quad* quad = docModel->getHexaPtr<HEXA_NS::Quad*>(dataIndex);
337 QModelIndex index = pModel->mapToSource(dataIndex);
340 geomIndexList << docModel->getVertexAssociation( index );
341 else if (edge != NULL)
342 geomIndexList = docModel->getEdgeAssociations( index );
343 else if ( quad != NULL)
344 geomIndexList = docModel->getQuadAssociations( index );
346 return geomIndexList;
349 void PatternDataSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
351 QModelIndexList indexes = selected.indexes();
352 if (indexes.count() == 0)
355 // ** unhighlight current highlighted items in the trees
356 PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
359 unhighlightTreeItems(false);
361 QModelIndexList associatedGeomIndexes = getGeomAssociations(indexes[0]); //Mono Selection
362 if (associatedGeomIndexes.count() == 0)
363 pgsm->unhighlightTreeItems();
365 // ** highlight association in geometry tree
366 pgsm->highlightTreeItems(associatedGeomIndexes);
368 // ** highlight association in the vtk view
369 HEXABLOCKGUI::currentDocGView->highlight(indexes);
371 // ** highlight association in the occ view
372 HEXABLOCKGUI::currentOccGView->highlight(indexes);
376 void PatternDataSelectionModel::geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject )
378 // if (HEXABLOCKGUI::assocInProgress) return;
380 PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
381 if (pgsm == NULL) return;
383 QModelIndex geomModelIndex = pgsm->getModelIndex(anIObject);
384 if (!geomModelIndex.isValid())
386 pgsm->select( geomModelIndex, QItemSelectionModel::SelectCurrent );
390 void PatternDataSelectionModel::vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject )
392 QModelIndexList selectedIndexes = getSelectionFromModel(anIObject);
393 if (selectedIndexes.count() == 0)
398 QModelIndex anIOIndex = selectedIndexes[0]; //Monoselection
400 //Temporary Debug for hexa selection ------------------------------
401 if (HEXABLOCKGUI::currentDocGView->getSelectionMode() == HEXA_TREE)
403 DocumentModel *docModel = NULL;
404 const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
406 if ( pModel != NULL){
407 docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() );
408 if ( docModel != NULL && anIOIndex.isValid())
410 //get the selected quad
411 HEXA_NS::Quad* quad = docModel->getHexaPtr<HEXA_NS::Quad*>(anIOIndex);
415 //get the hexa the quad belongs to
416 HEXA_NS::Hexa* hexa = docModel->getQuadHexa(quad);
417 if (hexa != NULL) //convert the hexa to a QModelIndex so we can select it in the model
418 anIOIndex = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(hexa));
421 SUIT_MessageBox::critical( 0,
423 tr("The Hexahedron this quad belongs to has been deleted!"));
429 }//end if HEXA_TREE-----------------------------------------------
431 //select the element in the model
432 select( anIOIndex, QItemSelectionModel::SelectCurrent );
435 // //===========================================================================
436 // PatternGeomSelectionModel
437 // //===========================================================================
439 PatternGeomSelectionModel::PatternGeomSelectionModel( QAbstractItemModel * model ):
440 SelectionModel( model )
442 connect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
443 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
444 connect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
445 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ), Qt::UniqueConnection );
448 PatternGeomSelectionModel::~PatternGeomSelectionModel()
450 disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
451 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
452 disconnect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
453 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
456 void PatternGeomSelectionModel::onCurrentChanged( const QModelIndex & current, const QModelIndex & previous )
458 //Setting the selection mode of the selected item from the treeview}
459 HEXABLOCKGUI::currentDocGView->setSelectionMode( current );
460 HEXABLOCKGUI::currentOccGView->setSelectionMode( current );
463 void PatternGeomSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
465 DocumentModel* docModel = NULL;
466 const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
468 docModel = dynamic_cast<DocumentModel*>(pModel->sourceModel());
470 QModelIndexList indexes = selected.indexes();
471 if (indexes.count() == 0 || docModel == NULL)
474 // ** unhighlight current highlighted items in the trees
475 PatternDataSelectionModel* pdsm = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel();
478 unhighlightTreeItems(false);
480 //find the corresponding element in the model
481 HEXA_NS::SubShape* eltSubShape = dynamic_cast<HEXA_NS::SubShape*>(docModel->getHexaPtr(indexes[0]));
482 if (eltSubShape == NULL) return;
484 HEXA_NS::NewShape* subShapeParent = eltSubShape->getParentShape();
485 if (subShapeParent == NULL) return;
487 QString parentShapeName = subShapeParent->getName();
488 QString subId = QString::number(eltSubShape->getIdent());
489 QString aGeomObjModelEntry = parentShapeName + "," + subId + ";";
491 QModelIndexList assocsIndexes = pdsm->indexListOf(aGeomObjModelEntry, HEXA_ASSOC_ENTRY_ROLE);
492 if (assocsIndexes.count() == 0)
493 pdsm->unhighlightTreeItems();
495 // ** highlight associations in the data tree
496 pdsm->highlightTreeItems(assocsIndexes);
498 // ** highlight associations in the vtk view
499 HEXABLOCKGUI::currentDocGView->highlight(assocsIndexes);
501 // ** highlight the selected element in the occ view
502 QMultiMap<QString, int> entrySubIDs;
503 entrySubIDs.insert(parentShapeName, eltSubShape->getIdent());
504 HEXABLOCKGUI::currentOccGView->highlight(entrySubIDs);
507 QModelIndex PatternGeomSelectionModel::getModelIndex(const Handle(SALOME_InteractiveObject)& anIObject)
510 DocumentModel *docModel = NULL;
511 const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
513 docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel());
515 if ( docModel == NULL || HEXABLOCKGUI::selectionMgr() == NULL ||
516 HEXABLOCKGUI::currentOccGView->getViewWindow() == NULL)
519 //extract associated elements in the model
520 TColStd_IndexedMapOfInteger anIndexes;
521 HEXABLOCKGUI::selectionMgr()->GetIndexes(anIObject, anIndexes);
522 if (anIndexes.Extent() == 0) return result;
523 QString aGeomObjStudyEntry = anIObject->getEntry();
524 QString aGeomObjModelEntry = docModel->getGeomObjName(aGeomObjStudyEntry) + "," + QString::number(anIndexes(1));
526 HEXA_NS::SubShape* ssh = docModel->getGeomPtr(aGeomObjModelEntry);
527 HEXA_NS::VertexShape* vSh = dynamic_cast<HEXA_NS::VertexShape*>(ssh);
528 HEXA_NS::EdgeShape* eSh = dynamic_cast<HEXA_NS::EdgeShape*>(ssh);
529 HEXA_NS::FaceShape* fSh = dynamic_cast<HEXA_NS::FaceShape*>(ssh);
532 result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(vSh));
533 else if (eSh != NULL)
534 result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(eSh));
535 else if (fSh != NULL)
536 result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(fSh));
541 void PatternGeomSelectionModel::highlightTreeItems(QModelIndexList& indexes,
542 Qt::GlobalColor bgColor,
543 Qt::GlobalColor fgColor, bool only)
545 if (indexes.count() == 0)
549 unhighlightTreeItems();
552 QAbstractItemModel* theModel = (QAbstractItemModel*) model();
553 QMap<int, QVariant> roles;
554 roles[Qt::BackgroundRole] = bgColor;
555 roles[Qt::ForegroundRole] = fgColor;
556 foreach( const QModelIndex& anItemIndex, indexes )
558 if (anItemIndex.isValid())
560 theModel->setItemData(anItemIndex, roles);
561 currentHighlightedItems << anItemIndex;
565 // * scroll to the first highlighted item in the tree
566 HEXABLOCKGUI* module = HEXABLOCKGUI::getInstance();
567 if (module != NULL && indexes[0].isValid())
568 module->getPatternGeomTreeView()->scrollTo(indexes[0]);
571 void PatternGeomSelectionModel::unhighlightTreeItems(bool clearSelected)
575 if (currentHighlightedItems.count() == 0)
577 QAbstractItemModel* theModel = (QAbstractItemModel*) model();
578 QMap<int, QVariant> roles;
579 roles[Qt::BackgroundRole] = Qt::white;
580 roles[Qt::ForegroundRole] = Qt::darkGreen;
581 foreach( const QModelIndex& anItemIndex, currentHighlightedItems)
583 if (anItemIndex.isValid())
584 theModel->setItemData(anItemIndex, roles);
586 currentHighlightedItems.clear();
589 // //===========================================================================
590 // GroupsSelectionModel
591 // //===========================================================================
592 GroupsSelectionModel::GroupsSelectionModel( QAbstractItemModel * model ):
593 SelectionModel( model )
595 connect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
596 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ), Qt::UniqueConnection );
597 connect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
598 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ), Qt::UniqueConnection );
601 GroupsSelectionModel::~GroupsSelectionModel()
603 disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
604 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
605 disconnect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
606 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
610 void GroupsSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
613 QModelIndexList indexes = selected.indexes();
614 for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){
615 HEXABLOCKGUI::currentDocGView->highlightGroups( *i_index );
618 MESSAGE("Unknown exception was cought !!!");
622 // //===========================================================================
623 // MeshSelectionModel
624 // //===========================================================================
625 MeshSelectionModel::MeshSelectionModel( QAbstractItemModel * model ):
626 SelectionModel( model )
628 connect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
629 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ), Qt::UniqueConnection );
630 connect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
631 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ), Qt::UniqueConnection );
635 MeshSelectionModel::~MeshSelectionModel()
637 disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
638 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
639 disconnect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
640 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
644 void MeshSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
648 QModelIndexList indexes = selected.indexes();
649 for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){
650 HEXABLOCKGUI::currentDocGView->highlightPropagation( *i_index );
653 MESSAGE("Unknown exception was cought !!!");