Cleaning in progress in Hurricane

This commit is contained in:
Christophe Alexandre 2008-03-14 16:31:18 +00:00
parent 751425c2d1
commit 0eb89cad32
23 changed files with 2523 additions and 1809 deletions

View File

@ -1 +1,3 @@
EXEC_PROGRAM(${DOXYGEN_EXECUTABLE})
ADD_CUSTOM_TARGET(doc ALL cd ${HURRICANE_SOURCE_DIR}/doc/hurricane && ${DOXYGEN_EXECUTABLE} doxyfile)
INSTALL(DIRECTORY html/ DESTINATION /share/doc/en/html/hurricane)

File diff suppressed because it is too large Load Diff

View File

@ -74,7 +74,7 @@ void InstanceGraphicsItem::drawElements(QPainter* painter) {
painter->save();
BasicLayer* layer = dynamic_cast<BasicLayer*>(slice->GetLayer());
if (layer) {
painter->setBrush(QColor(layer->GetRedValue(), layer->GetGreenValue(), layer->GetBlueValue()));
painter->setBrush(QColor(layer->getRedValue(), layer->getGreenValue(), layer->getBlueValue()));
} else {
painter->setBrush(Qt::blue);
}

View File

@ -80,9 +80,9 @@ void SegmentGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
boxToRectangle(box, rect);
BasicLayer* blayer = dynamic_cast<BasicLayer*>(segment->GetLayer());
if (blayer) {
QColor layerColor(blayer->GetRedValue(),
blayer->GetGreenValue(),
blayer->GetBlueValue());
QColor layerColor(blayer->getRedValue(),
blayer->getGreenValue(),
blayer->getBlueValue());
QBrush brush(layerColor);
brush.setStyle(Qt::Dense1Pattern);
painter->setBrush(brush);
@ -95,10 +95,10 @@ void SegmentGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
} else {
CompositeLayer* clayer = dynamic_cast<CompositeLayer*>(segment->GetLayer());
if (clayer) {
for_each_basic_layer(basiclayer, clayer->GetBasicLayers()) {
QColor layerColor(basiclayer->GetRedValue(),
basiclayer->GetGreenValue(),
basiclayer->GetBlueValue());
for_each_basic_layer(basiclayer, clayer->getBasicLayers()) {
QColor layerColor(basiclayer->getRedValue(),
basiclayer->getGreenValue(),
basiclayer->getBlueValue());
QBrush brush(layerColor);
brush.setStyle(Qt::Dense1Pattern);
painter->setBrush(brush);

View File

@ -96,7 +96,7 @@ BasicLayer::BasicLayer(Technology* technology, const Name& name, const Type& typ
{
}
BasicLayer* BasicLayer::Create(Technology* technology, const Name& name, const Type& type, unsigned extractNumber, const Unit& minimalSize, const Unit& minimalSpacing)
BasicLayer* BasicLayer::create(Technology* technology, const Name& name, const Type& type, unsigned extractNumber, const Unit& minimalSize, const Unit& minimalSpacing)
// ****************************************************************************************************
{
BasicLayer* basicLayer =
@ -107,31 +107,23 @@ BasicLayer* BasicLayer::Create(Technology* technology, const Name& name, const T
return basicLayer;
}
BasicLayers BasicLayer::GetBasicLayers() const
BasicLayers BasicLayer::getBasicLayers() const
// *******************************************
{
return BasicLayer_BasicLayers(this);
}
void BasicLayer::SetColor(unsigned short redValue, unsigned short greenValue, unsigned short blueValue)
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;
//if (_drawGC) {
// gdk_gc_destroy(_drawGC);
// _drawGC = NULL;
//}
//if (_fillGC) {
// gdk_gc_destroy(_fillGC);
// _fillGC = NULL;
//}
}
}
void BasicLayer::SetFillPattern(const string& fillPattern)
void BasicLayer::setFillPattern(const string& fillPattern)
// *******************************************************
{
if (fillPattern != _fillPattern) {
@ -144,14 +136,6 @@ void BasicLayer::SetFillPattern(const string& fillPattern)
throw Error("Can't set fill pattern (bad value)");
}
_fillPattern = fillPattern;
//if (_drawGC) {
// gdk_gc_destroy(_drawGC);
// _drawGC = NULL;
//}
//if (_fillGC) {
// gdk_gc_destroy(_fillGC);
// _fillGC = NULL;
//}
}
}
@ -159,8 +143,8 @@ void BasicLayer::_PostCreate()
// ***************************
{
Mask basicLayersMask = 0;
for_each_basic_layer(basicLayer, GetTechnology()->GetBasicLayers()) {
basicLayersMask |= basicLayer->GetMask();
for_each_basic_layer(basicLayer, getTechnology()->GetBasicLayers()) {
basicLayersMask |= basicLayer->getMask();
end_for;
}
@ -170,7 +154,7 @@ void BasicLayer::_PostCreate()
if (!mask)
throw Error("Can't create " + _TName("BasicLayer") + " : mask capacity overflow");
_SetMask(mask);
_setMask(mask);
if (_extractNumber) {
Mask extractMask = (1 << _extractNumber);
@ -178,7 +162,7 @@ void BasicLayer::_PostCreate()
if (!extractMask)
throw Error("Can't create " + _TName("BasicLayer") + " : extract mask capacity overflow");
_SetExtractMask(extractMask);
_setExtractMask(extractMask);
}
Inherit::_PostCreate();
@ -189,12 +173,9 @@ void BasicLayer::_PreDelete()
{
Inherit::_PreDelete();
//if (_drawGC) gdk_gc_destroy(_drawGC);
//if (_fillGC) gdk_gc_destroy(_fillGC);
CompositeLayers compositeLayers = GetTechnology()->GetCompositeLayers();
CompositeLayers compositeLayers = getTechnology()->GetCompositeLayers();
for_each_composite_layer(compositeLayer, compositeLayers) {
if (compositeLayer->Contains(this)) compositeLayer->Remove(this);
if (compositeLayer->contains(this)) compositeLayer->remove(this);
end_for;
}
}
@ -222,76 +203,6 @@ Record* BasicLayer::_GetRecord() const
return record;
}
//GdkGC* BasicLayer::_GetDrawGC()
//// ****************************
//{
// if (!_drawGC) _drawGC = gtk_gc_new(_redValue, _greenValue, _blueValue);
//
// return _drawGC;
//}
//
//GdkGC* BasicLayer::_GetFillGC()
//// ****************************
//{
// if (!_fillGC) _fillGC = gtk_gc_new(_redValue, _greenValue, _blueValue, _fillPattern);
//
// return _fillGC;
//}
//
//void BasicLayer::_Fill(View* view, const Box& box) const
//// *****************************************************
//{
// switch (_type) {
// case Type::CONTACT : {
//
// Unit minimalSize = GetMinimalSize();
// Unit minimalSpacing = GetMinimalSpacing();
//
// if ((minimalSize <= 0) || (minimalSpacing <= 0))
// view->FillRectangle(box);
// else {
// view->DrawRectangle(box);
//
// Unit width = box.GetWidth();
// Unit height = box.GetHeight();
// Unit offset = minimalSize + minimalSpacing;
//
// int nx = (int)(GetValue(width) / GetValue(offset));
// int ny = (int)(GetValue(height) / GetValue(offset));
//
// Unit dx = (width - (minimalSize + (offset * nx))) / 2;
// Unit dy = (height - (minimalSize + (offset * ny))) / 2;
//
// if (dx < 0) dx = (width - (minimalSize + (offset * (--nx)))) / 2;
// if (dy < 0) dy = (height - (minimalSize + (offset * (--ny)))) / 2;
//
// Unit xmin = box.GetXMin() + dx;
// Unit ymin = box.GetYMin() + dy;
// Unit xmax = box.GetXMax() - dx;
// Unit ymax = box.GetYMax() - dy;
//
// if ((xmin < xmax) && (ymin < ymax)) {
// Unit y = ymin;
// do {
// Unit x = xmin;
// do {
// view->FillRectangle(x, y, x + minimalSize, y + minimalSize, true);
// x += offset;
// } while (x < xmax);
// y += offset;
// } while (y < ymax);
// }
// }
// break;
// }
// default : {
// view->FillRectangle(box);
// break;
// }
// }
//}
//
// ****************************************************************************************************
// BasicLayer_BasicLayers implementation
// ****************************************************************************************************

View File

@ -43,7 +43,7 @@ class BasicLayer : public Layer {
public: operator const Code&() const {return _code;};
public: const Code& GetCode() const {return _code;};
public: const Code& getCode() const {return _code;};
public: string _GetTypeName() const { return _TName("BasicLayer::Type"); };
public: string _GetString() const;
@ -61,34 +61,32 @@ class BasicLayer : public Layer {
private: unsigned short _blueValue;
private: string _fillPattern;
private: double _displayThreshold;
// private: GdkGC* _drawGC;
// private: GdkGC* _fillGC;
// Constructors
// ************
protected: BasicLayer(Technology* technology, const Name& name, const Type& type, unsigned extractNumber, const Unit& minimalSize = 0, const Unit& minimalSpacing = 0);
public: static BasicLayer* Create(Technology* technology, const Name& name, const Type& type, unsigned extractNumber, const Unit& minimalSize = 0, const Unit& minimalSpacing = 0);
public: static BasicLayer* create(Technology* technology, const Name& name, const Type& type, unsigned extractNumber, const Unit& minimalSize = 0, const Unit& minimalSpacing = 0);
// Accessors
// *********
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: 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;
// 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 setColor(unsigned short redValue, unsigned short greenValue, unsigned short blueValue);
public: void setFillPattern(const string& fillPattern);
public: void setDisplayThreshold(double threshold) {_displayThreshold = threshold;};
// Others
// ******
@ -100,11 +98,9 @@ class BasicLayer : public Layer {
public: virtual string _GetTypeName() const {return _TName("BasicLayer");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual BasicLayer* _GetSymbolicBasicLayer() {return this;};
//public: GdkGC* _GetDrawGC();
//public: GdkGC* _GetFillGC();
public: virtual BasicLayer* _getSymbolicBasicLayer() {return this;};
public: void _Fill(View* view, const Box& box) const;
public: void _fill(View* view, const Box& box) const;
};

View File

@ -1451,7 +1451,7 @@ Cell_Slices::Locator::Locator(const Cell* cell, const Layer::Mask& mask)
{
if (_cell && (_mask != 0)) {
_sliceLocator = ((Cell*)_cell)->_GetSliceMap().GetElements().GetLocator();
while (_sliceLocator.IsValid() && !(_sliceLocator.GetElement()->GetLayer()->GetMask() & _mask))
while (_sliceLocator.IsValid() && !(_sliceLocator.GetElement()->GetLayer()->getMask() & _mask))
_sliceLocator.Progress();
}
}
@ -1499,7 +1499,7 @@ void Cell_Slices::Locator::Progress()
do {
_sliceLocator.Progress();
}
while (_sliceLocator.IsValid() && !(_sliceLocator.GetElement()->GetLayer()->GetMask() & _mask));
while (_sliceLocator.IsValid() && !(_sliceLocator.GetElement()->GetLayer()->getMask() & _mask));
}
}

View File

@ -19,180 +19,180 @@ namespace Hurricane {
CompositeLayer::CompositeLayer(Technology* technology, const Name& name, const Type& type, const Unit& minimalSize, const Unit& minimalSpacing)
// ****************************************************************************************************
: Inherit(technology, name, minimalSize, minimalSpacing),
_type(type),
_basicLayerList(),
_contactSizeMap(),
_segmentSizeMap(),
_segmentExtentionMap(),
_padSizeMap(),
_maximalContactSize(0),
_maximalSegmentSize(0),
_maximalSegmentExtention(0),
_maximalPadSize(0),
_symbolicBasicLayer(NULL)
: Inherit(technology, name, minimalSize, minimalSpacing),
_type(type),
_basicLayerList(),
_contactSizeMap(),
_segmentSizeMap(),
_segmentExtentionMap(),
_padSizeMap(),
_maximalContactSize(0),
_maximalSegmentSize(0),
_maximalSegmentExtention(0),
_maximalPadSize(0),
_symbolicBasicLayer(NULL)
{
}
CompositeLayer* CompositeLayer::Create(Technology* technology, const Name& name, const Type& type, const Unit& minimalSize, const Unit& minimalSpacing)
CompositeLayer* CompositeLayer::create(Technology* technology, const Name& name, const Type& type, const Unit& minimalSize, const Unit& minimalSpacing)
// ****************************************************************************************************
{
CompositeLayer* compositeLayer =
new CompositeLayer(technology, name, type, minimalSize, minimalSpacing);
CompositeLayer* compositeLayer =
new CompositeLayer(technology, name, type, minimalSize, minimalSpacing);
compositeLayer->_PostCreate();
compositeLayer->_PostCreate();
return compositeLayer;
return compositeLayer;
}
BasicLayers CompositeLayer::GetBasicLayers() const
BasicLayers CompositeLayer::getBasicLayers() const
// ***********************************************
{
return GetCollection(_basicLayerList);
return GetCollection(_basicLayerList);
}
Unit CompositeLayer::GetContactSize(const BasicLayer* basicLayer) const
Unit CompositeLayer::getContactSize(const BasicLayer* basicLayer) const
// **************************************************************
{
SizeMap::const_iterator it = _contactSizeMap.find(basicLayer);
return ((it == _contactSizeMap.end()) ? 0 : (*it).second);
SizeMap::const_iterator it = _contactSizeMap.find(basicLayer);
return ((it == _contactSizeMap.end()) ? 0 : (*it).second);
}
Unit CompositeLayer::GetSegmentSize(const BasicLayer* basicLayer) const
Unit CompositeLayer::getSegmentSize(const BasicLayer* basicLayer) const
// **************************************************************
{
SizeMap::const_iterator it = _segmentSizeMap.find(basicLayer);
return ((it == _segmentSizeMap.end()) ? 0 : (*it).second);
SizeMap::const_iterator it = _segmentSizeMap.find(basicLayer);
return ((it == _segmentSizeMap.end()) ? 0 : (*it).second);
}
Unit CompositeLayer::GetSegmentExtention(const BasicLayer* basicLayer) const
Unit CompositeLayer::getSegmentExtention(const BasicLayer* basicLayer) const
// *******************************************************************
{
SizeMap::const_iterator it = _segmentExtentionMap.find(basicLayer);
return ((it == _segmentExtentionMap.end()) ? 0 : (*it).second);
SizeMap::const_iterator it = _segmentExtentionMap.find(basicLayer);
return ((it == _segmentExtentionMap.end()) ? 0 : (*it).second);
}
Unit CompositeLayer::GetPadSize(const BasicLayer* basicLayer) const
Unit CompositeLayer::getPadSize(const BasicLayer* basicLayer) const
// **********************************************************
{
SizeMap::const_iterator it = _padSizeMap.find(basicLayer);
return ((it == _padSizeMap.end()) ? 0 : (*it).second);
SizeMap::const_iterator it = _padSizeMap.find(basicLayer);
return ((it == _padSizeMap.end()) ? 0 : (*it).second);
}
void CompositeLayer::Add(BasicLayer* basicLayer, const Unit& contactSize, const Unit& segmentSize, const Unit& segmentExtention, const Unit& padSize)
void CompositeLayer::add(BasicLayer* basicLayer, const Unit& contactSize, const Unit& segmentSize, const Unit& segmentExtention, const Unit& padSize)
// ****************************************************************************************************
{
if (!basicLayer)
throw Error("Can't add basic layer : null basic layer");
if (!basicLayer)
throw Error("Can't add basic layer : null basic layer");
if (Contains(basicLayer))
throw Error("Can't add basic layer : already done");
if (contains(basicLayer))
throw Error("Can't add basic layer : already done");
_basicLayerList.push_back(basicLayer);
_basicLayerList.push_back(basicLayer);
_SetMask(GetMask() | basicLayer->GetMask());
_SetExtractMask(GetExtractMask() | basicLayer->GetExtractMask());
_setMask(getMask() | basicLayer->getMask());
_setExtractMask(getExtractMask() | basicLayer->getExtractMask());
if (contactSize != 0) _contactSizeMap[basicLayer] = contactSize;
if (segmentSize != 0) _segmentSizeMap[basicLayer] = segmentSize;
if (segmentExtention != 0) _segmentExtentionMap[basicLayer] = segmentExtention;
if (padSize != 0) _padSizeMap[basicLayer] = padSize;
if (contactSize != 0) _contactSizeMap[basicLayer] = contactSize;
if (segmentSize != 0) _segmentSizeMap[basicLayer] = segmentSize;
if (segmentExtention != 0) _segmentExtentionMap[basicLayer] = segmentExtention;
if (padSize != 0) _padSizeMap[basicLayer] = padSize;
_maximalContactSize = max(contactSize, _maximalContactSize);
_maximalSegmentSize = max(segmentSize, _maximalSegmentSize);
_maximalSegmentExtention = max(segmentExtention, _maximalSegmentExtention);
_maximalPadSize = max(padSize, _maximalPadSize);
_maximalContactSize = max(contactSize, _maximalContactSize);
_maximalSegmentSize = max(segmentSize, _maximalSegmentSize);
_maximalSegmentExtention = max(segmentExtention, _maximalSegmentExtention);
_maximalPadSize = max(padSize, _maximalPadSize);
}
void CompositeLayer::Remove(BasicLayer* basicLayer)
void CompositeLayer::remove(BasicLayer* basicLayer)
// ************************************************
{
if (!basicLayer)
throw Error("Can't remove basic layer : null basic layer");
if (!basicLayer)
throw Error("Can't remove basic layer : null basic layer");
if (!Contains(basicLayer))
throw Error("Can't remove basic layer : not contained");
if (!contains(basicLayer))
throw Error("Can't remove basic layer : not contained");
_basicLayerList.remove(basicLayer);
_basicLayerList.remove(basicLayer);
_contactSizeMap.erase(basicLayer);
_segmentSizeMap.erase(basicLayer);
_segmentExtentionMap.erase(basicLayer);
_padSizeMap.erase(basicLayer);
_contactSizeMap.erase(basicLayer);
_segmentSizeMap.erase(basicLayer);
_segmentExtentionMap.erase(basicLayer);
_padSizeMap.erase(basicLayer);
_maximalContactSize = 0;
_maximalSegmentSize = 0;
_maximalSegmentExtention = 0;
_maximalPadSize = 0;
_maximalContactSize = 0;
_maximalSegmentSize = 0;
_maximalSegmentExtention = 0;
_maximalPadSize = 0;
Mask mask = 0;
Mask extractMask = 0;
Mask mask = 0;
Mask extractMask = 0;
for_each_basic_layer(basicLayer, GetBasicLayers()) {
mask |= basicLayer->GetMask();
extractMask |= basicLayer->GetExtractMask();
_maximalContactSize = max(GetContactSize(basicLayer), _maximalContactSize);
_maximalSegmentSize = max(GetSegmentSize(basicLayer), _maximalSegmentSize);
_maximalSegmentExtention = max(GetSegmentExtention(basicLayer), _maximalSegmentExtention);
_maximalPadSize = max(GetPadSize(basicLayer), _maximalPadSize);
end_for;
}
for_each_basic_layer(basicLayer, getBasicLayers()) {
mask |= basicLayer->getMask();
extractMask |= basicLayer->getExtractMask();
_maximalContactSize = max(getContactSize(basicLayer), _maximalContactSize);
_maximalSegmentSize = max(getSegmentSize(basicLayer), _maximalSegmentSize);
_maximalSegmentExtention = max(getSegmentExtention(basicLayer), _maximalSegmentExtention);
_maximalPadSize = max(getPadSize(basicLayer), _maximalPadSize);
end_for;
}
_SetMask(mask);
_SetExtractMask(extractMask);
_setMask(mask);
_setExtractMask(extractMask);
}
string CompositeLayer::_GetString() const
// **************************************
{
string s = Inherit::_GetString();
/*
s.insert(s.length() - 1, " " + GetString(_type));
s.insert(s.length() - 1, " {");
string separator = "";
for_each_basic_layer(basicLayer, GetBasicLayers()) {
s.insert(s.length() - 1, separator + GetString(basicLayer->GetName()));
separator = "|";
end_for;
}
s.insert(s.length() - 1, "}");
*/
return s;
string s = Inherit::_GetString();
/*
s.insert(s.length() - 1, " " + GetString(_type));
s.insert(s.length() - 1, " {");
string separator = "";
for_each_basic_layer(basicLayer, GetBasicLayers()) {
s.insert(s.length() - 1, separator + GetString(basicLayer->GetName()));
separator = "|";
end_for;
}
s.insert(s.length() - 1, "}");
*/
return s;
}
Record* CompositeLayer::_GetRecord() const
// ***************************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("Type", &_type));
record->Add(GetSlot("BasicLayers", &_basicLayerList));
record->Add(GetSlot("ContactSizes", &_contactSizeMap));
record->Add(GetSlot("SegmentSizes", &_segmentSizeMap));
record->Add(GetSlot("SegmentExtentions", &_segmentExtentionMap));
record->Add(GetSlot("PadSizes", &_padSizeMap));
record->Add(GetSlot("MaximalContactSize", &_maximalContactSize));
record->Add(GetSlot("MaximalSegmentSize", &_maximalSegmentSize));
record->Add(GetSlot("MaximalSegmentExtention", &_maximalSegmentExtention));
record->Add(GetSlot("MaximalPadSize", &_maximalPadSize));
}
return record;
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("Type", &_type));
record->Add(GetSlot("BasicLayers", &_basicLayerList));
record->Add(GetSlot("ContactSizes", &_contactSizeMap));
record->Add(GetSlot("SegmentSizes", &_segmentSizeMap));
record->Add(GetSlot("SegmentExtentions", &_segmentExtentionMap));
record->Add(GetSlot("PadSizes", &_padSizeMap));
record->Add(GetSlot("MaximalContactSize", &_maximalContactSize));
record->Add(GetSlot("MaximalSegmentSize", &_maximalSegmentSize));
record->Add(GetSlot("MaximalSegmentExtention", &_maximalSegmentExtention));
record->Add(GetSlot("MaximalPadSize", &_maximalPadSize));
}
return record;
}
void CompositeLayer::_UpdateSymbolicBasicLayer(const Layer::Mask& visibleBasicLayersMask)
void CompositeLayer::_updateSymbolicBasicLayer(const Layer::Mask& visibleBasicLayersMask)
// **************************************************************************************
{
_symbolicBasicLayer = NULL;
BasicLayer* symbolicBasicLayer = NULL;
for_each_basic_layer(basicLayer, GetBasicLayers()) {
if (basicLayer->GetMask() & visibleBasicLayersMask) {
symbolicBasicLayer = basicLayer;
if (basicLayer->GetType() == BasicLayer::Type::CONTACT)
_symbolicBasicLayer = basicLayer;
}
end_for;
}
if (!_symbolicBasicLayer) _symbolicBasicLayer = symbolicBasicLayer;
_symbolicBasicLayer = NULL;
BasicLayer* symbolicBasicLayer = NULL;
for_each_basic_layer(basicLayer, getBasicLayers()) {
if (basicLayer->getMask() & visibleBasicLayersMask) {
symbolicBasicLayer = basicLayer;
if (basicLayer->getType() == BasicLayer::Type::CONTACT)
_symbolicBasicLayer = basicLayer;
}
end_for;
}
if (!_symbolicBasicLayer) _symbolicBasicLayer = symbolicBasicLayer;
}
// ****************************************************************************************************
@ -201,40 +201,40 @@ void CompositeLayer::_UpdateSymbolicBasicLayer(const Layer::Mask& visibleBasicLa
CompositeLayer::Type::Type(const Code& code)
// *****************************************
: _code(code)
: _code(code)
{
}
CompositeLayer::Type::Type(const Type& type)
// *****************************************
: _code(type._code)
: _code(type._code)
{
}
CompositeLayer::Type& CompositeLayer::Type::operator=(const Type& type)
// ********************************************************************
{
_code = type._code;
return *this;
_code = type._code;
return *this;
}
string CompositeLayer::Type::_GetString() const
// ********************************************
{
switch (_code) {
case UNDEFINED : return "UNDEFINED";
case METAL : return "METAL";
case VIA : return "VIA";
}
return "ABNORMAL";
switch (_code) {
case UNDEFINED : return "UNDEFINED";
case METAL : return "METAL";
case VIA : return "VIA";
}
return "ABNORMAL";
}
Record* CompositeLayer::Type::_GetRecord() const
// *********************************************
{
Record* record = new Record(GetString(this));
record->Add(GetSlot("Code", (int)_code));
return record;
Record* record = new Record(GetString(this));
record->Add(GetSlot("Code", (int)_code));
return record;
}
@ -249,19 +249,19 @@ Record* CompositeLayer::Type::_GetRecord() const
bool Scan(const string& s, H::CompositeLayer::Type& type)
// ***************************************************
{
if (s == "UNDEFINED") {
type = H::CompositeLayer::Type::UNDEFINED;
return true;
}
if (s == "METAL") {
type = H::CompositeLayer::Type::METAL;
return true;
}
if (s == "VIA") {
type = H::CompositeLayer::Type::VIA;
return true;
}
return false;
if (s == "UNDEFINED") {
type = H::CompositeLayer::Type::UNDEFINED;
return true;
}
if (s == "METAL") {
type = H::CompositeLayer::Type::METAL;
return true;
}
if (s == "VIA") {
type = H::CompositeLayer::Type::VIA;
return true;
}
return false;
}

View File

@ -24,86 +24,86 @@ class CompositeLayer : public Layer {
// Types
// *****
public: typedef Layer Inherit;
public: typedef Layer Inherit;
public: class Type {
// ***************
// ***************
public: enum Code {UNDEFINED=0, METAL=1, VIA=2};
public: enum Code {UNDEFINED=0, METAL=1, VIA=2};
private: Code _code;
private: Code _code;
public: Type(const Code& code = UNDEFINED);
public: Type(const Type& type);
public: Type(const Code& code = UNDEFINED);
public: Type(const Type& type);
public: Type& operator=(const Type& type);
public: Type& operator=(const Type& type);
public: operator const Code&() const {return _code;};
public: operator const Code&() const {return _code;};
public: const Code& GetCode() const {return _code;};
public: const Code& getCode() const {return _code;};
public: string _GetTypeName() const { return _TName("CompositeLayer::Type"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _GetString() const;
public: Record* _GetRecord() const;
};
};
public: typedef list<BasicLayer*> BasicLayerList;
public: typedef list<BasicLayer*> BasicLayerList;
public: typedef map<const BasicLayer*, Unit> SizeMap;
public: typedef map<const BasicLayer*, Unit> SizeMap;
// Attributes
// **********
private: Type _type;
private: BasicLayerList _basicLayerList;
private: SizeMap _contactSizeMap;
private: SizeMap _segmentSizeMap;
private: SizeMap _segmentExtentionMap;
private: SizeMap _padSizeMap;
private: Unit _maximalContactSize;
private: Unit _maximalSegmentSize;
private: Unit _maximalSegmentExtention;
private: Unit _maximalPadSize;
private: BasicLayer* _symbolicBasicLayer;
private: Type _type;
private: BasicLayerList _basicLayerList;
private: SizeMap _contactSizeMap;
private: SizeMap _segmentSizeMap;
private: SizeMap _segmentExtentionMap;
private: SizeMap _padSizeMap;
private: Unit _maximalContactSize;
private: Unit _maximalSegmentSize;
private: Unit _maximalSegmentExtention;
private: Unit _maximalPadSize;
private: BasicLayer* _symbolicBasicLayer;
// Constructors
// ************
protected: CompositeLayer(Technology* technology, const Name& name, const Type& type, const Unit& minimalSize = 0, const Unit& minimalSpacing = 0);
protected: CompositeLayer(Technology* technology, const Name& name, const Type& type, const Unit& minimalSize = 0, const Unit& minimalSpacing = 0);
public: static CompositeLayer* Create(Technology* technology, const Name& name, const Type& type, const Unit& minimalSize = 0, const Unit& minimalSpacing = 0);
public: static CompositeLayer* create(Technology* technology, const Name& name, const Type& type, const Unit& minimalSize = 0, const Unit& minimalSpacing = 0);
// Accessors
// *********
public: const Type& GetType() const {return _type;};
public: virtual BasicLayers GetBasicLayers() const;
public: Unit GetContactSize(const BasicLayer* basicLayer) const;
public: Unit GetSegmentSize(const BasicLayer* basicLayer) const;
public: Unit GetSegmentExtention(const BasicLayer* basicLayer) const;
public: Unit GetPadSize(const BasicLayer* basicLayer) const;
public: const Unit& GetMaximalContactSize() const {return _maximalContactSize;};
public: const Unit& GetMaximalSegmentSize() const {return _maximalSegmentSize;};
public: const Unit& GetMaximalSegmentExtention() const {return _maximalSegmentExtention;};
public: const Unit& GetMaximalPadSize() const {return _maximalPadSize;};
public: const Type& getType() const {return _type;};
public: virtual BasicLayers getBasicLayers() const;
public: Unit getContactSize(const BasicLayer* basicLayer) const;
public: Unit getSegmentSize(const BasicLayer* basicLayer) const;
public: Unit getSegmentExtention(const BasicLayer* basicLayer) const;
public: Unit getPadSize(const BasicLayer* basicLayer) const;
public: const Unit& getMaximalContactSize() const {return _maximalContactSize;};
public: const Unit& getMaximalSegmentSize() const {return _maximalSegmentSize;};
public: const Unit& getMaximalSegmentExtention() const {return _maximalSegmentExtention;};
public: const Unit& getMaximalPadSize() const {return _maximalPadSize;};
// Updators
// ********
public: void Add(BasicLayer* basicLayer, const Unit& contactSize, const Unit& segmentSize, const Unit& segmentExtention, const Unit& padSize);
public: void Remove(BasicLayer* basicLayer);
public: void add(BasicLayer* basicLayer, const Unit& contactSize, const Unit& segmentSize, const Unit& segmentExtention, const Unit& padSize);
public: void remove(BasicLayer* basicLayer);
// Others
// ******
public: virtual string _GetTypeName() const {return _TName("CompositeLayer");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual BasicLayer* _GetSymbolicBasicLayer() {return _symbolicBasicLayer;};
public: BasicLayerList& _GetBasicLayerList() {return _basicLayerList;};
public: virtual string _GetTypeName() const {return _TName("CompositeLayer");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual BasicLayer* _getSymbolicBasicLayer() {return _symbolicBasicLayer;};
public: BasicLayerList& _getBasicLayerList() {return _basicLayerList;};
public: void _UpdateSymbolicBasicLayer(const Layer::Mask& visibleBasicLayersMask);
public: void _updateSymbolicBasicLayer(const Layer::Mask& visibleBasicLayersMask);
};

View File

@ -186,7 +186,7 @@ Box Contact::GetBoundingBox() const
Box Contact::GetBoundingBox(const BasicLayer* basicLayer) const
// ******************************************************
{
if (!_layer->Contains(basicLayer)) return Box();
if (!_layer->contains(basicLayer)) return Box();
Unit size = _GetSize(basicLayer);
@ -318,7 +318,7 @@ string Contact::_GetString() const
// *******************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_layer->GetName()));
s.insert(s.length() - 1, " " + GetString(_layer->getName()));
s.insert(s.length() - 1, " [" + GetValueString(GetX()));
s.insert(s.length() - 1, " " + GetValueString(GetY()));
s.insert(s.length() - 1, "] " + GetValueString(_width));
@ -349,7 +349,7 @@ Unit Contact::_GetSize() const
Layer* layer = GetLayer();
if (is_a<CompositeLayer*>(layer))
size = ((CompositeLayer*)layer)->GetMaximalContactSize();
size = ((CompositeLayer*)layer)->getMaximalContactSize();
return size;
}
@ -359,69 +359,16 @@ Unit Contact::_GetSize(const BasicLayer* basicLayer) const
{
Layer* layer = GetLayer();
if (!layer->Contains(basicLayer)) return 0;
if (!layer->contains(basicLayer)) return 0;
Unit size = 0;
if (is_a<CompositeLayer*>(layer))
size = ((CompositeLayer*)layer)->GetContactSize(basicLayer);
size = ((CompositeLayer*)layer)->getContactSize(basicLayer);
return size;
}
//void Contact::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// ****************************************************************************************************
//{
// if (_width && _height) {
// if (1 < view->GetScreenSize(max(_width, _height)))
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
// }
// if (basicLayer == _layer->_GetSymbolicBasicLayer()) {
// if (view->CutPointsAreVisible() && (3 < view->GetScale())) {
// Point position = GetPosition();
// view->DrawPoint(transformation.GetPoint(position), 3);
// if (_width) {
// Box box = transformation.GetBox(Box(position).Inflate(GetHalfWidth(), 0));
// view->DrawLine(box.GetXMin(), box.GetYMin(), box.GetXMax(), box.GetYMax());
// }
// if (_height) {
// Box box = transformation.GetBox(Box(position).Inflate(0, GetHalfHeight()));
// view->DrawLine(box.GetXMin(), box.GetYMin(), box.GetXMax(), box.GetYMax());
// }
// }
// }
//}
//
//void Contact::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
//// **********************************************************************************************
//{
// if (_width && _height) {
// if (1 < view->GetScreenSize(max(_width, _height))) {
// for_each_basic_layer(basicLayer, GetLayer()->GetBasicLayers()) {
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
// end_for;
// }
// }
// }
// if (view->GetScale() <= 1)
// view->DrawPoint(transformation.GetPoint(GetPosition()), 1);
// else if (view->GetScale() <= 3)
// view->DrawPoint(transformation.GetPoint(GetPosition()), 2);
// else {
// Point position = GetPosition();
// view->DrawPoint(transformation.GetPoint(position), 3);
// if (_width) {
// Box box = transformation.GetBox(Box(position).Inflate(GetHalfWidth(), 0));
// view->DrawLine(box.GetXMin(), box.GetYMin(), box.GetXMax(), box.GetYMax());
// }
// if (_height) {
// Box box = transformation.GetBox(Box(position).Inflate(0, GetHalfHeight()));
// view->DrawLine(box.GetXMin(), box.GetYMin(), box.GetXMax(), box.GetYMax());
// }
// }
//}
//
// ****************************************************************************************************
// Contact::AnchorHook implementation
// ****************************************************************************************************

View File

@ -27,69 +27,69 @@ class DBo : public NestedSlotAdapter {
// Types
// *****
public: typedef set<Property*> PropertySet;
public: typedef set<Property*> PropertySet;
// Attributs
// *********
private: PropertySet _propertySet;
private: PropertySet _propertySet;
// Constructors
// ************
protected: DBo();
protected: DBo();
private: DBo(const DBo& dbo); // not implemented to forbid copy construction
private: DBo(const DBo& dbo); // not implemented to forbid copy construction
// Destructors
// ***********
protected: virtual ~DBo();
protected: virtual ~DBo();
// Operators
// *********
private: DBo& operator=(const DBo& dbo); // not implemented to forbid assignment
private: DBo& operator=(const DBo& dbo); // not implemented to forbid assignment
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _PostCreate();
protected: virtual void _PreDelete();
protected: virtual void _PreDelete();
public: virtual string _GetTypeName() const = 0;
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: PropertySet& _GetPropertySet() {return _propertySet;};
public: virtual string _GetTypeName() const = 0;
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: PropertySet& _GetPropertySet() {return _propertySet;};
public: void _OnDeleted(Property* property);
public: void _OnDeleted(Property* property);
# endif
// Destructors
// ***********
public: virtual void Delete();
public: virtual void Delete();
// Accessors
// *********
public: Property* GetProperty(const Name& name) const;
public: Properties GetProperties() const {return GetCollection(_propertySet);};
public: Property* GetProperty(const Name& name) const;
public: Properties GetProperties() const {return GetCollection(_propertySet);};
// Predicates
// **********
public: bool HasProperty() const {return !_propertySet.empty();};
public: bool HasProperty() const {return !_propertySet.empty();};
// Updators
// ********
public: void Put(Property* property);
public: void Remove(Property* property);
public: void RemoveProperty(const Name& name);
public: void ClearProperties();
public: void Put(Property* property);
public: void Remove(Property* property);
public: void RemoveProperty(const Name& name);
public: void ClearProperties();
};

View File

@ -70,7 +70,7 @@ Box Horizontal::GetBoundingBox() const
Box Horizontal::GetBoundingBox(const BasicLayer* basicLayer) const
// *********************************************************
{
if (!GetLayer()->Contains(basicLayer)) return Box();
if (!GetLayer()->contains(basicLayer)) return Box();
Unit size = GetHalfWidth() + _GetSize(basicLayer);
Unit extention = _GetExtention(basicLayer);

File diff suppressed because it is too large Load Diff

View File

@ -18,112 +18,112 @@ namespace Hurricane {
Layer::Layer(Technology* technology, const Name& name, const Unit& minimalSize, const Unit& minimalSpacing, const Unit& pitch)
// ****************************************************************************************************
: Inherit(),
_technology(technology),
_name(name),
_mask(0),
_extractMask(0),
_minimalSize(minimalSize),
_minimalSpacing(minimalSpacing),
: Inherit(),
_technology(technology),
_name(name),
_mask(0),
_extractMask(0),
_minimalSize(minimalSize),
_minimalSpacing(minimalSpacing),
_pitch(pitch),
_nextOfTechnologyLayerMap(NULL)
_nextOfTechnologyLayerMap(NULL)
{
if (!_technology)
throw Error("Can't create " + _TName("Layer") + " : null technology");
if (!_technology)
throw Error("Can't create " + _TName("Layer") + " : null technology");
if (_name.IsEmpty())
throw Error("Can't create " + _TName("Layer") + " : empty name");
if (_name.IsEmpty())
throw Error("Can't create " + _TName("Layer") + " : empty name");
if (_technology->GetLayer(_name))
throw Error("Can't create " + _TName("Layer") + " " + GetString(_name) + " : already exists");
if (_technology->GetLayer(_name))
throw Error("Can't create " + _TName("Layer") + " " + GetString(_name) + " : already exists");
}
bool Layer::Contains(const Layer* layer) const
bool Layer::contains(const Layer* layer) const
// *******************************************
{
return (layer && ((_mask & layer->GetMask()) == layer->GetMask()));
return (layer && ((_mask & layer->getMask()) == layer->getMask()));
}
bool Layer::Intersect(const Layer* layer) const
bool Layer::intersect(const Layer* layer) const
// ********************************************
{
return ((_mask & layer->GetMask()) != 0);
return ((_mask & layer->getMask()) != 0);
}
void Layer::SetName(const Name& name)
void Layer::setName(const Name& name)
// **********************************
{
if (name != _name) {
if (name.IsEmpty())
throw Error("Can't change layer name : empty name");
if (name != _name) {
if (name.IsEmpty())
throw Error("Can't change layer name : empty name");
if (_technology->GetLayer(name))
throw Error("Can't change layer name : already exists");
if (_technology->GetLayer(name))
throw Error("Can't change layer name : already exists");
_technology->_GetLayerMap()._Remove(this);
_name = name;
_technology->_GetLayerMap()._Insert(this);
}
_technology->_GetLayerMap()._Remove(this);
_name = name;
_technology->_GetLayerMap()._Insert(this);
}
}
void Layer::SetMinimalSize(const Unit& minimalSize)
void Layer::setMinimalSize(const Unit& minimalSize)
// ************************************************
{
_minimalSize = minimalSize;
_minimalSize = minimalSize;
}
void Layer::SetMinimalSpacing(const Unit& minimalSpacing)
void Layer::setMinimalSpacing(const Unit& minimalSpacing)
// ******************************************************
{
_minimalSpacing = minimalSpacing;
_minimalSpacing = minimalSpacing;
}
void Layer::SetPitch(const Unit& pitch)
void Layer::setPitch(const Unit& pitch)
// ************************************
{
_pitch = pitch;
_pitch = pitch;
}
void Layer::_PostCreate()
// **********************
{
_technology->_GetLayerMap()._Insert(this);
_technology->_GetLayerList().push_back(this);
_technology->_GetLayerMap()._Insert(this);
_technology->_GetLayerList().push_back(this);
Inherit::_PostCreate();
Inherit::_PostCreate();
}
void Layer::_PreDelete()
// *********************
{
Inherit::_PreDelete();
Inherit::_PreDelete();
_technology->_GetLayerList().remove(this);
_technology->_GetLayerMap()._Remove(this);
_technology->_GetLayerList().remove(this);
_technology->_GetLayerMap()._Remove(this);
}
string Layer::_GetString() const
// *****************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name));
return s;
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name));
return s;
}
Record* Layer::_GetRecord() const
// ************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("Technology", _technology));
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("Mask", &_mask));
record->Add(GetSlot("ExtractMask", &_extractMask));
record->Add(GetSlot("MinimalSize", &_minimalSize));
record->Add(GetSlot("MinimalSpacing", &_minimalSpacing));
record->Add(GetSlot("Pitch", &_pitch));
}
return record;
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("Technology", _technology));
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("Mask", &_mask));
record->Add(GetSlot("ExtractMask", &_extractMask));
record->Add(GetSlot("MinimalSize", &_minimalSize));
record->Add(GetSlot("MinimalSpacing", &_minimalSpacing));
record->Add(GetSlot("Pitch", &_pitch));
}
return record;
}
} // End of Hurricane namespace.

View File

@ -28,68 +28,68 @@ class Layer : public DBo {
// Types
// *****
public: typedef DBo Inherit;
public: typedef DBo Inherit;
public: typedef unsigned long long Mask;
public: typedef unsigned long long Mask;
// Attributes
// **********
private: Technology* _technology;
private: Name _name;
private: Mask _mask;
private: Mask _extractMask;
private: Unit _minimalSize;
private: Unit _minimalSpacing;
private: Unit _pitch;
private: Layer* _nextOfTechnologyLayerMap;
private: Technology* _technology;
private: Name _name;
private: Mask _mask;
private: Mask _extractMask;
private: Unit _minimalSize;
private: Unit _minimalSpacing;
private: Unit _pitch;
private: Layer* _nextOfTechnologyLayerMap;
// Constructors
// ************
protected: Layer(Technology* technology, const Name& name, const Unit& minimalSize = 0, const Unit& minimalSpacing = 0, const Unit& pitch = 0);
protected: Layer(Technology* technology, const Name& name, const Unit& minimalSize = 0, const Unit& minimalSpacing = 0, const Unit& pitch = 0);
// Accessors
// *********
public: Technology* GetTechnology() const {return _technology;};
public: const Name& GetName() const {return _name;};
public: const Mask& GetMask() const {return _mask;};
public: const Mask& GetExtractMask() const {return _extractMask;};
public: const Unit& GetMinimalSize() const {return _minimalSize;};
public: const Unit& GetMinimalSpacing() const {return _minimalSpacing;};
public: Unit GetPitch() const {return (_pitch==0?(_minimalSize + _minimalSpacing):_pitch);};
public: virtual BasicLayers GetBasicLayers() const = 0;
public: Technology* getTechnology() const {return _technology;};
public: const Name& getName() const {return _name;};
public: const Mask& getMask() const {return _mask;};
public: const Mask& getExtractMask() const {return _extractMask;};
public: const Unit& getMinimalSize() const {return _minimalSize;};
public: const Unit& getMinimalSpacing() const {return _minimalSpacing;};
public: Unit getPitch() const {return (_pitch==0?(_minimalSize + _minimalSpacing):_pitch);};
public: virtual BasicLayers getBasicLayers() const = 0;
// Predicates
// **********
public: bool Contains(const Layer* layer) const;
public: bool Intersect(const Layer* layer) const;
public: bool contains(const Layer* layer) const;
public: bool intersect(const Layer* layer) const;
// Updators
// ********
public: void SetName(const Name& name);
public: void SetMinimalSize(const Unit& minimalSize);
public: void SetMinimalSpacing(const Unit& minimalSpacing);
public: void SetPitch(const Unit& pitch);
public: void setName(const Name& name);
public: void setMinimalSize(const Unit& minimalSize);
public: void setMinimalSpacing(const Unit& minimalSpacing);
public: void setPitch(const Unit& pitch);
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _PostCreate();
protected: virtual void _PreDelete();
protected: virtual void _PreDelete();
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual BasicLayer* _GetSymbolicBasicLayer() = 0;
public: Layer* _GetNextOfTechnologyLayerMap() const {return _nextOfTechnologyLayerMap;};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual BasicLayer* _getSymbolicBasicLayer() = 0;
public: Layer* _getNextOfTechnologyLayerMap() const {return _nextOfTechnologyLayerMap;};
public: void _SetMask(const Mask& mask) {_mask = mask;};
public: void _SetExtractMask(const Mask& extractMask) {_extractMask = extractMask;};
public: void _SetNextOfTechnologyLayerMap(Layer* layer) {_nextOfTechnologyLayerMap = layer;};
public: void _setMask(const Mask& mask) {_mask = mask;};
public: void _setExtractMask(const Mask& extractMask) {_extractMask = extractMask;};
public: void _setNextOfTechnologyLayerMap(Layer* layer) {_nextOfTechnologyLayerMap = layer;};
};

View File

@ -60,7 +60,7 @@ Box Pad::GetBoundingBox() const
Box boundingBox = _boundingBox;
if (is_a<CompositeLayer*>(_layer))
boundingBox.inflate(((CompositeLayer*)_layer)->GetMaximalPadSize());
boundingBox.inflate(((CompositeLayer*)_layer)->getMaximalPadSize());
return boundingBox;
}
@ -68,12 +68,12 @@ Box Pad::GetBoundingBox() const
Box Pad::GetBoundingBox(const BasicLayer* basicLayer) const
// **************************************************
{
if (!_layer->Contains(basicLayer)) return Box();
if (!_layer->contains(basicLayer)) return Box();
Box boundingBox = _boundingBox;
if (is_a<CompositeLayer*>(_layer))
boundingBox.inflate(((CompositeLayer*)_layer)->GetPadSize(basicLayer));
boundingBox.inflate(((CompositeLayer*)_layer)->getPadSize(basicLayer));
return boundingBox;
}
@ -103,7 +103,7 @@ string Pad::_GetString() const
// ***************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_layer->GetName()));
s.insert(s.length() - 1, " " + GetString(_layer->getName()));
s.insert(s.length() - 1, " " + GetString(_boundingBox));
return s;
}

View File

@ -24,58 +24,58 @@ class Segment_Hooks : public Collection<Hook*> {
// Types
// *****
public: typedef Collection<Hook*> Inherit;
public: typedef Collection<Hook*> Inherit;
public: class Locator : public Hurricane::Locator<Hook*> {
// *****************************************************
public: class Locator : public Hurricane::Locator<Hook*> {
// *****************************************************
public: typedef Hurricane::Locator<Hook*> Inherit;
public: typedef Hurricane::Locator<Hook*> Inherit;
private: const Segment* _segment;
private: Hook* _hook;
private: const Segment* _segment;
private: Hook* _hook;
public: Locator(const Segment* segment = NULL);
public: Locator(const Locator& locator);
public: Locator(const Segment* segment = NULL);
public: Locator(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: virtual Hook* GetElement() const;
public: virtual Hurricane::Locator<Hook*>* GetClone() const;
public: virtual Hook* GetElement() const;
public: virtual Hurricane::Locator<Hook*>* GetClone() const;
public: virtual bool IsValid() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _GetString() const;
};
};
// Attributes
// **********
private: const Segment* _segment;
private: const Segment* _segment;
// Constructors
// ************
public: Segment_Hooks(const Segment* segment = NULL);
public: Segment_Hooks(const Segment_Hooks& hooks);
public: Segment_Hooks(const Segment* segment = NULL);
public: Segment_Hooks(const Segment_Hooks& hooks);
// Operators
// *********
public: Segment_Hooks& operator=(const Segment_Hooks& hooks);
public: Segment_Hooks& operator=(const Segment_Hooks& hooks);
// Accessors
// *********
public: virtual Collection<Hook*>* GetClone() const;
public: virtual Hurricane::Locator<Hook*>* GetLocator() const;
public: virtual Collection<Hook*>* GetClone() const;
public: virtual Hurricane::Locator<Hook*>* GetLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _GetString() const;
};
@ -91,58 +91,58 @@ class Segment_Anchors : public Collection<Component*> {
// Types
// *****
public: typedef Collection<Component*> Inherit;
public: typedef Collection<Component*> Inherit;
public: class Locator : public Hurricane::Locator<Component*> {
// **********************************************************
public: class Locator : public Hurricane::Locator<Component*> {
// **********************************************************
public: typedef Hurricane::Locator<Component*> Inherit;
public: typedef Hurricane::Locator<Component*> Inherit;
private: const Segment* _segment;
private: Component* _anchor;
private: const Segment* _segment;
private: Component* _anchor;
public: Locator(const Segment* segment = NULL);
public: Locator(const Locator& locator);
public: Locator(const Segment* segment = NULL);
public: Locator(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: virtual Component* GetElement() const;
public: virtual Hurricane::Locator<Component*>* GetClone() const;
public: virtual Component* GetElement() const;
public: virtual Hurricane::Locator<Component*>* GetClone() const;
public: virtual bool IsValid() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _GetString() const;
};
};
// Attributes
// **********
private: const Segment* _segment;
private: const Segment* _segment;
// Constructors
// ************
public: Segment_Anchors(const Segment* segment = NULL);
public: Segment_Anchors(const Segment_Anchors& anchors);
public: Segment_Anchors(const Segment* segment = NULL);
public: Segment_Anchors(const Segment_Anchors& anchors);
// Operators
// *********
public: Segment_Anchors& operator=(const Segment_Anchors& anchors);
public: Segment_Anchors& operator=(const Segment_Anchors& anchors);
// Accessors
// *********
public: virtual Collection<Component*>* GetClone() const;
public: virtual Hurricane::Locator<Component*>* GetLocator() const;
public: virtual Collection<Component*>* GetClone() const;
public: virtual Hurricane::Locator<Component*>* GetLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _GetString() const;
};
@ -155,124 +155,124 @@ class Segment_Anchors : public Collection<Component*> {
Segment::Segment(Net* net, Component* source, Component* target, Layer* layer, const Unit& width)
// **********************************************************************************************
: Inherit(net),
_sourceHook(this),
_targetHook(this),
_layer(layer),
_width(width)
_sourceHook(this),
_targetHook(this),
_layer(layer),
_width(width)
{
if (source) {
if (!source->GetNet())
throw Error("Can't create " + _TName("Segment") + " : unconnected source");
if (source->GetNet() != net)
throw Error("Can't create " + _TName("Segment") + " : incompatible source");
}
if (source) {
if (!source->GetNet())
throw Error("Can't create " + _TName("Segment") + " : unconnected source");
if (source->GetNet() != net)
throw Error("Can't create " + _TName("Segment") + " : incompatible source");
}
if (target) {
if (!target->GetNet())
throw Error("Can't create " + _TName("Segment") + " : unconnected target");
if (target->GetNet() != net)
throw Error("Can't create " + _TName("Segment") + " : incompatible target");
}
if (target) {
if (!target->GetNet())
throw Error("Can't create " + _TName("Segment") + " : unconnected target");
if (target->GetNet() != net)
throw Error("Can't create " + _TName("Segment") + " : incompatible target");
}
if (!_layer)
throw Error("Can't create " + _TName("Segment") + " : null layer");
if (!_layer)
throw Error("Can't create " + _TName("Segment") + " : null layer");
if (source) _sourceHook.Attach(source->GetBodyHook());
if (target) _targetHook.Attach(target->GetBodyHook());
if (source) _sourceHook.Attach(source->GetBodyHook());
if (target) _targetHook.Attach(target->GetBodyHook());
}
Hooks Segment::GetHooks() const
// ****************************
{
return Segment_Hooks(this);
return Segment_Hooks(this);
}
Hook* Segment::GetOppositeHook(const Hook* hook) const
// ***************************************************
{
if (hook) {
if (hook == &_sourceHook) return (Hook*)&_targetHook;
if (hook == &_targetHook) return (Hook*)&_sourceHook;
}
return NULL;
if (hook) {
if (hook == &_sourceHook) return (Hook*)&_targetHook;
if (hook == &_targetHook) return (Hook*)&_sourceHook;
}
return NULL;
}
Component* Segment::GetSource() const
// **********************************
{
Hook* masterHook = _sourceHook.GetMasterHook();
return (masterHook) ? masterHook->GetComponent() : NULL;
Hook* masterHook = _sourceHook.GetMasterHook();
return (masterHook) ? masterHook->GetComponent() : NULL;
}
Component* Segment::GetTarget() const
// **********************************
{
Hook* masterHook = _targetHook.GetMasterHook();
return (masterHook) ? masterHook->GetComponent() : NULL;
Hook* masterHook = _targetHook.GetMasterHook();
return (masterHook) ? masterHook->GetComponent() : NULL;
}
Components Segment::GetAnchors() const
// ***********************************
{
return Segment_Anchors(this);
return Segment_Anchors(this);
}
Component* Segment::GetOppositeAnchor(Component* anchor) const
// ***********************************************************
{
if (anchor) {
Component* source = GetSource();
Component* target = GetTarget();
if (anchor == source) return target;
if (anchor == target) return source;
}
return NULL;
if (anchor) {
Component* source = GetSource();
Component* target = GetTarget();
if (anchor == source) return target;
if (anchor == target) return source;
}
return NULL;
}
Point Segment::GetSourcePosition() const
// *************************************
{
return Point(GetSourceX(), GetSourceY());
return Point(GetSourceX(), GetSourceY());
}
Point Segment::GetTargetPosition() const
// *************************************
{
return Point(GetTargetX(), GetTargetY());
return Point(GetTargetX(), GetTargetY());
}
void Segment::SetLayer(Layer* layer)
// *********************************
{
if (!layer)
throw Error("Can't set layer : null layer");
if (!layer)
throw Error("Can't set layer : null layer");
if (layer != _layer) {
Invalidate(false);
_layer = layer;
}
if (layer != _layer) {
Invalidate(false);
_layer = layer;
}
}
void Segment::SetWidth(const Unit& width)
// **************************************
{
if (width != _width) {
Invalidate(false);
_width = width;
}
if (width != _width) {
Invalidate(false);
_width = width;
}
}
void Segment::Invert()
// *******************
{
Component* source = GetSource();
Component* target = GetTarget();
if (source && target && (target != source)) {
GetSourceHook()->Detach();
GetTargetHook()->Detach();
GetSourceHook()->Attach(target->GetBodyHook());
GetTargetHook()->Attach(source->GetBodyHook());
}
Component* source = GetSource();
Component* target = GetTarget();
if (source && target && (target != source)) {
GetSourceHook()->Detach();
GetTargetHook()->Detach();
GetSourceHook()->Attach(target->GetBodyHook());
GetTargetHook()->Attach(source->GetBodyHook());
}
}
void Segment::_PreDelete()
@ -281,10 +281,10 @@ void Segment::_PreDelete()
// trace << "entering Segment::_PreDelete: " << this << endl;
// trace_in();
Inherit::_PreDelete();
Inherit::_PreDelete();
_sourceHook.Detach();
_targetHook.Detach();
_sourceHook.Detach();
_targetHook.Detach();
// trace << "exiting Segment::_PreDelete:" << endl;
// trace_out();
@ -293,111 +293,83 @@ void Segment::_PreDelete()
string Segment::_GetString() const
// *******************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_layer->GetName()));
s.insert(s.length() - 1, " [" + GetValueString(GetSourceX()) + " " + GetValueString(GetSourceY()) + "]");
s.insert(s.length() - 1, " [" + GetValueString(GetTargetX()) + " " + GetValueString(GetTargetY()) + "]");
s.insert(s.length() - 1, " " + GetValueString(_width));
return s;
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_layer->getName()));
s.insert(s.length() - 1, " [" + GetValueString(GetSourceX()) + " " + GetValueString(GetSourceY()) + "]");
s.insert(s.length() - 1, " [" + GetValueString(GetTargetX()) + " " + GetValueString(GetTargetY()) + "]");
s.insert(s.length() - 1, " " + GetValueString(_width));
return s;
}
Record* Segment::_GetRecord() const
// **************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("SourceHook", &_sourceHook));
record->Add(GetSlot("Source", GetSource()));
record->Add(GetSlot("TargetHook", &_targetHook));
record->Add(GetSlot("Target", GetTarget()));
record->Add(GetSlot("Layer", _layer));
record->Add(GetSlot("Width", &_width));
}
return record;
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("SourceHook", &_sourceHook));
record->Add(GetSlot("Source", GetSource()));
record->Add(GetSlot("TargetHook", &_targetHook));
record->Add(GetSlot("Target", GetTarget()));
record->Add(GetSlot("Layer", _layer));
record->Add(GetSlot("Width", &_width));
}
return record;
}
Unit Segment::_GetSize() const
// ***************************
{
Unit size = 0;
Unit size = 0;
Layer* layer = GetLayer();
if (is_a<CompositeLayer*>(layer))
size = ((CompositeLayer*)layer)->GetMaximalSegmentSize();
Layer* layer = GetLayer();
if (is_a<CompositeLayer*>(layer))
size = ((CompositeLayer*)layer)->getMaximalSegmentSize();
return size;
return size;
}
Unit Segment::_GetExtention() const
// ********************************
{
Unit extention = 0;
Unit extention = 0;
Layer* layer = GetLayer();
if (is_a<CompositeLayer*>(layer))
extention = ((CompositeLayer*)layer)->GetMaximalSegmentExtention();
Layer* layer = GetLayer();
if (is_a<CompositeLayer*>(layer))
extention = ((CompositeLayer*)layer)->getMaximalSegmentExtention();
return extention;
return extention;
}
Unit Segment::_GetSize(const BasicLayer* basicLayer) const
// *************************************************
{
Layer* layer = GetLayer();
Layer* layer = GetLayer();
if (!layer->Contains(basicLayer)) return 0;
if (!layer->contains(basicLayer)) return 0;
Unit size = 0;
Unit size = 0;
if (is_a<CompositeLayer*>(layer))
size = ((CompositeLayer*)layer)->GetSegmentSize(basicLayer);
if (is_a<CompositeLayer*>(layer))
size = ((CompositeLayer*)layer)->getSegmentSize(basicLayer);
return size;
return size;
}
Unit Segment::_GetExtention(const BasicLayer* basicLayer) const
// ******************************************************
{
Layer* layer = GetLayer();
Layer* layer = GetLayer();
if (!layer->Contains(basicLayer)) return 0;
if (!layer->contains(basicLayer)) return 0;
Unit extention = 0;
Unit extention = 0;
if (is_a<CompositeLayer*>(layer))
extention = ((CompositeLayer*)layer)->GetSegmentExtention(basicLayer);
if (is_a<CompositeLayer*>(layer))
extention = ((CompositeLayer*)layer)->getSegmentExtention(basicLayer);
return extention;
return extention;
}
//bool Segment::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const
//// ***************************************************************************************
//{
// Box area(point);
// area.Inflate(aperture);
// Layer* layer = GetLayer();
// for_each_basic_layer(basicLayer, layer->GetBasicLayers()) {
// if (view->IsVisible(basicLayer))
// if (GetBoundingBox(basicLayer).Intersect(area)) return true;
// end_for;
// }
//
// return false;
//}
//
//void Segment::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// ****************************************************************************************************
//{
// if (1 < view->GetScreenSize(GetWidth()))
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
// else
// if (basicLayer == GetLayer()->_GetSymbolicBasicLayer())
// view->DrawLine(transformation.GetPoint(GetSourcePosition()),
// transformation.GetPoint(GetTargetPosition()));
//}
//
// ****************************************************************************************************
// Segment::SourceHook implementation
// ****************************************************************************************************
@ -406,25 +378,25 @@ static int SOURCE_HOOK_OFFSET = -1;
Segment::SourceHook::SourceHook(Segment* segment)
// **********************************************
: Inherit()
: Inherit()
{
if (!segment)
throw Error("Can't create " + _TName("Segment::SourceHook") + " (null segment)");
if (!segment)
throw Error("Can't create " + _TName("Segment::SourceHook") + " (null segment)");
if (SOURCE_HOOK_OFFSET == -1)
SOURCE_HOOK_OFFSET = (unsigned long)this - (unsigned long)segment;
if (SOURCE_HOOK_OFFSET == -1)
SOURCE_HOOK_OFFSET = (unsigned long)this - (unsigned long)segment;
}
Component* Segment::SourceHook::GetComponent() const
// *************************************************
{
return (Component*)((unsigned long)this - SOURCE_HOOK_OFFSET);
return (Component*)((unsigned long)this - SOURCE_HOOK_OFFSET);
}
string Segment::SourceHook::_GetString() const
// *******************************************
{
return "<" + _TName("Segment::SourceHook") + " " + GetString(GetComponent()) + ">";
return "<" + _TName("Segment::SourceHook") + " " + GetString(GetComponent()) + ">";
}
@ -437,25 +409,25 @@ static int TARGET_HOOK_OFFSET = -1;
Segment::TargetHook::TargetHook(Segment* segment)
// **********************************************
: Inherit()
: Inherit()
{
if (!segment)
throw Error("Can't create " + _TName("Segment::TargetHook") + " (null segment)");
if (!segment)
throw Error("Can't create " + _TName("Segment::TargetHook") + " (null segment)");
if (TARGET_HOOK_OFFSET == -1)
TARGET_HOOK_OFFSET = (unsigned long)this - (unsigned long)segment;
if (TARGET_HOOK_OFFSET == -1)
TARGET_HOOK_OFFSET = (unsigned long)this - (unsigned long)segment;
}
Component* Segment::TargetHook::GetComponent() const
// *************************************************
{
return (Component*)((unsigned long)this - TARGET_HOOK_OFFSET);
return (Component*)((unsigned long)this - TARGET_HOOK_OFFSET);
}
string Segment::TargetHook::_GetString() const
// *******************************************
{
return "<" + _TName("Segment::TargetHook") + " " + GetString(GetComponent()) + ">";
return "<" + _TName("Segment::TargetHook") + " " + GetString(GetComponent()) + ">";
}
// ****************************************************************************************************
@ -464,44 +436,44 @@ string Segment::TargetHook::_GetString() const
Segment_Hooks::Segment_Hooks(const Segment* segment)
// *************************************************
: Inherit(),
_segment(segment)
: Inherit(),
_segment(segment)
{
}
Segment_Hooks::Segment_Hooks(const Segment_Hooks& hooks)
// *****************************************************
: Inherit(),
_segment(hooks._segment)
: Inherit(),
_segment(hooks._segment)
{
}
Segment_Hooks& Segment_Hooks::operator=(const Segment_Hooks& hooks)
// ****************************************************************
{
_segment = hooks._segment;
return *this;
_segment = hooks._segment;
return *this;
}
Collection<Hook*>* Segment_Hooks::GetClone() const
// ***********************************************
{
return new Segment_Hooks(*this);
return new Segment_Hooks(*this);
}
Locator<Hook*>* Segment_Hooks::GetLocator() const
// **********************************************
{
return new Locator(_segment);
return new Locator(_segment);
}
string Segment_Hooks::_GetString() const
// *************************************
{
string s = "<" + _TName("Segment::Hooks");
if (_segment) s += " " + GetString(_segment);
s += ">";
return s;
string s = "<" + _TName("Segment::Hooks");
if (_segment) s += " " + GetString(_segment);
s += ">";
return s;
}
@ -512,69 +484,69 @@ string Segment_Hooks::_GetString() const
Segment_Hooks::Locator::Locator(const Segment* segment)
// ****************************************************
: Inherit(),
_segment(segment),
_hook(NULL)
: Inherit(),
_segment(segment),
_hook(NULL)
{
if (_segment) _hook = ((Segment*)_segment)->GetBodyHook();
if (_segment) _hook = ((Segment*)_segment)->GetBodyHook();
}
Segment_Hooks::Locator::Locator(const Locator& locator)
// ****************************************************
: Inherit(),
_segment(locator._segment),
_hook(locator._hook)
: Inherit(),
_segment(locator._segment),
_hook(locator._hook)
{
}
Segment_Hooks::Locator& Segment_Hooks::Locator::operator=(const Locator& locator)
// ******************************************************************************
{
_segment = locator._segment;
_hook = locator._hook;
return *this;
_segment = locator._segment;
_hook = locator._hook;
return *this;
}
Hook* Segment_Hooks::Locator::GetElement() const
// *********************************************
{
return _hook;
return _hook;
}
Locator<Hook*>* Segment_Hooks::Locator::GetClone() const
// *****************************************************
{
return new Locator(*this);
return new Locator(*this);
}
bool Segment_Hooks::Locator::IsValid() const
// *****************************************
{
return (_hook != NULL);
return (_hook != NULL);
}
void Segment_Hooks::Locator::Progress()
// ************************************
{
if (_hook) {
if (_hook == ((Segment*)_segment)->GetBodyHook())
_hook = ((Segment*)_segment)->GetSourceHook();
else {
if (_hook == ((Segment*)_segment)->GetSourceHook())
_hook = ((Segment*)_segment)->GetTargetHook();
else
_hook = NULL;
}
}
if (_hook) {
if (_hook == ((Segment*)_segment)->GetBodyHook())
_hook = ((Segment*)_segment)->GetSourceHook();
else {
if (_hook == ((Segment*)_segment)->GetSourceHook())
_hook = ((Segment*)_segment)->GetTargetHook();
else
_hook = NULL;
}
}
}
string Segment_Hooks::Locator::_GetString() const
// **********************************************
{
string s = "<" + _TName("Segment::Hooks::Locator");
if (_segment) s += " " + GetString(_segment);
s += ">";
return s;
string s = "<" + _TName("Segment::Hooks::Locator");
if (_segment) s += " " + GetString(_segment);
s += ">";
return s;
}
@ -585,44 +557,44 @@ string Segment_Hooks::Locator::_GetString() const
Segment_Anchors::Segment_Anchors(const Segment* segment)
// *****************************************************
: Inherit(),
_segment(segment)
: Inherit(),
_segment(segment)
{
}
Segment_Anchors::Segment_Anchors(const Segment_Anchors& hooks)
// ***********************************************************
: Inherit(),
_segment(hooks._segment)
: Inherit(),
_segment(hooks._segment)
{
}
Segment_Anchors& Segment_Anchors::operator=(const Segment_Anchors& hooks)
// **********************************************************************
{
_segment = hooks._segment;
return *this;
_segment = hooks._segment;
return *this;
}
Collection<Component*>* Segment_Anchors::GetClone() const
// ******************************************************
{
return new Segment_Anchors(*this);
return new Segment_Anchors(*this);
}
Locator<Component*>* Segment_Anchors::GetLocator() const
// *****************************************************
{
return new Locator(_segment);
return new Locator(_segment);
}
string Segment_Anchors::_GetString() const
// ***************************************
{
string s = "<" + _TName("Segment::Anchors");
if (_segment) s += " " + GetString(_segment);
s += ">";
return s;
string s = "<" + _TName("Segment::Anchors");
if (_segment) s += " " + GetString(_segment);
s += ">";
return s;
}
@ -633,68 +605,68 @@ string Segment_Anchors::_GetString() const
Segment_Anchors::Locator::Locator(const Segment* segment)
// ******************************************************
: Inherit(),
_segment(segment),
_anchor(NULL)
: Inherit(),
_segment(segment),
_anchor(NULL)
{
if (_segment) {
_anchor = ((Segment*)_segment)->GetSource();
if (!_anchor) _anchor = ((Segment*)_segment)->GetTarget();
}
if (_segment) {
_anchor = ((Segment*)_segment)->GetSource();
if (!_anchor) _anchor = ((Segment*)_segment)->GetTarget();
}
}
Segment_Anchors::Locator::Locator(const Locator& locator)
// ******************************************************
: Inherit(),
_segment(locator._segment),
_anchor(locator._anchor)
: Inherit(),
_segment(locator._segment),
_anchor(locator._anchor)
{
}
Segment_Anchors::Locator& Segment_Anchors::Locator::operator=(const Locator& locator)
// **********************************************************************************
{
_segment = locator._segment;
_anchor = locator._anchor;
return *this;
_segment = locator._segment;
_anchor = locator._anchor;
return *this;
}
Component* Segment_Anchors::Locator::GetElement() const
// ****************************************************
{
return _anchor;
return _anchor;
}
Locator<Component*>* Segment_Anchors::Locator::GetClone() const
// ************************************************************
{
return new Locator(*this);
return new Locator(*this);
}
bool Segment_Anchors::Locator::IsValid() const
// *******************************************
{
return (_anchor != NULL);
return (_anchor != NULL);
}
void Segment_Anchors::Locator::Progress()
// **************************************
{
if (_anchor) {
if (_anchor == ((Segment*)_segment)->GetTarget())
_anchor = NULL;
else
_anchor = ((Segment*)_segment)->GetTarget();
}
if (_anchor) {
if (_anchor == ((Segment*)_segment)->GetTarget())
_anchor = NULL;
else
_anchor = ((Segment*)_segment)->GetTarget();
}
}
string Segment_Anchors::Locator::_GetString() const
// ************************************************
{
string s = "<" + _TName("Segment::Anchors::Locator");
if (_segment) s += " " + GetString(_segment);
s += ">";
return s;
string s = "<" + _TName("Segment::Anchors::Locator");
if (_segment) s += " " + GetString(_segment);
s += ">";
return s;
}

View File

@ -21,112 +21,93 @@ namespace Hurricane {
Slice::Slice(Cell* cell, Layer* layer)
// ***********************************
: _cell(cell),
_layer(layer),
_quadTree(),
_nextOfCellSliceMap(NULL)
: _cell(cell),
_layer(layer),
_quadTree(),
_nextOfCellSliceMap(NULL)
{
if (!_cell)
throw Error("Can't create " + _TName("Slice") + " : null cell");
if (!_cell)
throw Error("Can't create " + _TName("Slice") + " : null cell");
if (!_layer)
throw Error("Can't create " + _TName("Slice") + " : null layer");
if (!_layer)
throw Error("Can't create " + _TName("Slice") + " : null layer");
if (_cell->GetSlice(_layer))
throw Error("Can't create " + _TName("Slice") + " : already exists");
if (_cell->GetSlice(_layer))
throw Error("Can't create " + _TName("Slice") + " : already exists");
_cell->_GetSliceMap()._Insert(this);
_cell->_GetSliceMap()._Insert(this);
}
Slice::~Slice()
// ************
{
_cell->_GetSliceMap()._Remove(this);
_cell->_GetSliceMap()._Remove(this);
}
Components Slice::GetComponents() const
// ************************************
{
// return _quadTree.GetGos().GetSubSet<Component*>();
return SubTypeCollection<Go*, Component*>(_quadTree.GetGos());
// return _quadTree.GetGos().GetSubSet<Component*>();
return SubTypeCollection<Go*, Component*>(_quadTree.GetGos());
}
Components Slice::GetComponentsUnder(const Box& area) const
// ********************************************************
{
// return _quadTree.GetGosUnder(area).GetSubSet<Component*>();
return SubTypeCollection<Go*, Component*>(_quadTree.GetGosUnder(area));
// return _quadTree.GetGosUnder(area).GetSubSet<Component*>();
return SubTypeCollection<Go*, Component*>(_quadTree.GetGosUnder(area));
}
Markers Slice::GetMarkers() const
// ******************************
{
// return _quadTree.GetGos().GetSubSet<Marker*>();
return SubTypeCollection<Go*, Marker*>(_quadTree.GetGos());
// return _quadTree.GetGos().GetSubSet<Marker*>();
return SubTypeCollection<Go*, Marker*>(_quadTree.GetGos());
}
Markers Slice::GetMarkersUnder(const Box& area) const
// **************************************************
{
// return _quadTree.GetGosUnder(area).GetSubSet<Marker*>();
return SubTypeCollection<Go*, Marker*>(_quadTree.GetGosUnder(area));
// return _quadTree.GetGosUnder(area).GetSubSet<Marker*>();
return SubTypeCollection<Go*, Marker*>(_quadTree.GetGosUnder(area));
}
Slice* Slice::_Create(Cell* cell, Layer* layer)
// ********************************************
{
Slice* slice = new Slice(cell, layer);
Slice* slice = new Slice(cell, layer);
return slice;
return slice;
}
void Slice::_Delete()
// ******************
{
delete this;
delete this;
}
string Slice::_GetString() const
// *****************************
{
string s = "<" + _TName("Slice");
// s += " " + GetString(_cell->GetName());
s += " " + GetString(_layer->GetName());
s += ">";
return s;
string s = "<" + _TName("Slice");
// s += " " + GetString(_cell->GetName());
s += " " + GetString(_layer->getName());
s += ">";
return s;
}
Record* Slice::_GetRecord() const
// ************************
{
Record* record = new Record(GetString(this));
if (record) {
record->Add(GetSlot("Cell", _cell));
record->Add(GetSlot("Layer", _layer));
record->Add(GetSlot("QuadTree", &_quadTree));
}
return record;
Record* record = new Record(GetString(this));
if (record) {
record->Add(GetSlot("Cell", _cell));
record->Add(GetSlot("Layer", _layer));
record->Add(GetSlot("QuadTree", &_quadTree));
}
return record;
}
//void Slice::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// ****************************************************************************************************
//{
// assert(view);
// assert(basicLayer);
// if (_layer->Contains(basicLayer)) {
// if (GetBoundingBox().Intersect(updateArea)) {
// if ((basicLayer == _layer->_GetSymbolicBasicLayer()) || (3 < view->GetScale())) {
// for_each_go(go, GetGosUnder(updateArea)) {
// go->_Draw(view, basicLayer, updateArea, transformation);
// end_for;
// }
// }
// }
// }
//}
//
} // End of Hurricane namespace.
// ****************************************************************************************************

View File

@ -9,7 +9,6 @@
#include "Layer.h"
#include "BasicLayer.h"
#include "CompositeLayer.h"
#include "Tag.h"
#include "Error.h"
@ -28,440 +27,178 @@ class Technology_BasicLayers : public Collection<BasicLayer*> {
// Types
// *****
public: typedef Collection<BasicLayer*> Inherit;
public: typedef Collection<BasicLayer*> Inherit;
public: class Locator : public Hurricane::Locator<BasicLayer*> {
// ***********************************************************
public: class Locator : public Hurricane::Locator<BasicLayer*> {
// ***********************************************************
public: typedef Hurricane::Locator<BasicLayer*> Inherit;
public: typedef Hurricane::Locator<BasicLayer*> Inherit;
private: const Technology* _technology;
private: Layer::Mask _mask;
private: BasicLayerLocator _basicLayerLocator;
private: const Technology* _technology;
private: Layer::Mask _mask;
private: BasicLayerLocator _basicLayerLocator;
public: Locator();
public: Locator(const Technology* technology, const Layer::Mask& mask);
public: Locator(const Locator& locator);
public: Locator();
public: Locator(const Technology* technology, const Layer::Mask& mask);
public: Locator(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: virtual BasicLayer* GetElement() const;
public: virtual Hurricane::Locator<BasicLayer*>* GetClone() const;
public: virtual BasicLayer* GetElement() const;
public: virtual Hurricane::Locator<BasicLayer*>* GetClone() const;
public: virtual bool IsValid() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _GetString() const;
};
};
// Attributes
// **********
private: const Technology* _technology;
private: Layer::Mask _mask;
private: const Technology* _technology;
private: Layer::Mask _mask;
// Constructors
// ************
public: Technology_BasicLayers();
public: Technology_BasicLayers(const Technology* technology, const Layer::Mask& mask);
public: Technology_BasicLayers(const Technology_BasicLayers& basicLayers);
public: Technology_BasicLayers();
public: Technology_BasicLayers(const Technology* technology, const Layer::Mask& mask);
public: Technology_BasicLayers(const Technology_BasicLayers& basicLayers);
// Operators
// *********
public: Technology_BasicLayers& operator=(const Technology_BasicLayers& basicLayers);
public: Technology_BasicLayers& operator=(const Technology_BasicLayers& basicLayers);
// Accessors
// *********
public: virtual Collection<BasicLayer*>* GetClone() const;
public: virtual Hurricane::Locator<BasicLayer*>* GetLocator() const;
public: virtual Collection<BasicLayer*>* GetClone() const;
public: virtual Hurricane::Locator<BasicLayer*>* GetLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _GetString() const;
};
// ****************************************************************************************************
// Utilitarians
// ****************************************************************************************************
static void Abort(Tag* tag, const string& reason)
// **********************************************
{
Tag* topTag = tag;
while (topTag->GetTag()) topTag = topTag->GetTag();
throw Error("Can't load technology : " + reason +
" : " + topTag->GetArgument() + " (line " + GetString(tag->GetLine()) + ")");
}
static void CreateBasicLayerFromTag(Technology* technology, Tag* tag)
// ******************************************************************
{
Name name = tag->GetArgument();
if (name.IsEmpty())
Abort(tag, "undefined basic layer name");
if (technology->GetLayer(name))
Abort(tag, "layer " + GetString(name) + " already exists");
BasicLayer::Type type;
unsigned extractNumber = 0;
Unit minimalSize = 0;
Unit minimalSpacing = 0;
unsigned short redValue = 255;
unsigned short greenValue = 255;
unsigned short blueValue = 255;
string fillPattern = "FFFFFFFFFFFFFFFF";
double displayThreshold = 0.0;
for_each_tag(childTag, tag->GetTags()) {
if (childTag->GetName() == "type") {
if (!::Scan(childTag->GetArgument(), type))
Abort(tag, "invalid type");
}
else if (childTag->GetName() == "extract-number") {
if (!::Scan(childTag->GetArgument(), extractNumber))
Abort(tag, "invalid extract-number");
}
else if (childTag->GetName() == "minimal-size") {
if (!::Scan(childTag->GetArgument(), minimalSize))
Abort(tag, "invalid minimal-size");
}
else if (childTag->GetName() == "minimal-spacing") {
if (!::Scan(childTag->GetArgument(), minimalSpacing))
Abort(tag, "invalid minimal-spacing");
}
else if (childTag->GetName() == "color") {
if (!::Scan(childTag->GetArgument(), redValue, greenValue, blueValue))
Abort(tag, "invalid color");
}
else if (childTag->GetName() == "pattern") {
if (!::Scan(childTag->GetArgument(), fillPattern))
Abort(tag, "invalid pattern");
}
else if (childTag->GetName() == "display-threshold") {
if (!::Scan(childTag->GetArgument(), displayThreshold))
Abort(tag, "invalid display-threshold");
}
end_for;
}
BasicLayer* basicLayer =
BasicLayer::Create(technology, name, type, extractNumber, minimalSize, minimalSpacing);
basicLayer->SetColor(redValue, greenValue, blueValue);
basicLayer->SetFillPattern(fillPattern);
basicLayer->SetDisplayThreshold(displayThreshold);
}
void AddBasicLayerFromTag(CompositeLayer* compositeLayer, Tag* tag)
// ****************************************************************
{
Name name = tag->GetArgument();
if (name.IsEmpty())
Abort(tag, "undefined basic layer name");
BasicLayer* basicLayer = compositeLayer->GetTechnology()->GetBasicLayer(name);
if (!basicLayer)
Abort(tag, "undefined basic layer " + GetString(name));
if (compositeLayer->Contains(basicLayer)) compositeLayer->Remove(basicLayer);
Unit contactSize = 0;
Unit segmentSize = 0;
Unit segmentExtention = 0;
Unit padSize = 0;
for_each_tag(childTag, tag->GetTags()) {
if (childTag->GetName() == "contact-size") {
if (!::Scan(childTag->GetArgument(), contactSize))
Abort(tag, "invalid contact-size");
}
else if (childTag->GetName() == "segment-size") {
if (!::Scan(childTag->GetArgument(), segmentSize))
Abort(tag, "invalid segment-size");
}
else if (childTag->GetName() == "segment-extention") {
if (!::Scan(childTag->GetArgument(), segmentExtention))
Abort(tag, "invalid segment-extention");
}
else if (childTag->GetName() == "pad-size") {
if (!::Scan(childTag->GetArgument(), padSize))
Abort(tag, "invalid pad-size");
}
end_for;
}
compositeLayer->Add(basicLayer, contactSize, segmentSize, segmentExtention, padSize);
}
void AddCompositeLayerFromTag(CompositeLayer* compositeLayer, Tag* tag)
// ********************************************************************
{
Name name = tag->GetArgument();
CompositeLayer* childCompositeLayer = compositeLayer->GetTechnology()->GetCompositeLayer(name);
if (!childCompositeLayer)
Abort(tag, "unknown composite-layer " + GetString(name));
for_each_basic_layer(basicLayer, childCompositeLayer->GetBasicLayers()) {
Unit contactSize =
max(childCompositeLayer->GetContactSize(basicLayer),
compositeLayer->GetContactSize(basicLayer));
Unit segmentSize =
max(childCompositeLayer->GetSegmentSize(basicLayer),
compositeLayer->GetSegmentSize(basicLayer));
Unit segmentExtention =
max(childCompositeLayer->GetSegmentExtention(basicLayer),
compositeLayer->GetSegmentExtention(basicLayer));
Unit padSize =
max(childCompositeLayer->GetPadSize(basicLayer),
compositeLayer->GetPadSize(basicLayer));
if (compositeLayer->Contains(basicLayer)) compositeLayer->Remove(basicLayer);
compositeLayer->Add(basicLayer, contactSize, segmentSize, segmentExtention, padSize);
Unit minimalSize = max(compositeLayer->GetMinimalSize(), childCompositeLayer->GetMinimalSize());
compositeLayer->SetMinimalSize(minimalSize);
end_for;
}
}
static void CreateCompositeLayerFromTag(Technology* technology, Tag* tag)
// **********************************************************************
{
Name name = tag->GetArgument();
if (name.IsEmpty())
Abort(tag, "undefined composite layer name");
if (technology->GetLayer(name))
Abort(tag, "layer " + GetString(name) + " already exists");
CompositeLayer::Type type;
Unit minimalSize = 0;
Unit minimalSpacing = 0;
for_each_tag(childTag, tag->GetTags()) {
if (childTag->GetName() == "type") {
if (!::Scan(childTag->GetArgument(), type))
Abort(tag, "invalid type");
}
else if (childTag->GetName() == "minimal-size") {
if (!::Scan(childTag->GetArgument(), minimalSize))
Abort(tag, "invalid minimal-size");
}
else if (childTag->GetName() == "minimal-spacing") {
if (!::Scan(childTag->GetArgument(), minimalSpacing))
Abort(tag, "invalid minimal-spacing");
}
end_for;
}
CompositeLayer* compositeLayer =
CompositeLayer::Create(technology, name, type, minimalSize, minimalSpacing);
for_each_tag(childTag, tag->GetTags()) {
if (childTag->GetName() == "basic-layer")
AddBasicLayerFromTag(compositeLayer, childTag);
if (childTag->GetName() == "composite-layer")
AddCompositeLayerFromTag(compositeLayer, childTag);
end_for;
}
}
static Technology* CreateTechnologyFromTag(DataBase* dataBase, Tag* tag)
// *********************************************************************
{
Name name;
unsigned precision;
unsigned gridStep = 1;
for_each_tag(childTag, tag->GetTags()) {
if (childTag->GetName() == "name") {
name = childTag->GetArgument();
}
else if (childTag->GetName() == "precision") {
if (!::Scan(childTag->GetArgument(), precision))
Abort(tag, "invalid precision");
if (GetMaximalPrecisionAllowed() < precision)
Abort(childTag, "too big precision (not allowed)");
}
else if (childTag->GetName() == "grid-step") {
if (!::Scan(childTag->GetArgument(), gridStep))
Abort(tag, "invalid grid-step");
if (!gridStep)
Abort(childTag, "too small grid step (not allowed)");
}
end_for;
}
if (name.IsEmpty())
Abort(tag, "undefined technology name");
Technology* technology = Technology::Create(dataBase, name);
SetPrecision(precision);
SetGridStep(gridStep);
for_each_tag(childTag, tag->GetTags()) {
if (childTag->GetName() == "basic-layer")
CreateBasicLayerFromTag(technology, childTag);
else if (childTag->GetName() == "composite-layer")
CreateCompositeLayerFromTag(technology, childTag);
end_for;
}
return technology;
}
// ****************************************************************************************************
// Technology implementation
// ****************************************************************************************************
Technology::Technology(DataBase* dataBase, const Name& name)
// *********************************************************
: Inherit(),
_dataBase(dataBase),
_name(name),
_layerMap(),
_layerList()
: Inherit(),
_dataBase(dataBase),
_name(name),
_layerMap(),
_layerList()
{
if (!_dataBase)
throw Error("Can't create " + _TName("Technology") + " : null data base");
if (!_dataBase)
throw Error("Can't create " + _TName("Technology") + " : null data base");
if (_dataBase->GetTechnology())
throw Error("Can't create " + _TName("Technology") + " : already exists");
if (_dataBase->GetTechnology())
throw Error("Can't create " + _TName("Technology") + " : already exists");
if (_name.IsEmpty())
throw Error("Can't create " + _TName("Technology") + " : empty name");
if (_name.IsEmpty())
throw Error("Can't create " + _TName("Technology") + " : empty name");
}
Technology* Technology::Create(DataBase* dataBase, const Name& name)
// *****************************************************************
{
Technology* technology = new Technology(dataBase, name);
Technology* technology = new Technology(dataBase, name);
technology->_PostCreate();
technology->_PostCreate();
return technology;
}
Technology* Technology::CreateFromFile(DataBase* dataBase, const string& filePathName)
// ***********************************************************************************
{
Tag* tag = NULL;
Technology* technology = NULL;
try {
tag = new Tag(filePathName, "technology");
technology = CreateTechnologyFromTag(dataBase, tag);
delete tag;
}
catch (...) {
if (technology) technology->Delete();
if (tag) delete tag;
throw;
}
return technology;
return technology;
}
BasicLayer* Technology::GetBasicLayer(const Name& name) const
// **********************************************************
{
Layer* layer = GetLayer(name);
return (layer && is_a<BasicLayer*>(layer)) ? (BasicLayer*)layer : NULL;
Layer* layer = GetLayer(name);
return (layer && is_a<BasicLayer*>(layer)) ? (BasicLayer*)layer : NULL;
}
CompositeLayer* Technology::GetCompositeLayer(const Name& name) const
// ******************************************************************
{
Layer* layer = GetLayer(name);
return (layer && is_a<CompositeLayer*>(layer)) ? (CompositeLayer*)layer : NULL;
Layer* layer = GetLayer(name);
return (layer && is_a<CompositeLayer*>(layer)) ? (CompositeLayer*)layer : NULL;
}
BasicLayers Technology::GetBasicLayers() const
// *******************************************
{
// return GetLayers().GetSubSet<BasicLayer*>();
return SubTypeCollection<Layer*, BasicLayer*>(GetLayers());
// return GetLayers().GetSubSet<BasicLayer*>();
return SubTypeCollection<Layer*, BasicLayer*>(GetLayers());
}
BasicLayers Technology::GetBasicLayers(const Layer::Mask& mask) const
// ******************************************************************
{
return Technology_BasicLayers(this, mask);
return Technology_BasicLayers(this, mask);
}
CompositeLayers Technology::GetCompositeLayers() const
// ***************************************************
{
// return GetLayers().GetSubSet<CompositeLayer*>();
return SubTypeCollection<Layer*, CompositeLayer*>(GetLayers());
// return GetLayers().GetSubSet<CompositeLayer*>();
return SubTypeCollection<Layer*, CompositeLayer*>(GetLayers());
}
void Technology::SetName(const Name& name)
// ***************************************
{
if (name != _name) {
if (name.IsEmpty())
throw Error("Can't change technology name : empty name");
if (name != _name) {
if (name.IsEmpty())
throw Error("Can't change technology name : empty name");
_name = name;
}
_name = name;
}
}
void Technology::_PostCreate()
// ***************************
{
Inherit::_PostCreate();
Inherit::_PostCreate();
_dataBase->_SetTechnology(this);
_dataBase->_SetTechnology(this);
}
void Technology::_PreDelete()
// **************************
{
Inherit::_PreDelete();
Inherit::_PreDelete();
for_each_layer(layer, GetLayers()) layer->Delete(); end_for;
for_each_layer(layer, GetLayers()) layer->Delete(); end_for;
_dataBase->_SetTechnology(NULL);
_dataBase->_SetTechnology(NULL);
}
string Technology::_GetString() const
// **********************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name));
return s;
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name));
return s;
}
Record* Technology::_GetRecord() const
// *****************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("DataBase", _dataBase));
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("Layers", &_layerList));
}
return record;
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("DataBase", _dataBase));
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("Layers", &_layerList));
}
return record;
}
// ****************************************************************************************************
@ -470,32 +207,32 @@ Record* Technology::_GetRecord() const
Technology::LayerMap::LayerMap()
// *****************************
: Inherit()
: Inherit()
{
}
Name Technology::LayerMap::_GetKey(Layer* layer) const
// ***************************************************
{
return layer->GetName();
return layer->getName();
}
unsigned Technology::LayerMap::_GetHashValue(Name name) const
// **********************************************************
{
return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8;
return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8;
}
Layer* Technology::LayerMap::_GetNextElement(Layer* layer) const
// *************************************************************
{
return layer->_GetNextOfTechnologyLayerMap();
return layer->_getNextOfTechnologyLayerMap();
}
void Technology::LayerMap::_SetNextElement(Layer* layer, Layer* nextLayer) const
// *****************************************************************************
{
layer->_SetNextOfTechnologyLayerMap(nextLayer);
layer->_setNextOfTechnologyLayerMap(nextLayer);
};
@ -506,58 +243,58 @@ void Technology::LayerMap::_SetNextElement(Layer* layer, Layer* nextLayer) const
Technology_BasicLayers::Technology_BasicLayers()
// *********************************************
: Inherit(),
_technology(NULL),
_mask(0)
: Inherit(),
_technology(NULL),
_mask(0)
{
}
Technology_BasicLayers::Technology_BasicLayers(const Technology* technology, const Layer::Mask& mask)
// **************************************************************************************************
: Inherit(),
_technology(technology),
_mask(mask)
: Inherit(),
_technology(technology),
_mask(mask)
{
}
Technology_BasicLayers::Technology_BasicLayers(const Technology_BasicLayers& basicLayers)
// **************************************************************************************
: Inherit(),
_technology(basicLayers._technology),
_mask(basicLayers._mask)
: Inherit(),
_technology(basicLayers._technology),
_mask(basicLayers._mask)
{
}
Technology_BasicLayers& Technology_BasicLayers::operator=(const Technology_BasicLayers& basicLayers)
// *************************************************************************************************
{
_technology = basicLayers._technology;
_mask = basicLayers._mask;
return *this;
_technology = basicLayers._technology;
_mask = basicLayers._mask;
return *this;
}
Collection<BasicLayer*>* Technology_BasicLayers::GetClone() const
// **************************************************************
{
return new Technology_BasicLayers(*this);
return new Technology_BasicLayers(*this);
}
Locator<BasicLayer*>* Technology_BasicLayers::GetLocator() const
// *************************************************************
{
return new Locator(_technology, _mask);
return new Locator(_technology, _mask);
}
string Technology_BasicLayers::_GetString() const
// **********************************************
{
string s = "<" + _TName("Technology::BasicLayers");
if (_technology) {
s += " " + GetString(_technology);
s += " " + GetString(_mask);
}
s += ">";
return s;
string s = "<" + _TName("Technology::BasicLayers");
if (_technology) {
s += " " + GetString(_technology);
s += " " + GetString(_mask);
}
s += ">";
return s;
}
@ -568,82 +305,82 @@ string Technology_BasicLayers::_GetString() const
Technology_BasicLayers::Locator::Locator()
// ***************************************
: Inherit(),
_technology(NULL),
_mask(0),
_basicLayerLocator()
: Inherit(),
_technology(NULL),
_mask(0),
_basicLayerLocator()
{
}
Technology_BasicLayers::Locator::Locator(const Technology* technology, const Layer::Mask& mask)
// ********************************************************************************************
: Inherit(),
_technology(technology),
_mask(mask),
_basicLayerLocator()
: Inherit(),
_technology(technology),
_mask(mask),
_basicLayerLocator()
{
if (_technology) {
_basicLayerLocator = _technology->GetBasicLayers().GetLocator();
while (_basicLayerLocator.IsValid() && !(_basicLayerLocator.GetElement()->GetMask() & _mask))
_basicLayerLocator.Progress();
}
if (_technology) {
_basicLayerLocator = _technology->GetBasicLayers().GetLocator();
while (_basicLayerLocator.IsValid() && !(_basicLayerLocator.GetElement()->getMask() & _mask))
_basicLayerLocator.Progress();
}
}
Technology_BasicLayers::Locator::Locator(const Locator& locator)
// *************************************************************
: Inherit(),
_technology(locator._technology),
_mask(locator._mask),
_basicLayerLocator(locator._basicLayerLocator)
: Inherit(),
_technology(locator._technology),
_mask(locator._mask),
_basicLayerLocator(locator._basicLayerLocator)
{
}
Technology_BasicLayers::Locator& Technology_BasicLayers::Locator::operator=(const Locator& locator)
// ************************************************************************************************
{
_technology = locator._technology;
_mask = locator._mask;
_basicLayerLocator = locator._basicLayerLocator;
return *this;
_technology = locator._technology;
_mask = locator._mask;
_basicLayerLocator = locator._basicLayerLocator;
return *this;
}
BasicLayer* Technology_BasicLayers::Locator::GetElement() const
// ************************************************************
{
return _basicLayerLocator.GetElement();
return _basicLayerLocator.GetElement();
}
Locator<BasicLayer*>* Technology_BasicLayers::Locator::GetClone() const
// ********************************************************************
{
return new Locator(*this);
return new Locator(*this);
}
bool Technology_BasicLayers::Locator::IsValid() const
// **************************************************
{
return _basicLayerLocator.IsValid();
return _basicLayerLocator.IsValid();
}
void Technology_BasicLayers::Locator::Progress()
// *********************************************
{
do {
_basicLayerLocator.Progress();
}
while (_basicLayerLocator.IsValid() && !(_basicLayerLocator.GetElement()->GetMask() & _mask));
do {
_basicLayerLocator.Progress();
}
while (_basicLayerLocator.IsValid() && !(_basicLayerLocator.GetElement()->getMask() & _mask));
}
string Technology_BasicLayers::Locator::_GetString() const
// *******************************************************
{
string s = "<" + _TName("Technology::BasicLayers::Locator");
if (_technology) {
s += " " + GetString(_technology);
s += " " + GetString(_mask);
}
s += ">";
return s;
string s = "<" + _TName("Technology::BasicLayers::Locator");
if (_technology) {
s += " " + GetString(_technology);
s += " " + GetString(_mask);
}
s += ">";
return s;
}
} // End of Hurricane namespace.

View File

@ -63,7 +63,6 @@ class Technology : public DBo {
protected: Technology(DataBase* dataBase, const Name& name);
public: static Technology* Create(DataBase* dataBase, const Name& name);
public: static Technology* CreateFromFile(DataBase* dataBase, const string& filePathName);
// Accessors
// *********

View File

@ -70,7 +70,7 @@ Box Vertical::GetBoundingBox() const
Box Vertical::GetBoundingBox(const BasicLayer* basicLayer) const
// *******************************************************
{
if (!GetLayer()->Contains(basicLayer)) return Box();
if (!GetLayer()->contains(basicLayer)) return Box();
Unit size = GetHalfWidth() + _GetSize(basicLayer);
Unit extention = _GetExtention(basicLayer);

View File

@ -181,12 +181,12 @@ CellWidget::CellWidget(Cell* cell,
if (technology) {
for_each_basic_layer(basiclayer, technology->GetBasicLayers()) {
_basicLayersBrush[basiclayer] =
::getBrush(basiclayer->GetFillPattern(),
basiclayer->GetRedValue(),
basiclayer->GetGreenValue(),
basiclayer->GetBlueValue());
::getBrush(basiclayer->getFillPattern(),
basiclayer->getRedValue(),
basiclayer->getGreenValue(),
basiclayer->getBlueValue());
_basicLayersPen[basiclayer] =
QPen(QColor(basiclayer->GetRedValue(), basiclayer->GetGreenValue(), basiclayer->GetBlueValue()));
QPen(QColor(basiclayer->getRedValue(), basiclayer->getGreenValue(), basiclayer->getBlueValue()));
end_for;
}
}
@ -768,7 +768,7 @@ CellWidget::isVisible(BasicLayer* layer) const
//throw Error(NULL_LAYER, __FILE__, __LINE__);
}
return (_visibleLayerMask & layer->GetMask());
return (_visibleLayerMask & layer->getMask());
}
bool
@ -778,7 +778,7 @@ CellWidget::isDrawable(BasicLayer* layer) const
//throw Error(NULL_LAYER, __FILE__, __LINE__);
}
return (layer->GetDisplayThreshold() <= _scale);
return (layer->getDisplayThreshold() <= _scale);
}
@ -911,10 +911,10 @@ CellWidget::setVisible(BasicLayer* layer,
{
if (isVisible(layer) != visible) {
if (visible) {
_visibleLayerMask |= layer->GetMask();
_visibleLayerMask |= layer->getMask();
}
else {
_visibleLayerMask &= ~layer->GetMask();
_visibleLayerMask &= ~layer->getMask();
}
onSetVisible(layer, visible);
@ -925,7 +925,7 @@ CellWidget::setVisible(BasicLayer* layer,
// invalidate();
//}
if (cell && !cell->GetSlices(layer->GetMask()).IsEmpty() && isDrawable(layer)) {
if (cell && !cell->GetSlices(layer->getMask()).IsEmpty() && isDrawable(layer)) {
invalidate();
}
}
@ -1798,7 +1798,7 @@ void CellWidget::drawContent(const Instance* instance, const BasicLayer* basicLa
void CellWidget::drawSlice(const Slice* slice, const BasicLayer* basicLayer, const H::Box& updateArea, const Transformation& transformation) const {
if (slice->GetLayer()->Contains(basicLayer)) {
if (slice->GetLayer()->contains(basicLayer)) {
if (slice->GetBoundingBox().intersect(updateArea)) {
//if ((basicLayer == _layer->_GetSymbolicBasicLayer()) || (3 < view->GetScale()))
for_each_go(go, slice->GetGosUnder(updateArea)) {

View File

@ -25,7 +25,7 @@ LayersWidget::LayersWidget(QWidget* parent)
//connect(checkBox, SIGNAL(toggled(bool)),
// renderArea, SLOT(setAntialiased(bool)));
string layerName = GetString(basicLayer->GetName());
string layerName = GetString(basicLayer->getName());
QLabel* label = new QLabel(tr(layerName.c_str()));
widgets.insert(label);
mainLayout->addWidget(label, line, 1, Qt::AlignRight);