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>
68 #include <OCCViewer_ViewModel.h>
69 #include <SVTK_ViewModel.h>
70 #include <SalomeApp_Study.h>
71 #include <SalomeApp_Application.h>
72 #include <LightApp_SelectionMgr.h>
73 #include <SALOME_ListIteratorOfListIO.hxx>
75 #include <TopExp_Explorer.hxx>
76 #include <TopoDS_Iterator.hxx>
77 #include <TopTools_MapOfShape.hxx>
78 #include <TopTools_IndexedMapOfShape.hxx>
79 #include <TColStd_IndexedMapOfInteger.hxx>
84 using namespace HEXABLOCK::GUI;
87 // //===========================================================================
89 // //===========================================================================
91 SelectionModel::SelectionModel( QAbstractItemModel * model ):
92 QItemSelectionModel( model )
97 SelectionModel::~SelectionModel()
99 disconnect( HEXABLOCKGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( salomeSelectionChanged() ) );
103 QModelIndex SelectionModel::indexBy( int role, const QString& value )
105 QModelIndex eltIndex; // element (vertex, edge, quad) of model
106 const QAbstractItemModel* theModel = model();
107 if ( !theModel ) return eltIndex;
108 QModelIndexList theIndexes = theModel->match( theModel->index(0, 0),
112 Qt::MatchRecursive | Qt::MatchContains );//Qt::MatchFixedString );
113 if ( theIndexes.count()>0 )
114 eltIndex = theIndexes[0] ;
119 QModelIndex SelectionModel::indexBy( int role, const QVariant& var )
121 QModelIndex eltIndex; // element (vertex, edge, quad) of model
122 const QAbstractItemModel* theModel = model();
123 if ( !theModel ) return eltIndex;
124 QModelIndexList theIndexes = theModel->match( theModel->index(0, 0),
128 Qt::MatchRecursive /*| Qt::MatchContains*/ );//Qt::MatchFixedString );
129 if ( theIndexes.count()>0 )
130 eltIndex = theIndexes[0] ;
134 QModelIndex SelectionModel::indexOf( const QString& anEntry, int role )
136 QModelIndex eltIndex; // element (vertex, edge, quad) of model
137 const QAbstractItemModel* theModel = model();
138 if ( !theModel ) return eltIndex;
140 QModelIndexList theIndexes = theModel->match( theModel->index(0, 0),
144 Qt::MatchRecursive | Qt::MatchContains );//Qt::MatchFixedString );
145 if ( theIndexes.count()>0 )
146 eltIndex = theIndexes[0] ;
151 QModelIndexList SelectionModel::indexListOf( const QString& anEntry, int role )
153 QModelIndexList theIndexes; // element (vertex, edge, quad) of model
154 const QAbstractItemModel* theModel = model();
155 if ( !theModel ) return theIndexes;
156 theIndexes = theModel->match( theModel->index(0, 0),
160 Qt::MatchRecursive | Qt::MatchContains );//Qt::MatchFixedString );
164 void SelectionModel::salomeSelectionChanged()
166 // clear highlights and selections in the trees
167 PatternDataSelectionModel* pdsm = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel();
168 PatternBuilderSelectionModel* pbsm = HEXABLOCKGUI::currentDocGView->getPatternBuilderSelectionModel();
169 PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
170 pdsm->clearSelection();
171 pbsm->clearSelection();
172 pgsm->clearSelection();
173 pdsm->unhighlightTreeItems();
174 pgsm->unhighlightTreeItems();
177 SALOME_ListIO selectedObjects;
178 Handle(SALOME_InteractiveObject) anIObject;
180 switch (HEXABLOCKGUI::getActiveViewType())
182 case HEXABLOCKGUI::VTK:
184 HEXABLOCKGUI::currentDocGView->getSelected(selectedObjects);
185 if ( selectedObjects.IsEmpty() )
187 anIObject = selectedObjects.First();
188 vtkSelectionChanged( anIObject );
191 case HEXABLOCKGUI::OCC:
192 HEXABLOCKGUI::currentOccGView->getSelected(selectedObjects);
193 if ( selectedObjects.IsEmpty() )
195 anIObject = selectedObjects.First();
196 geomSelectionChanged( anIObject );
200 MESSAGE("* Unknown selection exception!");
205 QModelIndexList SelectionModel::getSelectionFromModel(const Handle(SALOME_InteractiveObject)& anIObject)
207 QModelIndexList selectedIndexes;
209 //verify if the IOBject is valid and from VTK selection
210 bool fromVTK = ( strcmp("HEXABLOCK", anIObject->getComponentDataType()) == 0 );
211 if ( !fromVTK || !anIObject->hasEntry() || HEXABLOCKGUI::currentDocGView->getViewWindow() == NULL)
212 return selectedIndexes;
214 QString anIOEntry = anIObject->getEntry();
218 //extract vtk selection from the model -----------
219 if ( GetNameOfSelectedElements( HEXABLOCKGUI::currentDocGView->getViewWindow(), anIObject, aText ) <= 0 )
220 return selectedIndexes;
222 Document_Actor* docActor = dynamic_cast<Document_Actor*>( findActorByEntry( HEXABLOCKGUI::currentDocGView->getViewWindow(),
223 anIOEntry.toLatin1() ) );
224 if ( !docActor ) return selectedIndexes;
225 QStringList idList = aText.split(" ");
226 foreach( const QString& id, idList )
230 //find selection in the model
231 anhexaElemsId = docActor->hexaElemsId[ id.toInt() ];
232 anIOEntry = QString::number( anhexaElemsId );
234 selectedIndexes << indexOf( anIOEntry, HEXA_ENTRY_ROLE );
237 return selectedIndexes;
240 // //===========================================================================
241 // PatternDataSelectionModel
242 // //===========================================================================
244 PatternDataSelectionModel::PatternDataSelectionModel( QAbstractItemModel * model ):
245 SelectionModel( model )
247 connect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
248 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ), Qt::UniqueConnection );
249 connect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
250 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ), Qt::UniqueConnection );
254 PatternDataSelectionModel::~PatternDataSelectionModel()
256 disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
257 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
258 disconnect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
259 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
263 void PatternDataSelectionModel::onCurrentChanged( const QModelIndex & current, const QModelIndex & previous )
265 //Setting the selection mode of the selected item from the treeview
266 HEXABLOCKGUI::currentDocGView->setSelectionMode( current );
267 HEXABLOCKGUI::currentOccGView->setSelectionMode( current );
270 void PatternDataSelectionModel::highlightTreeItems(QModelIndexList& indexes,
271 Qt::GlobalColor bgColor,
272 Qt::GlobalColor fgColor, bool only)
274 if (indexes.count() == 0)
278 unhighlightTreeItems();
281 QAbstractItemModel* theModel = (QAbstractItemModel*) model();
282 QMap<int, QVariant> roles;
283 roles[Qt::BackgroundRole] = bgColor;
284 roles[Qt::ForegroundRole] = fgColor;
285 foreach( const QModelIndex& anItemIndex, indexes )
287 if (anItemIndex.isValid())
289 theModel->setItemData(anItemIndex, roles);
290 currentHighlightedItems << anItemIndex;
294 // * scroll to the first highlighted item in the tree
295 HEXABLOCKGUI* module = HEXABLOCKGUI::getInstance();
296 if (module != NULL && indexes[0].isValid())
297 module->getPatternDataTreeView()->scrollTo(indexes[0]);
300 void PatternDataSelectionModel::unhighlightTreeItems(bool clearSelected)
304 if (currentHighlightedItems.count() == 0)
307 QAbstractItemModel* theModel = (QAbstractItemModel*) model();
308 QMap<int, QVariant> roles;
309 roles[Qt::BackgroundRole] = Qt::white;
310 roles[Qt::ForegroundRole] = Qt::darkGreen;
311 foreach( const QModelIndex& anItemIndex, currentHighlightedItems)
313 if (anItemIndex.isValid())
314 theModel->setItemData(anItemIndex, roles);
316 currentHighlightedItems.clear();
319 QModelIndexList PatternDataSelectionModel::getGeomAssociations(const QModelIndex& dataIndex)
321 QModelIndexList geomIndexList;
322 DocumentModel *docModel = NULL;
323 const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
324 PatternGeomSelectionModel* pGSModel = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
327 docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() );
329 if (docModel == NULL || pGSModel == NULL)
330 return geomIndexList;
332 HEXA_NS::Vertex* vertex = docModel->getHexaPtr<HEXA_NS::Vertex*>(dataIndex);
333 HEXA_NS::Edge* edge = docModel->getHexaPtr<HEXA_NS::Edge*>(dataIndex);
334 HEXA_NS::Quad* quad = docModel->getHexaPtr<HEXA_NS::Quad*>(dataIndex);
335 QModelIndex index = pModel->mapToSource(dataIndex);
338 geomIndexList << docModel->getVertexAssociation( index );
339 else if (edge != NULL)
340 geomIndexList = docModel->getEdgeAssociations( index );
341 else if ( quad != NULL)
342 geomIndexList = docModel->getQuadAssociations( index );
344 return geomIndexList;
347 void PatternDataSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
349 QModelIndexList indexes = selected.indexes();
350 if (indexes.count() == 0)
353 // ** unhighlight current highlighted items in the trees
354 PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
357 unhighlightTreeItems(false);
359 QModelIndexList associatedGeomIndexes = getGeomAssociations(indexes[0]); //Mono Selection
360 if (associatedGeomIndexes.count() == 0)
361 pgsm->unhighlightTreeItems();
363 // ** highlight association in geometry tree
364 pgsm->highlightTreeItems(associatedGeomIndexes);
366 // ** highlight association in the vtk view
367 HEXABLOCKGUI::currentDocGView->highlight(indexes);
369 // ** highlight association in the occ view
370 HEXABLOCKGUI::currentOccGView->highlight(indexes);
374 void PatternDataSelectionModel::geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject )
376 // if (HEXABLOCKGUI::assocInProgress) return;
378 PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
379 if (pgsm == NULL) return;
381 QModelIndex geomModelIndex = pgsm->getModelIndex(anIObject);
382 if (!geomModelIndex.isValid())
384 pgsm->select( geomModelIndex, QItemSelectionModel::SelectCurrent );
388 void PatternDataSelectionModel::vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject )
390 QModelIndexList selectedIndexes = getSelectionFromModel(anIObject);
391 if (selectedIndexes.count() == 0)
396 QModelIndex anIOIndex = selectedIndexes[0]; //Monoselection
398 //Temporary Debug for hexa selection ------------------------------
399 if (HEXABLOCKGUI::currentDocGView->getSelectionMode() == HEXA_TREE)
401 DocumentModel *docModel = NULL;
402 const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
404 if ( pModel != NULL){
405 docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() );
406 if ( docModel != NULL && anIOIndex.isValid())
408 //get the selected quad
409 HEXA_NS::Quad* quad = docModel->getHexaPtr<HEXA_NS::Quad*>(anIOIndex);
413 //get the hexa the quad belongs to
414 HEXA_NS::Hexa* hexa = docModel->getQuadHexa(quad);
415 if (hexa != NULL) //convert the hexa to a QModelIndex so we can select it in the model
416 anIOIndex = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(hexa));
419 SUIT_MessageBox::critical( 0,
421 tr("The Hexahedron this quad belongs to has been deleted!"));
427 }//end if HEXA_TREE-----------------------------------------------
429 //select the element in the model
430 select( anIOIndex, QItemSelectionModel::SelectCurrent );
433 // //===========================================================================
434 // PatternGeomSelectionModel
435 // //===========================================================================
437 PatternGeomSelectionModel::PatternGeomSelectionModel( QAbstractItemModel * model ):
438 SelectionModel( model )
440 connect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
441 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
442 connect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
443 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ), Qt::UniqueConnection );
446 PatternGeomSelectionModel::~PatternGeomSelectionModel()
448 disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
449 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
450 disconnect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
451 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
454 void PatternGeomSelectionModel::onCurrentChanged( const QModelIndex & current, const QModelIndex & previous )
456 //Setting the selection mode of the selected item from the treeview}
457 HEXABLOCKGUI::currentDocGView->setSelectionMode( current );
458 HEXABLOCKGUI::currentOccGView->setSelectionMode( current );
461 void PatternGeomSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
463 DocumentModel* docModel = NULL;
464 const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
466 docModel = dynamic_cast<DocumentModel*>(pModel->sourceModel());
468 QModelIndexList indexes = selected.indexes();
469 if (indexes.count() == 0 || docModel == NULL)
472 // ** unhighlight current highlighted items in the trees
473 PatternDataSelectionModel* pdsm = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel();
476 unhighlightTreeItems(false);
478 //find the corresponding element in the model
479 HEXA_NS::SubShape* eltSubShape = dynamic_cast<HEXA_NS::SubShape*>(docModel->getHexaPtr(indexes[0]));
480 if (eltSubShape == NULL) return;
482 HEXA_NS::NewShape* subShapeParent = eltSubShape->getParentShape();
483 if (subShapeParent == NULL) return;
485 QString parentShapeName = subShapeParent->getName();
486 QString subId = QString::number(eltSubShape->getIdent());
487 QString aGeomObjModelEntry = parentShapeName + "," + subId + ";";
489 QModelIndexList assocsIndexes = pdsm->indexListOf(aGeomObjModelEntry, HEXA_ASSOC_ENTRY_ROLE);
490 if (assocsIndexes.count() == 0)
491 pdsm->unhighlightTreeItems();
493 // ** highlight associations in the data tree
494 pdsm->highlightTreeItems(assocsIndexes);
496 // ** highlight associations in the vtk view
497 HEXABLOCKGUI::currentDocGView->highlight(assocsIndexes);
499 // ** highlight the selected element in the occ view
500 QMultiMap<QString, int> entrySubIDs;
501 entrySubIDs.insert(parentShapeName, eltSubShape->getIdent());
502 HEXABLOCKGUI::currentOccGView->highlight(entrySubIDs);
505 QModelIndex PatternGeomSelectionModel::getModelIndex(const Handle(SALOME_InteractiveObject)& anIObject)
508 DocumentModel *docModel = NULL;
509 const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
511 docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel());
513 if ( docModel == NULL || HEXABLOCKGUI::selectionMgr() == NULL ||
514 HEXABLOCKGUI::currentOccGView->getViewWindow() == NULL)
517 //extract associated elements in the model
518 TColStd_IndexedMapOfInteger anIndexes;
519 HEXABLOCKGUI::selectionMgr()->GetIndexes(anIObject, anIndexes);
520 if (anIndexes.Extent() == 0) return result;
521 QString aGeomObjStudyEntry = anIObject->getEntry();
522 QString aGeomObjModelEntry = docModel->getGeomObjName(aGeomObjStudyEntry) + "," + QString::number(anIndexes(1));
524 HEXA_NS::SubShape* ssh = docModel->getGeomPtr(aGeomObjModelEntry);
525 HEXA_NS::VertexShape* vSh = dynamic_cast<HEXA_NS::VertexShape*>(ssh);
526 HEXA_NS::EdgeShape* eSh = dynamic_cast<HEXA_NS::EdgeShape*>(ssh);
527 HEXA_NS::FaceShape* fSh = dynamic_cast<HEXA_NS::FaceShape*>(ssh);
530 result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(vSh));
531 else if (eSh != NULL)
532 result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(eSh));
533 else if (fSh != NULL)
534 result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(fSh));
539 void PatternGeomSelectionModel::highlightTreeItems(QModelIndexList& indexes,
540 Qt::GlobalColor bgColor,
541 Qt::GlobalColor fgColor, bool only)
543 if (indexes.count() == 0)
547 unhighlightTreeItems();
550 QAbstractItemModel* theModel = (QAbstractItemModel*) model();
551 QMap<int, QVariant> roles;
552 roles[Qt::BackgroundRole] = bgColor;
553 roles[Qt::ForegroundRole] = fgColor;
554 foreach( const QModelIndex& anItemIndex, indexes )
556 if (anItemIndex.isValid())
558 theModel->setItemData(anItemIndex, roles);
559 currentHighlightedItems << anItemIndex;
563 // * scroll to the first highlighted item in the tree
564 HEXABLOCKGUI* module = HEXABLOCKGUI::getInstance();
565 if (module != NULL && indexes[0].isValid())
566 module->getPatternGeomTreeView()->scrollTo(indexes[0]);
569 void PatternGeomSelectionModel::unhighlightTreeItems(bool clearSelected)
573 if (currentHighlightedItems.count() == 0)
575 QAbstractItemModel* theModel = (QAbstractItemModel*) model();
576 QMap<int, QVariant> roles;
577 roles[Qt::BackgroundRole] = Qt::white;
578 roles[Qt::ForegroundRole] = Qt::darkGreen;
579 foreach( const QModelIndex& anItemIndex, currentHighlightedItems)
581 if (anItemIndex.isValid())
582 theModel->setItemData(anItemIndex, roles);
584 currentHighlightedItems.clear();
587 // //===========================================================================
588 // GroupsSelectionModel
589 // //===========================================================================
590 GroupsSelectionModel::GroupsSelectionModel( QAbstractItemModel * model ):
591 SelectionModel( model )
593 connect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
594 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ), Qt::UniqueConnection );
595 connect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
596 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ), Qt::UniqueConnection );
599 GroupsSelectionModel::~GroupsSelectionModel()
601 disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
602 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
603 disconnect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
604 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
608 void GroupsSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
611 QModelIndexList indexes = selected.indexes();
612 for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){
613 HEXABLOCKGUI::currentDocGView->highlightGroups( *i_index );
616 MESSAGE("Unknown exception was cought !!!");
620 // //===========================================================================
621 // MeshSelectionModel
622 // //===========================================================================
623 MeshSelectionModel::MeshSelectionModel( QAbstractItemModel * model ):
624 SelectionModel( model )
626 connect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
627 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ), Qt::UniqueConnection );
628 connect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
629 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ), Qt::UniqueConnection );
633 MeshSelectionModel::~MeshSelectionModel()
635 disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
636 this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
637 disconnect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
638 this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
642 void MeshSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
646 QModelIndexList indexes = selected.indexes();
647 for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){
648 HEXABLOCKGUI::currentDocGView->highlightPropagation( *i_index );
651 MESSAGE("Unknown exception was cought !!!");