* ./hurricane/src/hurricane:
- New: Torus object. To allow a simpler management of a chip's corona, the toric area between the pads and the core. - Change: In HyperNet/LeafPlugOccurrences, change the instance stop criterions from "isLeaf()", which means "contains no instances" to "isTerminal()" which can be programmatically changed. This has to be done for the Pads which are non-leaf due to "padreal" but still must be considered for their connectors. This modification is coupled with one in the Ap parser. - Change: In Backtrace, enable support for Apple backtrace. This is a blind test as I can't check by myself. * ./hurricane/src/viewer: - Change: In CellWidget/SelectionModel/SelectionWidget, rewrite the Gos selec- tion mechanism. Now ExtensionGo could be selecteds as they ought to be. Also adopt a more standard way of how objetcs are selecteds. Prefer "dataChanged()" signal over "reset()" or "layoutChanged()" as it keeps the selection instead of resetting it. Unselecteds entry in the window (toggled with 't') are now shown in red for better readability.
This commit is contained in:
parent
edd711dd9b
commit
828b1d6b6f
|
@ -98,7 +98,23 @@ namespace Hurricane {
|
||||||
#else
|
#else
|
||||||
# ifdef __APPLE__
|
# ifdef __APPLE__
|
||||||
boost::regex re ( "(\\d+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S)\\s+\\+\\s+(\\d+)" );
|
boost::regex re ( "(\\d+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S)\\s+\\+\\s+(\\d+)" );
|
||||||
|
boost::cmatch match;
|
||||||
|
|
||||||
|
for ( size_t i=0 ; i<depth ; ++i ) {
|
||||||
|
if ( boost::regex_search(symbols[i],match,re) ) {
|
||||||
|
string function ( match[4].first, match[4].second );
|
||||||
|
string demangled ( demangle(function.c_str()) );
|
||||||
|
if ( demangled.empty() )
|
||||||
|
_stack.push_back ( (demangled.empty()) ? function : demangled );
|
||||||
|
else {
|
||||||
|
string reformated ( match[1].first, match[1].second );
|
||||||
|
reformated += "( <b>" + demangled + "</b> )";
|
||||||
|
_stack.push_back ( reformated );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_stack.push_back ( symbols[i] );
|
||||||
|
}
|
||||||
|
}
|
||||||
# else
|
# else
|
||||||
_stack.push_back ( "Backtrace only supported under Linux & OSX." );
|
_stack.push_back ( "Backtrace only supported under Linux & OSX." );
|
||||||
# endif
|
# endif
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
hurricane/ContactLayer.h
|
hurricane/ContactLayer.h
|
||||||
hurricane/DiffusionLayer.h
|
hurricane/DiffusionLayer.h
|
||||||
hurricane/TransistorLayer.h hurricane/TransistorLayers.h
|
hurricane/TransistorLayer.h hurricane/TransistorLayers.h
|
||||||
hurricane/Boxes.h hurricane/Box.h
|
hurricane/Box.h hurricane/Boxes.h
|
||||||
|
hurricane/Torus.h
|
||||||
hurricane/Cell.h hurricane/Cells.h
|
hurricane/Cell.h hurricane/Cells.h
|
||||||
hurricane/Collection.h
|
hurricane/Collection.h
|
||||||
hurricane/Commons.h
|
hurricane/Commons.h
|
||||||
|
@ -100,6 +101,7 @@
|
||||||
DbU.cpp
|
DbU.cpp
|
||||||
Point.cpp
|
Point.cpp
|
||||||
Box.cpp
|
Box.cpp
|
||||||
|
Torus.cpp
|
||||||
Interval.cpp
|
Interval.cpp
|
||||||
Transformation.cpp
|
Transformation.cpp
|
||||||
Name.cpp
|
Name.cpp
|
||||||
|
|
|
@ -989,7 +989,8 @@ void HyperNet_LeafPlugOccurrences::Locator::progress()
|
||||||
_netOccurrenceLocator.progress();
|
_netOccurrenceLocator.progress();
|
||||||
Net* net = (Net*)netOccurrence.getEntity();
|
Net* net = (Net*)netOccurrence.getEntity();
|
||||||
Path path = netOccurrence.getPath();
|
Path path = netOccurrence.getPath();
|
||||||
if (!path.isEmpty() && net->getCell()->isLeaf())
|
|
||||||
|
if (!path.isEmpty() && net->getCell()->isTerminal())
|
||||||
{
|
{
|
||||||
Instance *instance = path.getTailInstance();
|
Instance *instance = path.getTailInstance();
|
||||||
Plug *plug=instance->getPlug(net);
|
Plug *plug=instance->getPlug(net);
|
||||||
|
|
|
@ -0,0 +1,100 @@
|
||||||
|
|
||||||
|
// -*- C++ -*-
|
||||||
|
//
|
||||||
|
// Copyright (c) BULL S.A. 2000-2010, All Rights Reserved
|
||||||
|
//
|
||||||
|
// This file is part of Hurricane.
|
||||||
|
//
|
||||||
|
// Hurricane is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Hurricane is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
|
||||||
|
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
||||||
|
// General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the Lesser GNU General Public
|
||||||
|
// License along with Hurricane. If not, see
|
||||||
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ===================================================================
|
||||||
|
//
|
||||||
|
// $Id$
|
||||||
|
//
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
// | |
|
||||||
|
// | H U R R I C A N E |
|
||||||
|
// | V L S I B a c k e n d D a t a - B a s e |
|
||||||
|
// | |
|
||||||
|
// | Author : Jean-Paul Chaput |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Module : "./Torus.cpp" |
|
||||||
|
// | *************************************************************** |
|
||||||
|
// | U p d a t e s |
|
||||||
|
// | |
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
#include "hurricane/Torus.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Hurricane {
|
||||||
|
|
||||||
|
using std::string;
|
||||||
|
using std::ostringstream;
|
||||||
|
|
||||||
|
|
||||||
|
Torus::Torus ()
|
||||||
|
: _outerBox()
|
||||||
|
, _innerBox()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
Torus::Torus ( const Box& outer, const Box& inner )
|
||||||
|
: _outerBox(outer)
|
||||||
|
, _innerBox(inner)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
bool Torus::contains ( const Box& box ) const
|
||||||
|
{
|
||||||
|
if ( isEmpty() ) return false;
|
||||||
|
|
||||||
|
return _outerBox.contains (box)
|
||||||
|
and not _innerBox.contains (box)
|
||||||
|
and not _innerBox.intersect(box);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string Torus::_getString () const
|
||||||
|
{
|
||||||
|
ostringstream s;
|
||||||
|
s << "<Torus [" << DbU::getValueString(_outerBox.getXMin())
|
||||||
|
<< " " << DbU::getValueString(_outerBox.getYMin())
|
||||||
|
<< " " << DbU::getValueString(_outerBox.getXMax())
|
||||||
|
<< " " << DbU::getValueString(_outerBox.getYMax())
|
||||||
|
<< "] [" << DbU::getValueString(_innerBox.getXMin())
|
||||||
|
<< " " << DbU::getValueString(_innerBox.getYMin())
|
||||||
|
<< " " << DbU::getValueString(_innerBox.getXMax())
|
||||||
|
<< " " << DbU::getValueString(_innerBox.getYMax());
|
||||||
|
return s.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Record* Torus::_getRecord () const
|
||||||
|
{
|
||||||
|
if ( isEmpty() ) return NULL;
|
||||||
|
|
||||||
|
Record* record = new Record(getString(this));
|
||||||
|
record->add(getSlot("_outerBox", &_outerBox));
|
||||||
|
record->add(getSlot("_innerBox", &_innerBox));
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // End of Hurricane namespace.
|
|
@ -0,0 +1,81 @@
|
||||||
|
|
||||||
|
// -*- C++ -*-
|
||||||
|
//
|
||||||
|
// Copyright (c) BULL S.A. 2000-2010, All Rights Reserved
|
||||||
|
//
|
||||||
|
// This file is part of Hurricane.
|
||||||
|
//
|
||||||
|
// Hurricane is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Hurricane is distributed in the hope that it will be useful, but
|
||||||
|
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
|
||||||
|
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
||||||
|
// General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the Lesser GNU General Public
|
||||||
|
// License along with Hurricane. If not, see
|
||||||
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ===================================================================
|
||||||
|
//
|
||||||
|
// $Id$
|
||||||
|
//
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
// | |
|
||||||
|
// | H U R R I C A N E |
|
||||||
|
// | V L S I B a c k e n d D a t a - B a s e |
|
||||||
|
// | |
|
||||||
|
// | Author : Jean-Paul Chaput |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Header : "./hurricane/Torus.h" |
|
||||||
|
// | *************************************************************** |
|
||||||
|
// | U p d a t e s |
|
||||||
|
// | |
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __HURRICANE_TORUS__
|
||||||
|
#define __HURRICANE_TORUS__
|
||||||
|
|
||||||
|
#include "hurricane/Box.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
|
class Torus {
|
||||||
|
public:
|
||||||
|
Torus ();
|
||||||
|
Torus ( const Box& outer, const Box& inner );
|
||||||
|
inline bool isEmpty () const;
|
||||||
|
inline const Box& getBoundingBox () const;
|
||||||
|
inline const Box& getOuterBox () const;
|
||||||
|
inline const Box& getInnerBox () const;
|
||||||
|
bool contains ( const Box& ) const;
|
||||||
|
inline std::string _getTypeName () const;
|
||||||
|
std::string _getString () const;
|
||||||
|
Record* _getRecord () const;
|
||||||
|
private:
|
||||||
|
Box _outerBox;
|
||||||
|
Box _innerBox;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Inline Functions.
|
||||||
|
inline bool Torus::isEmpty () const { return _outerBox.isEmpty(); }
|
||||||
|
inline const Box& Torus::getBoundingBox () const { return getOuterBox(); }
|
||||||
|
inline const Box& Torus::getOuterBox () const { return _outerBox; }
|
||||||
|
inline const Box& Torus::getInnerBox () const { return _innerBox; }
|
||||||
|
inline std::string Torus::_getTypeName () const { return "Torus"; }
|
||||||
|
|
||||||
|
|
||||||
|
} // End of Hurricane namespace.
|
||||||
|
|
||||||
|
|
||||||
|
INSPECTOR_PV_SUPPORT(Hurricane::Torus);
|
||||||
|
|
||||||
|
#endif // __HURRICANE_TORUS__
|
|
@ -338,8 +338,10 @@ namespace Hurricane {
|
||||||
|
|
||||||
connect ( _cellWidget , SIGNAL(selectionModeChanged())
|
connect ( _cellWidget , SIGNAL(selectionModeChanged())
|
||||||
, this , SLOT (changeSelectionMode ()) );
|
, this , SLOT (changeSelectionMode ()) );
|
||||||
|
// connect ( &_selectCommand , SIGNAL(selectionToggled (Occurrence))
|
||||||
|
// , _cellWidget , SLOT (toggleSelection (Occurrence)) );
|
||||||
connect ( &_selectCommand , SIGNAL(selectionToggled (Occurrence))
|
connect ( &_selectCommand , SIGNAL(selectionToggled (Occurrence))
|
||||||
, _cellWidget , SLOT (toggleSelection (Occurrence)) );
|
, _cellWidget , SLOT (select (Occurrence)) );
|
||||||
|
|
||||||
connect ( _cellWidget , SIGNAL(stateChanged(shared_ptr<CellWidget::State>&))
|
connect ( _cellWidget , SIGNAL(stateChanged(shared_ptr<CellWidget::State>&))
|
||||||
, this , SLOT (setState (shared_ptr<CellWidget::State>&)) );
|
, this , SLOT (setState (shared_ptr<CellWidget::State>&)) );
|
||||||
|
|
|
@ -1008,29 +1008,34 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
CellWidget::SelectorCriterions::~SelectorCriterions ()
|
CellWidget::SelectorCriterions::~SelectorCriterions ()
|
||||||
{
|
{ clear (); }
|
||||||
clear ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool CellWidget::SelectorCriterions::add ( const Net* net )
|
SelectorCriterion* CellWidget::SelectorCriterions::add ( const Net* net )
|
||||||
{
|
{
|
||||||
if ( _cellWidget == NULL ) return false;
|
if ( _cellWidget == NULL ) return NULL;
|
||||||
if ( not _cellWidget->isSelected(Occurrence(net)) ) {
|
if ( not _cellWidget->isSelected(Occurrence(net)) ) {
|
||||||
_criterions.push_back ( new NetSelectorCriterion(net) );
|
_criterions.push_back ( new NetSelectorCriterion(net) );
|
||||||
_criterions.back()->doSelection ( _cellWidget );
|
//_criterions.back()->doSelection ( _cellWidget );
|
||||||
return true;
|
return _criterions.back();
|
||||||
}
|
}
|
||||||
return false;
|
for ( size_t i=0 ; i<_criterions.size() ; ++i ) {
|
||||||
|
if ( _criterions[i]->getNet() == net ) return _criterions[i];
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CellWidget::SelectorCriterions::add ( Box area )
|
SelectorCriterion* CellWidget::SelectorCriterions::add ( Box area )
|
||||||
{
|
{
|
||||||
if ( _cellWidget == NULL ) return false;
|
if ( _cellWidget == NULL ) return NULL;
|
||||||
|
|
||||||
|
for ( size_t i=0 ; i<_criterions.size() ; ++i ) {
|
||||||
|
if ( _criterions[i]->getArea() == area ) return _criterions[i];
|
||||||
|
}
|
||||||
_criterions.push_back ( new AreaSelectorCriterion(area) );
|
_criterions.push_back ( new AreaSelectorCriterion(area) );
|
||||||
_criterions.back()->doSelection ( _cellWidget );
|
//_criterions.back()->doSelection ( _cellWidget );
|
||||||
return true;
|
return _criterions.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1045,7 +1050,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
if ( i < _criterions.size() ) {
|
if ( i < _criterions.size() ) {
|
||||||
swap ( _criterions[i], *(_criterions.end()-1) );
|
swap ( _criterions[i], *(_criterions.end()-1) );
|
||||||
_criterions.back()->undoSelection ( _cellWidget );
|
//_criterions.back()->undoSelection ( _cellWidget );
|
||||||
_criterions.pop_back ();
|
_criterions.pop_back ();
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
|
@ -1063,6 +1068,16 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CellWidget::SelectorCriterions::invalidate ()
|
||||||
|
{
|
||||||
|
if ( _cellWidget == NULL ) return;
|
||||||
|
|
||||||
|
for ( size_t i=0 ; i<_criterions.size() ; i++ ) {
|
||||||
|
_criterions[i]->disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::SelectorCriterions::revalidate ()
|
void CellWidget::SelectorCriterions::revalidate ()
|
||||||
{
|
{
|
||||||
if ( _cellWidget == NULL ) return;
|
if ( _cellWidget == NULL ) return;
|
||||||
|
@ -2629,16 +2644,6 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::select ( const Net* net )
|
|
||||||
{
|
|
||||||
++_delaySelectionChanged;
|
|
||||||
|
|
||||||
bool added = _state->getSelection().add ( net );
|
|
||||||
|
|
||||||
if ( !--_delaySelectionChanged && added ) emit selectionChanged(_selectors);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool CellWidget::isSelected ( Occurrence occurrence )
|
bool CellWidget::isSelected ( Occurrence occurrence )
|
||||||
{
|
{
|
||||||
if ( !occurrence.isValid() )
|
if ( !occurrence.isValid() )
|
||||||
|
@ -2663,9 +2668,51 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// void CellWidget::select ( const Net* net )
|
||||||
|
// {
|
||||||
|
// if ( (++_delaySelectionChanged == 1) and not _state->cumulativeSelection() ) {
|
||||||
|
// openRefreshSession ();
|
||||||
|
// unselectAll ();
|
||||||
|
// closeRefreshSession ();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// bool added = _state->getSelection().add ( net );
|
||||||
|
|
||||||
|
// if ( (--_delaySelectionChanged == 0) and added ) emit selectionChanged(_selectors);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
void CellWidget::selectOccurrencesUnder ( Box selectArea )
|
||||||
|
{
|
||||||
|
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();
|
||||||
|
|
||||||
|
forEach ( Occurrence, ioccurrence, getOccurrencesUnder(selectArea) )
|
||||||
|
select ( *ioccurrence );
|
||||||
|
} else
|
||||||
|
selected = false;
|
||||||
|
|
||||||
|
if ( (--_delaySelectionChanged == 0) and selected ) emit selectionChanged(_selectors);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::select ( Occurrence occurrence )
|
void CellWidget::select ( Occurrence occurrence )
|
||||||
{
|
{
|
||||||
if ( !occurrence.isValid() )
|
if ( (++_delaySelectionChanged == 1) and not _state->cumulativeSelection() ) {
|
||||||
|
openRefreshSession ();
|
||||||
|
unselectAll ();
|
||||||
|
closeRefreshSession ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( not occurrence.isValid() )
|
||||||
throw Error ( "Can't select occurrence : invalid occurrence" );
|
throw Error ( "Can't select occurrence : invalid occurrence" );
|
||||||
|
|
||||||
if ( occurrence.getOwnerCell() != getCell() ) {
|
if ( occurrence.getOwnerCell() != getCell() ) {
|
||||||
|
@ -2675,13 +2722,31 @@ namespace Hurricane {
|
||||||
, s1.c_str(), s2.c_str() );
|
, s1.c_str(), s2.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool selected = true;
|
||||||
|
const Net* net = dynamic_cast<const Net*>(occurrence.getEntity());
|
||||||
|
if ( net ) {
|
||||||
|
SelectorCriterion* criterion = _state->getSelection().add ( net );
|
||||||
|
if ( criterion and (not criterion->isEnabled()) ) {
|
||||||
|
criterion->enable ();
|
||||||
|
forEach ( Component*, component, net->getComponents() ) {
|
||||||
|
Occurrence occurrence ( *component );
|
||||||
|
select ( occurrence );
|
||||||
|
}
|
||||||
|
forEach ( Rubber*, irubber, net->getRubbers() ) {
|
||||||
|
Occurrence occurrence ( *irubber );
|
||||||
|
select ( occurrence );
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
selected = false;
|
||||||
|
}
|
||||||
|
|
||||||
Property* property = occurrence.getProperty ( Selector::getPropertyName() );
|
Property* property = occurrence.getProperty ( Selector::getPropertyName() );
|
||||||
Selector* selector = NULL;
|
Selector* selector = NULL;
|
||||||
if ( !property )
|
if ( not property )
|
||||||
selector = Selector::create ( occurrence );
|
selector = Selector::create ( occurrence );
|
||||||
else {
|
else {
|
||||||
selector = dynamic_cast<Selector*>(property);
|
selector = dynamic_cast<Selector*>(property);
|
||||||
if ( !selector )
|
if ( not selector )
|
||||||
throw Error ( "Abnormal property named " + getString(Selector::getPropertyName()) );
|
throw Error ( "Abnormal property named " + getString(Selector::getPropertyName()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2689,53 +2754,48 @@ namespace Hurricane {
|
||||||
|
|
||||||
setShowSelection ( true );
|
setShowSelection ( true );
|
||||||
_selectionHasChanged = true;
|
_selectionHasChanged = true;
|
||||||
if ( !_delaySelectionChanged ) emit selectionChanged(_selectors);
|
|
||||||
|
if ( (--_delaySelectionChanged == 0) and selected ) {
|
||||||
|
if ( _state->showSelection() ) _redrawManager.refresh ();
|
||||||
|
emit selectionChanged(_selectors);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::selectOccurrencesUnder ( Box selectArea )
|
// void CellWidget::unselect ( const Net* net )
|
||||||
{
|
// {
|
||||||
++_delaySelectionChanged;
|
// ++_delaySelectionChanged;
|
||||||
|
|
||||||
if ( !_state->cumulativeSelection() ) {
|
// bool removed = _state->getSelection().remove ( net );
|
||||||
openRefreshSession ();
|
// if ( (--_delaySelectionChanged == 0) and removed ) emit selectionChanged(_selectors);
|
||||||
unselectAll ();
|
// }
|
||||||
closeRefreshSession ();
|
|
||||||
}
|
|
||||||
bool added = _state->getSelection().add ( selectArea );
|
|
||||||
|
|
||||||
if ( !--_delaySelectionChanged && added ) emit selectionChanged(_selectors);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::unselect ( const Net* net )
|
|
||||||
{
|
|
||||||
++_delaySelectionChanged;
|
|
||||||
|
|
||||||
bool removed = _state->getSelection().remove ( net );
|
|
||||||
if ( !--_delaySelectionChanged && removed ) emit selectionChanged(_selectors);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::unselect ( Occurrence occurrence )
|
void CellWidget::unselect ( Occurrence occurrence )
|
||||||
{
|
{
|
||||||
if ( !occurrence.isValid() )
|
if ( not occurrence.isValid() )
|
||||||
throw Error ( "Can't unselect occurrence : invalid occurrence" );
|
throw Error ( "Can't unselect occurrence : invalid occurrence" );
|
||||||
|
|
||||||
if ( occurrence.getOwnerCell() != getCell() )
|
if ( occurrence.getOwnerCell() != getCell() )
|
||||||
throw Error ( "Can't unselect occurrence : incompatible occurrence" );
|
throw Error ( "Can't unselect occurrence : incompatible occurrence" );
|
||||||
|
|
||||||
|
bool unselected = true;
|
||||||
|
const Net* net = dynamic_cast<const Net*>(occurrence.getEntity());
|
||||||
|
if ( net ) {
|
||||||
|
unselected = _state->getSelection().remove ( net );
|
||||||
|
}
|
||||||
|
|
||||||
Property* property = occurrence.getProperty ( Selector::getPropertyName() );
|
Property* property = occurrence.getProperty ( Selector::getPropertyName() );
|
||||||
if ( property ) {
|
if ( property ) {
|
||||||
Selector* selector = dynamic_cast<Selector*>(property);
|
Selector* selector = dynamic_cast<Selector*>(property);
|
||||||
if ( !selector )
|
if ( not selector )
|
||||||
throw Error ( "Abnormal property named " + getString(Selector::getPropertyName()) );
|
throw Error ( "Abnormal property named " + getString(Selector::getPropertyName()) );
|
||||||
|
|
||||||
selector->detachFrom(this);
|
selector->detachFrom(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
_selectionHasChanged = true;
|
_selectionHasChanged = true;
|
||||||
if ( !_delaySelectionChanged ) emit selectionChanged(_selectors);
|
if ( (_delaySelectionChanged == 0) and unselected ) emit selectionChanged(_selectors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2746,13 +2806,13 @@ namespace Hurricane {
|
||||||
_state->getSelection().clear ();
|
_state->getSelection().clear ();
|
||||||
_unselectAll ();
|
_unselectAll ();
|
||||||
|
|
||||||
if ( !--_delaySelectionChanged ) emit selectionChanged(_selectors);
|
if ( --_delaySelectionChanged == 0 ) emit selectionChanged(_selectors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::toggleSelection ( Occurrence occurrence )
|
void CellWidget::toggleSelection ( Occurrence occurrence )
|
||||||
{
|
{
|
||||||
if ( !occurrence.isValid() )
|
if ( not occurrence.isValid() )
|
||||||
throw Error ( "Can't select occurrence : invalid occurrence" );
|
throw Error ( "Can't select occurrence : invalid occurrence" );
|
||||||
|
|
||||||
if ( occurrence.getOwnerCell() != getCell() )
|
if ( occurrence.getOwnerCell() != getCell() )
|
||||||
|
@ -2760,7 +2820,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
Property* property = occurrence.getProperty ( Selector::getPropertyName() );
|
Property* property = occurrence.getProperty ( Selector::getPropertyName() );
|
||||||
Selector* selector = NULL;
|
Selector* selector = NULL;
|
||||||
if ( !property ) {
|
if ( not property ) {
|
||||||
// Net special case.
|
// Net special case.
|
||||||
Net* net = dynamic_cast<Net*>(occurrence.getEntity());
|
Net* net = dynamic_cast<Net*>(occurrence.getEntity());
|
||||||
if ( net ) {
|
if ( net ) {
|
||||||
|
@ -2799,41 +2859,41 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::_select ( const Net* net )
|
// void CellWidget::_select ( const Net* net )
|
||||||
{
|
// {
|
||||||
select ( Occurrence(net) );
|
// //select ( Occurrence(net) );
|
||||||
forEach ( Component*, component, net->getComponents() ) {
|
// forEach ( Component*, component, net->getComponents() ) {
|
||||||
Occurrence occurrence ( *component );
|
// Occurrence occurrence ( *component );
|
||||||
select ( occurrence );
|
// select ( occurrence );
|
||||||
}
|
// }
|
||||||
forEach ( Rubber*, irubber, net->getRubbers() ) {
|
// forEach ( Rubber*, irubber, net->getRubbers() ) {
|
||||||
Occurrence occurrence ( *irubber );
|
// Occurrence occurrence ( *irubber );
|
||||||
select ( occurrence );
|
// select ( occurrence );
|
||||||
}
|
// }
|
||||||
if ( _state->showSelection() ) _redrawManager.refresh ();
|
// if ( _state->showSelection() ) _redrawManager.refresh ();
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::_unselect ( const Net* net )
|
// void CellWidget::_unselect ( const Net* net )
|
||||||
{
|
// {
|
||||||
unselect ( Occurrence(net) );
|
// //unselect ( Occurrence(net) );
|
||||||
forEach ( Component*, component, net->getComponents() ) {
|
// forEach ( Component*, component, net->getComponents() ) {
|
||||||
Occurrence occurrence ( *component );
|
// Occurrence occurrence ( *component );
|
||||||
unselect ( occurrence );
|
// unselect ( occurrence );
|
||||||
}
|
// }
|
||||||
forEach ( Rubber*, rubber, net->getRubbers() ) {
|
// forEach ( Rubber*, rubber, net->getRubbers() ) {
|
||||||
Occurrence occurrence ( *rubber );
|
// Occurrence occurrence ( *rubber );
|
||||||
unselect ( occurrence );
|
// unselect ( occurrence );
|
||||||
}
|
// }
|
||||||
if ( _state->showSelection() ) _redrawManager.refresh ();
|
// if ( _state->showSelection() ) _redrawManager.refresh ();
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::_selectOccurrencesUnder ( Box selectArea )
|
// void CellWidget::_selectOccurrencesUnder ( Box selectArea )
|
||||||
{
|
// {
|
||||||
forEach ( Occurrence, ioccurrence, getOccurrencesUnder(selectArea) )
|
// forEach ( Occurrence, ioccurrence, getOccurrencesUnder(selectArea) )
|
||||||
select ( *ioccurrence );
|
// select ( *ioccurrence );
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::_unselectAll ()
|
void CellWidget::_unselectAll ()
|
||||||
|
@ -2850,6 +2910,7 @@ namespace Hurricane {
|
||||||
void CellWidget::cellPreModificate ()
|
void CellWidget::cellPreModificate ()
|
||||||
{
|
{
|
||||||
openRefreshSession ();
|
openRefreshSession ();
|
||||||
|
_state->getSelection().invalidate ();
|
||||||
_unselectAll ();
|
_unselectAll ();
|
||||||
|
|
||||||
emit selectionChanged(_selectors);
|
emit selectionChanged(_selectors);
|
||||||
|
@ -2871,6 +2932,7 @@ namespace Hurricane {
|
||||||
_redrawManager.refresh ();
|
_redrawManager.refresh ();
|
||||||
|
|
||||||
--_delaySelectionChanged;
|
--_delaySelectionChanged;
|
||||||
|
|
||||||
emit selectionChanged(_selectors);
|
emit selectionChanged(_selectors);
|
||||||
emit cellPostModificated ();
|
emit cellPostModificated ();
|
||||||
|
|
||||||
|
|
|
@ -233,8 +233,8 @@ namespace Hurricane {
|
||||||
getCellWidget()->closeRefreshSession ();
|
getCellWidget()->closeRefreshSession ();
|
||||||
}
|
}
|
||||||
getCellWidget()->setShowSelection ( true );
|
getCellWidget()->setShowSelection ( true );
|
||||||
connect ( _netlistBrowser, SIGNAL(netSelected (const Net*)), getCellWidget(), SLOT(select (const Net*)) );
|
connect ( _netlistBrowser, SIGNAL(netSelected (Occurrence)), getCellWidget(), SLOT(select (Occurrence)) );
|
||||||
connect ( _netlistBrowser, SIGNAL(netUnselected(const Net*)), getCellWidget(), SLOT(unselect(const Net*)) );
|
connect ( _netlistBrowser, SIGNAL(netUnselected(Occurrence)), getCellWidget(), SLOT(unselect(Occurrence)) );
|
||||||
_netlistBrowser->updateSelecteds ();
|
_netlistBrowser->updateSelecteds ();
|
||||||
} else {
|
} else {
|
||||||
getCellWidget()->setShowSelection ( false );
|
getCellWidget()->setShowSelection ( false );
|
||||||
|
|
|
@ -166,10 +166,10 @@ namespace Hurricane {
|
||||||
switch ( isel->getAccesses() ) {
|
switch ( isel->getAccesses() ) {
|
||||||
case 1: break;
|
case 1: break;
|
||||||
case 64:
|
case 64:
|
||||||
emit netSelected ( isel->getNet() );
|
emit netSelected ( Occurrence(isel->getNet()) );
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
emit netUnselected ( isel->getNet() );
|
emit netUnselected ( Occurrence(isel->getNet()) );
|
||||||
remove = isel;
|
remove = isel;
|
||||||
++isel;
|
++isel;
|
||||||
_selecteds.erase ( remove );
|
_selecteds.erase ( remove );
|
||||||
|
|
|
@ -281,7 +281,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
//_cellWidget->unselectAll ();
|
//_cellWidget->unselectAll ();
|
||||||
_cellWidget->selectOccurrencesUnder ( _cellWidget->screenToDbuBox(selectArea) );
|
_cellWidget->selectOccurrencesUnder ( _cellWidget->screenToDbuBox(selectArea) );
|
||||||
bool somethingSelected = !_cellWidget->getSelectorSet().empty();
|
bool somethingSelected = not _cellWidget->getSelectorSet().empty();
|
||||||
|
|
||||||
if ( _cellWidget->showSelection() != somethingSelected )
|
if ( _cellWidget->showSelection() != somethingSelected )
|
||||||
_cellWidget->setShowSelection ( somethingSelected );
|
_cellWidget->setShowSelection ( somethingSelected );
|
||||||
|
|
|
@ -54,21 +54,21 @@ namespace Hurricane {
|
||||||
SelectionWidget* widget = qobject_cast<SelectionWidget*>(QObject::parent());
|
SelectionWidget* widget = qobject_cast<SelectionWidget*>(QObject::parent());
|
||||||
if ( widget )
|
if ( widget )
|
||||||
return widget->cumulativeSelection();
|
return widget->cumulativeSelection();
|
||||||
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SelectionModel::clear ()
|
void SelectionModel::clear ()
|
||||||
{
|
{
|
||||||
_selection.clear ();
|
_selection.clear ();
|
||||||
emit layoutChanged ();
|
reset ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SelectionModel::setSelection ( const SelectorSet& selection )
|
void SelectionModel::setSelection ( const SelectorSet& selection )
|
||||||
{
|
{
|
||||||
if ( !isCumulative() ) _selection.clear ();
|
bool modificated = true;
|
||||||
|
if ( not isCumulative() ) _selection.clear ();
|
||||||
|
|
||||||
SelectorSet::const_iterator iselector = selection.begin();
|
SelectorSet::const_iterator iselector = selection.begin();
|
||||||
vector<OccurrenceItem>::iterator iitem;
|
vector<OccurrenceItem>::iterator iitem;
|
||||||
|
@ -76,23 +76,54 @@ namespace Hurricane {
|
||||||
if ( isCumulative() ) {
|
if ( isCumulative() ) {
|
||||||
iitem = find( _selection.begin(), _selection.end(), (*iselector)->getOccurrence() );
|
iitem = find( _selection.begin(), _selection.end(), (*iselector)->getOccurrence() );
|
||||||
if ( iitem != _selection.end() ) {
|
if ( iitem != _selection.end() ) {
|
||||||
(*iitem)._flags |= OccurrenceItem::Selected;
|
(*iitem).setFlags ( OccurrenceItem::Selected );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
modificated = true;
|
||||||
_selection.push_back ( OccurrenceItem((*iselector)->getOccurrence()) );
|
_selection.push_back ( OccurrenceItem((*iselector)->getOccurrence()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
emit layoutChanged ();
|
if ( modificated ) reset ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Occurrence SelectionModel::toggleSelection ( const QModelIndex& index )
|
void SelectionModel::setSelection ( Occurrence occurrence )
|
||||||
|
{
|
||||||
|
bool modificated = false;
|
||||||
|
if ( not isCumulative() ) _selection.clear ();
|
||||||
|
|
||||||
|
size_t i = 0;
|
||||||
|
for ( ; i<_selection.size() ; i++ ) {
|
||||||
|
if ( _selection[i]._occurrence == occurrence ) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( i >= _selection.size() ) {
|
||||||
|
modificated = true;
|
||||||
|
_selection.push_back ( OccurrenceItem(occurrence) );
|
||||||
|
}
|
||||||
|
else _selection[i].setFlags ( OccurrenceItem::Selected );
|
||||||
|
|
||||||
|
if ( modificated ) reset ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Occurrence SelectionModel::toggleSelection ( const QModelIndex& oindex )
|
||||||
|
{
|
||||||
|
if ( oindex.isValid() && ( oindex.row() < (int)_selection.size() ) ) {
|
||||||
|
_selection[oindex.row()].toggle();
|
||||||
|
emit dataChanged ( index(oindex.row(),0), index(oindex.row(),1) );
|
||||||
|
|
||||||
|
return _selection[oindex.row()]._occurrence;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Occurrence ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Occurrence SelectionModel::getOccurrence ( const QModelIndex& index )
|
||||||
{
|
{
|
||||||
if ( index.isValid() && ( index.row() < (int)_selection.size() ) ) {
|
if ( index.isValid() && ( index.row() < (int)_selection.size() ) ) {
|
||||||
_selection[index.row()].toggle();
|
|
||||||
emit layoutChanged ();
|
|
||||||
|
|
||||||
return _selection[index.row()]._occurrence;
|
return _selection[index.row()]._occurrence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,30 +136,52 @@ namespace Hurricane {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
for ( ; i<_selection.size() ; i++ ) {
|
for ( ; i<_selection.size() ; i++ ) {
|
||||||
if ( !found && (_selection[i]._occurrence == occurrence) ) {
|
if ( (not found) and (_selection[i]._occurrence == occurrence) ) {
|
||||||
found = true;
|
found = true;
|
||||||
if ( isCumulative() ) break;
|
break;
|
||||||
}
|
}
|
||||||
if ( found && ( i < _selection.size()-1 ) )
|
|
||||||
_selection[i] = _selection[i+1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !found )
|
if ( not found ) {
|
||||||
_selection.push_back ( OccurrenceItem(occurrence) );
|
_selection.push_back ( OccurrenceItem(occurrence) );
|
||||||
else {
|
}
|
||||||
if ( isCumulative() ) _selection[i].toggle ();
|
_selection[i].toggle ();
|
||||||
else _selection.pop_back ();
|
|
||||||
|
//emit dataChanged ( index(i,0), index(i,1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
emit layoutChanged ();
|
|
||||||
}
|
// void SelectionModel::toggleSelection ( Occurrence occurrence )
|
||||||
|
// {
|
||||||
|
// bool found = false;
|
||||||
|
// size_t i = 0;
|
||||||
|
// for ( ; i<_selection.size() ; i++ ) {
|
||||||
|
// if ( (not found) and (_selection[i]._occurrence == occurrence) ) {
|
||||||
|
// found = true;
|
||||||
|
// if ( isCumulative() ) break;
|
||||||
|
// }
|
||||||
|
// if ( found and ( i < _selection.size()-1 ) )
|
||||||
|
// _selection[i] = _selection[i+1];
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if ( not found ) {
|
||||||
|
// _selection.push_back ( OccurrenceItem(occurrence) );
|
||||||
|
// } else {
|
||||||
|
// if ( isCumulative() ) _selection[i].toggle ();
|
||||||
|
// else _selection.pop_back ();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// reset ();
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
QVariant SelectionModel::data ( const QModelIndex& index, int role ) const
|
QVariant SelectionModel::data ( const QModelIndex& index, int role ) const
|
||||||
{
|
{
|
||||||
|
static QBrush unselectForeground = QBrush ( QColor(255,0,0) );
|
||||||
static QFont occurrenceFont = Graphics::getFixedFont ( QFont::Normal );
|
static QFont occurrenceFont = Graphics::getFixedFont ( QFont::Normal );
|
||||||
static QFont entityFont = Graphics::getFixedFont ( QFont::Bold, false );
|
static QFont unselectFont = Graphics::getFixedFont ( QFont::Normal, true );
|
||||||
static QFontMetrics entityMetrics = QFontMetrics(entityFont);
|
static QFont selectFont = Graphics::getFixedFont ( QFont::Bold, false );
|
||||||
|
static QFontMetrics entityMetrics = QFontMetrics(selectFont);
|
||||||
|
|
||||||
if ( !index.isValid() ) return QVariant ();
|
if ( !index.isValid() ) return QVariant ();
|
||||||
|
|
||||||
|
@ -150,12 +203,17 @@ namespace Hurricane {
|
||||||
case 0: return occurrenceFont;
|
case 0: return occurrenceFont;
|
||||||
case 1:
|
case 1:
|
||||||
if ( _selection[row]._flags & OccurrenceItem::Selected )
|
if ( _selection[row]._flags & OccurrenceItem::Selected )
|
||||||
return entityFont;
|
return selectFont;
|
||||||
default:
|
default:
|
||||||
return occurrenceFont;
|
return unselectFont;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( role == Qt::ForegroundRole ) {
|
||||||
|
if ( _selection[row]._flags & OccurrenceItem::Selected ) return QVariant();
|
||||||
|
return unselectForeground;
|
||||||
|
}
|
||||||
|
|
||||||
if ( role == Qt::DisplayRole ) {
|
if ( role == Qt::DisplayRole ) {
|
||||||
switch ( index.column() ) {
|
switch ( index.column() ) {
|
||||||
case 0: return getString(_selection[row]._occurrence.getPath().getName()).c_str();
|
case 0: return getString(_selection[row]._occurrence.getPath().getName()).c_str();
|
||||||
|
|
|
@ -133,6 +133,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
connect ( _view->selectionModel(), SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&))
|
connect ( _view->selectionModel(), SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&))
|
||||||
, this , SLOT (selectCurrent (const QModelIndex&,const QModelIndex&)) );
|
, this , SLOT (selectCurrent (const QModelIndex&,const QModelIndex&)) );
|
||||||
|
//connect ( _baseModel , SIGNAL(dataChanged (const QModelIndex&,const QModelIndex&))
|
||||||
|
// , this , SLOT (dataChanged (const QModelIndex&,const QModelIndex&)) );
|
||||||
|
|
||||||
QAction* toggleAction = new QAction ( tr("&Toggle Selection"), this );
|
QAction* toggleAction = new QAction ( tr("&Toggle Selection"), this );
|
||||||
toggleAction->setShortcut ( QKeySequence(tr("T")) );
|
toggleAction->setShortcut ( QKeySequence(tr("T")) );
|
||||||
|
@ -229,6 +231,11 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// void SelectionWidget::dataChanged ( const QModelIndex&, const QModelIndex& )
|
||||||
|
// {
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
void SelectionWidget::toggleSelection ()
|
void SelectionWidget::toggleSelection ()
|
||||||
{
|
{
|
||||||
toggleSelection ( _view->currentIndex() );
|
toggleSelection ( _view->currentIndex() );
|
||||||
|
@ -250,9 +257,7 @@ namespace Hurricane {
|
||||||
void SelectionWidget::toggleSelection ( Occurrence occurrence )
|
void SelectionWidget::toggleSelection ( Occurrence occurrence )
|
||||||
{
|
{
|
||||||
if ( _updateState != InternalEmit ) {
|
if ( _updateState != InternalEmit ) {
|
||||||
blockAllSignals ( true );
|
|
||||||
_baseModel->toggleSelection ( occurrence );
|
_baseModel->toggleSelection ( occurrence );
|
||||||
blockAllSignals ( false );
|
|
||||||
}
|
}
|
||||||
_updateState = ExternalEmit;
|
_updateState = ExternalEmit;
|
||||||
}
|
}
|
||||||
|
@ -273,6 +278,10 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SelectionWidget::setSelection ( Occurrence occurrence )
|
||||||
|
{ _baseModel->setSelection ( occurrence ); }
|
||||||
|
|
||||||
|
|
||||||
void SelectionWidget::clear ()
|
void SelectionWidget::clear ()
|
||||||
{
|
{
|
||||||
_baseModel->clear ();
|
_baseModel->clear ();
|
||||||
|
|
|
@ -42,6 +42,10 @@ namespace Hurricane {
|
||||||
{ return NULL; }
|
{ return NULL; }
|
||||||
|
|
||||||
|
|
||||||
|
const Box& SelectorCriterion::getArea () const
|
||||||
|
{ static const Box empty; return empty; }
|
||||||
|
|
||||||
|
|
||||||
void SelectorCriterion::undoSelection ( CellWidget* cw )
|
void SelectorCriterion::undoSelection ( CellWidget* cw )
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -51,7 +55,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
NetSelectorCriterion::NetSelectorCriterion ( const Net* net )
|
NetSelectorCriterion::NetSelectorCriterion ( const Net* net )
|
||||||
: _net(net)
|
: _net (net)
|
||||||
, _name(_net->getName())
|
, _name(_net->getName())
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -73,15 +77,11 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
void NetSelectorCriterion::doSelection ( CellWidget* cw )
|
void NetSelectorCriterion::doSelection ( CellWidget* cw )
|
||||||
{
|
{ cw->select ( Occurrence(_net) ); }
|
||||||
cw->_select ( _net );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void NetSelectorCriterion::undoSelection ( CellWidget* cw )
|
void NetSelectorCriterion::undoSelection ( CellWidget* cw )
|
||||||
{
|
{ cw->unselect ( Occurrence(_net) ); }
|
||||||
cw->_unselect ( _net );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string NetSelectorCriterion::_getTypeName () const
|
string NetSelectorCriterion::_getTypeName () const
|
||||||
|
@ -125,9 +125,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
void AreaSelectorCriterion::doSelection ( CellWidget* cw )
|
void AreaSelectorCriterion::doSelection ( CellWidget* cw )
|
||||||
{
|
{ cw->selectOccurrencesUnder ( _area ); }
|
||||||
cw->_selectOccurrencesUnder ( _area );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string AreaSelectorCriterion::_getTypeName () const
|
string AreaSelectorCriterion::_getTypeName () const
|
||||||
|
|
|
@ -266,19 +266,19 @@ namespace Hurricane {
|
||||||
inline void closeRefreshSession ();
|
inline void closeRefreshSession ();
|
||||||
inline DrawingPlanes& getDrawingPlanes ();
|
inline DrawingPlanes& getDrawingPlanes ();
|
||||||
inline QPoint& getOffsetVA ();
|
inline QPoint& getOffsetVA ();
|
||||||
void select ( const Net* );
|
// void select ( const Net* );
|
||||||
void select ( Occurrence );
|
void select ( Occurrence );
|
||||||
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 unselectAll ();
|
void unselectAll ();
|
||||||
void toggleSelection ( Occurrence );
|
void toggleSelection ( Occurrence );
|
||||||
void setShowSelection ( bool state );
|
void setShowSelection ( bool state );
|
||||||
void setCumulativeSelection ( bool state );
|
void setCumulativeSelection ( bool state );
|
||||||
void _select ( const Net* );
|
// void _select ( const Net* );
|
||||||
void _unselect ( const Net* );
|
// void _unselect ( const Net* );
|
||||||
void _selectOccurrencesUnder ( Box selectArea );
|
// void _selectOccurrencesUnder ( Box selectArea );
|
||||||
void _unselectAll ();
|
void _unselectAll ();
|
||||||
inline void addRuler ( const Point&, const Point& );
|
inline void addRuler ( const Point&, const Point& );
|
||||||
inline void addRuler ( shared_ptr<Ruler> );
|
inline void addRuler ( shared_ptr<Ruler> );
|
||||||
|
@ -539,10 +539,11 @@ namespace Hurricane {
|
||||||
SelectorCriterions ();
|
SelectorCriterions ();
|
||||||
~SelectorCriterions ();
|
~SelectorCriterions ();
|
||||||
inline void setCellWidget ( CellWidget* );
|
inline void setCellWidget ( CellWidget* );
|
||||||
bool add ( const Net* net );
|
SelectorCriterion* add ( const Net* net );
|
||||||
bool add ( Box area );
|
SelectorCriterion* add ( Box area );
|
||||||
bool remove ( const Net* net );
|
bool remove ( const Net* net );
|
||||||
void clear ();
|
void clear ();
|
||||||
|
void invalidate ();
|
||||||
void revalidate ();
|
void revalidate ();
|
||||||
inline size_t size () const;
|
inline size_t size () const;
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -149,8 +149,8 @@ namespace Hurricane {
|
||||||
void goTo ( int );
|
void goTo ( int );
|
||||||
void updateSelecteds ();
|
void updateSelecteds ();
|
||||||
signals:
|
signals:
|
||||||
void netSelected ( const Net* );
|
void netSelected ( Occurrence );
|
||||||
void netUnselected ( const Net* );
|
void netUnselected ( Occurrence );
|
||||||
void netFitted ( const Net* );
|
void netFitted ( const Net* );
|
||||||
private slots:
|
private slots:
|
||||||
void textFilterChanged ();
|
void textFilterChanged ();
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace Hurricane {
|
||||||
enum Flags { Selected=1 };
|
enum Flags { Selected=1 };
|
||||||
public:
|
public:
|
||||||
inline OccurrenceItem ( Occurrence occurrence, unsigned int flags=Selected );
|
inline OccurrenceItem ( Occurrence occurrence, unsigned int flags=Selected );
|
||||||
|
inline void setFlags ( unsigned int );
|
||||||
inline void toggle ();
|
inline void toggle ();
|
||||||
inline bool operator== ( const OccurrenceItem& other ) const;
|
inline bool operator== ( const OccurrenceItem& other ) const;
|
||||||
public:
|
public:
|
||||||
|
@ -61,6 +62,10 @@ namespace Hurricane {
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
inline void OccurrenceItem::setFlags ( unsigned int flags )
|
||||||
|
{ _flags |= flags; }
|
||||||
|
|
||||||
|
|
||||||
inline void OccurrenceItem::toggle ()
|
inline void OccurrenceItem::toggle ()
|
||||||
{
|
{
|
||||||
if ( _flags & Selected ) _flags &= ~Selected;
|
if ( _flags & Selected ) _flags &= ~Selected;
|
||||||
|
@ -80,7 +85,9 @@ namespace Hurricane {
|
||||||
public:
|
public:
|
||||||
SelectionModel ( QObject* parent=NULL );
|
SelectionModel ( QObject* parent=NULL );
|
||||||
~SelectionModel ();
|
~SelectionModel ();
|
||||||
|
Occurrence getOccurrence ( const QModelIndex& index );
|
||||||
void setSelection ( const SelectorSet& selection );
|
void setSelection ( const SelectorSet& selection );
|
||||||
|
void setSelection ( Occurrence occurrence );
|
||||||
void toggleSelection ( Occurrence occurrence );
|
void toggleSelection ( Occurrence occurrence );
|
||||||
Occurrence toggleSelection ( const QModelIndex& index );
|
Occurrence toggleSelection ( const QModelIndex& index );
|
||||||
int rowCount ( const QModelIndex& parent=QModelIndex() ) const;
|
int rowCount ( const QModelIndex& parent=QModelIndex() ) const;
|
||||||
|
|
|
@ -73,12 +73,14 @@ namespace Hurricane {
|
||||||
void setCumulativeSelection ( bool );
|
void setCumulativeSelection ( bool );
|
||||||
void selectCurrent ( const QModelIndex& current, const QModelIndex& );
|
void selectCurrent ( const QModelIndex& current, const QModelIndex& );
|
||||||
void setSelection ( const SelectorSet& selection );
|
void setSelection ( const SelectorSet& selection );
|
||||||
|
void setSelection ( Occurrence );
|
||||||
void toggleSelection ();
|
void toggleSelection ();
|
||||||
void toggleSelection ( Occurrence );
|
void toggleSelection ( Occurrence );
|
||||||
void toggleSelection ( const QModelIndex& );
|
void toggleSelection ( const QModelIndex& );
|
||||||
void inspect ();
|
void inspect ();
|
||||||
private slots:
|
private slots:
|
||||||
void textFilterChanged ();
|
void textFilterChanged ();
|
||||||
|
//void dataChanged ( const QModelIndex&, const QModelIndex& );
|
||||||
protected:
|
protected:
|
||||||
void blockAllSignals ( bool );
|
void blockAllSignals ( bool );
|
||||||
|
|
||||||
|
|
|
@ -41,17 +41,30 @@ namespace Hurricane {
|
||||||
|
|
||||||
class SelectorCriterion {
|
class SelectorCriterion {
|
||||||
public:
|
public:
|
||||||
|
inline SelectorCriterion ();
|
||||||
virtual ~SelectorCriterion ();
|
virtual ~SelectorCriterion ();
|
||||||
virtual bool isValid ( CellWidget* ) const = 0;
|
virtual bool isValid ( CellWidget* ) const = 0;
|
||||||
|
inline bool isEnabled () const;
|
||||||
virtual const Net* getNet () const;
|
virtual const Net* getNet () const;
|
||||||
|
virtual const Box& getArea () const;
|
||||||
|
inline void enable ();
|
||||||
|
inline void disable ();
|
||||||
virtual void doSelection ( CellWidget* ) = 0;
|
virtual void doSelection ( CellWidget* ) = 0;
|
||||||
virtual void undoSelection ( CellWidget* );
|
virtual void undoSelection ( CellWidget* );
|
||||||
virtual Record* _getRecord () const = 0;
|
virtual Record* _getRecord () const = 0;
|
||||||
virtual string _getString () const = 0;
|
virtual string _getString () const = 0;
|
||||||
virtual string _getTypeName () const = 0;
|
virtual string _getTypeName () const = 0;
|
||||||
|
private:
|
||||||
|
bool _isEnabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline SelectorCriterion::SelectorCriterion () : _isEnabled(false) { }
|
||||||
|
inline bool SelectorCriterion::isEnabled () const { return _isEnabled; }
|
||||||
|
inline void SelectorCriterion::enable () { _isEnabled=true; }
|
||||||
|
inline void SelectorCriterion::disable () { _isEnabled=false; }
|
||||||
|
|
||||||
|
|
||||||
class NetSelectorCriterion : public SelectorCriterion {
|
class NetSelectorCriterion : public SelectorCriterion {
|
||||||
public:
|
public:
|
||||||
NetSelectorCriterion ( const Net* );
|
NetSelectorCriterion ( const Net* );
|
||||||
|
@ -73,7 +86,7 @@ namespace Hurricane {
|
||||||
public:
|
public:
|
||||||
AreaSelectorCriterion ( const Box& );
|
AreaSelectorCriterion ( const Box& );
|
||||||
virtual ~AreaSelectorCriterion ();
|
virtual ~AreaSelectorCriterion ();
|
||||||
const Box& getArea () const;
|
virtual const Box& getArea () const;
|
||||||
virtual bool isValid ( CellWidget* ) const;
|
virtual bool isValid ( CellWidget* ) const;
|
||||||
virtual void doSelection ( CellWidget* );
|
virtual void doSelection ( CellWidget* );
|
||||||
virtual Record* _getRecord () const;
|
virtual Record* _getRecord () const;
|
||||||
|
|
Loading…
Reference in New Issue