From cc98bd541d9447d2ab0ca91033fad4e0dc7c8813 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 25 Jul 2009 15:10:46 +0000 Subject: [PATCH] * ./hurricane/src/hurricane : - Change: In Technology::getViaBetween(Layer*,Layer*) if the two layers are identicals, return the layer instead of NULL (mostly for mono- metallic VIAs). * ./hurricane/src/hviewer : - Bug: In CellWidget::redrawSelection(), correct calculation of the selected Instances abutment box. We must apply the occurrence path transformation to the instance transformation and not the other way around. - Bug: In SelectorLess(), Instance must be *inferior* to Components as they are drawed after in CellWidget::redrawSelection(). --- hurricane/src/hurricane/Interval.cpp | 2 ++ hurricane/src/hurricane/Technology.cpp | 1 + hurricane/src/hviewer/CellWidget.cpp | 46 ++++++++++++++------------ hurricane/src/hviewer/HApplication.cpp | 6 ++-- hurricane/src/hviewer/Selector.cpp | 16 ++++----- 5 files changed, 38 insertions(+), 33 deletions(-) diff --git a/hurricane/src/hurricane/Interval.cpp b/hurricane/src/hurricane/Interval.cpp index c186a9bf..8c718b19 100644 --- a/hurricane/src/hurricane/Interval.cpp +++ b/hurricane/src/hurricane/Interval.cpp @@ -240,6 +240,8 @@ Interval& Interval::translate(const DbU::Unit& dv) string Interval::_getString() const // ******************************** { + if ( isEmpty() ) + return "<" + _TName("Interval") + " (empty) " + DbU::getValueString(_vMin) + " " + DbU::getValueString(_vMax) + ">"; return "<" + _TName("Interval") + " " + DbU::getValueString(_vMin) + " " + DbU::getValueString(_vMax) + ">"; } diff --git a/hurricane/src/hurricane/Technology.cpp b/hurricane/src/hurricane/Technology.cpp index 24ee9c47..9eee226c 100644 --- a/hurricane/src/hurricane/Technology.cpp +++ b/hurricane/src/hurricane/Technology.cpp @@ -261,6 +261,7 @@ ViaLayers Technology::getViaLayers() const Layer* Technology::getViaBetween ( const Layer* metal1, const Layer* metal2 ) const { if ( !metal1 || !metal2 ) return NULL; + if ( metal1 == metal2 ) return const_cast(metal1); if ( metal1->above(metal2) ) swap ( metal1, metal2 ); Layer* cutLayer = getCutBelow ( metal2 ); diff --git a/hurricane/src/hviewer/CellWidget.cpp b/hurricane/src/hviewer/CellWidget.cpp index ad4b00b3..6a0951f9 100644 --- a/hurricane/src/hviewer/CellWidget.cpp +++ b/hurricane/src/hviewer/CellWidget.cpp @@ -744,9 +744,7 @@ namespace Hurricane { bool CellWidget::DrawingQuery::hasMasterCellCallback () const - { - return true; - } + { return true; } void CellWidget::DrawingQuery::masterCellCallback () @@ -1466,25 +1464,16 @@ namespace Hurricane { _drawingPlanes.setPen ( Graphics::getPen (basicLayer->getName()) ); _drawingPlanes.setBrush ( Graphics::getBrush(basicLayer->getName()) ); - iselector = _selectors.begin (); + iselector = _selectors.begin(); for ( ; iselector != _selectors.end() ; iselector++ ) { - Occurrence occurrence = (*iselector)->getOccurrence(); - Transformation transformation = occurrence.getPath().getTransformation(); + Occurrence occurrence = (*iselector)->getOccurrence(); + Component* component = dynamic_cast(occurrence.getEntity()); - Instance* instance = dynamic_cast(occurrence.getEntity()); - if ( instance ) { - _drawingPlanes.setPen ( Graphics::getPen ("boundaries",getDarkening()) ); - _drawingPlanes.setBrush ( Graphics::getBrush("boundaries",getDarkening()) ); - - _drawingQuery.drawMasterCell ( instance->getMasterCell(), instance->getTransformation().getTransformation(transformation) ); - continue; - } - - Component* component = dynamic_cast(occurrence.getEntity()); if ( !component ) break; if ( !component->getLayer() ) continue; if ( !component->getLayer()->contains(*basicLayer) ) continue; + Transformation transformation = occurrence.getPath().getTransformation(); _drawingQuery.drawGo ( dynamic_cast(occurrence.getEntity()) , *basicLayer , redrawBox @@ -1493,27 +1482,40 @@ namespace Hurricane { } } + _drawingPlanes.setPen ( Graphics::getPen ("boundaries") ); + _drawingPlanes.setBrush ( Graphics::getBrush("boundaries") ); + + for ( ; iselector != _selectors.end() ; iselector++ ) { + Occurrence occurrence = (*iselector)->getOccurrence(); + Instance* instance = dynamic_cast(occurrence.getEntity()); + if ( instance ) { + Transformation transformation + = occurrence.getPath().getTransformation().getTransformation(instance->getTransformation()); + _drawingQuery.drawMasterCell ( instance->getMasterCell(), transformation ); + } + } + _drawingPlanes.setPen ( Graphics::getPen ("rubber") ); _drawingPlanes.setBrush ( Graphics::getBrush("rubber") ); for ( ; iselector != _selectors.end() ; iselector++ ) { - Occurrence occurrence = (*iselector)->getOccurrence(); - Transformation transformation = occurrence.getPath().getTransformation(); + Occurrence occurrence = (*iselector)->getOccurrence(); + Rubber* rubber = dynamic_cast(occurrence.getEntity()); - Rubber* rubber = dynamic_cast(occurrence.getEntity()); if ( !rubber ) break; + Transformation transformation = occurrence.getPath().getTransformation(); _drawingQuery.drawRubber ( rubber, redrawBox, transformation ); } Name extensionName = ""; for ( ; iselector != _selectors.end() ; iselector++ ) { - Occurrence occurrence = (*iselector)->getOccurrence(); - Transformation transformation = occurrence.getPath().getTransformation(); + Occurrence occurrence = (*iselector)->getOccurrence(); + ExtensionGo* eGo = dynamic_cast(occurrence.getEntity()); - ExtensionGo* eGo = dynamic_cast(occurrence.getEntity()); if ( !eGo ) break; + Transformation transformation = occurrence.getPath().getTransformation(); if ( eGo->getName() != extensionName ) { extensionName = eGo->getName(); _drawingQuery.setDrawExtensionGo ( extensionName ); diff --git a/hurricane/src/hviewer/HApplication.cpp b/hurricane/src/hviewer/HApplication.cpp index 019c3f79..1ea41df8 100644 --- a/hurricane/src/hviewer/HApplication.cpp +++ b/hurricane/src/hviewer/HApplication.cpp @@ -26,7 +26,7 @@ #include #include -#include "hurricane/Error.h" +#include "hurricane/Exception.h" #include "hurricane/viewer/ExceptionWidget.h" #include "hurricane/viewer/HApplication.h" @@ -75,9 +75,9 @@ namespace Hurricane { try { return QApplication::notify ( object, event ); } - catch ( Error& e ) { + catch ( Exception& e ) { ExceptionWidget* ew = new ExceptionWidget (); - ew->setMessage ( e.getReason().c_str() ); + ew->setMessage ( e.what().c_str() ); if ( ew->exec() == QDialog::Rejected ) kill ( getpid(), SIGSEGV ); } diff --git a/hurricane/src/hviewer/Selector.cpp b/hurricane/src/hviewer/Selector.cpp index c0730fb0..4681d4ba 100644 --- a/hurricane/src/hviewer/Selector.cpp +++ b/hurricane/src/hviewer/Selector.cpp @@ -48,8 +48,14 @@ namespace Hurricane { bool SelectorLess::operator () ( const Selector* lhs, const Selector* rhs ) const { - const Entity* lhsEntity = lhs->getOccurrence().getEntity(); - const Entity* rhsEntity = rhs->getOccurrence().getEntity(); + const Entity* lhsEntity = lhs->getOccurrence().getEntity(); + const Entity* rhsEntity = rhs->getOccurrence().getEntity(); + + const Component* lhsComponent = dynamic_cast ( lhsEntity ); + const Component* rhsComponent = dynamic_cast ( rhsEntity ); + if ( lhsComponent && rhsComponent ) return lhs < rhs; // lhs & rhs are Components. + if ( lhsComponent && !rhsComponent ) return true; // lhs only is an Component. + if ( !lhsComponent && rhsComponent ) return false; // rhs only is an Component. const Instance* lhsInstance = dynamic_cast ( lhsEntity ); const Instance* rhsInstance = dynamic_cast ( rhsEntity ); @@ -59,12 +65,6 @@ namespace Hurricane { if ( lhsInstance && !rhsInstance ) return true; // lhs only is an Instance. if ( !lhsInstance && rhsInstance ) return false; // rhs only is an Instance. - const Component* lhsComponent = dynamic_cast ( lhsEntity ); - const Component* rhsComponent = dynamic_cast ( rhsEntity ); - if ( lhsComponent && rhsComponent ) return lhs < rhs; // lhs & rhs are Components. - if ( lhsComponent && !rhsComponent ) return true; // lhs only is an Component. - if ( !lhsComponent && rhsComponent ) return false; // rhs only is an Component. - const Rubber* lhsRubber = dynamic_cast ( lhsEntity ); const Rubber* rhsRubber = dynamic_cast ( rhsEntity ); if ( lhsRubber && rhsRubber ) return lhs < rhs; // lhs & rhs are Rubbers.