* ./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.
This commit is contained in:
parent
ecef0bb749
commit
46cff23d7a
|
@ -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("<not associated>")
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
// ******
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace Hurricane {
|
|||
// Functions.
|
||||
|
||||
QBrush getBrush ( const string& pattern, int red, int green, int blue );
|
||||
QBrush getBrush ( const BasicLayer* layer );
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue