From 46cff23d7af6ec3072e3f5f44bc3118c6fcf9ffb Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 19 May 2008 22:24:23 +0000 Subject: [PATCH] * ./hurricane/src/hurricane/BasicLayer.{h,cpp} - Suppress all graphics related members from Layer. - Adding realName member for symbolic to real transformation. * ./hurricane/src/hviewer/CellWidget.cpp Bug: Now uses display threshold from Graphics (DisplayStyle) instead of layer. Now layers appears/diseapears while zooming/unzooming. --- hurricane/src/hurricane/BasicLayer.cpp | 38 ++--------------------- hurricane/src/hurricane/BasicLayer.h | 16 ++-------- hurricane/src/hviewer/CellWidget.cpp | 3 +- hurricane/src/hviewer/LayerPaletteEntry.h | 16 +++++----- hurricane/src/hviewer/ScreenUtilities.cpp | 10 ------ hurricane/src/hviewer/ScreenUtilities.h | 1 - 6 files changed, 14 insertions(+), 70 deletions(-) diff --git a/hurricane/src/hurricane/BasicLayer.cpp b/hurricane/src/hurricane/BasicLayer.cpp index 97c4ac40..9f094e1d 100644 --- a/hurricane/src/hurricane/BasicLayer.cpp +++ b/hurricane/src/hurricane/BasicLayer.cpp @@ -88,11 +88,7 @@ BasicLayer::BasicLayer(Technology* technology, const Name& name, const Type& typ : Inherit(technology, name, minimalSize, minimalSpacing), _type(type), _extractNumber(extractNumber), - _redValue(255), - _greenValue(255), - _blueValue(255), - _fillPattern("FFFFFFFFFFFFFFFF"), - _displayThreshold(0.0) + _realName("") { } @@ -113,32 +109,6 @@ BasicLayers BasicLayer::getBasicLayers() const return BasicLayer_BasicLayers(this); } -void BasicLayer::setColor(unsigned short redValue, unsigned short greenValue, unsigned short blueValue) -// **************************************************************************************************** -{ - if ((redValue != _redValue) || (greenValue != _greenValue) || (blueValue != _blueValue)) { - _redValue = redValue; - _greenValue = greenValue; - _blueValue = blueValue; - } -} - -void BasicLayer::setFillPattern(const string& fillPattern) -// ******************************************************* -{ - if (fillPattern != _fillPattern) { - if (fillPattern.size() != 16) - throw Error("Can't set fill pattern (bad value)"); - - string validChars = "0123456789ABCDEFabcdef"; - for (unsigned i = 0; i < 16; i++) { - if (validChars.find(fillPattern[i]) == string::npos) - throw Error("Can't set fill pattern (bad value)"); - } - _fillPattern = fillPattern; - } -} - void BasicLayer::_postCreate() // *************************** { @@ -194,11 +164,7 @@ Record* BasicLayer::_getRecord() const Record* record = Inherit::_getRecord(); if (record) { record->add(getSlot("Type", &_type)); - record->add(getSlot("RedValue", &_redValue)); - record->add(getSlot("GreenValue", &_greenValue)); - record->add(getSlot("BlueValue", &_blueValue)); - record->add(getSlot("FillPattern", &_fillPattern)); - record->add(getSlot("DisplayThreshold", &_displayThreshold)); + record->add(getSlot("RealName", &_realName)); } return record; } diff --git a/hurricane/src/hurricane/BasicLayer.h b/hurricane/src/hurricane/BasicLayer.h index 4c9fa5b6..80fd7630 100644 --- a/hurricane/src/hurricane/BasicLayer.h +++ b/hurricane/src/hurricane/BasicLayer.h @@ -56,13 +56,9 @@ class BasicLayer : public Layer { private: Type _type; private: unsigned _extractNumber; - private: unsigned short _redValue; - private: unsigned short _greenValue; - private: unsigned short _blueValue; - private: string _fillPattern; - private: double _displayThreshold; private: BasicLayer* _connectorLayer; private: BasicLayer* _obstructionLayer; + private: Name _realName; // Constructors // ************ @@ -76,23 +72,17 @@ class BasicLayer : public Layer { public: const Type& getType() const {return _type;}; public: unsigned getExtractNumber() const {return _extractNumber;}; - public: const unsigned short& getRedValue() const {return _redValue;}; - public: const unsigned short& getGreenValue() const {return _greenValue;}; - public: const unsigned short& getBlueValue() const {return _blueValue;}; - public: const string& getFillPattern() const {return _fillPattern;}; - public: double getDisplayThreshold() const {return _displayThreshold;}; public: virtual BasicLayers getBasicLayers() const; public: virtual BasicLayer* getConnectorLayer() const {return _connectorLayer;}; public: virtual BasicLayer* getObstructionLayer() const {return _obstructionLayer;}; + public: const Name& getRealName () const { return _realName; }; // Updators // ******** - public: void setColor(unsigned short redValue, unsigned short greenValue, unsigned short blueValue); - public: void setFillPattern(const string& fillPattern); - public: void setDisplayThreshold(double threshold) {_displayThreshold = threshold;}; public: void setConnectorLayer(BasicLayer* layer) {_connectorLayer = layer;}; public: void setObstructionLayer(BasicLayer* layer) {_obstructionLayer = layer;}; + public: void setRealName(const char* realName) { _realName = realName; }; // Others // ****** diff --git a/hurricane/src/hviewer/CellWidget.cpp b/hurricane/src/hviewer/CellWidget.cpp index 0679d285..9ff97ca5 100644 --- a/hurricane/src/hviewer/CellWidget.cpp +++ b/hurricane/src/hviewer/CellWidget.cpp @@ -164,8 +164,7 @@ void CellWidget::drawBoundaries ( const Instance* instance bool CellWidget::isDrawable ( PaletteEntry* entry ) { - return entry->isChecked() - && ( entry->getBasicLayer()->getDisplayThreshold() < _scale*100 ); + return entry->isChecked() && ( Graphics::getThreshold(entry->getName()) < _scale*100 ); } diff --git a/hurricane/src/hviewer/LayerPaletteEntry.h b/hurricane/src/hviewer/LayerPaletteEntry.h index fbd584e5..47973337 100644 --- a/hurricane/src/hviewer/LayerPaletteEntry.h +++ b/hurricane/src/hviewer/LayerPaletteEntry.h @@ -19,20 +19,20 @@ namespace Hurricane { // Constructor. public: - static LayerPaletteEntry* create ( Palette* palette, BasicLayer* basicLayer ); + static LayerPaletteEntry* create ( Palette* palette, BasicLayer* basicLayer ); // Methods. public: - virtual bool isGroup () const; - virtual bool isBasicLayer () const; - virtual const Name& getName () const; - virtual BasicLayer* getBasicLayer (); - virtual bool isChecked () const; - virtual void setChecked ( bool state ); + virtual bool isGroup () const; + virtual bool isBasicLayer () const; + virtual const Name& getName () const; + virtual BasicLayer* getBasicLayer (); + virtual bool isChecked () const; + virtual void setChecked ( bool state ); // Slots. public slots: - virtual void toggle (); + virtual void toggle (); // Internal - Attributes. protected: diff --git a/hurricane/src/hviewer/ScreenUtilities.cpp b/hurricane/src/hviewer/ScreenUtilities.cpp index ba63a9c4..4ec48a8c 100644 --- a/hurricane/src/hviewer/ScreenUtilities.cpp +++ b/hurricane/src/hviewer/ScreenUtilities.cpp @@ -71,14 +71,4 @@ QBrush getBrush ( const string& pattern, int red, int green, int blue ) } -QBrush getBrush ( const BasicLayer* layer ) -{ - return getBrush ( layer->getFillPattern() - , layer->getRedValue() - , layer->getGreenValue() - , layer->getBlueValue() - ); -} - - } // End of Hurricane namespace. diff --git a/hurricane/src/hviewer/ScreenUtilities.h b/hurricane/src/hviewer/ScreenUtilities.h index 4140069e..61591fcc 100644 --- a/hurricane/src/hviewer/ScreenUtilities.h +++ b/hurricane/src/hviewer/ScreenUtilities.h @@ -24,7 +24,6 @@ namespace Hurricane { // Functions. QBrush getBrush ( const string& pattern, int red, int green, int blue ); - QBrush getBrush ( const BasicLayer* layer );