Add selection/unselection by Occurrence collection in CellWidget.
This commit is contained in:
parent
b9862ecd5e
commit
31b0c4daf1
|
@ -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 )
|
void CellWidget::select ( Occurrence occurrence )
|
||||||
{
|
{
|
||||||
if ( (++_delaySelectionChanged == 1) and not _state->cumulativeSelection() ) {
|
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 ()
|
void CellWidget::unselectAll ()
|
||||||
{
|
{
|
||||||
++_delaySelectionChanged;
|
++_delaySelectionChanged;
|
||||||
|
|
|
@ -265,12 +265,14 @@ namespace Hurricane {
|
||||||
inline DrawingPlanes& getDrawingPlanes ();
|
inline DrawingPlanes& getDrawingPlanes ();
|
||||||
// void select ( const Net* );
|
// void select ( const Net* );
|
||||||
void select ( Occurrence );
|
void select ( Occurrence );
|
||||||
|
void select ( Occurrences );
|
||||||
void selectSet ( const OccurrenceSet& );
|
void selectSet ( const OccurrenceSet& );
|
||||||
void selectSet ( const ComponentSet& );
|
void selectSet ( const ComponentSet& );
|
||||||
bool isSelected ( Occurrence );
|
bool isSelected ( Occurrence );
|
||||||
void selectOccurrencesUnder ( Box selectArea );
|
void selectOccurrencesUnder ( Box selectArea );
|
||||||
// void unselect ( const Net* );
|
// void unselect ( const Net* );
|
||||||
void unselect ( Occurrence );
|
void unselect ( Occurrence );
|
||||||
|
void unselect ( Occurrences );
|
||||||
void unselectSet ( const ComponentSet& );
|
void unselectSet ( const ComponentSet& );
|
||||||
void unselectSet ( const OccurrenceSet& );
|
void unselectSet ( const OccurrenceSet& );
|
||||||
void unselectAll ();
|
void unselectAll ();
|
||||||
|
|
Loading…
Reference in New Issue