* ./hurricane/src/hviewer :
- Bug: correction of the bad keyPress event handling in InspectorWidget (had to press twice the key for the action to be transmitted). Uses an eventFilter() at InspectorWidget instead of a keyPressEvent() overload. The keyPress event is first received by the QTableView then transmitted to the upper level. The eventFilter allows the InspectorWidget to catch the event *before* it gets to QTableView (but let pass thoses it don't want). - Bug: idem for SeletionWidget. - Change: do not draw the rectangular area of AreaCommand until it is bigger than a given threshold (programmable). Affect ZoomCommand and SelectCommand. ZoomCommand no longer issue a warning when the zoom is to small. - New feature: fit to net in the NetlistWidget. Uses simple contextual menu, another way to avoid overloading keyPressEvent(). - Change: in Query, the filter has now it's own subtype: Query::Mask. - Change: enhancement for the "start" model of signal propagation, used to re-implement the DisplayFilterWidget. - Change: more clear policy for signal emission: a signal must be emitted by any "setter" method (setStartLevel(), setStopLevel(), ...). Has to be enforced for all setter (work in progress). - Change: re-implemenation of the delayed refresh mechanism. No more flags propaged througout the functions calls but a session mechanism instead. See CellWidget::openRefreshSession() & CellWidget::closeRefreshSession(). Nothing is actually drawn until the last session is closed. Session mechanism can be invoked by signals/slots, see NetlistWidget. - Change: less dangerous key mapping: 'z' : zoom in. 'm' : zoom out. 'CTRL+z' : previous zoom level. 'CTRL+m' : next zoom level. 'CTRL+Up' : back in hierarchy. 'CTRL+Down' : go down in hierarchy. 'SHIFT+Up' : back in hierarchy stack. 'SHIFT+Down' : go down in hierarchy stack.
This commit is contained in:
parent
a2e1fd4d97
commit
4067a363dc
|
@ -79,7 +79,7 @@ namespace Hurricane {
|
||||||
, const Transformation& transformation
|
, const Transformation& transformation
|
||||||
, const BasicLayer* basicLayer
|
, const BasicLayer* basicLayer
|
||||||
, ExtensionSlice::Mask mask
|
, ExtensionSlice::Mask mask
|
||||||
, unsigned int filter
|
, Mask filter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_basicLayer = basicLayer;
|
_basicLayer = basicLayer;
|
||||||
|
@ -102,13 +102,13 @@ namespace Hurricane {
|
||||||
|
|
||||||
while ( !_stack.empty() ) {
|
while ( !_stack.empty() ) {
|
||||||
// Process the Components of the current instance.
|
// Process the Components of the current instance.
|
||||||
if ( hasGoCallback() && _basicLayer && (_filter & DoComponents) ) {
|
if ( hasGoCallback() && _basicLayer && (_filter.isSet(DoComponents)) ) {
|
||||||
//if ( getInstance() )
|
//if ( getInstance() )
|
||||||
// cerr << getTab() << getInstance() << " " << getTransformation() << endl;
|
// cerr << getTab() << getInstance() << " " << getTransformation() << endl;
|
||||||
//else
|
//else
|
||||||
// cerr << " TopCell: " << getMasterCell() << " " << getTransformation() << endl;
|
// cerr << " TopCell: " << getMasterCell() << " " << getTransformation() << endl;
|
||||||
|
|
||||||
if ( !getMasterCell()->isTerminal() || (_filter & DoTerminalCells) ) {
|
if ( !getMasterCell()->isTerminal() || (_filter.isSet(DoTerminalCells)) ) {
|
||||||
forEach ( Slice*, islice, getMasterCell()->getSlices() ) {
|
forEach ( Slice*, islice, getMasterCell()->getSlices() ) {
|
||||||
if ( !(*islice)->getLayer()->contains(getBasicLayer()) ) continue;
|
if ( !(*islice)->getLayer()->contains(getBasicLayer()) ) continue;
|
||||||
if ( !(*islice)->getBoundingBox().intersect(getArea()) ) continue;
|
if ( !(*islice)->getBoundingBox().intersect(getArea()) ) continue;
|
||||||
|
@ -119,13 +119,13 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !getMasterCell()->isTerminal() && (_filter & DoRubbers) ) {
|
if ( !getMasterCell()->isTerminal() && (_filter.isSet(DoRubbers)) ) {
|
||||||
forEach ( Rubber*, rubber, getMasterCell()->getRubbersUnder(_stack.getArea()) )
|
forEach ( Rubber*, rubber, getMasterCell()->getRubbersUnder(_stack.getArea()) )
|
||||||
rubberCallback ( *rubber );
|
rubberCallback ( *rubber );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( hasExtensionGoCallback() && (_filter & DoExtensionGos) ) {
|
if ( hasExtensionGoCallback() && (_filter.isSet(DoExtensionGos)) ) {
|
||||||
if ( !getMasterCell()->isTerminal() || (_filter & DoTerminalCells) ) {
|
if ( !getMasterCell()->isTerminal() || (_filter.isSet(DoTerminalCells)) ) {
|
||||||
forEach ( ExtensionSlice*, islice, getMasterCell()->getExtensionSlices() ) {
|
forEach ( ExtensionSlice*, islice, getMasterCell()->getExtensionSlices() ) {
|
||||||
if ( !( (*islice)->getMask() & _extensionMask ) ) continue;
|
if ( !( (*islice)->getMask() & _extensionMask ) ) continue;
|
||||||
if ( !(*islice)->getBoundingBox().intersect(getArea()) ) continue;
|
if ( !(*islice)->getBoundingBox().intersect(getArea()) ) continue;
|
||||||
|
@ -136,7 +136,7 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (_filter & DoMasterCells) && hasMasterCellCallback() )
|
if ( (_filter.isSet(DoMasterCells)) && hasMasterCellCallback() )
|
||||||
masterCellCallback ();
|
masterCellCallback ();
|
||||||
|
|
||||||
_stack.progress ();
|
_stack.progress ();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -41,6 +41,7 @@ namespace Hurricane {
|
||||||
inline bool zero () const;
|
inline bool zero () const;
|
||||||
inline Mask& set ( const Mask mask );
|
inline Mask& set ( const Mask mask );
|
||||||
inline Mask& unset ( const Mask mask );
|
inline Mask& unset ( const Mask mask );
|
||||||
|
inline bool isSet ( const Mask mask ) const;
|
||||||
inline bool contains ( const Mask mask ) const;
|
inline bool contains ( const Mask mask ) const;
|
||||||
inline bool intersect ( const Mask mask ) const;
|
inline bool intersect ( const Mask mask ) const;
|
||||||
inline Mask& merge ( const Mask mask ) const;
|
inline Mask& merge ( const Mask mask ) const;
|
||||||
|
@ -85,6 +86,10 @@ namespace Hurricane {
|
||||||
inline Mask<IntType>& Mask<IntType>::unset ( const Mask<IntType> mask )
|
inline Mask<IntType>& Mask<IntType>::unset ( const Mask<IntType> mask )
|
||||||
{ _mask &= ~mask._mask; return *this; }
|
{ _mask &= ~mask._mask; return *this; }
|
||||||
|
|
||||||
|
template<typename IntType>
|
||||||
|
inline bool Mask<IntType>::isSet ( const Mask<IntType> mask ) const
|
||||||
|
{ return _mask & mask._mask; }
|
||||||
|
|
||||||
template<typename IntType>
|
template<typename IntType>
|
||||||
inline bool Mask<IntType>::contains ( const Mask<IntType> mask ) const
|
inline bool Mask<IntType>::contains ( const Mask<IntType> mask ) const
|
||||||
{ return (_mask & mask._mask) && !(~_mask & mask._mask); }
|
{ return (_mask & mask._mask) && !(~_mask & mask._mask); }
|
||||||
|
|
|
@ -1,36 +1,9 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Project.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
// Universite Pierre et Marie Curie
|
|
||||||
//
|
//
|
||||||
// Main contributors :
|
|
||||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
|
||||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
|
||||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
|
||||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
|
||||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
|
||||||
// Christian Masson <Christian.Masson@lip6.fr>
|
|
||||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
|
||||||
//
|
|
||||||
// The Coriolis Project is free software; you can redistribute it
|
|
||||||
// and/or modify it under the terms of the GNU General Public License
|
|
||||||
// as published by the Free Software Foundation; either version 2 of
|
|
||||||
// the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// The Coriolis Project is distributed in the hope that it will be
|
|
||||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
||||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with the Coriolis Project; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
// USA
|
|
||||||
//
|
|
||||||
// License-Tag
|
|
||||||
// Authors-Tag
|
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
// $Id$
|
// $Id$
|
||||||
|
@ -303,6 +276,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
class Query {
|
class Query {
|
||||||
|
public:
|
||||||
|
typedef Hurricane::Mask<int> Mask;
|
||||||
public:
|
public:
|
||||||
// Types.
|
// Types.
|
||||||
enum QueryFilter { DoMasterCells = 1
|
enum QueryFilter { DoMasterCells = 1
|
||||||
|
@ -344,14 +319,14 @@ namespace Hurricane {
|
||||||
, const Transformation& transformation
|
, const Transformation& transformation
|
||||||
, const BasicLayer* basicLayer
|
, const BasicLayer* basicLayer
|
||||||
, ExtensionSlice::Mask extensionMask
|
, ExtensionSlice::Mask extensionMask
|
||||||
, unsigned int filter
|
, Mask filter
|
||||||
);
|
);
|
||||||
inline void setCell ( Cell* cell );
|
inline void setCell ( Cell* cell );
|
||||||
inline void setArea ( const Box& area );
|
inline void setArea ( const Box& area );
|
||||||
inline void setTransformation ( const Transformation& transformation );
|
inline void setTransformation ( const Transformation& transformation );
|
||||||
inline void setBasicLayer ( const BasicLayer* basicLayer );
|
inline void setBasicLayer ( const BasicLayer* basicLayer );
|
||||||
inline void setExtensionMask ( ExtensionSlice::Mask mode );
|
inline void setExtensionMask ( ExtensionSlice::Mask mode );
|
||||||
inline void setFilter ( unsigned int mode );
|
inline void setFilter ( Mask mode );
|
||||||
inline void setStartLevel ( unsigned int level );
|
inline void setStartLevel ( unsigned int level );
|
||||||
inline void setStopLevel ( unsigned int level );
|
inline void setStopLevel ( unsigned int level );
|
||||||
void doQuery ();
|
void doQuery ();
|
||||||
|
@ -361,7 +336,7 @@ namespace Hurricane {
|
||||||
QueryStack _stack;
|
QueryStack _stack;
|
||||||
const BasicLayer* _basicLayer;
|
const BasicLayer* _basicLayer;
|
||||||
ExtensionSlice::Mask _extensionMask;
|
ExtensionSlice::Mask _extensionMask;
|
||||||
unsigned int _filter;
|
Mask _filter;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -371,7 +346,7 @@ namespace Hurricane {
|
||||||
inline void Query::setArea ( const Box& area ) { _stack.setTopArea(area); }
|
inline void Query::setArea ( const Box& area ) { _stack.setTopArea(area); }
|
||||||
inline void Query::setTransformation ( const Transformation& transformation ) { _stack.setTopTransformation(transformation); }
|
inline void Query::setTransformation ( const Transformation& transformation ) { _stack.setTopTransformation(transformation); }
|
||||||
inline void Query::setBasicLayer ( const BasicLayer* basicLayer ) { _basicLayer = basicLayer; }
|
inline void Query::setBasicLayer ( const BasicLayer* basicLayer ) { _basicLayer = basicLayer; }
|
||||||
inline void Query::setFilter ( unsigned int filter ) { _filter = filter; }
|
inline void Query::setFilter ( Mask filter ) { _filter = filter; }
|
||||||
inline void Query::setExtensionMask ( ExtensionSlice::Mask mask ) { _extensionMask = mask; }
|
inline void Query::setExtensionMask ( ExtensionSlice::Mask mask ) { _extensionMask = mask; }
|
||||||
inline void Query::setStartLevel ( unsigned int level ) { _stack.setStartLevel(level); }
|
inline void Query::setStartLevel ( unsigned int level ) { _stack.setStartLevel(level); }
|
||||||
inline void Query::setStopLevel ( unsigned int level ) { _stack.setStopLevel(level); }
|
inline void Query::setStopLevel ( unsigned int level ) { _stack.setStopLevel(level); }
|
||||||
|
|
|
@ -1,36 +1,9 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Project.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
// Universite Pierre et Marie Curie
|
|
||||||
//
|
//
|
||||||
// Main contributors :
|
|
||||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
|
||||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
|
||||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
|
||||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
|
||||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
|
||||||
// Christian Masson <Christian.Masson@lip6.fr>
|
|
||||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
|
||||||
//
|
|
||||||
// The Coriolis Project is free software; you can redistribute it
|
|
||||||
// and/or modify it under the terms of the GNU General Public License
|
|
||||||
// as published by the Free Software Foundation; either version 2 of
|
|
||||||
// the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// The Coriolis Project is distributed in the hope that it will be
|
|
||||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
||||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with the Coriolis Project; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
// USA
|
|
||||||
//
|
|
||||||
// License-Tag
|
|
||||||
// Authors-Tag
|
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
// $Id$
|
// $Id$
|
||||||
|
@ -69,6 +42,7 @@ namespace Hurricane {
|
||||||
: Command()
|
: Command()
|
||||||
, _startPoint()
|
, _startPoint()
|
||||||
, _stopPoint()
|
, _stopPoint()
|
||||||
|
, _drawingThreshold(10)
|
||||||
, _drawingEnabled(false)
|
, _drawingEnabled(false)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -93,11 +67,14 @@ namespace Hurricane {
|
||||||
{
|
{
|
||||||
if ( !_drawingEnabled ) return;
|
if ( !_drawingEnabled ) return;
|
||||||
|
|
||||||
|
if ( ( abs(_stopPoint.x()-_startPoint.x()) > _drawingThreshold )
|
||||||
|
&& ( abs(_stopPoint.y()-_startPoint.y()) > _drawingThreshold ) ) {
|
||||||
widget->setPen ( Graphics::getPen("grid"), 2 );
|
widget->setPen ( Graphics::getPen("grid"), 2 );
|
||||||
widget->drawScreenRect ( _startPoint, _stopPoint, 2 );
|
widget->drawScreenRect ( _startPoint, _stopPoint, 2 );
|
||||||
drawCorner ( widget, true );
|
drawCorner ( widget, true );
|
||||||
drawCorner ( widget, false );
|
drawCorner ( widget, false );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AreaCommand::drawCorner ( CellWidget* widget, bool bottomLeft )
|
void AreaCommand::drawCorner ( CellWidget* widget, bool bottomLeft )
|
||||||
|
|
|
@ -198,6 +198,7 @@ namespace Hurricane {
|
||||||
CellWidget::RedrawManager::RedrawManager ( CellWidget* widget )
|
CellWidget::RedrawManager::RedrawManager ( CellWidget* widget )
|
||||||
: _widget (widget)
|
: _widget (widget)
|
||||||
, _events ()
|
, _events ()
|
||||||
|
, _refreshSession(0)
|
||||||
, _processing (false)
|
, _processing (false)
|
||||||
, _interrupted (false)
|
, _interrupted (false)
|
||||||
{ }
|
{ }
|
||||||
|
@ -283,14 +284,25 @@ namespace Hurricane {
|
||||||
if ( !_processing ) process ();
|
if ( !_processing ) process ();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
bool addRefresh = true;
|
||||||
|
if ( _refreshSession ) {
|
||||||
|
list<RedrawEvent*>::iterator ievent = _events.begin();
|
||||||
|
for ( ; ievent != _events.end() ; ievent++ ) {
|
||||||
|
if ( (_events.back()->getType() == RedrawEvent::Refresh) ) {
|
||||||
|
addRefresh = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( addRefresh )
|
||||||
_events.push_back ( new RedrawEvent(RedrawEvent::Refresh,0,_widget) );
|
_events.push_back ( new RedrawEvent(RedrawEvent::Refresh,0,_widget) );
|
||||||
|
|
||||||
if ( !_processing ) process ();
|
if ( !_processing && (_refreshSession == 0) ) process ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::RedrawManager::process ()
|
void CellWidget::RedrawManager::process ()
|
||||||
{
|
{
|
||||||
_processing = true;
|
_processing = true;
|
||||||
|
|
||||||
|
@ -780,12 +792,12 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CellWidget::SelectorCriterions::add ( const Net* net, bool delayRedraw )
|
bool CellWidget::SelectorCriterions::add ( const Net* net )
|
||||||
{
|
{
|
||||||
if ( !_cellWidget ) return false;
|
if ( !_cellWidget ) return false;
|
||||||
if ( !_cellWidget->isSelected(Occurrence(net)) ) {
|
if ( !_cellWidget->isSelected(Occurrence(net)) ) {
|
||||||
_criterions.push_back ( new NetSelectorCriterion(net) );
|
_criterions.push_back ( new NetSelectorCriterion(net) );
|
||||||
_criterions.back()->doSelection ( _cellWidget, delayRedraw );
|
_criterions.back()->doSelection ( _cellWidget );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -796,12 +808,12 @@ namespace Hurricane {
|
||||||
{
|
{
|
||||||
if ( !_cellWidget ) return false;
|
if ( !_cellWidget ) return false;
|
||||||
_criterions.push_back ( new AreaSelectorCriterion(area) );
|
_criterions.push_back ( new AreaSelectorCriterion(area) );
|
||||||
_criterions.back()->doSelection ( _cellWidget, true );
|
_criterions.back()->doSelection ( _cellWidget );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CellWidget::SelectorCriterions::remove ( const Net* net, bool delayRedraw )
|
bool CellWidget::SelectorCriterions::remove ( const Net* net )
|
||||||
{
|
{
|
||||||
if ( !_cellWidget ) return false;
|
if ( !_cellWidget ) return false;
|
||||||
if ( !_cellWidget->isSelected(Occurrence(net)) ) return false;
|
if ( !_cellWidget->isSelected(Occurrence(net)) ) return false;
|
||||||
|
@ -812,7 +824,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, delayRedraw );
|
_criterions.back()->undoSelection ( _cellWidget );
|
||||||
_criterions.pop_back ();
|
_criterions.pop_back ();
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
|
@ -838,7 +850,7 @@ namespace Hurricane {
|
||||||
size_t last = _criterions.size ();
|
size_t last = _criterions.size ();
|
||||||
while ( i < last ) {
|
while ( i < last ) {
|
||||||
if ( _criterions[i]->isValid(_cellWidget) ) {
|
if ( _criterions[i]->isValid(_cellWidget) ) {
|
||||||
_criterions[i]->doSelection ( _cellWidget, true );
|
_criterions[i]->doSelection ( _cellWidget );
|
||||||
++i;
|
++i;
|
||||||
} else
|
} else
|
||||||
swap ( _criterions[i], _criterions[--last] );
|
swap ( _criterions[i], _criterions[--last] );
|
||||||
|
@ -912,7 +924,6 @@ namespace Hurricane {
|
||||||
, _drawingPlanes (QSize(_initialSide+2*_stripWidth,_initialSide+2*_stripWidth),this)
|
, _drawingPlanes (QSize(_initialSide+2*_stripWidth,_initialSide+2*_stripWidth),this)
|
||||||
, _drawingQuery (this)
|
, _drawingQuery (this)
|
||||||
, _textDrawingQuery (this)
|
, _textDrawingQuery (this)
|
||||||
, _queryFilter (~Query::DoTerminalCells)
|
|
||||||
, _darkening (100)
|
, _darkening (100)
|
||||||
, _mousePosition (0,0)
|
, _mousePosition (0,0)
|
||||||
, _spot (this)
|
, _spot (this)
|
||||||
|
@ -926,7 +937,6 @@ namespace Hurricane {
|
||||||
, _commands ()
|
, _commands ()
|
||||||
, _redrawRectCount (0)
|
, _redrawRectCount (0)
|
||||||
, _textFontHeight (20)
|
, _textFontHeight (20)
|
||||||
, _rubberShape (Steiner)
|
|
||||||
{
|
{
|
||||||
//setBackgroundRole ( QPalette::Dark );
|
//setBackgroundRole ( QPalette::Dark );
|
||||||
//setAutoFillBackground ( false );
|
//setAutoFillBackground ( false );
|
||||||
|
@ -1046,7 +1056,6 @@ namespace Hurricane {
|
||||||
case Barycentric: setRubberShape(Steiner ); break;
|
case Barycentric: setRubberShape(Steiner ); break;
|
||||||
case Steiner: setRubberShape(Centric ); break;
|
case Steiner: setRubberShape(Centric ); break;
|
||||||
}
|
}
|
||||||
emit settingsChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1082,11 +1091,18 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CellWidget::changeQueryFilter ()
|
||||||
|
{
|
||||||
|
_redrawManager.refresh ();
|
||||||
|
emit queryFilterChanged ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::_redraw ( QRect redrawArea )
|
void CellWidget::_redraw ( QRect redrawArea )
|
||||||
{
|
{
|
||||||
// cerr << "CellWidget::redraw() - start "
|
// cerr << "CellWidget::redraw() - start "
|
||||||
// << _selectionHasChanged << " filter:"
|
// << _selectionHasChanged << " filter:"
|
||||||
// << _queryFilter << endl;
|
// << _state->getQueryFilter() << endl;
|
||||||
|
|
||||||
// static bool timedout;
|
// static bool timedout;
|
||||||
// static Timer timer;
|
// static Timer timer;
|
||||||
|
@ -1130,7 +1146,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
if ( isDrawable((*iLayer)->getName()) ) {
|
if ( isDrawable((*iLayer)->getName()) ) {
|
||||||
_drawingQuery.setBasicLayer ( *iLayer );
|
_drawingQuery.setBasicLayer ( *iLayer );
|
||||||
_drawingQuery.setFilter ( _queryFilter & ~(Query::DoMasterCells|Query::DoRubbers) );
|
_drawingQuery.setFilter ( getQueryFilter().unset(Query::DoMasterCells|Query::DoRubbers) );
|
||||||
_drawingQuery.doQuery ();
|
_drawingQuery.doQuery ();
|
||||||
}
|
}
|
||||||
if ( _enableRedrawInterrupt ) QApplication::processEvents();
|
if ( _enableRedrawInterrupt ) QApplication::processEvents();
|
||||||
|
@ -1147,7 +1163,7 @@ namespace Hurricane {
|
||||||
_drawingPlanes.setBrush ( Graphics::getBrush("boundaries",getDarkening()) );
|
_drawingPlanes.setBrush ( Graphics::getBrush("boundaries",getDarkening()) );
|
||||||
|
|
||||||
_drawingQuery.setBasicLayer ( NULL );
|
_drawingQuery.setBasicLayer ( NULL );
|
||||||
_drawingQuery.setFilter ( _queryFilter & ~(Query::DoComponents|Query::DoRubbers) );
|
_drawingQuery.setFilter ( getQueryFilter().unset(Query::DoComponents|Query::DoRubbers) );
|
||||||
_drawingQuery.doQuery ();
|
_drawingQuery.doQuery ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1158,7 +1174,7 @@ namespace Hurricane {
|
||||||
_drawingPlanes.setBrush ( Graphics::getBrush("rubber",getDarkening()) );
|
_drawingPlanes.setBrush ( Graphics::getBrush("rubber",getDarkening()) );
|
||||||
|
|
||||||
_drawingQuery.setBasicLayer ( NULL );
|
_drawingQuery.setBasicLayer ( NULL );
|
||||||
_drawingQuery.setFilter ( _queryFilter & ~(Query::DoComponents|Query::DoMasterCells) );
|
_drawingQuery.setFilter ( getQueryFilter().unset(Query::DoComponents|Query::DoMasterCells) );
|
||||||
_drawingQuery.doQuery ();
|
_drawingQuery.doQuery ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1175,7 +1191,7 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//_drawingQuery.setFilter ( _queryFilter & ~Query::DoMasterCells );
|
//_drawingQuery.setFilter ( getQueryFilter() & ~Query::DoMasterCells );
|
||||||
forEach ( ExtensionSlice*, islice, getCell()->getExtensionSlices() ) {
|
forEach ( ExtensionSlice*, islice, getCell()->getExtensionSlices() ) {
|
||||||
if ( _enableRedrawInterrupt ) QApplication::processEvents();
|
if ( _enableRedrawInterrupt ) QApplication::processEvents();
|
||||||
if ( /*timeout("redraw [extension]",timer,10.0,timedout) ||*/ (_redrawManager.interrupted()) ) break;
|
if ( /*timeout("redraw [extension]",timer,10.0,timedout) ||*/ (_redrawManager.interrupted()) ) break;
|
||||||
|
@ -1517,7 +1533,7 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::displayReframe ( bool delayed )
|
void CellWidget::displayReframe ()
|
||||||
{
|
{
|
||||||
_offsetVA.rx() = _stripWidth;
|
_offsetVA.rx() = _stripWidth;
|
||||||
_offsetVA.ry() = _stripWidth;
|
_offsetVA.ry() = _stripWidth;
|
||||||
|
@ -1529,7 +1545,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
_displayArea = Box ( xmin, ymin, xmax, ymax );
|
_displayArea = Box ( xmin, ymin, xmax, ymax );
|
||||||
|
|
||||||
if ( !delayed ) _redrawManager.refresh ();
|
_redrawManager.refresh ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1612,41 +1628,42 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::reframe ( bool delayed )
|
void CellWidget::reframe ()
|
||||||
{
|
{
|
||||||
//cerr << "CellWidget::reframe() - scale:" << _state->getScale()
|
//cerr << "CellWidget::reframe() - scale:" << _state->getScale()
|
||||||
// << " topLeft:" << _state->getTopLeft() << endl;
|
// << " topLeft:" << _state->getTopLeft() << endl;
|
||||||
|
|
||||||
_visibleArea = computeVisibleArea ( _state->getScale(), _state->getTopLeft() );
|
_visibleArea = computeVisibleArea ( _state->getScale(), _state->getTopLeft() );
|
||||||
displayReframe ( delayed );
|
displayReframe ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::reframe ( const Box& box, bool delayed )
|
void CellWidget::reframe ( const Box& box, bool historyEnable )
|
||||||
{
|
{
|
||||||
//cerr << "CellWidget::reframe() - " << box << endl;
|
//cerr << "CellWidget::reframe() - " << box << endl;
|
||||||
//cerr << " widget size := " << _drawingPlanes.width() << "x" << _drawingPlanes.height() << endl;
|
//cerr << " widget size := " << _drawingPlanes.width() << "x" << _drawingPlanes.height() << endl;
|
||||||
|
|
||||||
//cerr << " CellWidget::reframe() - widget size := " << width() << "x" << height() << endl;
|
//cerr << " CellWidget::reframe() - widget size := " << width() << "x" << height() << endl;
|
||||||
|
|
||||||
float scale;
|
bool backupHistoryEnable = _state->getHistoryEnable ();
|
||||||
|
_state->setHistoryEnable ( historyEnable );
|
||||||
_state->setTopLeft ( getTopLeft() );
|
_state->setTopLeft ( getTopLeft() );
|
||||||
|
|
||||||
|
float scale;
|
||||||
_visibleArea = computeVisibleArea ( box, scale );
|
_visibleArea = computeVisibleArea ( box, scale );
|
||||||
_state->setScale ( scale );
|
_state->setScale ( scale );
|
||||||
displayReframe ( delayed );
|
displayReframe ();
|
||||||
|
|
||||||
|
_state->setHistoryEnable ( backupHistoryEnable );
|
||||||
|
|
||||||
//cerr << " _displayArea: " << _displayArea << " (offset: " << _offsetVA.x() << ")" << endl;
|
//cerr << " _displayArea: " << _displayArea << " (offset: " << _offsetVA.x() << ")" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::fitToContents ( bool delayed, bool historyEnable )
|
void CellWidget::fitToContents ( bool historyEnable )
|
||||||
{
|
{
|
||||||
//cerr << "CellWidget::fitToContents()" << endl;
|
//cerr << "CellWidget::fitToContents()" << endl;
|
||||||
|
|
||||||
bool backupHistoryEnable = _state->getHistoryEnable ();
|
|
||||||
_state->setHistoryEnable ( historyEnable );
|
|
||||||
|
|
||||||
Box boundingBox = Box ( DbU::lambda(0)
|
Box boundingBox = Box ( DbU::lambda(0)
|
||||||
, DbU::lambda(0)
|
, DbU::lambda(0)
|
||||||
, DbU::lambda(10)
|
, DbU::lambda(10)
|
||||||
|
@ -1654,9 +1671,26 @@ namespace Hurricane {
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( getCell() ) boundingBox = getCell()->getBoundingBox();
|
if ( getCell() ) boundingBox = getCell()->getBoundingBox();
|
||||||
reframe ( boundingBox, delayed );
|
reframe ( boundingBox, historyEnable );
|
||||||
|
}
|
||||||
|
|
||||||
_state->setHistoryEnable ( backupHistoryEnable );
|
|
||||||
|
void CellWidget::fitToNet ( const Net* net, bool historyEnable )
|
||||||
|
{
|
||||||
|
if ( !net )
|
||||||
|
throw Error ( "<b>CellWidget::fitToNet()</b>: NULL net argument." );
|
||||||
|
|
||||||
|
if ( net->getCell() != getCell() )
|
||||||
|
throw Error ( "<b>CellWidget::fitToNet()</b>:<br>"
|
||||||
|
"Net %s (cell: %s) do not belong to Cell %s"
|
||||||
|
, Graphics::toHtml(getString(net->getName())).c_str()
|
||||||
|
, Graphics::toHtml(getString(net->getCell()->getName())).c_str()
|
||||||
|
, Graphics::toHtml(getString(getCell()->getName())).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
Box boundingBox = net->getBoundingBox ();
|
||||||
|
if ( !boundingBox.isEmpty() )
|
||||||
|
reframe ( boundingBox, historyEnable );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1782,7 +1816,7 @@ namespace Hurricane {
|
||||||
{
|
{
|
||||||
//cerr << "CellWidget::showEvent() - size: " << geometry().width() << "x" << geometry().height() << endl;
|
//cerr << "CellWidget::showEvent() - size: " << geometry().width() << "x" << geometry().height() << endl;
|
||||||
if ( _cellChanged )
|
if ( _cellChanged )
|
||||||
fitToContents ( false, false );
|
fitToContents ( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1963,12 +1997,16 @@ namespace Hurricane {
|
||||||
|
|
||||||
if ( cell == getCell() ) return;
|
if ( cell == getCell() ) return;
|
||||||
|
|
||||||
|
openRefreshSession ();
|
||||||
|
|
||||||
shared_ptr<State> state ( new State(cell) );
|
shared_ptr<State> state ( new State(cell) );
|
||||||
setState ( state );
|
setState ( state );
|
||||||
|
|
||||||
fitToContents ( false, false );
|
fitToContents ( false );
|
||||||
|
|
||||||
_state->setHistoryEnable ( true );
|
_state->setHistoryEnable ( true );
|
||||||
|
|
||||||
|
closeRefreshSession ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1978,6 +2016,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
if ( state == _state ) return;
|
if ( state == _state ) return;
|
||||||
|
|
||||||
|
openRefreshSession ();
|
||||||
|
|
||||||
cellPreModificate ();
|
cellPreModificate ();
|
||||||
_state->getSelection ().clear ();
|
_state->getSelection ().clear ();
|
||||||
_state->setCellWidget ( NULL );
|
_state->setCellWidget ( NULL );
|
||||||
|
@ -1995,15 +2035,20 @@ namespace Hurricane {
|
||||||
_state->setHistoryEnable ( false );
|
_state->setHistoryEnable ( false );
|
||||||
_state->setCellWidget ( this );
|
_state->setCellWidget ( this );
|
||||||
_drawingQuery .setCell ( getCell() );
|
_drawingQuery .setCell ( getCell() );
|
||||||
|
_drawingQuery .setStartLevel ( _state->getStartLevel() );
|
||||||
|
_drawingQuery .setStopLevel ( _state->getStopLevel() );
|
||||||
_textDrawingQuery.setCell ( getCell() );
|
_textDrawingQuery.setCell ( getCell() );
|
||||||
|
|
||||||
reframe ( true );
|
reframe ();
|
||||||
_state->setHistoryEnable ( true );
|
_state->setHistoryEnable ( true );
|
||||||
|
|
||||||
emit cellChanged ( getCell() );
|
emit cellChanged ( getCell() );
|
||||||
emit stateChanged ( _state );
|
emit stateChanged ( _state );
|
||||||
|
emit queryFilterChanged ();
|
||||||
|
|
||||||
cellPostModificate ();
|
cellPostModificate ();
|
||||||
|
|
||||||
|
closeRefreshSession ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2013,12 +2058,16 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::select ( const Net* net, bool delayRedraw )
|
void CellWidget::select ( const Net* net )
|
||||||
{
|
{
|
||||||
++_delaySelectionChanged;
|
++_delaySelectionChanged;
|
||||||
|
|
||||||
if ( !_state->cumulativeSelection() ) unselectAll ( true );
|
if ( !_state->cumulativeSelection() ) {
|
||||||
bool added = _state->getSelection().add ( net, delayRedraw );
|
openRefreshSession ();
|
||||||
|
unselectAll ();
|
||||||
|
closeRefreshSession ();
|
||||||
|
}
|
||||||
|
bool added = _state->getSelection().add ( net );
|
||||||
|
|
||||||
if ( !--_delaySelectionChanged && added ) emit selectionChanged(_selectors,getCell());
|
if ( !--_delaySelectionChanged && added ) emit selectionChanged(_selectors,getCell());
|
||||||
}
|
}
|
||||||
|
@ -2083,18 +2132,22 @@ namespace Hurricane {
|
||||||
{
|
{
|
||||||
++_delaySelectionChanged;
|
++_delaySelectionChanged;
|
||||||
|
|
||||||
if ( !_state->cumulativeSelection() ) unselectAll ( true );
|
if ( !_state->cumulativeSelection() ) {
|
||||||
|
openRefreshSession ();
|
||||||
|
unselectAll ();
|
||||||
|
closeRefreshSession ();
|
||||||
|
}
|
||||||
bool added = _state->getSelection().add ( selectArea );
|
bool added = _state->getSelection().add ( selectArea );
|
||||||
|
|
||||||
if ( !--_delaySelectionChanged && added ) emit selectionChanged(_selectors,getCell());
|
if ( !--_delaySelectionChanged && added ) emit selectionChanged(_selectors,getCell());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::unselect ( const Net* net, bool delayRedraw )
|
void CellWidget::unselect ( const Net* net )
|
||||||
{
|
{
|
||||||
++_delaySelectionChanged;
|
++_delaySelectionChanged;
|
||||||
|
|
||||||
bool removed = _state->getSelection().remove ( net, delayRedraw );
|
bool removed = _state->getSelection().remove ( net );
|
||||||
if ( !--_delaySelectionChanged && removed ) emit selectionChanged(_selectors,getCell());
|
if ( !--_delaySelectionChanged && removed ) emit selectionChanged(_selectors,getCell());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2121,12 +2174,12 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::unselectAll ( bool delayRedraw )
|
void CellWidget::unselectAll ()
|
||||||
{
|
{
|
||||||
++_delaySelectionChanged;
|
++_delaySelectionChanged;
|
||||||
|
|
||||||
_state->getSelection().clear ();
|
_state->getSelection().clear ();
|
||||||
_unselectAll ( delayRedraw );
|
_unselectAll ();
|
||||||
|
|
||||||
if ( !--_delaySelectionChanged ) emit selectionChanged(_selectors,getCell());
|
if ( !--_delaySelectionChanged ) emit selectionChanged(_selectors,getCell());
|
||||||
}
|
}
|
||||||
|
@ -2159,7 +2212,7 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::_select ( const Net* net, bool delayRedraw )
|
void CellWidget::_select ( const Net* net )
|
||||||
{
|
{
|
||||||
select ( Occurrence(net) );
|
select ( Occurrence(net) );
|
||||||
forEach ( Component*, component, net->getComponents() ) {
|
forEach ( Component*, component, net->getComponents() ) {
|
||||||
|
@ -2170,11 +2223,11 @@ namespace Hurricane {
|
||||||
Occurrence occurrence ( *rubber );
|
Occurrence occurrence ( *rubber );
|
||||||
select ( occurrence );
|
select ( occurrence );
|
||||||
}
|
}
|
||||||
if ( !delayRedraw && _state->showSelection() ) _redrawManager.refresh ();
|
if ( _state->showSelection() ) _redrawManager.refresh ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::_unselect ( const Net* net, bool delayRedraw )
|
void CellWidget::_unselect ( const Net* net )
|
||||||
{
|
{
|
||||||
unselect ( Occurrence(net) );
|
unselect ( Occurrence(net) );
|
||||||
forEach ( Component*, component, net->getComponents() ) {
|
forEach ( Component*, component, net->getComponents() ) {
|
||||||
|
@ -2185,7 +2238,7 @@ namespace Hurricane {
|
||||||
Occurrence occurrence ( *rubber );
|
Occurrence occurrence ( *rubber );
|
||||||
unselect ( occurrence );
|
unselect ( occurrence );
|
||||||
}
|
}
|
||||||
if ( !delayRedraw && _state->showSelection() ) _redrawManager.refresh ();
|
if ( _state->showSelection() ) _redrawManager.refresh ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2196,28 +2249,32 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::_unselectAll ( bool delayRedraw )
|
void CellWidget::_unselectAll ()
|
||||||
{
|
{
|
||||||
SelectorSet::iterator iselector;
|
SelectorSet::iterator iselector;
|
||||||
while ( !_selectors.empty() )
|
while ( !_selectors.empty() )
|
||||||
(*_selectors.begin())->detachFrom ( this );
|
(*_selectors.begin())->detachFrom ( this );
|
||||||
|
|
||||||
if ( !_selectionHasChanged ) _selectionHasChanged = true;
|
if ( !_selectionHasChanged ) _selectionHasChanged = true;
|
||||||
if ( !delayRedraw && _state->showSelection() ) _redrawManager.refresh ();
|
if ( _state->showSelection() ) _redrawManager.refresh ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::cellPreModificate ()
|
void CellWidget::cellPreModificate ()
|
||||||
{
|
{
|
||||||
_unselectAll ( true );
|
openRefreshSession ();
|
||||||
|
_unselectAll ();
|
||||||
|
|
||||||
emit selectionChanged(_selectors,getCell());
|
emit selectionChanged(_selectors,getCell());
|
||||||
emit cellPreModificated ();
|
emit cellPreModificated ();
|
||||||
|
|
||||||
|
closeRefreshSession ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::cellPostModificate ()
|
void CellWidget::cellPostModificate ()
|
||||||
{
|
{
|
||||||
|
openRefreshSession ();
|
||||||
_cellModificated = true;
|
_cellModificated = true;
|
||||||
|
|
||||||
++_delaySelectionChanged;
|
++_delaySelectionChanged;
|
||||||
|
@ -2229,6 +2286,8 @@ namespace Hurricane {
|
||||||
--_delaySelectionChanged;
|
--_delaySelectionChanged;
|
||||||
emit selectionChanged(_selectors,getCell());
|
emit selectionChanged(_selectors,getCell());
|
||||||
emit cellPostModificated ();
|
emit cellPostModificated ();
|
||||||
|
|
||||||
|
closeRefreshSession ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -221,8 +221,11 @@ namespace Hurricane {
|
||||||
{
|
{
|
||||||
if ( state && getCellWidget() && _syncNetlist->isChecked() ) {
|
if ( state && getCellWidget() && _syncNetlist->isChecked() ) {
|
||||||
_cwCumulativeSelection = getCellWidget()->cumulativeSelection();
|
_cwCumulativeSelection = getCellWidget()->cumulativeSelection();
|
||||||
if ( !_cwCumulativeSelection )
|
if ( !_cwCumulativeSelection ) {
|
||||||
getCellWidget()->unselectAll ( true );
|
getCellWidget()->openRefreshSession ();
|
||||||
|
getCellWidget()->unselectAll ();
|
||||||
|
getCellWidget()->closeRefreshSession ();
|
||||||
|
}
|
||||||
getCellWidget()->setCumulativeSelection ( true );
|
getCellWidget()->setCumulativeSelection ( true );
|
||||||
getCellWidget()->setShowSelection ( true );
|
getCellWidget()->setShowSelection ( true );
|
||||||
connect ( _netlistBrowser, SIGNAL(netSelected (const Net*)), getCellWidget(), SLOT(select (const Net*)) );
|
connect ( _netlistBrowser, SIGNAL(netSelected (const Net*)), getCellWidget(), SLOT(select (const Net*)) );
|
||||||
|
@ -247,7 +250,13 @@ namespace Hurricane {
|
||||||
if ( getCellWidget() != cellWidget ) {
|
if ( getCellWidget() != cellWidget ) {
|
||||||
ControllerTab::setCellWidget ( cellWidget );
|
ControllerTab::setCellWidget ( cellWidget );
|
||||||
if ( getCellWidget() ) {
|
if ( getCellWidget() ) {
|
||||||
|
connect ( _netlistBrowser, SIGNAL(refreshSessionOpened())
|
||||||
|
, getCellWidget(), SLOT (openRefreshSession()) );
|
||||||
|
connect ( _netlistBrowser, SIGNAL(refreshSessionClosed())
|
||||||
|
, getCellWidget(), SLOT (closeRefreshSession()) );
|
||||||
connect ( getCellWidget(), SIGNAL(cellChanged(Cell*)), this, SLOT(setCell(Cell*)) );
|
connect ( getCellWidget(), SIGNAL(cellChanged(Cell*)), this, SLOT(setCell(Cell*)) );
|
||||||
|
connect ( _netlistBrowser, SIGNAL(netFitted(const Net*))
|
||||||
|
, getCellWidget(), SLOT (fitToNet (const Net*)) );
|
||||||
}
|
}
|
||||||
setSyncNetlist ( _syncNetlist->isChecked() );
|
setSyncNetlist ( _syncNetlist->isChecked() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -55,8 +55,7 @@ namespace Hurricane {
|
||||||
, _steiner (new QRadioButton())
|
, _steiner (new QRadioButton())
|
||||||
, _centric (new QRadioButton())
|
, _centric (new QRadioButton())
|
||||||
, _barycentric (new QRadioButton())
|
, _barycentric (new QRadioButton())
|
||||||
, _queryFilter (Query::DoAll)
|
, _updateState (External)
|
||||||
, _signalEmitter (false)
|
|
||||||
{
|
{
|
||||||
setAttribute ( Qt::WA_QuitOnClose, false );
|
setAttribute ( Qt::WA_QuitOnClose, false );
|
||||||
setWindowTitle ( tr("Display Filter") );
|
setWindowTitle ( tr("Display Filter") );
|
||||||
|
@ -152,55 +151,79 @@ namespace Hurricane {
|
||||||
void DisplayFilterWidget::setCellWidget ( CellWidget* cw )
|
void DisplayFilterWidget::setCellWidget ( CellWidget* cw )
|
||||||
{
|
{
|
||||||
if ( !cw ) {
|
if ( !cw ) {
|
||||||
if ( _cellWidget )
|
if ( _cellWidget ) {
|
||||||
disconnect ( _cellWidget, SLOT(refresh()) );
|
disconnect ( this , SIGNAL(queryFilterChanged()), _cellWidget, SLOT(changeQueryFilter()) );
|
||||||
|
disconnect ( _cellWidget , SIGNAL(queryFilterChanged()), this , SLOT(changeQueryFilter()) );
|
||||||
|
}
|
||||||
_cellWidget = NULL;
|
_cellWidget = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_cellWidget = cw;
|
_cellWidget = cw;
|
||||||
connect ( this , SIGNAL(filterChanged()) , _cellWidget, SLOT(refresh()) );
|
connect ( this , SIGNAL(queryFilterChanged()), _cellWidget, SLOT(changeQueryFilter()) );
|
||||||
connect ( _cellWidget , SIGNAL(settingsChanged()), this , SLOT(syncFromCellWidget()) );
|
connect ( _cellWidget , SIGNAL(queryFilterChanged()), this , SLOT(changeQueryFilter()) );
|
||||||
connect ( _steiner , SIGNAL(clicked()) , this , SLOT(setRubberSteiner()) );
|
connect ( _steiner , SIGNAL(clicked()) , this , SLOT(setRubberSteiner()) );
|
||||||
connect ( _centric , SIGNAL(clicked()) , this , SLOT(setRubberCentric()) );
|
connect ( _centric , SIGNAL(clicked()) , this , SLOT(setRubberCentric()) );
|
||||||
connect ( _barycentric, SIGNAL(clicked()) , this , SLOT(setRubberBarycentric()) );
|
connect ( _barycentric, SIGNAL(clicked()) , this , SLOT(setRubberBarycentric()) );
|
||||||
|
|
||||||
_signalEmitter = false;
|
_updateState = External;
|
||||||
syncFromCellWidget ();
|
changeQueryFilter ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DisplayFilterWidget::syncFromCellWidget ()
|
void DisplayFilterWidget::changeQueryFilter()
|
||||||
{
|
{
|
||||||
if ( !_cellWidget ) return;
|
if ( !_cellWidget ) return;
|
||||||
if ( _signalEmitter ) {
|
|
||||||
_signalEmitter = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_doMasterCells ->setChecked ( _cellWidget->getQueryFilter() & Query::DoMasterCells );
|
if ( _updateState == InternalEmit ) {
|
||||||
_doTerminalCells->setChecked ( _cellWidget->getQueryFilter() & Query::DoTerminalCells );
|
_updateState = InternalReceive;
|
||||||
_doComponents ->setChecked ( _cellWidget->getQueryFilter() & Query::DoComponents );
|
emit queryFilterChanged ();
|
||||||
|
} else {
|
||||||
|
if ( _updateState == External ) {
|
||||||
|
blockAllSignals ( true );
|
||||||
|
|
||||||
|
_startSpinBox->setValue ( _cellWidget->getStartLevel() );
|
||||||
|
_stopSpinBox ->setValue ( _cellWidget->getStopLevel() );
|
||||||
|
|
||||||
|
_doMasterCells ->setChecked ( _cellWidget->getQueryFilter().isSet(Query::DoMasterCells ) );
|
||||||
|
_doTerminalCells->setChecked ( _cellWidget->getQueryFilter().isSet(Query::DoTerminalCells) );
|
||||||
|
_doComponents ->setChecked ( _cellWidget->getQueryFilter().isSet(Query::DoComponents ) );
|
||||||
|
|
||||||
switch ( _cellWidget->getRubberShape() ) {
|
switch ( _cellWidget->getRubberShape() ) {
|
||||||
case CellWidget::Steiner: _steiner->setChecked(true); break;
|
case CellWidget::Steiner: _steiner->setChecked(true); break;
|
||||||
case CellWidget::Centric: _centric->setChecked(true); break;
|
case CellWidget::Centric: _centric->setChecked(true); break;
|
||||||
case CellWidget::Barycentric: _barycentric->setChecked(true); break;
|
case CellWidget::Barycentric: _barycentric->setChecked(true); break;
|
||||||
}
|
}
|
||||||
_signalEmitter = false;
|
blockAllSignals ( false );
|
||||||
|
}
|
||||||
|
_updateState = External;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DisplayFilterWidget::blockAllSignals ( bool state )
|
||||||
|
{
|
||||||
|
_startSpinBox ->blockSignals ( state );
|
||||||
|
_stopSpinBox ->blockSignals ( state );
|
||||||
|
_doMasterCells ->blockSignals ( state );
|
||||||
|
_doTerminalCells->blockSignals ( state );
|
||||||
|
_doComponents ->blockSignals ( state );
|
||||||
|
_steiner ->blockSignals ( state );
|
||||||
|
_centric ->blockSignals ( state );
|
||||||
|
_barycentric ->blockSignals ( state );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DisplayFilterWidget::startLevelChanged ( int level )
|
void DisplayFilterWidget::startLevelChanged ( int level )
|
||||||
{
|
{
|
||||||
if ( _cellWidget ) {
|
if ( _cellWidget ) {
|
||||||
_cellWidget->setStartLevel ( level );
|
|
||||||
if ( _stopSpinBox->value() < level ) {
|
if ( _stopSpinBox->value() < level ) {
|
||||||
|
_stopSpinBox->blockSignals ( true );
|
||||||
_stopSpinBox->setValue ( level );
|
_stopSpinBox->setValue ( level );
|
||||||
return;
|
_stopSpinBox->blockSignals ( false );
|
||||||
}
|
}
|
||||||
_signalEmitter = true;
|
_updateState = InternalEmit;
|
||||||
emit filterChanged();
|
_cellWidget->setStartLevel ( level );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,59 +231,66 @@ namespace Hurricane {
|
||||||
void DisplayFilterWidget::stopLevelChanged ( int level )
|
void DisplayFilterWidget::stopLevelChanged ( int level )
|
||||||
{
|
{
|
||||||
if ( _cellWidget ) {
|
if ( _cellWidget ) {
|
||||||
_cellWidget->setStopLevel ( level );
|
|
||||||
if ( _startSpinBox->value() > level ) {
|
if ( _startSpinBox->value() > level ) {
|
||||||
|
_startSpinBox->blockSignals ( true );
|
||||||
_startSpinBox->setValue ( level );
|
_startSpinBox->setValue ( level );
|
||||||
return;
|
_startSpinBox->blockSignals ( false );
|
||||||
}
|
}
|
||||||
_signalEmitter = true;
|
_updateState = InternalEmit;
|
||||||
emit filterChanged();
|
_cellWidget->setStopLevel ( level );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DisplayFilterWidget::setDoMasterCells ( int state )
|
void DisplayFilterWidget::setDoMasterCells ( int state )
|
||||||
{
|
{
|
||||||
if ( state != Qt::Unchecked ) _queryFilter |= Query::DoMasterCells;
|
if ( _cellWidget ) {
|
||||||
else _queryFilter &= ~Query::DoMasterCells;
|
_updateState = InternalEmit;
|
||||||
|
Query::Mask queryFilter = _cellWidget->getQueryFilter();
|
||||||
|
|
||||||
_cellWidget->setQueryFilter ( _queryFilter );
|
if ( state != Qt::Unchecked ) queryFilter.set ( Query::DoMasterCells );
|
||||||
|
else queryFilter.unset ( Query::DoMasterCells );
|
||||||
|
|
||||||
_signalEmitter = true;
|
_cellWidget->setQueryFilter ( queryFilter );
|
||||||
emit filterChanged();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DisplayFilterWidget::setDoTerminalCells ( int state )
|
void DisplayFilterWidget::setDoTerminalCells ( int state )
|
||||||
{
|
{
|
||||||
if ( state != Qt::Unchecked ) _queryFilter |= Query::DoTerminalCells;
|
if ( _cellWidget ) {
|
||||||
else _queryFilter &= ~Query::DoTerminalCells;
|
_updateState = InternalEmit;
|
||||||
|
Query::Mask queryFilter = _cellWidget->getQueryFilter();
|
||||||
|
|
||||||
_cellWidget->setQueryFilter ( _queryFilter );
|
if ( state != Qt::Unchecked ) queryFilter.set ( Query::DoTerminalCells );
|
||||||
|
else queryFilter.unset ( Query::DoTerminalCells );
|
||||||
|
|
||||||
_signalEmitter = true;
|
_cellWidget->setQueryFilter ( queryFilter );
|
||||||
emit filterChanged();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DisplayFilterWidget::setDoComponents ( int state )
|
void DisplayFilterWidget::setDoComponents ( int state )
|
||||||
{
|
{
|
||||||
if ( state != Qt::Unchecked ) _queryFilter |= Query::DoComponents;
|
if ( _cellWidget ) {
|
||||||
else _queryFilter &= ~Query::DoComponents;
|
_updateState = InternalEmit;
|
||||||
|
Query::Mask queryFilter = _cellWidget->getQueryFilter();
|
||||||
|
|
||||||
_cellWidget->setQueryFilter ( _queryFilter );
|
if ( state != Qt::Unchecked ) queryFilter.set ( Query::DoComponents );
|
||||||
|
else queryFilter.unset ( Query::DoComponents );
|
||||||
|
|
||||||
_signalEmitter = true;
|
_cellWidget->setQueryFilter ( queryFilter );
|
||||||
emit filterChanged();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DisplayFilterWidget::setRubberSteiner ()
|
void DisplayFilterWidget::setRubberSteiner ()
|
||||||
{
|
{
|
||||||
if ( _cellWidget ) {
|
if ( _cellWidget ) {
|
||||||
if ( _cellWidget->getRubberShape() != CellWidget::Steiner )
|
if ( _cellWidget->getRubberShape() != CellWidget::Steiner ) {
|
||||||
|
_updateState = InternalEmit;
|
||||||
_cellWidget->setRubberShape ( CellWidget::Steiner );
|
_cellWidget->setRubberShape ( CellWidget::Steiner );
|
||||||
//emit filterChanged();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,9 +298,10 @@ namespace Hurricane {
|
||||||
void DisplayFilterWidget::setRubberCentric ()
|
void DisplayFilterWidget::setRubberCentric ()
|
||||||
{
|
{
|
||||||
if ( _cellWidget ) {
|
if ( _cellWidget ) {
|
||||||
if ( _cellWidget->getRubberShape() != CellWidget::Centric )
|
if ( _cellWidget->getRubberShape() != CellWidget::Centric ) {
|
||||||
|
_updateState = InternalEmit;
|
||||||
_cellWidget->setRubberShape ( CellWidget::Centric );
|
_cellWidget->setRubberShape ( CellWidget::Centric );
|
||||||
//emit filterChanged();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,9 +309,10 @@ namespace Hurricane {
|
||||||
void DisplayFilterWidget::setRubberBarycentric ()
|
void DisplayFilterWidget::setRubberBarycentric ()
|
||||||
{
|
{
|
||||||
if ( _cellWidget ) {
|
if ( _cellWidget ) {
|
||||||
if ( _cellWidget->getRubberShape() != CellWidget::Barycentric )
|
if ( _cellWidget->getRubberShape() != CellWidget::Barycentric ) {
|
||||||
|
_updateState = InternalEmit;
|
||||||
_cellWidget->setRubberShape ( CellWidget::Barycentric );
|
_cellWidget->setRubberShape ( CellWidget::Barycentric );
|
||||||
//emit filterChanged();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,12 +65,12 @@ namespace Hurricane {
|
||||||
Box pointBox ( widget->screenToDbuBox(QRect(position,QSize(1,1))) );
|
Box pointBox ( widget->screenToDbuBox(QRect(position,QSize(1,1))) );
|
||||||
|
|
||||||
switch ( event->key() ) {
|
switch ( event->key() ) {
|
||||||
case Qt::Key_U:
|
case Qt::Key_Up:
|
||||||
if ( ( _historyIndex > 0 ) && (shift || control) ) {
|
if ( ( _historyIndex > 0 ) && (shift || control) ) {
|
||||||
widget->setState ( _history[--_historyIndex]._state );
|
widget->setState ( _history[--_historyIndex]._state );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Qt::Key_D:
|
case Qt::Key_Down:
|
||||||
{
|
{
|
||||||
if ( control ) {
|
if ( control ) {
|
||||||
if ( _history.empty() )
|
if ( _history.empty() )
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -177,6 +177,7 @@ namespace Hurricane {
|
||||||
_view->setAlternatingRowColors(true);
|
_view->setAlternatingRowColors(true);
|
||||||
_view->setSelectionBehavior(QAbstractItemView::SelectRows);
|
_view->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
_view->setSortingEnabled(true);
|
_view->setSortingEnabled(true);
|
||||||
|
_view->installEventFilter(this);
|
||||||
|
|
||||||
QHeaderView* horizontalHeader = _view->horizontalHeader ();
|
QHeaderView* horizontalHeader = _view->horizontalHeader ();
|
||||||
horizontalHeader->setStretchLastSection ( true );
|
horizontalHeader->setStretchLastSection ( true );
|
||||||
|
@ -302,9 +303,12 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InspectorWidget::keyPressEvent ( QKeyEvent *event )
|
bool InspectorWidget::eventFilter ( QObject* object, QEvent* event )
|
||||||
{
|
{
|
||||||
if ( event->key() == Qt::Key_Right ) {
|
if ( event->type() == QEvent::KeyPress ) {
|
||||||
|
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
||||||
|
|
||||||
|
if ( keyEvent->key() == Qt::Key_Right ) {
|
||||||
QModelIndex index = _view->currentIndex();
|
QModelIndex index = _view->currentIndex();
|
||||||
if ( index.isValid() ) {
|
if ( index.isValid() ) {
|
||||||
Slot* slot = _baseModel->getRecord()->getSlot(_sortModel->mapToSource(index).row());
|
Slot* slot = _baseModel->getRecord()->getSlot(_sortModel->mapToSource(index).row());
|
||||||
|
@ -312,15 +316,16 @@ namespace Hurricane {
|
||||||
if ( slot )
|
if ( slot )
|
||||||
pushSlot ( slot );
|
pushSlot ( slot );
|
||||||
}
|
}
|
||||||
} else if ( event->key() == Qt::Key_Left ) {
|
} else if ( keyEvent->key() == Qt::Key_Left ) {
|
||||||
back ();
|
back ();
|
||||||
} else if ( event->key() == Qt::Key_O ) {
|
} else if ( keyEvent->key() == Qt::Key_O ) {
|
||||||
forkInspector ( _view->currentIndex() );
|
forkInspector ( _view->currentIndex() );
|
||||||
} else {
|
|
||||||
QWidget::keyPressEvent ( event );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return QObject::eventFilter ( object, event );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void InspectorWidget::textFilterChanged ()
|
void InspectorWidget::textFilterChanged ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -51,6 +51,9 @@ namespace Hurricane {
|
||||||
|
|
||||||
bool MoveCommand::keyPressEvent ( CellWidget* widget, QKeyEvent* event )
|
bool MoveCommand::keyPressEvent ( CellWidget* widget, QKeyEvent* event )
|
||||||
{
|
{
|
||||||
|
if ( event->modifiers() & (Qt::ControlModifier|Qt::ShiftModifier) )
|
||||||
|
return false;
|
||||||
|
|
||||||
switch ( event->key() ) {
|
switch ( event->key() ) {
|
||||||
case Qt::Key_Up: widget->goUp (); return true;
|
case Qt::Key_Up: widget->goUp (); return true;
|
||||||
case Qt::Key_Down: widget->goDown (); return true;
|
case Qt::Key_Down: widget->goDown (); return true;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -29,6 +29,7 @@
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
#include "hurricane/Commons.h"
|
#include "hurricane/Commons.h"
|
||||||
#include "hurricane/Net.h"
|
#include "hurricane/Net.h"
|
||||||
|
@ -61,6 +62,7 @@ namespace Hurricane {
|
||||||
{
|
{
|
||||||
setAttribute ( Qt::WA_DeleteOnClose );
|
setAttribute ( Qt::WA_DeleteOnClose );
|
||||||
setAttribute ( Qt::WA_QuitOnClose, false );
|
setAttribute ( Qt::WA_QuitOnClose, false );
|
||||||
|
setContextMenuPolicy ( Qt::ActionsContextMenu );
|
||||||
|
|
||||||
_rowHeight = QFontMetrics(Graphics::getFixedFont()).height() + 4;
|
_rowHeight = QFontMetrics(Graphics::getFixedFont()).height() + 4;
|
||||||
|
|
||||||
|
@ -93,11 +95,17 @@ namespace Hurricane {
|
||||||
|
|
||||||
setLayout ( gLayout );
|
setLayout ( gLayout );
|
||||||
|
|
||||||
|
QAction* fitAction = new QAction ( tr("&Fit to Net"), this );
|
||||||
|
fitAction->setShortcut ( QKeySequence(tr("CTRL+F")) );
|
||||||
|
fitAction->setStatusTip ( tr("Fit the view to the Net's bounding box") );
|
||||||
|
addAction ( fitAction );
|
||||||
|
|
||||||
connect ( _filterPatternLineEdit , SIGNAL(textChanged(const QString &))
|
connect ( _filterPatternLineEdit , SIGNAL(textChanged(const QString &))
|
||||||
, this , SLOT (textFilterChanged()) );
|
, this , SLOT (textFilterChanged()) );
|
||||||
connect ( _view->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&))
|
connect ( _view->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&))
|
||||||
, this , SLOT (updateSelecteds (const QItemSelection&,const QItemSelection&)) );
|
, this , SLOT (updateSelecteds (const QItemSelection&,const QItemSelection&)) );
|
||||||
connect ( _baseModel, SIGNAL(layoutChanged()), this, SLOT(forceRowHeight()) );
|
connect ( _baseModel, SIGNAL(layoutChanged()), this, SLOT(forceRowHeight()) );
|
||||||
|
connect ( fitAction , SIGNAL(triggered ()), this, SLOT(fitToNet ()) );
|
||||||
|
|
||||||
resize(300, 300);
|
resize(300, 300);
|
||||||
}
|
}
|
||||||
|
@ -123,10 +131,12 @@ namespace Hurricane {
|
||||||
|
|
||||||
void NetlistWidget::updateSelecteds ( const QItemSelection& , const QItemSelection& )
|
void NetlistWidget::updateSelecteds ( const QItemSelection& , const QItemSelection& )
|
||||||
{
|
{
|
||||||
const Net* net;
|
cerr << "open refresh session" << endl;
|
||||||
|
emit refreshSessionOpened ();
|
||||||
|
|
||||||
_selecteds.resetAccesses ();
|
_selecteds.resetAccesses ();
|
||||||
|
|
||||||
|
const Net* net;
|
||||||
QModelIndexList iList = _view->selectionModel()->selectedRows();
|
QModelIndexList iList = _view->selectionModel()->selectedRows();
|
||||||
for ( int i=0 ; i<iList.size() ; i++ ) {
|
for ( int i=0 ; i<iList.size() ; i++ ) {
|
||||||
net = _baseModel->getNet ( _sortModel->mapToSource(iList[i]).row() );
|
net = _baseModel->getNet ( _sortModel->mapToSource(iList[i]).row() );
|
||||||
|
@ -154,12 +164,9 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
++isel;
|
++isel;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
emit refreshSessionClosed ();
|
||||||
void NetlistWidget::keyPressEvent ( QKeyEvent* event )
|
cerr << "close refresh session" << endl;
|
||||||
{
|
|
||||||
QWidget::keyPressEvent ( event );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,4 +177,12 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void NetlistWidget::fitToNet ()
|
||||||
|
{
|
||||||
|
const Net* net = _baseModel->getNet ( _sortModel->mapToSource(_view->currentIndex()).row() );
|
||||||
|
|
||||||
|
if ( net ) emit netFitted ( net );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
|
@ -98,6 +98,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
void SelectionPopup::keyPressEvent ( QKeyEvent* event )
|
void SelectionPopup::keyPressEvent ( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
|
cerr << "SelectionPopup::keyPressEvent()" << endl;
|
||||||
|
|
||||||
QWidget::keyPressEvent ( event );
|
QWidget::keyPressEvent ( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,7 @@ namespace Hurricane {
|
||||||
_view->setSortingEnabled(true);
|
_view->setSortingEnabled(true);
|
||||||
_view->setModel ( _sortModel );
|
_view->setModel ( _sortModel );
|
||||||
_view->horizontalHeader()->setStretchLastSection ( true );
|
_view->horizontalHeader()->setStretchLastSection ( true );
|
||||||
|
_view->installEventFilter(this);
|
||||||
|
|
||||||
QHeaderView* horizontalHeader = _view->horizontalHeader ();
|
QHeaderView* horizontalHeader = _view->horizontalHeader ();
|
||||||
horizontalHeader->setStretchLastSection ( true );
|
horizontalHeader->setStretchLastSection ( true );
|
||||||
|
@ -144,11 +145,16 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SelectionWidget::keyPressEvent ( QKeyEvent* event )
|
bool SelectionWidget::eventFilter ( QObject* object, QEvent* event )
|
||||||
{
|
{
|
||||||
if ( event->key() == Qt::Key_I ) { inspect ( _view->currentIndex() ); }
|
if ( event->type() == QEvent::KeyPress ) {
|
||||||
else if ( event->key() == Qt::Key_T ) { toggleSelection ( _view->currentIndex() ); }
|
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
||||||
else QWidget::keyPressEvent ( event );
|
|
||||||
|
if ( keyEvent->key() == Qt::Key_I ) { inspect ( _view->currentIndex() ); }
|
||||||
|
else if ( keyEvent->key() == Qt::Key_T ) { toggleSelection ( _view->currentIndex() ); }
|
||||||
|
}
|
||||||
|
|
||||||
|
return QObject::eventFilter ( object, event );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace Hurricane {
|
||||||
{ return NULL; }
|
{ return NULL; }
|
||||||
|
|
||||||
|
|
||||||
void SelectorCriterion::undoSelection ( CellWidget* cw, bool delayRedraw )
|
void SelectorCriterion::undoSelection ( CellWidget* cw )
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,15 +72,15 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void NetSelectorCriterion::doSelection ( CellWidget* cw, bool delayRedraw )
|
void NetSelectorCriterion::doSelection ( CellWidget* cw )
|
||||||
{
|
{
|
||||||
cw->_select ( _net, delayRedraw );
|
cw->_select ( _net );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void NetSelectorCriterion::undoSelection ( CellWidget* cw, bool delayRedraw )
|
void NetSelectorCriterion::undoSelection ( CellWidget* cw )
|
||||||
{
|
{
|
||||||
cw->_unselect ( _net, delayRedraw );
|
cw->_unselect ( _net );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ namespace Hurricane {
|
||||||
{ return true; }
|
{ return true; }
|
||||||
|
|
||||||
|
|
||||||
void AreaSelectorCriterion::doSelection ( CellWidget* cw, bool delayRedraw )
|
void AreaSelectorCriterion::doSelection ( CellWidget* cw )
|
||||||
{
|
{
|
||||||
cw->_selectOccurrencesUnder ( _area );
|
cw->_selectOccurrencesUnder ( _area );
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,11 +59,17 @@ namespace Hurricane {
|
||||||
|
|
||||||
bool ZoomCommand::keyPressEvent ( CellWidget* widget, QKeyEvent* event )
|
bool ZoomCommand::keyPressEvent ( CellWidget* widget, QKeyEvent* event )
|
||||||
{
|
{
|
||||||
|
bool control = (event->modifiers() & Qt::ControlModifier);
|
||||||
|
|
||||||
switch ( event->key() ) {
|
switch ( event->key() ) {
|
||||||
case Qt::Key_Z: widget->setScale ( widget->getScale()*2.0 ); return true;
|
case Qt::Key_Z:
|
||||||
case Qt::Key_M: widget->setScale ( widget->getScale()/2.0 ); return true;
|
if ( control ) widget->scaleHistoryDown();
|
||||||
case Qt::Key_U: widget->scaleHistoryUp (); return true;
|
else widget->setScale ( widget->getScale()*2.0 );
|
||||||
case Qt::Key_D: widget->scaleHistoryDown(); return true;
|
return true;
|
||||||
|
case Qt::Key_M:
|
||||||
|
if ( control ) widget->scaleHistoryUp ();
|
||||||
|
else widget->setScale ( widget->getScale()/2.0 );
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -91,12 +97,13 @@ namespace Hurricane {
|
||||||
setDrawingEnabled ( false );
|
setDrawingEnabled ( false );
|
||||||
|
|
||||||
QRect zoomArea = QRect ( _startPoint, _stopPoint );
|
QRect zoomArea = QRect ( _startPoint, _stopPoint );
|
||||||
if ( ( abs(zoomArea.width()) > 10 ) && ( abs(zoomArea.height()) > 10 ) )
|
if ( ( abs(zoomArea.width ()) > getDrawingThreshold() )
|
||||||
|
&& ( abs(zoomArea.height()) > getDrawingThreshold() ) )
|
||||||
widget->reframe ( widget->screenToDbuBox(zoomArea) );
|
widget->reframe ( widget->screenToDbuBox(zoomArea) );
|
||||||
else {
|
//else {
|
||||||
cerr << Warning("Rejecting too small zoom request.") << endl;
|
// cerr << Warning("Rejecting too small zoom request.") << endl;
|
||||||
widget->update ();
|
// widget->update ();
|
||||||
}
|
//}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,9 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Project.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
// Universite Pierre et Marie Curie
|
|
||||||
//
|
//
|
||||||
// Main contributors :
|
|
||||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
|
||||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
|
||||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
|
||||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
|
||||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
|
||||||
// Christian Masson <Christian.Masson@lip6.fr>
|
|
||||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
|
||||||
//
|
|
||||||
// The Coriolis Project is free software; you can redistribute it
|
|
||||||
// and/or modify it under the terms of the GNU General Public License
|
|
||||||
// as published by the Free Software Foundation; either version 2 of
|
|
||||||
// the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// The Coriolis Project is distributed in the hope that it will be
|
|
||||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
||||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with the Coriolis Project; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
// USA
|
|
||||||
//
|
|
||||||
// License-Tag
|
|
||||||
// Authors-Tag
|
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
// $Id$
|
// $Id$
|
||||||
|
@ -50,8 +23,8 @@
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
#ifndef __HURRICANE_AREA_COMMAND_H__
|
#ifndef __HURRICANE_AREA_COMMAND__
|
||||||
#define __HURRICANE_AREA_COMMAND_H__
|
#define __HURRICANE_AREA_COMMAND__
|
||||||
|
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
|
||||||
|
@ -68,14 +41,17 @@ namespace Hurricane {
|
||||||
inline void setStartPoint ( const QPoint& start );
|
inline void setStartPoint ( const QPoint& start );
|
||||||
inline void setStopPoint ( const QPoint& stop );
|
inline void setStopPoint ( const QPoint& stop );
|
||||||
inline void setDrawingEnabled ( bool state );
|
inline void setDrawingEnabled ( bool state );
|
||||||
|
inline void setDrawingThreshold ( int );
|
||||||
virtual void draw ( CellWidget* widget );
|
virtual void draw ( CellWidget* widget );
|
||||||
virtual void drawCorner ( CellWidget* widget, bool bottomLeft );
|
virtual void drawCorner ( CellWidget* widget, bool bottomLeft );
|
||||||
virtual bool mouseMoveEvent ( CellWidget* widget, QMouseEvent* event );
|
virtual bool mouseMoveEvent ( CellWidget* widget, QMouseEvent* event );
|
||||||
inline bool isDrawingEnabled () const;
|
inline bool isDrawingEnabled () const;
|
||||||
|
inline int getDrawingThreshold () const;
|
||||||
protected:
|
protected:
|
||||||
QPoint _startPoint;
|
QPoint _startPoint;
|
||||||
QPoint _stopPoint;
|
QPoint _stopPoint;
|
||||||
QPoint _cornerPoints[3];
|
QPoint _cornerPoints[3];
|
||||||
|
int _drawingThreshold;
|
||||||
bool _drawingEnabled;
|
bool _drawingEnabled;
|
||||||
private:
|
private:
|
||||||
AreaCommand ( const AreaCommand& );
|
AreaCommand ( const AreaCommand& );
|
||||||
|
@ -95,10 +71,18 @@ namespace Hurricane {
|
||||||
{ _drawingEnabled = state; }
|
{ _drawingEnabled = state; }
|
||||||
|
|
||||||
|
|
||||||
|
inline void AreaCommand::setDrawingThreshold ( int threshold )
|
||||||
|
{ _drawingThreshold = threshold; }
|
||||||
|
|
||||||
|
|
||||||
inline bool AreaCommand::isDrawingEnabled () const
|
inline bool AreaCommand::isDrawingEnabled () const
|
||||||
{ return _drawingEnabled; }
|
{ return _drawingEnabled; }
|
||||||
|
|
||||||
|
|
||||||
|
inline int AreaCommand::getDrawingThreshold () const
|
||||||
|
{ return _drawingThreshold; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,13 @@ namespace Hurricane {
|
||||||
inline Cell* getCell () const;
|
inline Cell* getCell () const;
|
||||||
inline shared_ptr<State>& getState ();
|
inline shared_ptr<State>& getState ();
|
||||||
inline PaletteWidget* getPalette ();
|
inline PaletteWidget* getPalette ();
|
||||||
|
inline Occurrences getOccurrencesUnder ( const QRect& ) const;
|
||||||
|
Occurrences getOccurrencesUnder ( const Box& ) const;
|
||||||
|
inline SelectorSet& getSelectorSet ();
|
||||||
|
inline RubberShape getRubberShape () const;
|
||||||
|
inline int getStartLevel () const;
|
||||||
|
inline int getStopLevel () const;
|
||||||
|
inline Query::Mask getQueryFilter () const ;
|
||||||
void bindToPalette ( PaletteWidget* );
|
void bindToPalette ( PaletteWidget* );
|
||||||
void detachFromPalette ();
|
void detachFromPalette ();
|
||||||
void bindCommand ( Command* );
|
void bindCommand ( Command* );
|
||||||
|
@ -121,22 +128,17 @@ namespace Hurricane {
|
||||||
inline bool showBoundaries () const;
|
inline bool showBoundaries () const;
|
||||||
inline bool showSelection () const;
|
inline bool showSelection () const;
|
||||||
inline bool cumulativeSelection () const;
|
inline bool cumulativeSelection () const;
|
||||||
inline Occurrences getOccurrencesUnder ( const QRect& ) const;
|
|
||||||
Occurrences getOccurrencesUnder ( const Box& ) const;
|
|
||||||
inline SelectorSet& getSelectorSet ();
|
|
||||||
inline void setRubberShape ( RubberShape );
|
inline void setRubberShape ( RubberShape );
|
||||||
inline RubberShape getRubberShape () const;
|
|
||||||
inline void setStartLevel ( int );
|
inline void setStartLevel ( int );
|
||||||
inline void setStopLevel ( int );
|
inline void setStopLevel ( int );
|
||||||
inline void setQueryFilter ( int );
|
inline void setQueryFilter ( Query::Mask );
|
||||||
inline int getQueryFilter () const ;
|
|
||||||
inline bool timeout ( const char*, const Timer&, double timeout, bool& timedout ) const;
|
inline bool timeout ( const char*, const Timer&, double timeout, bool& timedout ) const;
|
||||||
// Painter control & Hurricane objects drawing primitives.
|
// Painter control & Hurricane objects drawing primitives.
|
||||||
inline void setEnableRedrawInterrupt ( bool );
|
inline void setEnableRedrawInterrupt ( bool );
|
||||||
inline void addDrawExtensionGo ( const Name&, InitExtensionGo_t*, DrawExtensionGo_t* );
|
inline void addDrawExtensionGo ( const Name&, InitExtensionGo_t*, DrawExtensionGo_t* );
|
||||||
inline QPainter& getPainter ( size_t plane=PlaneId::Working );
|
inline QPainter& getPainter ( size_t plane=PlaneId::Working );
|
||||||
inline int getDarkening () const;
|
inline int getDarkening () const;
|
||||||
inline void copyToPrinter ( QPrinter* printer );
|
inline void copyToPrinter ( QPrinter* );
|
||||||
inline const float& getScale () const;
|
inline const float& getScale () const;
|
||||||
inline const QPoint& getMousePosition () const;
|
inline const QPoint& getMousePosition () const;
|
||||||
bool isDrawable ( const Name& );
|
bool isDrawable ( const Name& );
|
||||||
|
@ -199,8 +201,8 @@ namespace Hurricane {
|
||||||
void cellPreModificated ();
|
void cellPreModificated ();
|
||||||
void cellPostModificated ();
|
void cellPostModificated ();
|
||||||
void stateChanged ( shared_ptr<CellWidget::State>& );
|
void stateChanged ( shared_ptr<CellWidget::State>& );
|
||||||
void settingsChanged ();
|
|
||||||
void styleChanged ( void* emitter );
|
void styleChanged ( void* emitter );
|
||||||
|
void queryFilterChanged ();
|
||||||
void updatePalette ( Cell* );
|
void updatePalette ( Cell* );
|
||||||
void mousePositionChanged ( const Point& position );
|
void mousePositionChanged ( const Point& position );
|
||||||
void selectionChanged ( const SelectorSet&, Cell* );
|
void selectionChanged ( const SelectorSet&, Cell* );
|
||||||
|
@ -211,22 +213,25 @@ namespace Hurricane {
|
||||||
public slots:
|
public slots:
|
||||||
// Qt QWidget Slots Overload & CellWidget Specifics.
|
// Qt QWidget Slots Overload & CellWidget Specifics.
|
||||||
void setState ( shared_ptr<CellWidget::State>& );
|
void setState ( shared_ptr<CellWidget::State>& );
|
||||||
|
inline void openRefreshSession ();
|
||||||
|
inline void closeRefreshSession ();
|
||||||
inline DrawingPlanes& getDrawingPlanes ();
|
inline DrawingPlanes& getDrawingPlanes ();
|
||||||
inline QPoint& getOffsetVA ();
|
inline QPoint& getOffsetVA ();
|
||||||
void select ( const Net* net, bool delayRedraw=false );
|
void select ( const Net* );
|
||||||
void select ( Occurrence occurence );
|
void select ( Occurrence );
|
||||||
bool isSelected ( Occurrence occurence );
|
bool isSelected ( Occurrence );
|
||||||
void selectOccurrencesUnder ( Box selectArea );
|
void selectOccurrencesUnder ( Box selectArea );
|
||||||
void unselect ( const Net* net, bool delayRedraw=false );
|
void unselect ( const Net* );
|
||||||
void unselect ( Occurrence occurence );
|
void unselect ( Occurrence );
|
||||||
void unselectAll ( bool delayRedraw=false );
|
void unselectAll ();
|
||||||
void toggleSelection ( Occurrence occurence );
|
void toggleSelection ( Occurrence );
|
||||||
void setShowSelection ( bool state );
|
void setShowSelection ( bool state );
|
||||||
void setCumulativeSelection ( bool state );
|
void setCumulativeSelection ( bool state );
|
||||||
void _select ( const Net* net, bool delayRedraw=false );
|
void _select ( const Net* );
|
||||||
void _unselect ( const Net* net, bool delayRedraw=false );
|
void _unselect ( const Net* );
|
||||||
void _selectOccurrencesUnder ( Box selectArea );
|
void _selectOccurrencesUnder ( Box selectArea );
|
||||||
void _unselectAll ( bool delayRedraw );
|
void _unselectAll ();
|
||||||
|
void changeQueryFilter ();
|
||||||
void rubberChange ();
|
void rubberChange ();
|
||||||
void styleChange ( void* emitter );
|
void styleChange ( void* emitter );
|
||||||
void updatePalette ();
|
void updatePalette ();
|
||||||
|
@ -240,14 +245,15 @@ namespace Hurricane {
|
||||||
void goRight ( int dx = 0 );
|
void goRight ( int dx = 0 );
|
||||||
void goUp ( int dy = 0 );
|
void goUp ( int dy = 0 );
|
||||||
void goDown ( int dy = 0 );
|
void goDown ( int dy = 0 );
|
||||||
void fitToContents ( bool delayed=false, bool historyEnable=true );
|
void fitToContents ( bool historyEnable=true );
|
||||||
|
void fitToNet ( const Net*, bool historyEnable=true );
|
||||||
void setScale ( float );
|
void setScale ( float );
|
||||||
void scaleHistoryUp ();
|
void scaleHistoryUp ();
|
||||||
void scaleHistoryDown ();
|
void scaleHistoryDown ();
|
||||||
void setShowBoundaries ( bool state );
|
void setShowBoundaries ( bool state );
|
||||||
void reframe ( bool delayed=false );
|
void reframe ();
|
||||||
void reframe ( const Box& box, bool delayed=false );
|
void reframe ( const Box& box, bool historyEnable=true );
|
||||||
void displayReframe ( bool delayed=false );
|
void displayReframe ();
|
||||||
void _goLeft ( int dx );
|
void _goLeft ( int dx );
|
||||||
void _goRight ( int dx );
|
void _goRight ( int dx );
|
||||||
void _goUp ( int dy );
|
void _goUp ( int dy );
|
||||||
|
@ -304,9 +310,12 @@ namespace Hurricane {
|
||||||
inline bool isProcessing () const;
|
inline bool isProcessing () const;
|
||||||
inline bool interrupted () const;
|
inline bool interrupted () const;
|
||||||
inline size_t getPendings () const;
|
inline size_t getPendings () const;
|
||||||
|
inline void openRefreshSession ();
|
||||||
|
inline void closeRefreshSession ();
|
||||||
private:
|
private:
|
||||||
CellWidget* _widget;
|
CellWidget* _widget;
|
||||||
list<RedrawEvent*> _events;
|
list<RedrawEvent*> _events;
|
||||||
|
int _refreshSession;
|
||||||
bool _processing;
|
bool _processing;
|
||||||
bool _interrupted;
|
bool _interrupted;
|
||||||
};
|
};
|
||||||
|
@ -449,9 +458,9 @@ namespace Hurricane {
|
||||||
SelectorCriterions ();
|
SelectorCriterions ();
|
||||||
~SelectorCriterions ();
|
~SelectorCriterions ();
|
||||||
inline void setCellWidget ( CellWidget* );
|
inline void setCellWidget ( CellWidget* );
|
||||||
bool add ( const Net* net, bool delayRedraw );
|
bool add ( const Net* net );
|
||||||
bool add ( Box area );
|
bool add ( Box area );
|
||||||
bool remove ( const Net* net, bool delayRedraw );
|
bool remove ( const Net* net );
|
||||||
void clear ();
|
void clear ();
|
||||||
void revalidate ();
|
void revalidate ();
|
||||||
inline size_t size () const;
|
inline size_t size () const;
|
||||||
|
@ -472,6 +481,10 @@ namespace Hurricane {
|
||||||
void setScale ( float );
|
void setScale ( float );
|
||||||
inline void setTopLeft ( DbU::Unit, DbU::Unit );
|
inline void setTopLeft ( DbU::Unit, DbU::Unit );
|
||||||
inline void setTopLeft ( const Point& );
|
inline void setTopLeft ( const Point& );
|
||||||
|
inline void setQueryFilter ( Query::Mask );
|
||||||
|
inline void setStartLevel ( int );
|
||||||
|
inline void setStopLevel ( int );
|
||||||
|
inline void setRubberShape ( RubberShape );
|
||||||
inline void setHistoryEnable ( bool );
|
inline void setHistoryEnable ( bool );
|
||||||
bool scaleHistoryUp ();
|
bool scaleHistoryUp ();
|
||||||
bool scaleHistoryDown ();
|
bool scaleHistoryDown ();
|
||||||
|
@ -485,6 +498,10 @@ namespace Hurricane {
|
||||||
inline size_t getHistorySize () const;
|
inline size_t getHistorySize () const;
|
||||||
inline const float& getScale () const;
|
inline const float& getScale () const;
|
||||||
inline const Point& getTopLeft () const;
|
inline const Point& getTopLeft () const;
|
||||||
|
inline Query::Mask getQueryFilter () const;
|
||||||
|
inline int getStartLevel () const;
|
||||||
|
inline int getStopLevel () const;
|
||||||
|
inline RubberShape getRubberShape () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class ScaleEntry {
|
class ScaleEntry {
|
||||||
|
@ -501,6 +518,10 @@ namespace Hurricane {
|
||||||
SelectorCriterions _selection;
|
SelectorCriterions _selection;
|
||||||
bool _showBoundaries;
|
bool _showBoundaries;
|
||||||
bool _showSelection;
|
bool _showSelection;
|
||||||
|
Query::Mask _queryFilter;
|
||||||
|
int _startLevel;
|
||||||
|
int _stopLevel;
|
||||||
|
RubberShape _rubberShape;
|
||||||
bool _cumulativeSelection;
|
bool _cumulativeSelection;
|
||||||
vector<ScaleEntry> _scaleHistory;
|
vector<ScaleEntry> _scaleHistory;
|
||||||
size_t _ihistory;
|
size_t _ihistory;
|
||||||
|
@ -530,7 +551,6 @@ namespace Hurricane {
|
||||||
DrawingPlanes _drawingPlanes;
|
DrawingPlanes _drawingPlanes;
|
||||||
DrawingQuery _drawingQuery;
|
DrawingQuery _drawingQuery;
|
||||||
TextDrawingQuery _textDrawingQuery;
|
TextDrawingQuery _textDrawingQuery;
|
||||||
int _queryFilter;
|
|
||||||
int _darkening;
|
int _darkening;
|
||||||
QPoint _mousePosition;
|
QPoint _mousePosition;
|
||||||
Spot _spot;
|
Spot _spot;
|
||||||
|
@ -544,7 +564,6 @@ namespace Hurricane {
|
||||||
vector<Command*> _commands;
|
vector<Command*> _commands;
|
||||||
size_t _redrawRectCount;
|
size_t _redrawRectCount;
|
||||||
int _textFontHeight;
|
int _textFontHeight;
|
||||||
RubberShape _rubberShape;
|
|
||||||
|
|
||||||
friend class RedrawManager;
|
friend class RedrawManager;
|
||||||
};
|
};
|
||||||
|
@ -579,6 +598,14 @@ namespace Hurricane {
|
||||||
{ _enableRedrawInterrupt = state; }
|
{ _enableRedrawInterrupt = state; }
|
||||||
|
|
||||||
|
|
||||||
|
inline void CellWidget::openRefreshSession ()
|
||||||
|
{ _redrawManager.openRefreshSession (); }
|
||||||
|
|
||||||
|
|
||||||
|
inline void CellWidget::closeRefreshSession ()
|
||||||
|
{ _redrawManager.closeRefreshSession (); }
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::DrawingQuery::addDrawExtensionGo ( const Name& name
|
inline void CellWidget::DrawingQuery::addDrawExtensionGo ( const Name& name
|
||||||
, InitExtensionGo_t* initExtensionGo
|
, InitExtensionGo_t* initExtensionGo
|
||||||
, DrawExtensionGo_t* drawExtensionGo
|
, DrawExtensionGo_t* drawExtensionGo
|
||||||
|
@ -630,6 +657,17 @@ namespace Hurricane {
|
||||||
{ return _events.size(); }
|
{ return _events.size(); }
|
||||||
|
|
||||||
|
|
||||||
|
inline void CellWidget::RedrawManager::openRefreshSession ()
|
||||||
|
{ _refreshSession++; }
|
||||||
|
|
||||||
|
|
||||||
|
inline void CellWidget::RedrawManager::closeRefreshSession ()
|
||||||
|
{
|
||||||
|
_refreshSession--;
|
||||||
|
if ( !_processing && (_refreshSession == 0) ) process ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool CellWidget::RedrawManager::interrupted () const
|
inline bool CellWidget::RedrawManager::interrupted () const
|
||||||
{
|
{
|
||||||
#ifdef ALLOW_REQUEST_INTERRUPT
|
#ifdef ALLOW_REQUEST_INTERRUPT
|
||||||
|
@ -733,6 +771,10 @@ namespace Hurricane {
|
||||||
inline CellWidget::State::State ( Cell* cell )
|
inline CellWidget::State::State ( Cell* cell )
|
||||||
: _cell (cell)
|
: _cell (cell)
|
||||||
, _selection ()
|
, _selection ()
|
||||||
|
, _queryFilter (~Query::DoTerminalCells)
|
||||||
|
, _startLevel (0)
|
||||||
|
, _stopLevel (99)
|
||||||
|
, _rubberShape (CellWidget::Steiner)
|
||||||
, _showBoundaries (true)
|
, _showBoundaries (true)
|
||||||
, _showSelection (false)
|
, _showSelection (false)
|
||||||
, _cumulativeSelection(false)
|
, _cumulativeSelection(false)
|
||||||
|
@ -775,9 +817,23 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::State::setTopLeft ( const Point& topLeft )
|
inline void CellWidget::State::setTopLeft ( const Point& topLeft )
|
||||||
{
|
{ _scaleHistory[_ihistory]._topLeft = topLeft; }
|
||||||
_scaleHistory[_ihistory]._topLeft = topLeft;
|
|
||||||
}
|
|
||||||
|
inline void CellWidget::State::setQueryFilter ( Query::Mask mask )
|
||||||
|
{ _queryFilter = mask; }
|
||||||
|
|
||||||
|
|
||||||
|
inline void CellWidget::State::setStartLevel ( int level )
|
||||||
|
{ _startLevel = level; }
|
||||||
|
|
||||||
|
|
||||||
|
inline void CellWidget::State::setStopLevel ( int level )
|
||||||
|
{ _stopLevel = level; }
|
||||||
|
|
||||||
|
|
||||||
|
inline void CellWidget::State::setRubberShape ( RubberShape shape )
|
||||||
|
{ _rubberShape = shape; }
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::State::setHistoryEnable ( bool enable )
|
inline void CellWidget::State::setHistoryEnable ( bool enable )
|
||||||
|
@ -816,6 +872,22 @@ namespace Hurricane {
|
||||||
{ return _scaleHistory[_ihistory]._topLeft; }
|
{ return _scaleHistory[_ihistory]._topLeft; }
|
||||||
|
|
||||||
|
|
||||||
|
inline Query::Mask CellWidget::State::getQueryFilter () const
|
||||||
|
{ return _queryFilter; }
|
||||||
|
|
||||||
|
|
||||||
|
inline int CellWidget::State::getStartLevel () const
|
||||||
|
{ return _startLevel; }
|
||||||
|
|
||||||
|
|
||||||
|
inline int CellWidget::State::getStopLevel () const
|
||||||
|
{ return _stopLevel; }
|
||||||
|
|
||||||
|
|
||||||
|
inline CellWidget::RubberShape CellWidget::State::getRubberShape () const
|
||||||
|
{ return _rubberShape; }
|
||||||
|
|
||||||
|
|
||||||
inline const float& CellWidget::State::getScale () const
|
inline const float& CellWidget::State::getScale () const
|
||||||
{ return _scaleHistory[_ihistory]._scale; }
|
{ return _scaleHistory[_ihistory]._scale; }
|
||||||
|
|
||||||
|
@ -845,11 +917,27 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::setStartLevel ( int level )
|
inline void CellWidget::setStartLevel ( int level )
|
||||||
{ _drawingQuery.setStartLevel ( level ); }
|
{
|
||||||
|
_drawingQuery.setStartLevel ( level );
|
||||||
|
_state->setStartLevel ( level );
|
||||||
|
emit queryFilterChanged ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::setStopLevel ( int level )
|
inline void CellWidget::setStopLevel ( int level )
|
||||||
{ _drawingQuery.setStopLevel ( level ); }
|
{
|
||||||
|
_drawingQuery.setStopLevel ( level );
|
||||||
|
_state->setStopLevel ( level );
|
||||||
|
emit queryFilterChanged ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline int CellWidget::getStartLevel () const
|
||||||
|
{ return _drawingQuery.getStartLevel (); }
|
||||||
|
|
||||||
|
|
||||||
|
inline int CellWidget::getStopLevel () const
|
||||||
|
{ return _drawingQuery.getStopLevel (); }
|
||||||
|
|
||||||
|
|
||||||
inline CellWidget::DrawingPlanes& CellWidget::getDrawingPlanes ()
|
inline CellWidget::DrawingPlanes& CellWidget::getDrawingPlanes ()
|
||||||
|
@ -988,23 +1076,26 @@ namespace Hurricane {
|
||||||
{ return _mousePosition; }
|
{ return _mousePosition; }
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::setQueryFilter ( int filter )
|
inline void CellWidget::setQueryFilter ( Query::Mask filter )
|
||||||
{ _queryFilter = filter; }
|
{
|
||||||
|
_state->setQueryFilter ( filter );
|
||||||
|
emit queryFilterChanged ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline int CellWidget::getQueryFilter () const
|
inline Query::Mask CellWidget::getQueryFilter () const
|
||||||
{ return _queryFilter; }
|
{ return _state->getQueryFilter(); }
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::setRubberShape ( RubberShape shape )
|
inline void CellWidget::setRubberShape ( RubberShape shape )
|
||||||
{
|
{
|
||||||
_rubberShape = shape;
|
_state->setRubberShape ( shape );
|
||||||
refresh ();
|
emit queryFilterChanged ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline CellWidget::RubberShape CellWidget::getRubberShape () const
|
inline CellWidget::RubberShape CellWidget::getRubberShape () const
|
||||||
{ return _rubberShape; }
|
{ return _state->getRubberShape(); }
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::setPen ( const QPen& pen, size_t plane )
|
inline void CellWidget::setPen ( const QPen& pen, size_t plane )
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -46,12 +46,10 @@ namespace Hurricane {
|
||||||
public:
|
public:
|
||||||
DisplayFilterWidget ( QWidget* parent=NULL );
|
DisplayFilterWidget ( QWidget* parent=NULL );
|
||||||
void setCellWidget ( CellWidget* );
|
void setCellWidget ( CellWidget* );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void filterChanged ();
|
void queryFilterChanged ();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void syncFromCellWidget ();
|
void changeQueryFilter ();
|
||||||
void startLevelChanged ( int level );
|
void startLevelChanged ( int level );
|
||||||
void stopLevelChanged ( int level );
|
void stopLevelChanged ( int level );
|
||||||
void setDoMasterCells ( int state );
|
void setDoMasterCells ( int state );
|
||||||
|
@ -60,6 +58,14 @@ namespace Hurricane {
|
||||||
void setRubberSteiner ();
|
void setRubberSteiner ();
|
||||||
void setRubberCentric ();
|
void setRubberCentric ();
|
||||||
void setRubberBarycentric ();
|
void setRubberBarycentric ();
|
||||||
|
protected:
|
||||||
|
void blockAllSignals ( bool state );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
enum UpdateState { External = 0
|
||||||
|
, InternalEmit
|
||||||
|
, InternalReceive
|
||||||
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CellWidget* _cellWidget;
|
CellWidget* _cellWidget;
|
||||||
|
@ -71,8 +77,7 @@ namespace Hurricane {
|
||||||
QRadioButton* _steiner;
|
QRadioButton* _steiner;
|
||||||
QRadioButton* _centric;
|
QRadioButton* _centric;
|
||||||
QRadioButton* _barycentric;
|
QRadioButton* _barycentric;
|
||||||
int _queryFilter;
|
UpdateState _updateState;
|
||||||
bool _signalEmitter;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -88,7 +88,7 @@ namespace Hurricane {
|
||||||
void historyChanged ( int depth );
|
void historyChanged ( int depth );
|
||||||
void forkInspector ( const QModelIndex& );
|
void forkInspector ( const QModelIndex& );
|
||||||
protected:
|
protected:
|
||||||
void keyPressEvent ( QKeyEvent* );
|
bool eventFilter ( QObject*, QEvent* );
|
||||||
private:
|
private:
|
||||||
void _setRootRecord ( Record* );
|
void _setRootRecord ( Record* );
|
||||||
void pushSlot ( Slot* );
|
void pushSlot ( Slot* );
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -122,17 +122,17 @@ namespace Hurricane {
|
||||||
void setCell ( Cell* );
|
void setCell ( Cell* );
|
||||||
void goTo ( int );
|
void goTo ( int );
|
||||||
signals:
|
signals:
|
||||||
|
void refreshSessionOpened ();
|
||||||
|
void refreshSessionClosed ();
|
||||||
void netSelected ( const Net* );
|
void netSelected ( const Net* );
|
||||||
void netUnselected ( const Net* );
|
void netUnselected ( const Net* );
|
||||||
|
void netFitted ( const Net* );
|
||||||
public slots:
|
public slots:
|
||||||
void forceRowHeight ();
|
void forceRowHeight ();
|
||||||
private slots:
|
private slots:
|
||||||
void textFilterChanged ();
|
void textFilterChanged ();
|
||||||
// void selectNet ( const QModelIndex& );
|
|
||||||
// void selectCurrent ( const QModelIndex& , const QModelIndex& );
|
|
||||||
void updateSelecteds ( const QItemSelection& , const QItemSelection& );
|
void updateSelecteds ( const QItemSelection& , const QItemSelection& );
|
||||||
protected:
|
void fitToNet ();
|
||||||
void keyPressEvent ( QKeyEvent* );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Cell* _cell;
|
Cell* _cell;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -77,7 +77,7 @@ namespace Hurricane {
|
||||||
private slots:
|
private slots:
|
||||||
void textFilterChanged ();
|
void textFilterChanged ();
|
||||||
protected:
|
protected:
|
||||||
virtual void keyPressEvent ( QKeyEvent * event );
|
virtual bool eventFilter ( QObject*, QEvent* );
|
||||||
virtual void hideEvent ( QHideEvent* event );
|
virtual void hideEvent ( QHideEvent* event );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -44,8 +44,8 @@ namespace Hurricane {
|
||||||
virtual ~SelectorCriterion ();
|
virtual ~SelectorCriterion ();
|
||||||
virtual bool isValid ( CellWidget* ) const = 0;
|
virtual bool isValid ( CellWidget* ) const = 0;
|
||||||
virtual const Net* getNet () const;
|
virtual const Net* getNet () const;
|
||||||
virtual void doSelection ( CellWidget*, bool delayRedraw ) = 0;
|
virtual void doSelection ( CellWidget* ) = 0;
|
||||||
virtual void undoSelection ( CellWidget*, bool delayRedraw );
|
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;
|
||||||
|
@ -58,8 +58,8 @@ namespace Hurricane {
|
||||||
virtual ~NetSelectorCriterion ();
|
virtual ~NetSelectorCriterion ();
|
||||||
virtual const Net* getNet () const;
|
virtual const Net* getNet () const;
|
||||||
virtual bool isValid ( CellWidget* ) const;
|
virtual bool isValid ( CellWidget* ) const;
|
||||||
virtual void doSelection ( CellWidget*, bool delayRedraw );
|
virtual void doSelection ( CellWidget* );
|
||||||
virtual void undoSelection ( CellWidget*, bool delayRedraw );
|
virtual void undoSelection ( CellWidget* );
|
||||||
virtual Record* _getRecord () const;
|
virtual Record* _getRecord () const;
|
||||||
virtual string _getString () const;
|
virtual string _getString () const;
|
||||||
virtual string _getTypeName () const;
|
virtual string _getTypeName () const;
|
||||||
|
@ -75,7 +75,7 @@ namespace Hurricane {
|
||||||
virtual ~AreaSelectorCriterion ();
|
virtual ~AreaSelectorCriterion ();
|
||||||
const Box& getArea () const;
|
const Box& getArea () const;
|
||||||
virtual bool isValid ( CellWidget* ) const;
|
virtual bool isValid ( CellWidget* ) const;
|
||||||
virtual void doSelection ( CellWidget*, bool delayRedraw );
|
virtual void doSelection ( CellWidget* );
|
||||||
virtual Record* _getRecord () const;
|
virtual Record* _getRecord () const;
|
||||||
virtual string _getString () const;
|
virtual string _getString () const;
|
||||||
virtual string _getTypeName () const;
|
virtual string _getTypeName () const;
|
||||||
|
|
Loading…
Reference in New Issue