From 4deb80c3c7cebefa31d2733d44d9e2c668cbe053 Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Sun, 15 Jun 2008 17:04:50 +0000 Subject: [PATCH] String Mode in DbU can now be set There was no drawing for pads in CellWidget --- hurricane/src/hurricane/DbU.cpp | 2 -- hurricane/src/hurricane/hurricane/DbU.h | 15 ++++++++------- hurricane/src/hviewer/CellWidget.cpp | 18 +++++++++++++++++- .../src/hviewer/hurricane/viewer/CellWidget.h | 2 ++ 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/hurricane/src/hurricane/DbU.cpp b/hurricane/src/hurricane/DbU.cpp index 21eff2df..9b4bb80c 100644 --- a/hurricane/src/hurricane/DbU.cpp +++ b/hurricane/src/hurricane/DbU.cpp @@ -91,8 +91,6 @@ namespace Hurricane { { return _realsPerLambda; } - void DbU::setStringMode ( unsigned int mode ) - { _stringMode = mode; } diff --git a/hurricane/src/hurricane/hurricane/DbU.h b/hurricane/src/hurricane/hurricane/DbU.h index 6cd70d15..faa2a3b9 100644 --- a/hurricane/src/hurricane/hurricane/DbU.h +++ b/hurricane/src/hurricane/hurricane/DbU.h @@ -68,7 +68,7 @@ namespace Hurricane { static inline double getReal ( Unit u ); static inline double getLambda ( Unit u ); static string getValueString ( Unit u ); - inline void setStringMode ( unsigned int mode ); + static inline void setStringMode ( unsigned int mode ); public: // Static Attributes: constants. @@ -85,12 +85,13 @@ namespace Hurricane { // Inline Functions. - inline DbU::Unit DbU::db ( long value ) { return value; } - inline DbU::Unit DbU::real ( double value ) { return (long)rint( value/_resolution ); } - inline DbU::Unit DbU::lambda ( double value ) { return real(value*_realsPerLambda); } - inline long DbU::getDb ( DbU::Unit u ) { return u; } - inline double DbU::getReal ( DbU::Unit u ) { return _resolution*(double)u; } - inline double DbU::getLambda ( DbU::Unit u ) { return getReal(u)/_realsPerLambda; } + inline DbU::Unit DbU::db ( long value ) { return value; } + inline DbU::Unit DbU::real ( double value ) { return (long)rint( value/_resolution ); } + inline DbU::Unit DbU::lambda ( double value ) { return real(value*_realsPerLambda); } + inline long DbU::getDb ( DbU::Unit u ) { return u; } + inline double DbU::getReal ( DbU::Unit u ) { return _resolution*(double)u; } + inline double DbU::getLambda ( DbU::Unit u ) { return getReal(u)/_realsPerLambda; } + inline void DbU::setStringMode ( unsigned int mode ) { _stringMode = mode; } } // End of Hurricane namespace. diff --git a/hurricane/src/hviewer/CellWidget.cpp b/hurricane/src/hviewer/CellWidget.cpp index dac37179..20a446d7 100644 --- a/hurricane/src/hviewer/CellWidget.cpp +++ b/hurricane/src/hviewer/CellWidget.cpp @@ -17,6 +17,7 @@ # include "hurricane/Slice.h" # include "hurricane/Segment.h" # include "hurricane/Contact.h" +# include "hurricane/Pad.h" # include "hurricane/viewer/Graphics.h" # include "hurricane/viewer/PaletteEntry.h" @@ -130,7 +131,7 @@ void CellWidget::redraw ( QRect redrawArea ) update (); popCursor (); - cerr << "Redrawed rectangles: " << _redrawRectCount << endl; + //cerr << "Redrawed rectangles: " << _redrawRectCount << endl; } @@ -237,6 +238,12 @@ void CellWidget::drawGo ( const Go* go drawContact ( contact, basicLayer, redrawArea, transformation ); return; } + + const Pad* pad = dynamic_cast(go); + if (pad) { + drawPad ( pad, basicLayer, redrawArea, transformation ); + return; + } } @@ -264,6 +271,15 @@ void CellWidget::drawContact ( const Contact* contact drawBox ( transformation.getBox(contact->getBoundingBox(basicLayer)) ); } +void CellWidget::drawPad ( const Pad* pad + , const BasicLayer* basicLayer + , const Box& redrawArea + , const Transformation& transformation + ) +{ + drawBox ( transformation.getBox(pad->getBoundingBox(basicLayer)) ); +} + void CellWidget::drawBox ( const Box& box ) { diff --git a/hurricane/src/hviewer/hurricane/viewer/CellWidget.h b/hurricane/src/hviewer/hurricane/viewer/CellWidget.h index 8274ea4e..614d607e 100644 --- a/hurricane/src/hviewer/hurricane/viewer/CellWidget.h +++ b/hurricane/src/hviewer/hurricane/viewer/CellWidget.h @@ -41,6 +41,7 @@ namespace Hurricane { class Slice; class Segment; class Contact; + class Pad; class PaletteEntry; class Palette; @@ -127,6 +128,7 @@ namespace Hurricane { void drawGo ( const Go* , const BasicLayer*, const Box&, const Transformation& ); void drawSegment ( const Segment* , const BasicLayer*, const Box&, const Transformation& ); void drawContact ( const Contact* , const BasicLayer*, const Box&, const Transformation& ); + void drawPad ( const Pad* , const BasicLayer*, const Box&, const Transformation& ); void drawBox ( const Box& ); void drawLine ( const Point&, const Point& );