diff --git a/hurricane/src/viewer/CellWidget.cpp b/hurricane/src/viewer/CellWidget.cpp index 573dea8e..cffabcde 100644 --- a/hurricane/src/viewer/CellWidget.cpp +++ b/hurricane/src/viewer/CellWidget.cpp @@ -2737,6 +2737,31 @@ namespace Hurricane { } + void CellWidget::select ( Occurrences occurrences ) + { + if ( (++_delaySelectionChanged == 1) and not _state->cumulativeSelection() ) { + openRefreshSession(); + unselectAll(); + closeRefreshSession(); + } + + bool selected = true; + // SelectorCriterion* criterion = _state->getSelection().add ( selectArea ); + // if ( criterion and (not criterion->isEnabled()) ) { + // criterion->enable(); + + for ( const Occurrence& occurrence : occurrences ) { + if (occurrence.getOwnerCell() == getCell()) { + select( occurrence ); + } + } + // } else + // selected = false; + + if ( (--_delaySelectionChanged == 0) and selected ) emit selectionChanged( _selectors ); + } + + void CellWidget::select ( Occurrence occurrence ) { if ( (++_delaySelectionChanged == 1) and not _state->cumulativeSelection() ) { @@ -2860,6 +2885,18 @@ namespace Hurricane { } + void CellWidget::unselect ( Occurrences occurrences ) + { + ++_delaySelectionChanged; + for ( const Occurrence& occurrence : occurrences ) { + if (occurrence.getOwnerCell() == getCell()) { + unselect( occurrence ); + } + } + if ( --_delaySelectionChanged == 0 ) emit selectionChanged( _selectors ); + } + + void CellWidget::unselectAll () { ++_delaySelectionChanged; diff --git a/hurricane/src/viewer/hurricane/viewer/CellWidget.h b/hurricane/src/viewer/hurricane/viewer/CellWidget.h index 51abdff6..3abd74f1 100644 --- a/hurricane/src/viewer/hurricane/viewer/CellWidget.h +++ b/hurricane/src/viewer/hurricane/viewer/CellWidget.h @@ -265,12 +265,14 @@ namespace Hurricane { inline DrawingPlanes& getDrawingPlanes (); // void select ( const Net* ); void select ( Occurrence ); + void select ( Occurrences ); void selectSet ( const OccurrenceSet& ); void selectSet ( const ComponentSet& ); bool isSelected ( Occurrence ); void selectOccurrencesUnder ( Box selectArea ); // void unselect ( const Net* ); void unselect ( Occurrence ); + void unselect ( Occurrences ); void unselectSet ( const ComponentSet& ); void unselectSet ( const OccurrenceSet& ); void unselectAll ();