Cleaning in progress in Hurricane
This commit is contained in:
parent
751425c2d1
commit
0eb89cad32
|
@ -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
|
@ -74,7 +74,7 @@ void InstanceGraphicsItem::drawElements(QPainter* painter) {
|
||||||
painter->save();
|
painter->save();
|
||||||
BasicLayer* layer = dynamic_cast<BasicLayer*>(slice->GetLayer());
|
BasicLayer* layer = dynamic_cast<BasicLayer*>(slice->GetLayer());
|
||||||
if (layer) {
|
if (layer) {
|
||||||
painter->setBrush(QColor(layer->GetRedValue(), layer->GetGreenValue(), layer->GetBlueValue()));
|
painter->setBrush(QColor(layer->getRedValue(), layer->getGreenValue(), layer->getBlueValue()));
|
||||||
} else {
|
} else {
|
||||||
painter->setBrush(Qt::blue);
|
painter->setBrush(Qt::blue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,9 +80,9 @@ void SegmentGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
|
||||||
boxToRectangle(box, rect);
|
boxToRectangle(box, rect);
|
||||||
BasicLayer* blayer = dynamic_cast<BasicLayer*>(segment->GetLayer());
|
BasicLayer* blayer = dynamic_cast<BasicLayer*>(segment->GetLayer());
|
||||||
if (blayer) {
|
if (blayer) {
|
||||||
QColor layerColor(blayer->GetRedValue(),
|
QColor layerColor(blayer->getRedValue(),
|
||||||
blayer->GetGreenValue(),
|
blayer->getGreenValue(),
|
||||||
blayer->GetBlueValue());
|
blayer->getBlueValue());
|
||||||
QBrush brush(layerColor);
|
QBrush brush(layerColor);
|
||||||
brush.setStyle(Qt::Dense1Pattern);
|
brush.setStyle(Qt::Dense1Pattern);
|
||||||
painter->setBrush(brush);
|
painter->setBrush(brush);
|
||||||
|
@ -95,10 +95,10 @@ void SegmentGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
|
||||||
} else {
|
} else {
|
||||||
CompositeLayer* clayer = dynamic_cast<CompositeLayer*>(segment->GetLayer());
|
CompositeLayer* clayer = dynamic_cast<CompositeLayer*>(segment->GetLayer());
|
||||||
if (clayer) {
|
if (clayer) {
|
||||||
for_each_basic_layer(basiclayer, clayer->GetBasicLayers()) {
|
for_each_basic_layer(basiclayer, clayer->getBasicLayers()) {
|
||||||
QColor layerColor(basiclayer->GetRedValue(),
|
QColor layerColor(basiclayer->getRedValue(),
|
||||||
basiclayer->GetGreenValue(),
|
basiclayer->getGreenValue(),
|
||||||
basiclayer->GetBlueValue());
|
basiclayer->getBlueValue());
|
||||||
QBrush brush(layerColor);
|
QBrush brush(layerColor);
|
||||||
brush.setStyle(Qt::Dense1Pattern);
|
brush.setStyle(Qt::Dense1Pattern);
|
||||||
painter->setBrush(brush);
|
painter->setBrush(brush);
|
||||||
|
|
|
@ -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 =
|
BasicLayer* basicLayer =
|
||||||
|
@ -107,31 +107,23 @@ BasicLayer* BasicLayer::Create(Technology* technology, const Name& name, const T
|
||||||
return basicLayer;
|
return basicLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicLayers BasicLayer::GetBasicLayers() const
|
BasicLayers BasicLayer::getBasicLayers() const
|
||||||
// *******************************************
|
// *******************************************
|
||||||
{
|
{
|
||||||
return BasicLayer_BasicLayers(this);
|
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)) {
|
if ((redValue != _redValue) || (greenValue != _greenValue) || (blueValue != _blueValue)) {
|
||||||
_redValue = redValue;
|
_redValue = redValue;
|
||||||
_greenValue = greenValue;
|
_greenValue = greenValue;
|
||||||
_blueValue = blueValue;
|
_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) {
|
if (fillPattern != _fillPattern) {
|
||||||
|
@ -144,14 +136,6 @@ void BasicLayer::SetFillPattern(const string& fillPattern)
|
||||||
throw Error("Can't set fill pattern (bad value)");
|
throw Error("Can't set fill pattern (bad value)");
|
||||||
}
|
}
|
||||||
_fillPattern = fillPattern;
|
_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;
|
Mask basicLayersMask = 0;
|
||||||
for_each_basic_layer(basicLayer, GetTechnology()->GetBasicLayers()) {
|
for_each_basic_layer(basicLayer, getTechnology()->GetBasicLayers()) {
|
||||||
basicLayersMask |= basicLayer->GetMask();
|
basicLayersMask |= basicLayer->getMask();
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +154,7 @@ void BasicLayer::_PostCreate()
|
||||||
if (!mask)
|
if (!mask)
|
||||||
throw Error("Can't create " + _TName("BasicLayer") + " : mask capacity overflow");
|
throw Error("Can't create " + _TName("BasicLayer") + " : mask capacity overflow");
|
||||||
|
|
||||||
_SetMask(mask);
|
_setMask(mask);
|
||||||
|
|
||||||
if (_extractNumber) {
|
if (_extractNumber) {
|
||||||
Mask extractMask = (1 << _extractNumber);
|
Mask extractMask = (1 << _extractNumber);
|
||||||
|
@ -178,7 +162,7 @@ void BasicLayer::_PostCreate()
|
||||||
if (!extractMask)
|
if (!extractMask)
|
||||||
throw Error("Can't create " + _TName("BasicLayer") + " : extract mask capacity overflow");
|
throw Error("Can't create " + _TName("BasicLayer") + " : extract mask capacity overflow");
|
||||||
|
|
||||||
_SetExtractMask(extractMask);
|
_setExtractMask(extractMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
Inherit::_PostCreate();
|
Inherit::_PostCreate();
|
||||||
|
@ -189,12 +173,9 @@ void BasicLayer::_PreDelete()
|
||||||
{
|
{
|
||||||
Inherit::_PreDelete();
|
Inherit::_PreDelete();
|
||||||
|
|
||||||
//if (_drawGC) gdk_gc_destroy(_drawGC);
|
CompositeLayers compositeLayers = getTechnology()->GetCompositeLayers();
|
||||||
//if (_fillGC) gdk_gc_destroy(_fillGC);
|
|
||||||
|
|
||||||
CompositeLayers compositeLayers = GetTechnology()->GetCompositeLayers();
|
|
||||||
for_each_composite_layer(compositeLayer, compositeLayers) {
|
for_each_composite_layer(compositeLayer, compositeLayers) {
|
||||||
if (compositeLayer->Contains(this)) compositeLayer->Remove(this);
|
if (compositeLayer->contains(this)) compositeLayer->remove(this);
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,76 +203,6 @@ Record* BasicLayer::_GetRecord() const
|
||||||
return record;
|
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
|
// BasicLayer_BasicLayers implementation
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
|
@ -43,7 +43,7 @@ class BasicLayer : public Layer {
|
||||||
|
|
||||||
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("BasicLayer::Type"); };
|
public: string _GetTypeName() const { return _TName("BasicLayer::Type"); };
|
||||||
public: string _GetString() const;
|
public: string _GetString() const;
|
||||||
|
@ -61,34 +61,32 @@ class BasicLayer : public Layer {
|
||||||
private: unsigned short _blueValue;
|
private: unsigned short _blueValue;
|
||||||
private: string _fillPattern;
|
private: string _fillPattern;
|
||||||
private: double _displayThreshold;
|
private: double _displayThreshold;
|
||||||
// private: GdkGC* _drawGC;
|
|
||||||
// private: GdkGC* _fillGC;
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
// ************
|
// ************
|
||||||
|
|
||||||
protected: BasicLayer(Technology* technology, const Name& name, const Type& type, unsigned extractNumber, const Unit& minimalSize = 0, const Unit& minimalSpacing = 0);
|
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
|
// Accessors
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
public: const Type& GetType() const {return _type;};
|
public: const Type& getType() const {return _type;};
|
||||||
public: unsigned GetExtractNumber() const {return _extractNumber;};
|
public: unsigned getExtractNumber() const {return _extractNumber;};
|
||||||
public: const unsigned short& GetRedValue() const {return _redValue;};
|
public: const unsigned short& getRedValue() const {return _redValue;};
|
||||||
public: const unsigned short& GetGreenValue() const {return _greenValue;};
|
public: const unsigned short& getGreenValue() const {return _greenValue;};
|
||||||
public: const unsigned short& GetBlueValue() const {return _blueValue;};
|
public: const unsigned short& getBlueValue() const {return _blueValue;};
|
||||||
public: const string& GetFillPattern() const {return _fillPattern;};
|
public: const string& getFillPattern() const {return _fillPattern;};
|
||||||
public: double GetDisplayThreshold() const {return _displayThreshold;};
|
public: double getDisplayThreshold() const {return _displayThreshold;};
|
||||||
public: virtual BasicLayers GetBasicLayers() const;
|
public: virtual BasicLayers getBasicLayers() const;
|
||||||
|
|
||||||
// Updators
|
// Updators
|
||||||
// ********
|
// ********
|
||||||
|
|
||||||
public: void SetColor(unsigned short redValue, unsigned short greenValue, unsigned short blueValue);
|
public: void setColor(unsigned short redValue, unsigned short greenValue, unsigned short blueValue);
|
||||||
public: void SetFillPattern(const string& fillPattern);
|
public: void setFillPattern(const string& fillPattern);
|
||||||
public: void SetDisplayThreshold(double threshold) {_displayThreshold = threshold;};
|
public: void setDisplayThreshold(double threshold) {_displayThreshold = threshold;};
|
||||||
|
|
||||||
// Others
|
// Others
|
||||||
// ******
|
// ******
|
||||||
|
@ -100,11 +98,9 @@ class BasicLayer : public Layer {
|
||||||
public: virtual string _GetTypeName() const {return _TName("BasicLayer");};
|
public: virtual string _GetTypeName() const {return _TName("BasicLayer");};
|
||||||
public: virtual string _GetString() const;
|
public: virtual string _GetString() const;
|
||||||
public: virtual Record* _GetRecord() const;
|
public: virtual Record* _GetRecord() const;
|
||||||
public: virtual BasicLayer* _GetSymbolicBasicLayer() {return this;};
|
public: virtual BasicLayer* _getSymbolicBasicLayer() {return this;};
|
||||||
//public: GdkGC* _GetDrawGC();
|
|
||||||
//public: GdkGC* _GetFillGC();
|
|
||||||
|
|
||||||
public: void _Fill(View* view, const Box& box) const;
|
public: void _fill(View* view, const Box& box) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1451,7 +1451,7 @@ Cell_Slices::Locator::Locator(const Cell* cell, const Layer::Mask& mask)
|
||||||
{
|
{
|
||||||
if (_cell && (_mask != 0)) {
|
if (_cell && (_mask != 0)) {
|
||||||
_sliceLocator = ((Cell*)_cell)->_GetSliceMap().GetElements().GetLocator();
|
_sliceLocator = ((Cell*)_cell)->_GetSliceMap().GetElements().GetLocator();
|
||||||
while (_sliceLocator.IsValid() && !(_sliceLocator.GetElement()->GetLayer()->GetMask() & _mask))
|
while (_sliceLocator.IsValid() && !(_sliceLocator.GetElement()->GetLayer()->getMask() & _mask))
|
||||||
_sliceLocator.Progress();
|
_sliceLocator.Progress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1499,7 +1499,7 @@ void Cell_Slices::Locator::Progress()
|
||||||
do {
|
do {
|
||||||
_sliceLocator.Progress();
|
_sliceLocator.Progress();
|
||||||
}
|
}
|
||||||
while (_sliceLocator.IsValid() && !(_sliceLocator.GetElement()->GetLayer()->GetMask() & _mask));
|
while (_sliceLocator.IsValid() && !(_sliceLocator.GetElement()->GetLayer()->getMask() & _mask));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,180 +19,180 @@ namespace Hurricane {
|
||||||
|
|
||||||
CompositeLayer::CompositeLayer(Technology* technology, const Name& name, const Type& type, const Unit& minimalSize, const Unit& minimalSpacing)
|
CompositeLayer::CompositeLayer(Technology* technology, const Name& name, const Type& type, const Unit& minimalSize, const Unit& minimalSpacing)
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
: Inherit(technology, name, minimalSize, minimalSpacing),
|
: Inherit(technology, name, minimalSize, minimalSpacing),
|
||||||
_type(type),
|
_type(type),
|
||||||
_basicLayerList(),
|
_basicLayerList(),
|
||||||
_contactSizeMap(),
|
_contactSizeMap(),
|
||||||
_segmentSizeMap(),
|
_segmentSizeMap(),
|
||||||
_segmentExtentionMap(),
|
_segmentExtentionMap(),
|
||||||
_padSizeMap(),
|
_padSizeMap(),
|
||||||
_maximalContactSize(0),
|
_maximalContactSize(0),
|
||||||
_maximalSegmentSize(0),
|
_maximalSegmentSize(0),
|
||||||
_maximalSegmentExtention(0),
|
_maximalSegmentExtention(0),
|
||||||
_maximalPadSize(0),
|
_maximalPadSize(0),
|
||||||
_symbolicBasicLayer(NULL)
|
_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 =
|
CompositeLayer* compositeLayer =
|
||||||
new CompositeLayer(technology, name, type, minimalSize, minimalSpacing);
|
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);
|
SizeMap::const_iterator it = _contactSizeMap.find(basicLayer);
|
||||||
return ((it == _contactSizeMap.end()) ? 0 : (*it).second);
|
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);
|
SizeMap::const_iterator it = _segmentSizeMap.find(basicLayer);
|
||||||
return ((it == _segmentSizeMap.end()) ? 0 : (*it).second);
|
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);
|
SizeMap::const_iterator it = _segmentExtentionMap.find(basicLayer);
|
||||||
return ((it == _segmentExtentionMap.end()) ? 0 : (*it).second);
|
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);
|
SizeMap::const_iterator it = _padSizeMap.find(basicLayer);
|
||||||
return ((it == _padSizeMap.end()) ? 0 : (*it).second);
|
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)
|
if (!basicLayer)
|
||||||
throw Error("Can't add basic layer : null basic layer");
|
throw Error("Can't add basic layer : null basic layer");
|
||||||
|
|
||||||
if (Contains(basicLayer))
|
if (contains(basicLayer))
|
||||||
throw Error("Can't add basic layer : already done");
|
throw Error("Can't add basic layer : already done");
|
||||||
|
|
||||||
_basicLayerList.push_back(basicLayer);
|
_basicLayerList.push_back(basicLayer);
|
||||||
|
|
||||||
_SetMask(GetMask() | basicLayer->GetMask());
|
_setMask(getMask() | basicLayer->getMask());
|
||||||
_SetExtractMask(GetExtractMask() | basicLayer->GetExtractMask());
|
_setExtractMask(getExtractMask() | basicLayer->getExtractMask());
|
||||||
|
|
||||||
if (contactSize != 0) _contactSizeMap[basicLayer] = contactSize;
|
if (contactSize != 0) _contactSizeMap[basicLayer] = contactSize;
|
||||||
if (segmentSize != 0) _segmentSizeMap[basicLayer] = segmentSize;
|
if (segmentSize != 0) _segmentSizeMap[basicLayer] = segmentSize;
|
||||||
if (segmentExtention != 0) _segmentExtentionMap[basicLayer] = segmentExtention;
|
if (segmentExtention != 0) _segmentExtentionMap[basicLayer] = segmentExtention;
|
||||||
if (padSize != 0) _padSizeMap[basicLayer] = padSize;
|
if (padSize != 0) _padSizeMap[basicLayer] = padSize;
|
||||||
|
|
||||||
_maximalContactSize = max(contactSize, _maximalContactSize);
|
_maximalContactSize = max(contactSize, _maximalContactSize);
|
||||||
_maximalSegmentSize = max(segmentSize, _maximalSegmentSize);
|
_maximalSegmentSize = max(segmentSize, _maximalSegmentSize);
|
||||||
_maximalSegmentExtention = max(segmentExtention, _maximalSegmentExtention);
|
_maximalSegmentExtention = max(segmentExtention, _maximalSegmentExtention);
|
||||||
_maximalPadSize = max(padSize, _maximalPadSize);
|
_maximalPadSize = max(padSize, _maximalPadSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompositeLayer::Remove(BasicLayer* basicLayer)
|
void CompositeLayer::remove(BasicLayer* basicLayer)
|
||||||
// ************************************************
|
// ************************************************
|
||||||
{
|
{
|
||||||
if (!basicLayer)
|
if (!basicLayer)
|
||||||
throw Error("Can't remove basic layer : null basic layer");
|
throw Error("Can't remove basic layer : null basic layer");
|
||||||
|
|
||||||
if (!Contains(basicLayer))
|
if (!contains(basicLayer))
|
||||||
throw Error("Can't remove basic layer : not contained");
|
throw Error("Can't remove basic layer : not contained");
|
||||||
|
|
||||||
_basicLayerList.remove(basicLayer);
|
_basicLayerList.remove(basicLayer);
|
||||||
|
|
||||||
_contactSizeMap.erase(basicLayer);
|
_contactSizeMap.erase(basicLayer);
|
||||||
_segmentSizeMap.erase(basicLayer);
|
_segmentSizeMap.erase(basicLayer);
|
||||||
_segmentExtentionMap.erase(basicLayer);
|
_segmentExtentionMap.erase(basicLayer);
|
||||||
_padSizeMap.erase(basicLayer);
|
_padSizeMap.erase(basicLayer);
|
||||||
|
|
||||||
_maximalContactSize = 0;
|
_maximalContactSize = 0;
|
||||||
_maximalSegmentSize = 0;
|
_maximalSegmentSize = 0;
|
||||||
_maximalSegmentExtention = 0;
|
_maximalSegmentExtention = 0;
|
||||||
_maximalPadSize = 0;
|
_maximalPadSize = 0;
|
||||||
|
|
||||||
Mask mask = 0;
|
Mask mask = 0;
|
||||||
Mask extractMask = 0;
|
Mask extractMask = 0;
|
||||||
|
|
||||||
for_each_basic_layer(basicLayer, GetBasicLayers()) {
|
for_each_basic_layer(basicLayer, getBasicLayers()) {
|
||||||
mask |= basicLayer->GetMask();
|
mask |= basicLayer->getMask();
|
||||||
extractMask |= basicLayer->GetExtractMask();
|
extractMask |= basicLayer->getExtractMask();
|
||||||
_maximalContactSize = max(GetContactSize(basicLayer), _maximalContactSize);
|
_maximalContactSize = max(getContactSize(basicLayer), _maximalContactSize);
|
||||||
_maximalSegmentSize = max(GetSegmentSize(basicLayer), _maximalSegmentSize);
|
_maximalSegmentSize = max(getSegmentSize(basicLayer), _maximalSegmentSize);
|
||||||
_maximalSegmentExtention = max(GetSegmentExtention(basicLayer), _maximalSegmentExtention);
|
_maximalSegmentExtention = max(getSegmentExtention(basicLayer), _maximalSegmentExtention);
|
||||||
_maximalPadSize = max(GetPadSize(basicLayer), _maximalPadSize);
|
_maximalPadSize = max(getPadSize(basicLayer), _maximalPadSize);
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
_SetMask(mask);
|
_setMask(mask);
|
||||||
_SetExtractMask(extractMask);
|
_setExtractMask(extractMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
string CompositeLayer::_GetString() const
|
string CompositeLayer::_GetString() const
|
||||||
// **************************************
|
// **************************************
|
||||||
{
|
{
|
||||||
string s = Inherit::_GetString();
|
string s = Inherit::_GetString();
|
||||||
/*
|
/*
|
||||||
s.insert(s.length() - 1, " " + GetString(_type));
|
s.insert(s.length() - 1, " " + GetString(_type));
|
||||||
s.insert(s.length() - 1, " {");
|
s.insert(s.length() - 1, " {");
|
||||||
string separator = "";
|
string separator = "";
|
||||||
for_each_basic_layer(basicLayer, GetBasicLayers()) {
|
for_each_basic_layer(basicLayer, GetBasicLayers()) {
|
||||||
s.insert(s.length() - 1, separator + GetString(basicLayer->GetName()));
|
s.insert(s.length() - 1, separator + GetString(basicLayer->GetName()));
|
||||||
separator = "|";
|
separator = "|";
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
s.insert(s.length() - 1, "}");
|
s.insert(s.length() - 1, "}");
|
||||||
*/
|
*/
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* CompositeLayer::_GetRecord() const
|
Record* CompositeLayer::_GetRecord() const
|
||||||
// ***************************************
|
// ***************************************
|
||||||
{
|
{
|
||||||
Record* record = Inherit::_GetRecord();
|
Record* record = Inherit::_GetRecord();
|
||||||
if (record) {
|
if (record) {
|
||||||
record->Add(GetSlot("Type", &_type));
|
record->Add(GetSlot("Type", &_type));
|
||||||
record->Add(GetSlot("BasicLayers", &_basicLayerList));
|
record->Add(GetSlot("BasicLayers", &_basicLayerList));
|
||||||
record->Add(GetSlot("ContactSizes", &_contactSizeMap));
|
record->Add(GetSlot("ContactSizes", &_contactSizeMap));
|
||||||
record->Add(GetSlot("SegmentSizes", &_segmentSizeMap));
|
record->Add(GetSlot("SegmentSizes", &_segmentSizeMap));
|
||||||
record->Add(GetSlot("SegmentExtentions", &_segmentExtentionMap));
|
record->Add(GetSlot("SegmentExtentions", &_segmentExtentionMap));
|
||||||
record->Add(GetSlot("PadSizes", &_padSizeMap));
|
record->Add(GetSlot("PadSizes", &_padSizeMap));
|
||||||
record->Add(GetSlot("MaximalContactSize", &_maximalContactSize));
|
record->Add(GetSlot("MaximalContactSize", &_maximalContactSize));
|
||||||
record->Add(GetSlot("MaximalSegmentSize", &_maximalSegmentSize));
|
record->Add(GetSlot("MaximalSegmentSize", &_maximalSegmentSize));
|
||||||
record->Add(GetSlot("MaximalSegmentExtention", &_maximalSegmentExtention));
|
record->Add(GetSlot("MaximalSegmentExtention", &_maximalSegmentExtention));
|
||||||
record->Add(GetSlot("MaximalPadSize", &_maximalPadSize));
|
record->Add(GetSlot("MaximalPadSize", &_maximalPadSize));
|
||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompositeLayer::_UpdateSymbolicBasicLayer(const Layer::Mask& visibleBasicLayersMask)
|
void CompositeLayer::_updateSymbolicBasicLayer(const Layer::Mask& visibleBasicLayersMask)
|
||||||
// **************************************************************************************
|
// **************************************************************************************
|
||||||
{
|
{
|
||||||
_symbolicBasicLayer = NULL;
|
_symbolicBasicLayer = NULL;
|
||||||
BasicLayer* symbolicBasicLayer = NULL;
|
BasicLayer* symbolicBasicLayer = NULL;
|
||||||
for_each_basic_layer(basicLayer, GetBasicLayers()) {
|
for_each_basic_layer(basicLayer, getBasicLayers()) {
|
||||||
if (basicLayer->GetMask() & visibleBasicLayersMask) {
|
if (basicLayer->getMask() & visibleBasicLayersMask) {
|
||||||
symbolicBasicLayer = basicLayer;
|
symbolicBasicLayer = basicLayer;
|
||||||
if (basicLayer->GetType() == BasicLayer::Type::CONTACT)
|
if (basicLayer->getType() == BasicLayer::Type::CONTACT)
|
||||||
_symbolicBasicLayer = basicLayer;
|
_symbolicBasicLayer = basicLayer;
|
||||||
}
|
}
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
if (!_symbolicBasicLayer) _symbolicBasicLayer = symbolicBasicLayer;
|
if (!_symbolicBasicLayer) _symbolicBasicLayer = symbolicBasicLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
@ -201,40 +201,40 @@ void CompositeLayer::_UpdateSymbolicBasicLayer(const Layer::Mask& visibleBasicLa
|
||||||
|
|
||||||
CompositeLayer::Type::Type(const Code& code)
|
CompositeLayer::Type::Type(const Code& code)
|
||||||
// *****************************************
|
// *****************************************
|
||||||
: _code(code)
|
: _code(code)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CompositeLayer::Type::Type(const Type& type)
|
CompositeLayer::Type::Type(const Type& type)
|
||||||
// *****************************************
|
// *****************************************
|
||||||
: _code(type._code)
|
: _code(type._code)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CompositeLayer::Type& CompositeLayer::Type::operator=(const Type& type)
|
CompositeLayer::Type& CompositeLayer::Type::operator=(const Type& type)
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
{
|
{
|
||||||
_code = type._code;
|
_code = type._code;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
string CompositeLayer::Type::_GetString() const
|
string CompositeLayer::Type::_GetString() const
|
||||||
// ********************************************
|
// ********************************************
|
||||||
{
|
{
|
||||||
switch (_code) {
|
switch (_code) {
|
||||||
case UNDEFINED : return "UNDEFINED";
|
case UNDEFINED : return "UNDEFINED";
|
||||||
case METAL : return "METAL";
|
case METAL : return "METAL";
|
||||||
case VIA : return "VIA";
|
case VIA : return "VIA";
|
||||||
}
|
}
|
||||||
return "ABNORMAL";
|
return "ABNORMAL";
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* CompositeLayer::Type::_GetRecord() const
|
Record* CompositeLayer::Type::_GetRecord() const
|
||||||
// *********************************************
|
// *********************************************
|
||||||
{
|
{
|
||||||
Record* record = new Record(GetString(this));
|
Record* record = new Record(GetString(this));
|
||||||
record->Add(GetSlot("Code", (int)_code));
|
record->Add(GetSlot("Code", (int)_code));
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -249,19 +249,19 @@ Record* CompositeLayer::Type::_GetRecord() const
|
||||||
bool Scan(const string& s, H::CompositeLayer::Type& type)
|
bool Scan(const string& s, H::CompositeLayer::Type& type)
|
||||||
// ***************************************************
|
// ***************************************************
|
||||||
{
|
{
|
||||||
if (s == "UNDEFINED") {
|
if (s == "UNDEFINED") {
|
||||||
type = H::CompositeLayer::Type::UNDEFINED;
|
type = H::CompositeLayer::Type::UNDEFINED;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (s == "METAL") {
|
if (s == "METAL") {
|
||||||
type = H::CompositeLayer::Type::METAL;
|
type = H::CompositeLayer::Type::METAL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (s == "VIA") {
|
if (s == "VIA") {
|
||||||
type = H::CompositeLayer::Type::VIA;
|
type = H::CompositeLayer::Type::VIA;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,86 +24,86 @@ class CompositeLayer : public Layer {
|
||||||
// Types
|
// Types
|
||||||
// *****
|
// *****
|
||||||
|
|
||||||
public: typedef Layer Inherit;
|
public: typedef Layer Inherit;
|
||||||
|
|
||||||
public: class Type {
|
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 Code& code = UNDEFINED);
|
||||||
public: Type(const Type& type);
|
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 _GetTypeName() const { return _TName("CompositeLayer::Type"); };
|
||||||
public: string _GetString() const;
|
public: string _GetString() const;
|
||||||
public: Record* _GetRecord() 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
|
// Attributes
|
||||||
// **********
|
// **********
|
||||||
|
|
||||||
private: Type _type;
|
private: Type _type;
|
||||||
private: BasicLayerList _basicLayerList;
|
private: BasicLayerList _basicLayerList;
|
||||||
private: SizeMap _contactSizeMap;
|
private: SizeMap _contactSizeMap;
|
||||||
private: SizeMap _segmentSizeMap;
|
private: SizeMap _segmentSizeMap;
|
||||||
private: SizeMap _segmentExtentionMap;
|
private: SizeMap _segmentExtentionMap;
|
||||||
private: SizeMap _padSizeMap;
|
private: SizeMap _padSizeMap;
|
||||||
private: Unit _maximalContactSize;
|
private: Unit _maximalContactSize;
|
||||||
private: Unit _maximalSegmentSize;
|
private: Unit _maximalSegmentSize;
|
||||||
private: Unit _maximalSegmentExtention;
|
private: Unit _maximalSegmentExtention;
|
||||||
private: Unit _maximalPadSize;
|
private: Unit _maximalPadSize;
|
||||||
private: BasicLayer* _symbolicBasicLayer;
|
private: BasicLayer* _symbolicBasicLayer;
|
||||||
|
|
||||||
// Constructors
|
// 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
|
// Accessors
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
public: const Type& GetType() const {return _type;};
|
public: const Type& getType() const {return _type;};
|
||||||
public: virtual BasicLayers GetBasicLayers() const;
|
public: virtual BasicLayers getBasicLayers() const;
|
||||||
public: Unit GetContactSize(const BasicLayer* basicLayer) const;
|
public: Unit getContactSize(const BasicLayer* basicLayer) const;
|
||||||
public: Unit GetSegmentSize(const BasicLayer* basicLayer) const;
|
public: Unit getSegmentSize(const BasicLayer* basicLayer) const;
|
||||||
public: Unit GetSegmentExtention(const BasicLayer* basicLayer) const;
|
public: Unit getSegmentExtention(const BasicLayer* basicLayer) const;
|
||||||
public: Unit GetPadSize(const BasicLayer* basicLayer) const;
|
public: Unit getPadSize(const BasicLayer* basicLayer) const;
|
||||||
public: const Unit& GetMaximalContactSize() const {return _maximalContactSize;};
|
public: const Unit& getMaximalContactSize() const {return _maximalContactSize;};
|
||||||
public: const Unit& GetMaximalSegmentSize() const {return _maximalSegmentSize;};
|
public: const Unit& getMaximalSegmentSize() const {return _maximalSegmentSize;};
|
||||||
public: const Unit& GetMaximalSegmentExtention() const {return _maximalSegmentExtention;};
|
public: const Unit& getMaximalSegmentExtention() const {return _maximalSegmentExtention;};
|
||||||
public: const Unit& GetMaximalPadSize() const {return _maximalPadSize;};
|
public: const Unit& getMaximalPadSize() const {return _maximalPadSize;};
|
||||||
|
|
||||||
// Updators
|
// Updators
|
||||||
// ********
|
// ********
|
||||||
|
|
||||||
public: void Add(BasicLayer* basicLayer, const Unit& contactSize, const Unit& segmentSize, const Unit& segmentExtention, const Unit& padSize);
|
public: void add(BasicLayer* basicLayer, const Unit& contactSize, const Unit& segmentSize, const Unit& segmentExtention, const Unit& padSize);
|
||||||
public: void Remove(BasicLayer* basicLayer);
|
public: void remove(BasicLayer* basicLayer);
|
||||||
|
|
||||||
// Others
|
// Others
|
||||||
// ******
|
// ******
|
||||||
|
|
||||||
public: virtual string _GetTypeName() const {return _TName("CompositeLayer");};
|
public: virtual string _GetTypeName() const {return _TName("CompositeLayer");};
|
||||||
public: virtual string _GetString() const;
|
public: virtual string _GetString() const;
|
||||||
public: virtual Record* _GetRecord() const;
|
public: virtual Record* _GetRecord() const;
|
||||||
public: virtual BasicLayer* _GetSymbolicBasicLayer() {return _symbolicBasicLayer;};
|
public: virtual BasicLayer* _getSymbolicBasicLayer() {return _symbolicBasicLayer;};
|
||||||
public: BasicLayerList& _GetBasicLayerList() {return _basicLayerList;};
|
public: BasicLayerList& _getBasicLayerList() {return _basicLayerList;};
|
||||||
|
|
||||||
public: void _UpdateSymbolicBasicLayer(const Layer::Mask& visibleBasicLayersMask);
|
public: void _updateSymbolicBasicLayer(const Layer::Mask& visibleBasicLayersMask);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -186,7 +186,7 @@ Box Contact::GetBoundingBox() const
|
||||||
Box Contact::GetBoundingBox(const BasicLayer* basicLayer) const
|
Box Contact::GetBoundingBox(const BasicLayer* basicLayer) const
|
||||||
// ******************************************************
|
// ******************************************************
|
||||||
{
|
{
|
||||||
if (!_layer->Contains(basicLayer)) return Box();
|
if (!_layer->contains(basicLayer)) return Box();
|
||||||
|
|
||||||
Unit size = _GetSize(basicLayer);
|
Unit size = _GetSize(basicLayer);
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ string Contact::_GetString() const
|
||||||
// *******************************
|
// *******************************
|
||||||
{
|
{
|
||||||
string s = Inherit::_GetString();
|
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(GetX()));
|
||||||
s.insert(s.length() - 1, " " + GetValueString(GetY()));
|
s.insert(s.length() - 1, " " + GetValueString(GetY()));
|
||||||
s.insert(s.length() - 1, "] " + GetValueString(_width));
|
s.insert(s.length() - 1, "] " + GetValueString(_width));
|
||||||
|
@ -349,7 +349,7 @@ Unit Contact::_GetSize() const
|
||||||
|
|
||||||
Layer* layer = GetLayer();
|
Layer* layer = GetLayer();
|
||||||
if (is_a<CompositeLayer*>(layer))
|
if (is_a<CompositeLayer*>(layer))
|
||||||
size = ((CompositeLayer*)layer)->GetMaximalContactSize();
|
size = ((CompositeLayer*)layer)->getMaximalContactSize();
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
@ -359,69 +359,16 @@ Unit Contact::_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))
|
if (is_a<CompositeLayer*>(layer))
|
||||||
size = ((CompositeLayer*)layer)->GetContactSize(basicLayer);
|
size = ((CompositeLayer*)layer)->getContactSize(basicLayer);
|
||||||
|
|
||||||
return size;
|
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
|
// Contact::AnchorHook implementation
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
|
@ -27,69 +27,69 @@ class DBo : public NestedSlotAdapter {
|
||||||
// Types
|
// Types
|
||||||
// *****
|
// *****
|
||||||
|
|
||||||
public: typedef set<Property*> PropertySet;
|
public: typedef set<Property*> PropertySet;
|
||||||
|
|
||||||
// Attributs
|
// Attributs
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
private: PropertySet _propertySet;
|
private: PropertySet _propertySet;
|
||||||
|
|
||||||
// Constructors
|
// 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
|
// Destructors
|
||||||
// ***********
|
// ***********
|
||||||
|
|
||||||
protected: virtual ~DBo();
|
protected: virtual ~DBo();
|
||||||
|
|
||||||
// Operators
|
// Operators
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
private: DBo& operator=(const DBo& dbo); // not implemented to forbid assignment
|
private: DBo& operator=(const DBo& dbo); // not implemented to forbid assignment
|
||||||
|
|
||||||
// Others
|
// 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 _GetTypeName() const = 0;
|
||||||
public: virtual string _GetString() const;
|
public: virtual string _GetString() const;
|
||||||
public: virtual Record* _GetRecord() const;
|
public: virtual Record* _GetRecord() const;
|
||||||
public: PropertySet& _GetPropertySet() {return _propertySet;};
|
public: PropertySet& _GetPropertySet() {return _propertySet;};
|
||||||
|
|
||||||
public: void _OnDeleted(Property* property);
|
public: void _OnDeleted(Property* property);
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// Destructors
|
// Destructors
|
||||||
// ***********
|
// ***********
|
||||||
|
|
||||||
public: virtual void Delete();
|
public: virtual void Delete();
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
public: Property* GetProperty(const Name& name) const;
|
public: Property* GetProperty(const Name& name) const;
|
||||||
public: Properties GetProperties() const {return GetCollection(_propertySet);};
|
public: Properties GetProperties() const {return GetCollection(_propertySet);};
|
||||||
|
|
||||||
// Predicates
|
// Predicates
|
||||||
// **********
|
// **********
|
||||||
|
|
||||||
public: bool HasProperty() const {return !_propertySet.empty();};
|
public: bool HasProperty() const {return !_propertySet.empty();};
|
||||||
|
|
||||||
// Updators
|
// Updators
|
||||||
// ********
|
// ********
|
||||||
|
|
||||||
public: void Put(Property* property);
|
public: void Put(Property* property);
|
||||||
public: void Remove(Property* property);
|
public: void Remove(Property* property);
|
||||||
public: void RemoveProperty(const Name& name);
|
public: void RemoveProperty(const Name& name);
|
||||||
public: void ClearProperties();
|
public: void ClearProperties();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ Box Horizontal::GetBoundingBox() const
|
||||||
Box Horizontal::GetBoundingBox(const BasicLayer* basicLayer) 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 size = GetHalfWidth() + _GetSize(basicLayer);
|
||||||
Unit extention = _GetExtention(basicLayer);
|
Unit extention = _GetExtention(basicLayer);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -18,112 +18,112 @@ namespace Hurricane {
|
||||||
|
|
||||||
Layer::Layer(Technology* technology, const Name& name, const Unit& minimalSize, const Unit& minimalSpacing, const Unit& pitch)
|
Layer::Layer(Technology* technology, const Name& name, const Unit& minimalSize, const Unit& minimalSpacing, const Unit& pitch)
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_technology(technology),
|
_technology(technology),
|
||||||
_name(name),
|
_name(name),
|
||||||
_mask(0),
|
_mask(0),
|
||||||
_extractMask(0),
|
_extractMask(0),
|
||||||
_minimalSize(minimalSize),
|
_minimalSize(minimalSize),
|
||||||
_minimalSpacing(minimalSpacing),
|
_minimalSpacing(minimalSpacing),
|
||||||
_pitch(pitch),
|
_pitch(pitch),
|
||||||
_nextOfTechnologyLayerMap(NULL)
|
_nextOfTechnologyLayerMap(NULL)
|
||||||
{
|
{
|
||||||
if (!_technology)
|
if (!_technology)
|
||||||
throw Error("Can't create " + _TName("Layer") + " : null technology");
|
throw Error("Can't create " + _TName("Layer") + " : null technology");
|
||||||
|
|
||||||
if (_name.IsEmpty())
|
if (_name.IsEmpty())
|
||||||
throw Error("Can't create " + _TName("Layer") + " : empty name");
|
throw Error("Can't create " + _TName("Layer") + " : empty name");
|
||||||
|
|
||||||
if (_technology->GetLayer(_name))
|
if (_technology->GetLayer(_name))
|
||||||
throw Error("Can't create " + _TName("Layer") + " " + GetString(_name) + " : already exists");
|
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 != _name) {
|
||||||
if (name.IsEmpty())
|
if (name.IsEmpty())
|
||||||
throw Error("Can't change layer name : empty name");
|
throw Error("Can't change layer name : empty name");
|
||||||
|
|
||||||
if (_technology->GetLayer(name))
|
if (_technology->GetLayer(name))
|
||||||
throw Error("Can't change layer name : already exists");
|
throw Error("Can't change layer name : already exists");
|
||||||
|
|
||||||
_technology->_GetLayerMap()._Remove(this);
|
_technology->_GetLayerMap()._Remove(this);
|
||||||
_name = name;
|
_name = name;
|
||||||
_technology->_GetLayerMap()._Insert(this);
|
_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()
|
void Layer::_PostCreate()
|
||||||
// **********************
|
// **********************
|
||||||
{
|
{
|
||||||
_technology->_GetLayerMap()._Insert(this);
|
_technology->_GetLayerMap()._Insert(this);
|
||||||
_technology->_GetLayerList().push_back(this);
|
_technology->_GetLayerList().push_back(this);
|
||||||
|
|
||||||
Inherit::_PostCreate();
|
Inherit::_PostCreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Layer::_PreDelete()
|
void Layer::_PreDelete()
|
||||||
// *********************
|
// *********************
|
||||||
{
|
{
|
||||||
Inherit::_PreDelete();
|
Inherit::_PreDelete();
|
||||||
|
|
||||||
_technology->_GetLayerList().remove(this);
|
_technology->_GetLayerList().remove(this);
|
||||||
_technology->_GetLayerMap()._Remove(this);
|
_technology->_GetLayerMap()._Remove(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
string Layer::_GetString() const
|
string Layer::_GetString() const
|
||||||
// *****************************
|
// *****************************
|
||||||
{
|
{
|
||||||
string s = Inherit::_GetString();
|
string s = Inherit::_GetString();
|
||||||
s.insert(s.length() - 1, " " + GetString(_name));
|
s.insert(s.length() - 1, " " + GetString(_name));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* Layer::_GetRecord() const
|
Record* Layer::_GetRecord() const
|
||||||
// ************************
|
// ************************
|
||||||
{
|
{
|
||||||
Record* record = Inherit::_GetRecord();
|
Record* record = Inherit::_GetRecord();
|
||||||
if (record) {
|
if (record) {
|
||||||
record->Add(GetSlot("Technology", _technology));
|
record->Add(GetSlot("Technology", _technology));
|
||||||
record->Add(GetSlot("Name", &_name));
|
record->Add(GetSlot("Name", &_name));
|
||||||
record->Add(GetSlot("Mask", &_mask));
|
record->Add(GetSlot("Mask", &_mask));
|
||||||
record->Add(GetSlot("ExtractMask", &_extractMask));
|
record->Add(GetSlot("ExtractMask", &_extractMask));
|
||||||
record->Add(GetSlot("MinimalSize", &_minimalSize));
|
record->Add(GetSlot("MinimalSize", &_minimalSize));
|
||||||
record->Add(GetSlot("MinimalSpacing", &_minimalSpacing));
|
record->Add(GetSlot("MinimalSpacing", &_minimalSpacing));
|
||||||
record->Add(GetSlot("Pitch", &_pitch));
|
record->Add(GetSlot("Pitch", &_pitch));
|
||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
|
@ -28,68 +28,68 @@ class Layer : public DBo {
|
||||||
// Types
|
// Types
|
||||||
// *****
|
// *****
|
||||||
|
|
||||||
public: typedef DBo Inherit;
|
public: typedef DBo Inherit;
|
||||||
|
|
||||||
public: typedef unsigned long long Mask;
|
public: typedef unsigned long long Mask;
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
// **********
|
// **********
|
||||||
|
|
||||||
private: Technology* _technology;
|
private: Technology* _technology;
|
||||||
private: Name _name;
|
private: Name _name;
|
||||||
private: Mask _mask;
|
private: Mask _mask;
|
||||||
private: Mask _extractMask;
|
private: Mask _extractMask;
|
||||||
private: Unit _minimalSize;
|
private: Unit _minimalSize;
|
||||||
private: Unit _minimalSpacing;
|
private: Unit _minimalSpacing;
|
||||||
private: Unit _pitch;
|
private: Unit _pitch;
|
||||||
private: Layer* _nextOfTechnologyLayerMap;
|
private: Layer* _nextOfTechnologyLayerMap;
|
||||||
|
|
||||||
// Constructors
|
// 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
|
// Accessors
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
public: Technology* GetTechnology() const {return _technology;};
|
public: Technology* getTechnology() const {return _technology;};
|
||||||
public: const Name& GetName() const {return _name;};
|
public: const Name& getName() const {return _name;};
|
||||||
public: const Mask& GetMask() const {return _mask;};
|
public: const Mask& getMask() const {return _mask;};
|
||||||
public: const Mask& GetExtractMask() const {return _extractMask;};
|
public: const Mask& getExtractMask() const {return _extractMask;};
|
||||||
public: const Unit& GetMinimalSize() const {return _minimalSize;};
|
public: const Unit& getMinimalSize() const {return _minimalSize;};
|
||||||
public: const Unit& GetMinimalSpacing() const {return _minimalSpacing;};
|
public: const Unit& getMinimalSpacing() const {return _minimalSpacing;};
|
||||||
public: Unit GetPitch() const {return (_pitch==0?(_minimalSize + _minimalSpacing):_pitch);};
|
public: Unit getPitch() const {return (_pitch==0?(_minimalSize + _minimalSpacing):_pitch);};
|
||||||
public: virtual BasicLayers GetBasicLayers() const = 0;
|
public: virtual BasicLayers getBasicLayers() const = 0;
|
||||||
|
|
||||||
// Predicates
|
// Predicates
|
||||||
// **********
|
// **********
|
||||||
|
|
||||||
public: bool Contains(const Layer* layer) const;
|
public: bool contains(const Layer* layer) const;
|
||||||
public: bool Intersect(const Layer* layer) const;
|
public: bool intersect(const Layer* layer) const;
|
||||||
|
|
||||||
// Updators
|
// Updators
|
||||||
// ********
|
// ********
|
||||||
|
|
||||||
public: void SetName(const Name& name);
|
public: void setName(const Name& name);
|
||||||
public: void SetMinimalSize(const Unit& minimalSize);
|
public: void setMinimalSize(const Unit& minimalSize);
|
||||||
public: void SetMinimalSpacing(const Unit& minimalSpacing);
|
public: void setMinimalSpacing(const Unit& minimalSpacing);
|
||||||
public: void SetPitch(const Unit& pitch);
|
public: void setPitch(const Unit& pitch);
|
||||||
|
|
||||||
// Others
|
// Others
|
||||||
// ******
|
// ******
|
||||||
|
|
||||||
protected: virtual void _PostCreate();
|
protected: virtual void _PostCreate();
|
||||||
|
|
||||||
protected: virtual void _PreDelete();
|
protected: virtual void _PreDelete();
|
||||||
|
|
||||||
public: virtual string _GetString() const;
|
public: virtual string _GetString() const;
|
||||||
public: virtual Record* _GetRecord() const;
|
public: virtual Record* _GetRecord() const;
|
||||||
public: virtual BasicLayer* _GetSymbolicBasicLayer() = 0;
|
public: virtual BasicLayer* _getSymbolicBasicLayer() = 0;
|
||||||
public: Layer* _GetNextOfTechnologyLayerMap() const {return _nextOfTechnologyLayerMap;};
|
public: Layer* _getNextOfTechnologyLayerMap() const {return _nextOfTechnologyLayerMap;};
|
||||||
|
|
||||||
public: void _SetMask(const Mask& mask) {_mask = mask;};
|
public: void _setMask(const Mask& mask) {_mask = mask;};
|
||||||
public: void _SetExtractMask(const Mask& extractMask) {_extractMask = extractMask;};
|
public: void _setExtractMask(const Mask& extractMask) {_extractMask = extractMask;};
|
||||||
public: void _SetNextOfTechnologyLayerMap(Layer* layer) {_nextOfTechnologyLayerMap = layer;};
|
public: void _setNextOfTechnologyLayerMap(Layer* layer) {_nextOfTechnologyLayerMap = layer;};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ Box Pad::GetBoundingBox() const
|
||||||
Box boundingBox = _boundingBox;
|
Box boundingBox = _boundingBox;
|
||||||
|
|
||||||
if (is_a<CompositeLayer*>(_layer))
|
if (is_a<CompositeLayer*>(_layer))
|
||||||
boundingBox.inflate(((CompositeLayer*)_layer)->GetMaximalPadSize());
|
boundingBox.inflate(((CompositeLayer*)_layer)->getMaximalPadSize());
|
||||||
|
|
||||||
return boundingBox;
|
return boundingBox;
|
||||||
}
|
}
|
||||||
|
@ -68,12 +68,12 @@ Box Pad::GetBoundingBox() const
|
||||||
Box Pad::GetBoundingBox(const BasicLayer* basicLayer) const
|
Box Pad::GetBoundingBox(const BasicLayer* basicLayer) const
|
||||||
// **************************************************
|
// **************************************************
|
||||||
{
|
{
|
||||||
if (!_layer->Contains(basicLayer)) return Box();
|
if (!_layer->contains(basicLayer)) return Box();
|
||||||
|
|
||||||
Box boundingBox = _boundingBox;
|
Box boundingBox = _boundingBox;
|
||||||
|
|
||||||
if (is_a<CompositeLayer*>(_layer))
|
if (is_a<CompositeLayer*>(_layer))
|
||||||
boundingBox.inflate(((CompositeLayer*)_layer)->GetPadSize(basicLayer));
|
boundingBox.inflate(((CompositeLayer*)_layer)->getPadSize(basicLayer));
|
||||||
|
|
||||||
return boundingBox;
|
return boundingBox;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ string Pad::_GetString() const
|
||||||
// ***************************
|
// ***************************
|
||||||
{
|
{
|
||||||
string s = Inherit::_GetString();
|
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));
|
s.insert(s.length() - 1, " " + GetString(_boundingBox));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,58 +24,58 @@ class Segment_Hooks : public Collection<Hook*> {
|
||||||
// Types
|
// 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: const Segment* _segment;
|
||||||
private: Hook* _hook;
|
private: Hook* _hook;
|
||||||
|
|
||||||
public: Locator(const Segment* segment = NULL);
|
public: Locator(const Segment* segment = NULL);
|
||||||
public: Locator(const Locator& locator);
|
public: Locator(const Locator& locator);
|
||||||
|
|
||||||
public: Locator& operator=(const Locator& locator);
|
public: Locator& operator=(const Locator& locator);
|
||||||
|
|
||||||
public: virtual Hook* GetElement() const;
|
public: virtual Hook* GetElement() const;
|
||||||
public: virtual Hurricane::Locator<Hook*>* GetClone() 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
|
// Attributes
|
||||||
// **********
|
// **********
|
||||||
|
|
||||||
private: const Segment* _segment;
|
private: const Segment* _segment;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
// ************
|
// ************
|
||||||
|
|
||||||
public: Segment_Hooks(const Segment* segment = NULL);
|
public: Segment_Hooks(const Segment* segment = NULL);
|
||||||
public: Segment_Hooks(const Segment_Hooks& hooks);
|
public: Segment_Hooks(const Segment_Hooks& hooks);
|
||||||
|
|
||||||
// Operators
|
// Operators
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
public: Segment_Hooks& operator=(const Segment_Hooks& hooks);
|
public: Segment_Hooks& operator=(const Segment_Hooks& hooks);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
public: virtual Collection<Hook*>* GetClone() const;
|
public: virtual Collection<Hook*>* GetClone() const;
|
||||||
public: virtual Hurricane::Locator<Hook*>* GetLocator() const;
|
public: virtual Hurricane::Locator<Hook*>* GetLocator() const;
|
||||||
|
|
||||||
// Others
|
// Others
|
||||||
// ******
|
// ******
|
||||||
|
|
||||||
public: virtual string _GetString() const;
|
public: virtual string _GetString() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -91,58 +91,58 @@ class Segment_Anchors : public Collection<Component*> {
|
||||||
// Types
|
// 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: const Segment* _segment;
|
||||||
private: Component* _anchor;
|
private: Component* _anchor;
|
||||||
|
|
||||||
public: Locator(const Segment* segment = NULL);
|
public: Locator(const Segment* segment = NULL);
|
||||||
public: Locator(const Locator& locator);
|
public: Locator(const Locator& locator);
|
||||||
|
|
||||||
public: Locator& operator=(const Locator& locator);
|
public: Locator& operator=(const Locator& locator);
|
||||||
|
|
||||||
public: virtual Component* GetElement() const;
|
public: virtual Component* GetElement() const;
|
||||||
public: virtual Hurricane::Locator<Component*>* GetClone() 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
|
// Attributes
|
||||||
// **********
|
// **********
|
||||||
|
|
||||||
private: const Segment* _segment;
|
private: const Segment* _segment;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
// ************
|
// ************
|
||||||
|
|
||||||
public: Segment_Anchors(const Segment* segment = NULL);
|
public: Segment_Anchors(const Segment* segment = NULL);
|
||||||
public: Segment_Anchors(const Segment_Anchors& anchors);
|
public: Segment_Anchors(const Segment_Anchors& anchors);
|
||||||
|
|
||||||
// Operators
|
// Operators
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
public: Segment_Anchors& operator=(const Segment_Anchors& anchors);
|
public: Segment_Anchors& operator=(const Segment_Anchors& anchors);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
public: virtual Collection<Component*>* GetClone() const;
|
public: virtual Collection<Component*>* GetClone() const;
|
||||||
public: virtual Hurricane::Locator<Component*>* GetLocator() const;
|
public: virtual Hurricane::Locator<Component*>* GetLocator() const;
|
||||||
|
|
||||||
// Others
|
// 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)
|
Segment::Segment(Net* net, Component* source, Component* target, Layer* layer, const Unit& width)
|
||||||
// **********************************************************************************************
|
// **********************************************************************************************
|
||||||
: Inherit(net),
|
: Inherit(net),
|
||||||
_sourceHook(this),
|
_sourceHook(this),
|
||||||
_targetHook(this),
|
_targetHook(this),
|
||||||
_layer(layer),
|
_layer(layer),
|
||||||
_width(width)
|
_width(width)
|
||||||
{
|
{
|
||||||
if (source) {
|
if (source) {
|
||||||
if (!source->GetNet())
|
if (!source->GetNet())
|
||||||
throw Error("Can't create " + _TName("Segment") + " : unconnected source");
|
throw Error("Can't create " + _TName("Segment") + " : unconnected source");
|
||||||
if (source->GetNet() != net)
|
if (source->GetNet() != net)
|
||||||
throw Error("Can't create " + _TName("Segment") + " : incompatible source");
|
throw Error("Can't create " + _TName("Segment") + " : incompatible source");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target) {
|
if (target) {
|
||||||
if (!target->GetNet())
|
if (!target->GetNet())
|
||||||
throw Error("Can't create " + _TName("Segment") + " : unconnected target");
|
throw Error("Can't create " + _TName("Segment") + " : unconnected target");
|
||||||
if (target->GetNet() != net)
|
if (target->GetNet() != net)
|
||||||
throw Error("Can't create " + _TName("Segment") + " : incompatible target");
|
throw Error("Can't create " + _TName("Segment") + " : incompatible target");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_layer)
|
if (!_layer)
|
||||||
throw Error("Can't create " + _TName("Segment") + " : null layer");
|
throw Error("Can't create " + _TName("Segment") + " : null layer");
|
||||||
|
|
||||||
if (source) _sourceHook.Attach(source->GetBodyHook());
|
if (source) _sourceHook.Attach(source->GetBodyHook());
|
||||||
if (target) _targetHook.Attach(target->GetBodyHook());
|
if (target) _targetHook.Attach(target->GetBodyHook());
|
||||||
}
|
}
|
||||||
|
|
||||||
Hooks Segment::GetHooks() const
|
Hooks Segment::GetHooks() const
|
||||||
// ****************************
|
// ****************************
|
||||||
{
|
{
|
||||||
return Segment_Hooks(this);
|
return Segment_Hooks(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Hook* Segment::GetOppositeHook(const Hook* hook) const
|
Hook* Segment::GetOppositeHook(const Hook* hook) const
|
||||||
// ***************************************************
|
// ***************************************************
|
||||||
{
|
{
|
||||||
if (hook) {
|
if (hook) {
|
||||||
if (hook == &_sourceHook) return (Hook*)&_targetHook;
|
if (hook == &_sourceHook) return (Hook*)&_targetHook;
|
||||||
if (hook == &_targetHook) return (Hook*)&_sourceHook;
|
if (hook == &_targetHook) return (Hook*)&_sourceHook;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component* Segment::GetSource() const
|
Component* Segment::GetSource() const
|
||||||
// **********************************
|
// **********************************
|
||||||
{
|
{
|
||||||
Hook* masterHook = _sourceHook.GetMasterHook();
|
Hook* masterHook = _sourceHook.GetMasterHook();
|
||||||
return (masterHook) ? masterHook->GetComponent() : NULL;
|
return (masterHook) ? masterHook->GetComponent() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component* Segment::GetTarget() const
|
Component* Segment::GetTarget() const
|
||||||
// **********************************
|
// **********************************
|
||||||
{
|
{
|
||||||
Hook* masterHook = _targetHook.GetMasterHook();
|
Hook* masterHook = _targetHook.GetMasterHook();
|
||||||
return (masterHook) ? masterHook->GetComponent() : NULL;
|
return (masterHook) ? masterHook->GetComponent() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Components Segment::GetAnchors() const
|
Components Segment::GetAnchors() const
|
||||||
// ***********************************
|
// ***********************************
|
||||||
{
|
{
|
||||||
return Segment_Anchors(this);
|
return Segment_Anchors(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Component* Segment::GetOppositeAnchor(Component* anchor) const
|
Component* Segment::GetOppositeAnchor(Component* anchor) const
|
||||||
// ***********************************************************
|
// ***********************************************************
|
||||||
{
|
{
|
||||||
if (anchor) {
|
if (anchor) {
|
||||||
Component* source = GetSource();
|
Component* source = GetSource();
|
||||||
Component* target = GetTarget();
|
Component* target = GetTarget();
|
||||||
if (anchor == source) return target;
|
if (anchor == source) return target;
|
||||||
if (anchor == target) return source;
|
if (anchor == target) return source;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Point Segment::GetSourcePosition() const
|
Point Segment::GetSourcePosition() const
|
||||||
// *************************************
|
// *************************************
|
||||||
{
|
{
|
||||||
return Point(GetSourceX(), GetSourceY());
|
return Point(GetSourceX(), GetSourceY());
|
||||||
}
|
}
|
||||||
|
|
||||||
Point Segment::GetTargetPosition() const
|
Point Segment::GetTargetPosition() const
|
||||||
// *************************************
|
// *************************************
|
||||||
{
|
{
|
||||||
return Point(GetTargetX(), GetTargetY());
|
return Point(GetTargetX(), GetTargetY());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Segment::SetLayer(Layer* layer)
|
void Segment::SetLayer(Layer* layer)
|
||||||
// *********************************
|
// *********************************
|
||||||
{
|
{
|
||||||
if (!layer)
|
if (!layer)
|
||||||
throw Error("Can't set layer : null layer");
|
throw Error("Can't set layer : null layer");
|
||||||
|
|
||||||
if (layer != _layer) {
|
if (layer != _layer) {
|
||||||
Invalidate(false);
|
Invalidate(false);
|
||||||
_layer = layer;
|
_layer = layer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Segment::SetWidth(const Unit& width)
|
void Segment::SetWidth(const Unit& width)
|
||||||
// **************************************
|
// **************************************
|
||||||
{
|
{
|
||||||
if (width != _width) {
|
if (width != _width) {
|
||||||
Invalidate(false);
|
Invalidate(false);
|
||||||
_width = width;
|
_width = width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Segment::Invert()
|
void Segment::Invert()
|
||||||
// *******************
|
// *******************
|
||||||
{
|
{
|
||||||
Component* source = GetSource();
|
Component* source = GetSource();
|
||||||
Component* target = GetTarget();
|
Component* target = GetTarget();
|
||||||
if (source && target && (target != source)) {
|
if (source && target && (target != source)) {
|
||||||
GetSourceHook()->Detach();
|
GetSourceHook()->Detach();
|
||||||
GetTargetHook()->Detach();
|
GetTargetHook()->Detach();
|
||||||
GetSourceHook()->Attach(target->GetBodyHook());
|
GetSourceHook()->Attach(target->GetBodyHook());
|
||||||
GetTargetHook()->Attach(source->GetBodyHook());
|
GetTargetHook()->Attach(source->GetBodyHook());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Segment::_PreDelete()
|
void Segment::_PreDelete()
|
||||||
|
@ -281,10 +281,10 @@ void Segment::_PreDelete()
|
||||||
// trace << "entering Segment::_PreDelete: " << this << endl;
|
// trace << "entering Segment::_PreDelete: " << this << endl;
|
||||||
// trace_in();
|
// trace_in();
|
||||||
|
|
||||||
Inherit::_PreDelete();
|
Inherit::_PreDelete();
|
||||||
|
|
||||||
_sourceHook.Detach();
|
_sourceHook.Detach();
|
||||||
_targetHook.Detach();
|
_targetHook.Detach();
|
||||||
|
|
||||||
// trace << "exiting Segment::_PreDelete:" << endl;
|
// trace << "exiting Segment::_PreDelete:" << endl;
|
||||||
// trace_out();
|
// trace_out();
|
||||||
|
@ -293,111 +293,83 @@ void Segment::_PreDelete()
|
||||||
string Segment::_GetString() const
|
string Segment::_GetString() const
|
||||||
// *******************************
|
// *******************************
|
||||||
{
|
{
|
||||||
string s = Inherit::_GetString();
|
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(GetSourceX()) + " " + GetValueString(GetSourceY()) + "]");
|
s.insert(s.length() - 1, " [" + GetValueString(GetSourceX()) + " " + GetValueString(GetSourceY()) + "]");
|
||||||
s.insert(s.length() - 1, " [" + GetValueString(GetTargetX()) + " " + GetValueString(GetTargetY()) + "]");
|
s.insert(s.length() - 1, " [" + GetValueString(GetTargetX()) + " " + GetValueString(GetTargetY()) + "]");
|
||||||
s.insert(s.length() - 1, " " + GetValueString(_width));
|
s.insert(s.length() - 1, " " + GetValueString(_width));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* Segment::_GetRecord() const
|
Record* Segment::_GetRecord() const
|
||||||
// **************************
|
// **************************
|
||||||
{
|
{
|
||||||
Record* record = Inherit::_GetRecord();
|
Record* record = Inherit::_GetRecord();
|
||||||
if (record) {
|
if (record) {
|
||||||
record->Add(GetSlot("SourceHook", &_sourceHook));
|
record->Add(GetSlot("SourceHook", &_sourceHook));
|
||||||
record->Add(GetSlot("Source", GetSource()));
|
record->Add(GetSlot("Source", GetSource()));
|
||||||
record->Add(GetSlot("TargetHook", &_targetHook));
|
record->Add(GetSlot("TargetHook", &_targetHook));
|
||||||
record->Add(GetSlot("Target", GetTarget()));
|
record->Add(GetSlot("Target", GetTarget()));
|
||||||
record->Add(GetSlot("Layer", _layer));
|
record->Add(GetSlot("Layer", _layer));
|
||||||
record->Add(GetSlot("Width", &_width));
|
record->Add(GetSlot("Width", &_width));
|
||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit Segment::_GetSize() const
|
Unit Segment::_GetSize() const
|
||||||
// ***************************
|
// ***************************
|
||||||
{
|
{
|
||||||
Unit size = 0;
|
Unit size = 0;
|
||||||
|
|
||||||
Layer* layer = GetLayer();
|
Layer* layer = GetLayer();
|
||||||
if (is_a<CompositeLayer*>(layer))
|
if (is_a<CompositeLayer*>(layer))
|
||||||
size = ((CompositeLayer*)layer)->GetMaximalSegmentSize();
|
size = ((CompositeLayer*)layer)->getMaximalSegmentSize();
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit Segment::_GetExtention() const
|
Unit Segment::_GetExtention() const
|
||||||
// ********************************
|
// ********************************
|
||||||
{
|
{
|
||||||
Unit extention = 0;
|
Unit extention = 0;
|
||||||
|
|
||||||
Layer* layer = GetLayer();
|
Layer* layer = GetLayer();
|
||||||
if (is_a<CompositeLayer*>(layer))
|
if (is_a<CompositeLayer*>(layer))
|
||||||
extention = ((CompositeLayer*)layer)->GetMaximalSegmentExtention();
|
extention = ((CompositeLayer*)layer)->getMaximalSegmentExtention();
|
||||||
|
|
||||||
return extention;
|
return extention;
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit Segment::_GetSize(const BasicLayer* basicLayer) const
|
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))
|
if (is_a<CompositeLayer*>(layer))
|
||||||
size = ((CompositeLayer*)layer)->GetSegmentSize(basicLayer);
|
size = ((CompositeLayer*)layer)->getSegmentSize(basicLayer);
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit Segment::_GetExtention(const BasicLayer* basicLayer) const
|
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))
|
if (is_a<CompositeLayer*>(layer))
|
||||||
extention = ((CompositeLayer*)layer)->GetSegmentExtention(basicLayer);
|
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
|
// Segment::SourceHook implementation
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
@ -406,25 +378,25 @@ static int SOURCE_HOOK_OFFSET = -1;
|
||||||
|
|
||||||
Segment::SourceHook::SourceHook(Segment* segment)
|
Segment::SourceHook::SourceHook(Segment* segment)
|
||||||
// **********************************************
|
// **********************************************
|
||||||
: Inherit()
|
: Inherit()
|
||||||
{
|
{
|
||||||
if (!segment)
|
if (!segment)
|
||||||
throw Error("Can't create " + _TName("Segment::SourceHook") + " (null segment)");
|
throw Error("Can't create " + _TName("Segment::SourceHook") + " (null segment)");
|
||||||
|
|
||||||
if (SOURCE_HOOK_OFFSET == -1)
|
if (SOURCE_HOOK_OFFSET == -1)
|
||||||
SOURCE_HOOK_OFFSET = (unsigned long)this - (unsigned long)segment;
|
SOURCE_HOOK_OFFSET = (unsigned long)this - (unsigned long)segment;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component* Segment::SourceHook::GetComponent() const
|
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
|
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)
|
Segment::TargetHook::TargetHook(Segment* segment)
|
||||||
// **********************************************
|
// **********************************************
|
||||||
: Inherit()
|
: Inherit()
|
||||||
{
|
{
|
||||||
if (!segment)
|
if (!segment)
|
||||||
throw Error("Can't create " + _TName("Segment::TargetHook") + " (null segment)");
|
throw Error("Can't create " + _TName("Segment::TargetHook") + " (null segment)");
|
||||||
|
|
||||||
if (TARGET_HOOK_OFFSET == -1)
|
if (TARGET_HOOK_OFFSET == -1)
|
||||||
TARGET_HOOK_OFFSET = (unsigned long)this - (unsigned long)segment;
|
TARGET_HOOK_OFFSET = (unsigned long)this - (unsigned long)segment;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component* Segment::TargetHook::GetComponent() const
|
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
|
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)
|
Segment_Hooks::Segment_Hooks(const Segment* segment)
|
||||||
// *************************************************
|
// *************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_segment(segment)
|
_segment(segment)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Segment_Hooks::Segment_Hooks(const Segment_Hooks& hooks)
|
Segment_Hooks::Segment_Hooks(const Segment_Hooks& hooks)
|
||||||
// *****************************************************
|
// *****************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_segment(hooks._segment)
|
_segment(hooks._segment)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Segment_Hooks& Segment_Hooks::operator=(const Segment_Hooks& hooks)
|
Segment_Hooks& Segment_Hooks::operator=(const Segment_Hooks& hooks)
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
{
|
{
|
||||||
_segment = hooks._segment;
|
_segment = hooks._segment;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Collection<Hook*>* Segment_Hooks::GetClone() const
|
Collection<Hook*>* Segment_Hooks::GetClone() const
|
||||||
// ***********************************************
|
// ***********************************************
|
||||||
{
|
{
|
||||||
return new Segment_Hooks(*this);
|
return new Segment_Hooks(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Locator<Hook*>* Segment_Hooks::GetLocator() const
|
Locator<Hook*>* Segment_Hooks::GetLocator() const
|
||||||
// **********************************************
|
// **********************************************
|
||||||
{
|
{
|
||||||
return new Locator(_segment);
|
return new Locator(_segment);
|
||||||
}
|
}
|
||||||
|
|
||||||
string Segment_Hooks::_GetString() const
|
string Segment_Hooks::_GetString() const
|
||||||
// *************************************
|
// *************************************
|
||||||
{
|
{
|
||||||
string s = "<" + _TName("Segment::Hooks");
|
string s = "<" + _TName("Segment::Hooks");
|
||||||
if (_segment) s += " " + GetString(_segment);
|
if (_segment) s += " " + GetString(_segment);
|
||||||
s += ">";
|
s += ">";
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -512,69 +484,69 @@ string Segment_Hooks::_GetString() const
|
||||||
|
|
||||||
Segment_Hooks::Locator::Locator(const Segment* segment)
|
Segment_Hooks::Locator::Locator(const Segment* segment)
|
||||||
// ****************************************************
|
// ****************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_segment(segment),
|
_segment(segment),
|
||||||
_hook(NULL)
|
_hook(NULL)
|
||||||
{
|
{
|
||||||
if (_segment) _hook = ((Segment*)_segment)->GetBodyHook();
|
if (_segment) _hook = ((Segment*)_segment)->GetBodyHook();
|
||||||
}
|
}
|
||||||
|
|
||||||
Segment_Hooks::Locator::Locator(const Locator& locator)
|
Segment_Hooks::Locator::Locator(const Locator& locator)
|
||||||
// ****************************************************
|
// ****************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_segment(locator._segment),
|
_segment(locator._segment),
|
||||||
_hook(locator._hook)
|
_hook(locator._hook)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Segment_Hooks::Locator& Segment_Hooks::Locator::operator=(const Locator& locator)
|
Segment_Hooks::Locator& Segment_Hooks::Locator::operator=(const Locator& locator)
|
||||||
// ******************************************************************************
|
// ******************************************************************************
|
||||||
{
|
{
|
||||||
_segment = locator._segment;
|
_segment = locator._segment;
|
||||||
_hook = locator._hook;
|
_hook = locator._hook;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Hook* Segment_Hooks::Locator::GetElement() const
|
Hook* Segment_Hooks::Locator::GetElement() const
|
||||||
// *********************************************
|
// *********************************************
|
||||||
{
|
{
|
||||||
return _hook;
|
return _hook;
|
||||||
}
|
}
|
||||||
|
|
||||||
Locator<Hook*>* Segment_Hooks::Locator::GetClone() const
|
Locator<Hook*>* Segment_Hooks::Locator::GetClone() const
|
||||||
// *****************************************************
|
// *****************************************************
|
||||||
{
|
{
|
||||||
return new Locator(*this);
|
return new Locator(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Segment_Hooks::Locator::IsValid() const
|
bool Segment_Hooks::Locator::IsValid() const
|
||||||
// *****************************************
|
// *****************************************
|
||||||
{
|
{
|
||||||
return (_hook != NULL);
|
return (_hook != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Segment_Hooks::Locator::Progress()
|
void Segment_Hooks::Locator::Progress()
|
||||||
// ************************************
|
// ************************************
|
||||||
{
|
{
|
||||||
if (_hook) {
|
if (_hook) {
|
||||||
if (_hook == ((Segment*)_segment)->GetBodyHook())
|
if (_hook == ((Segment*)_segment)->GetBodyHook())
|
||||||
_hook = ((Segment*)_segment)->GetSourceHook();
|
_hook = ((Segment*)_segment)->GetSourceHook();
|
||||||
else {
|
else {
|
||||||
if (_hook == ((Segment*)_segment)->GetSourceHook())
|
if (_hook == ((Segment*)_segment)->GetSourceHook())
|
||||||
_hook = ((Segment*)_segment)->GetTargetHook();
|
_hook = ((Segment*)_segment)->GetTargetHook();
|
||||||
else
|
else
|
||||||
_hook = NULL;
|
_hook = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string Segment_Hooks::Locator::_GetString() const
|
string Segment_Hooks::Locator::_GetString() const
|
||||||
// **********************************************
|
// **********************************************
|
||||||
{
|
{
|
||||||
string s = "<" + _TName("Segment::Hooks::Locator");
|
string s = "<" + _TName("Segment::Hooks::Locator");
|
||||||
if (_segment) s += " " + GetString(_segment);
|
if (_segment) s += " " + GetString(_segment);
|
||||||
s += ">";
|
s += ">";
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -585,44 +557,44 @@ string Segment_Hooks::Locator::_GetString() const
|
||||||
|
|
||||||
Segment_Anchors::Segment_Anchors(const Segment* segment)
|
Segment_Anchors::Segment_Anchors(const Segment* segment)
|
||||||
// *****************************************************
|
// *****************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_segment(segment)
|
_segment(segment)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Segment_Anchors::Segment_Anchors(const Segment_Anchors& hooks)
|
Segment_Anchors::Segment_Anchors(const Segment_Anchors& hooks)
|
||||||
// ***********************************************************
|
// ***********************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_segment(hooks._segment)
|
_segment(hooks._segment)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Segment_Anchors& Segment_Anchors::operator=(const Segment_Anchors& hooks)
|
Segment_Anchors& Segment_Anchors::operator=(const Segment_Anchors& hooks)
|
||||||
// **********************************************************************
|
// **********************************************************************
|
||||||
{
|
{
|
||||||
_segment = hooks._segment;
|
_segment = hooks._segment;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Collection<Component*>* Segment_Anchors::GetClone() const
|
Collection<Component*>* Segment_Anchors::GetClone() const
|
||||||
// ******************************************************
|
// ******************************************************
|
||||||
{
|
{
|
||||||
return new Segment_Anchors(*this);
|
return new Segment_Anchors(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Locator<Component*>* Segment_Anchors::GetLocator() const
|
Locator<Component*>* Segment_Anchors::GetLocator() const
|
||||||
// *****************************************************
|
// *****************************************************
|
||||||
{
|
{
|
||||||
return new Locator(_segment);
|
return new Locator(_segment);
|
||||||
}
|
}
|
||||||
|
|
||||||
string Segment_Anchors::_GetString() const
|
string Segment_Anchors::_GetString() const
|
||||||
// ***************************************
|
// ***************************************
|
||||||
{
|
{
|
||||||
string s = "<" + _TName("Segment::Anchors");
|
string s = "<" + _TName("Segment::Anchors");
|
||||||
if (_segment) s += " " + GetString(_segment);
|
if (_segment) s += " " + GetString(_segment);
|
||||||
s += ">";
|
s += ">";
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -633,68 +605,68 @@ string Segment_Anchors::_GetString() const
|
||||||
|
|
||||||
Segment_Anchors::Locator::Locator(const Segment* segment)
|
Segment_Anchors::Locator::Locator(const Segment* segment)
|
||||||
// ******************************************************
|
// ******************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_segment(segment),
|
_segment(segment),
|
||||||
_anchor(NULL)
|
_anchor(NULL)
|
||||||
{
|
{
|
||||||
if (_segment) {
|
if (_segment) {
|
||||||
_anchor = ((Segment*)_segment)->GetSource();
|
_anchor = ((Segment*)_segment)->GetSource();
|
||||||
if (!_anchor) _anchor = ((Segment*)_segment)->GetTarget();
|
if (!_anchor) _anchor = ((Segment*)_segment)->GetTarget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Segment_Anchors::Locator::Locator(const Locator& locator)
|
Segment_Anchors::Locator::Locator(const Locator& locator)
|
||||||
// ******************************************************
|
// ******************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_segment(locator._segment),
|
_segment(locator._segment),
|
||||||
_anchor(locator._anchor)
|
_anchor(locator._anchor)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Segment_Anchors::Locator& Segment_Anchors::Locator::operator=(const Locator& locator)
|
Segment_Anchors::Locator& Segment_Anchors::Locator::operator=(const Locator& locator)
|
||||||
// **********************************************************************************
|
// **********************************************************************************
|
||||||
{
|
{
|
||||||
_segment = locator._segment;
|
_segment = locator._segment;
|
||||||
_anchor = locator._anchor;
|
_anchor = locator._anchor;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component* Segment_Anchors::Locator::GetElement() const
|
Component* Segment_Anchors::Locator::GetElement() const
|
||||||
// ****************************************************
|
// ****************************************************
|
||||||
{
|
{
|
||||||
return _anchor;
|
return _anchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
Locator<Component*>* Segment_Anchors::Locator::GetClone() const
|
Locator<Component*>* Segment_Anchors::Locator::GetClone() const
|
||||||
// ************************************************************
|
// ************************************************************
|
||||||
{
|
{
|
||||||
return new Locator(*this);
|
return new Locator(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Segment_Anchors::Locator::IsValid() const
|
bool Segment_Anchors::Locator::IsValid() const
|
||||||
// *******************************************
|
// *******************************************
|
||||||
{
|
{
|
||||||
return (_anchor != NULL);
|
return (_anchor != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Segment_Anchors::Locator::Progress()
|
void Segment_Anchors::Locator::Progress()
|
||||||
// **************************************
|
// **************************************
|
||||||
{
|
{
|
||||||
if (_anchor) {
|
if (_anchor) {
|
||||||
if (_anchor == ((Segment*)_segment)->GetTarget())
|
if (_anchor == ((Segment*)_segment)->GetTarget())
|
||||||
_anchor = NULL;
|
_anchor = NULL;
|
||||||
else
|
else
|
||||||
_anchor = ((Segment*)_segment)->GetTarget();
|
_anchor = ((Segment*)_segment)->GetTarget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string Segment_Anchors::Locator::_GetString() const
|
string Segment_Anchors::Locator::_GetString() const
|
||||||
// ************************************************
|
// ************************************************
|
||||||
{
|
{
|
||||||
string s = "<" + _TName("Segment::Anchors::Locator");
|
string s = "<" + _TName("Segment::Anchors::Locator");
|
||||||
if (_segment) s += " " + GetString(_segment);
|
if (_segment) s += " " + GetString(_segment);
|
||||||
s += ">";
|
s += ">";
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,112 +21,93 @@ namespace Hurricane {
|
||||||
|
|
||||||
Slice::Slice(Cell* cell, Layer* layer)
|
Slice::Slice(Cell* cell, Layer* layer)
|
||||||
// ***********************************
|
// ***********************************
|
||||||
: _cell(cell),
|
: _cell(cell),
|
||||||
_layer(layer),
|
_layer(layer),
|
||||||
_quadTree(),
|
_quadTree(),
|
||||||
_nextOfCellSliceMap(NULL)
|
_nextOfCellSliceMap(NULL)
|
||||||
{
|
{
|
||||||
if (!_cell)
|
if (!_cell)
|
||||||
throw Error("Can't create " + _TName("Slice") + " : null cell");
|
throw Error("Can't create " + _TName("Slice") + " : null cell");
|
||||||
|
|
||||||
if (!_layer)
|
if (!_layer)
|
||||||
throw Error("Can't create " + _TName("Slice") + " : null layer");
|
throw Error("Can't create " + _TName("Slice") + " : null layer");
|
||||||
|
|
||||||
if (_cell->GetSlice(_layer))
|
if (_cell->GetSlice(_layer))
|
||||||
throw Error("Can't create " + _TName("Slice") + " : already exists");
|
throw Error("Can't create " + _TName("Slice") + " : already exists");
|
||||||
|
|
||||||
_cell->_GetSliceMap()._Insert(this);
|
_cell->_GetSliceMap()._Insert(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Slice::~Slice()
|
Slice::~Slice()
|
||||||
// ************
|
// ************
|
||||||
{
|
{
|
||||||
_cell->_GetSliceMap()._Remove(this);
|
_cell->_GetSliceMap()._Remove(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Components Slice::GetComponents() const
|
Components Slice::GetComponents() const
|
||||||
// ************************************
|
// ************************************
|
||||||
{
|
{
|
||||||
// return _quadTree.GetGos().GetSubSet<Component*>();
|
// return _quadTree.GetGos().GetSubSet<Component*>();
|
||||||
return SubTypeCollection<Go*, Component*>(_quadTree.GetGos());
|
return SubTypeCollection<Go*, Component*>(_quadTree.GetGos());
|
||||||
}
|
}
|
||||||
|
|
||||||
Components Slice::GetComponentsUnder(const Box& area) const
|
Components Slice::GetComponentsUnder(const Box& area) const
|
||||||
// ********************************************************
|
// ********************************************************
|
||||||
{
|
{
|
||||||
// return _quadTree.GetGosUnder(area).GetSubSet<Component*>();
|
// return _quadTree.GetGosUnder(area).GetSubSet<Component*>();
|
||||||
return SubTypeCollection<Go*, Component*>(_quadTree.GetGosUnder(area));
|
return SubTypeCollection<Go*, Component*>(_quadTree.GetGosUnder(area));
|
||||||
}
|
}
|
||||||
|
|
||||||
Markers Slice::GetMarkers() const
|
Markers Slice::GetMarkers() const
|
||||||
// ******************************
|
// ******************************
|
||||||
{
|
{
|
||||||
// return _quadTree.GetGos().GetSubSet<Marker*>();
|
// return _quadTree.GetGos().GetSubSet<Marker*>();
|
||||||
return SubTypeCollection<Go*, Marker*>(_quadTree.GetGos());
|
return SubTypeCollection<Go*, Marker*>(_quadTree.GetGos());
|
||||||
}
|
}
|
||||||
|
|
||||||
Markers Slice::GetMarkersUnder(const Box& area) const
|
Markers Slice::GetMarkersUnder(const Box& area) const
|
||||||
// **************************************************
|
// **************************************************
|
||||||
{
|
{
|
||||||
// return _quadTree.GetGosUnder(area).GetSubSet<Marker*>();
|
// return _quadTree.GetGosUnder(area).GetSubSet<Marker*>();
|
||||||
return SubTypeCollection<Go*, Marker*>(_quadTree.GetGosUnder(area));
|
return SubTypeCollection<Go*, Marker*>(_quadTree.GetGosUnder(area));
|
||||||
}
|
}
|
||||||
|
|
||||||
Slice* Slice::_Create(Cell* cell, Layer* layer)
|
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()
|
void Slice::_Delete()
|
||||||
// ******************
|
// ******************
|
||||||
{
|
{
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
string Slice::_GetString() const
|
string Slice::_GetString() const
|
||||||
// *****************************
|
// *****************************
|
||||||
{
|
{
|
||||||
string s = "<" + _TName("Slice");
|
string s = "<" + _TName("Slice");
|
||||||
// s += " " + GetString(_cell->GetName());
|
// s += " " + GetString(_cell->GetName());
|
||||||
s += " " + GetString(_layer->GetName());
|
s += " " + GetString(_layer->getName());
|
||||||
s += ">";
|
s += ">";
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* Slice::_GetRecord() const
|
Record* Slice::_GetRecord() const
|
||||||
// ************************
|
// ************************
|
||||||
{
|
{
|
||||||
Record* record = new Record(GetString(this));
|
Record* record = new Record(GetString(this));
|
||||||
if (record) {
|
if (record) {
|
||||||
record->Add(GetSlot("Cell", _cell));
|
record->Add(GetSlot("Cell", _cell));
|
||||||
record->Add(GetSlot("Layer", _layer));
|
record->Add(GetSlot("Layer", _layer));
|
||||||
record->Add(GetSlot("QuadTree", &_quadTree));
|
record->Add(GetSlot("QuadTree", &_quadTree));
|
||||||
}
|
}
|
||||||
return record;
|
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.
|
} // End of Hurricane namespace.
|
||||||
|
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "BasicLayer.h"
|
#include "BasicLayer.h"
|
||||||
#include "CompositeLayer.h"
|
#include "CompositeLayer.h"
|
||||||
#include "Tag.h"
|
|
||||||
#include "Error.h"
|
#include "Error.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,440 +27,178 @@ class Technology_BasicLayers : public Collection<BasicLayer*> {
|
||||||
// Types
|
// 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: const Technology* _technology;
|
||||||
private: Layer::Mask _mask;
|
private: Layer::Mask _mask;
|
||||||
private: BasicLayerLocator _basicLayerLocator;
|
private: BasicLayerLocator _basicLayerLocator;
|
||||||
|
|
||||||
public: Locator();
|
public: Locator();
|
||||||
public: Locator(const Technology* technology, const Layer::Mask& mask);
|
public: Locator(const Technology* technology, const Layer::Mask& mask);
|
||||||
public: Locator(const Locator& locator);
|
public: Locator(const Locator& locator);
|
||||||
|
|
||||||
public: Locator& operator=(const Locator& locator);
|
public: Locator& operator=(const Locator& locator);
|
||||||
|
|
||||||
public: virtual BasicLayer* GetElement() const;
|
public: virtual BasicLayer* GetElement() const;
|
||||||
public: virtual Hurricane::Locator<BasicLayer*>* GetClone() 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
|
// Attributes
|
||||||
// **********
|
// **********
|
||||||
|
|
||||||
private: const Technology* _technology;
|
private: const Technology* _technology;
|
||||||
private: Layer::Mask _mask;
|
private: Layer::Mask _mask;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
// ************
|
// ************
|
||||||
|
|
||||||
public: Technology_BasicLayers();
|
public: Technology_BasicLayers();
|
||||||
public: Technology_BasicLayers(const Technology* technology, const Layer::Mask& mask);
|
public: Technology_BasicLayers(const Technology* technology, const Layer::Mask& mask);
|
||||||
public: Technology_BasicLayers(const Technology_BasicLayers& basicLayers);
|
public: Technology_BasicLayers(const Technology_BasicLayers& basicLayers);
|
||||||
|
|
||||||
// Operators
|
// Operators
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
public: Technology_BasicLayers& operator=(const Technology_BasicLayers& basicLayers);
|
public: Technology_BasicLayers& operator=(const Technology_BasicLayers& basicLayers);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
// *********
|
// *********
|
||||||
|
|
||||||
public: virtual Collection<BasicLayer*>* GetClone() const;
|
public: virtual Collection<BasicLayer*>* GetClone() const;
|
||||||
public: virtual Hurricane::Locator<BasicLayer*>* GetLocator() const;
|
public: virtual Hurricane::Locator<BasicLayer*>* GetLocator() const;
|
||||||
|
|
||||||
// Others
|
// 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 implementation
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
||||||
Technology::Technology(DataBase* dataBase, const Name& name)
|
Technology::Technology(DataBase* dataBase, const Name& name)
|
||||||
// *********************************************************
|
// *********************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_dataBase(dataBase),
|
_dataBase(dataBase),
|
||||||
_name(name),
|
_name(name),
|
||||||
_layerMap(),
|
_layerMap(),
|
||||||
_layerList()
|
_layerList()
|
||||||
{
|
{
|
||||||
if (!_dataBase)
|
if (!_dataBase)
|
||||||
throw Error("Can't create " + _TName("Technology") + " : null data base");
|
throw Error("Can't create " + _TName("Technology") + " : null data base");
|
||||||
|
|
||||||
if (_dataBase->GetTechnology())
|
if (_dataBase->GetTechnology())
|
||||||
throw Error("Can't create " + _TName("Technology") + " : already exists");
|
throw Error("Can't create " + _TName("Technology") + " : already exists");
|
||||||
|
|
||||||
if (_name.IsEmpty())
|
if (_name.IsEmpty())
|
||||||
throw Error("Can't create " + _TName("Technology") + " : empty name");
|
throw Error("Can't create " + _TName("Technology") + " : empty name");
|
||||||
}
|
}
|
||||||
|
|
||||||
Technology* Technology::Create(DataBase* dataBase, const Name& 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;
|
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicLayer* Technology::GetBasicLayer(const Name& name) const
|
BasicLayer* Technology::GetBasicLayer(const Name& name) const
|
||||||
// **********************************************************
|
// **********************************************************
|
||||||
{
|
{
|
||||||
Layer* layer = GetLayer(name);
|
Layer* layer = GetLayer(name);
|
||||||
return (layer && is_a<BasicLayer*>(layer)) ? (BasicLayer*)layer : NULL;
|
return (layer && is_a<BasicLayer*>(layer)) ? (BasicLayer*)layer : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompositeLayer* Technology::GetCompositeLayer(const Name& name) const
|
CompositeLayer* Technology::GetCompositeLayer(const Name& name) const
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
{
|
{
|
||||||
Layer* layer = GetLayer(name);
|
Layer* layer = GetLayer(name);
|
||||||
return (layer && is_a<CompositeLayer*>(layer)) ? (CompositeLayer*)layer : NULL;
|
return (layer && is_a<CompositeLayer*>(layer)) ? (CompositeLayer*)layer : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicLayers Technology::GetBasicLayers() const
|
BasicLayers Technology::GetBasicLayers() const
|
||||||
// *******************************************
|
// *******************************************
|
||||||
{
|
{
|
||||||
// return GetLayers().GetSubSet<BasicLayer*>();
|
// return GetLayers().GetSubSet<BasicLayer*>();
|
||||||
return SubTypeCollection<Layer*, BasicLayer*>(GetLayers());
|
return SubTypeCollection<Layer*, BasicLayer*>(GetLayers());
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicLayers Technology::GetBasicLayers(const Layer::Mask& mask) const
|
BasicLayers Technology::GetBasicLayers(const Layer::Mask& mask) const
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
{
|
{
|
||||||
return Technology_BasicLayers(this, mask);
|
return Technology_BasicLayers(this, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
CompositeLayers Technology::GetCompositeLayers() const
|
CompositeLayers Technology::GetCompositeLayers() const
|
||||||
// ***************************************************
|
// ***************************************************
|
||||||
{
|
{
|
||||||
// return GetLayers().GetSubSet<CompositeLayer*>();
|
// return GetLayers().GetSubSet<CompositeLayer*>();
|
||||||
return SubTypeCollection<Layer*, CompositeLayer*>(GetLayers());
|
return SubTypeCollection<Layer*, CompositeLayer*>(GetLayers());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Technology::SetName(const Name& name)
|
void Technology::SetName(const Name& name)
|
||||||
// ***************************************
|
// ***************************************
|
||||||
{
|
{
|
||||||
if (name != _name) {
|
if (name != _name) {
|
||||||
if (name.IsEmpty())
|
if (name.IsEmpty())
|
||||||
throw Error("Can't change technology name : empty name");
|
throw Error("Can't change technology name : empty name");
|
||||||
|
|
||||||
_name = name;
|
_name = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Technology::_PostCreate()
|
void Technology::_PostCreate()
|
||||||
// ***************************
|
// ***************************
|
||||||
{
|
{
|
||||||
Inherit::_PostCreate();
|
Inherit::_PostCreate();
|
||||||
|
|
||||||
_dataBase->_SetTechnology(this);
|
_dataBase->_SetTechnology(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Technology::_PreDelete()
|
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 Technology::_GetString() const
|
||||||
// **********************************
|
// **********************************
|
||||||
{
|
{
|
||||||
string s = Inherit::_GetString();
|
string s = Inherit::_GetString();
|
||||||
s.insert(s.length() - 1, " " + GetString(_name));
|
s.insert(s.length() - 1, " " + GetString(_name));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* Technology::_GetRecord() const
|
Record* Technology::_GetRecord() const
|
||||||
// *****************************
|
// *****************************
|
||||||
{
|
{
|
||||||
Record* record = Inherit::_GetRecord();
|
Record* record = Inherit::_GetRecord();
|
||||||
if (record) {
|
if (record) {
|
||||||
record->Add(GetSlot("DataBase", _dataBase));
|
record->Add(GetSlot("DataBase", _dataBase));
|
||||||
record->Add(GetSlot("Name", &_name));
|
record->Add(GetSlot("Name", &_name));
|
||||||
record->Add(GetSlot("Layers", &_layerList));
|
record->Add(GetSlot("Layers", &_layerList));
|
||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
@ -470,32 +207,32 @@ Record* Technology::_GetRecord() const
|
||||||
|
|
||||||
Technology::LayerMap::LayerMap()
|
Technology::LayerMap::LayerMap()
|
||||||
// *****************************
|
// *****************************
|
||||||
: Inherit()
|
: Inherit()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Name Technology::LayerMap::_GetKey(Layer* layer) const
|
Name Technology::LayerMap::_GetKey(Layer* layer) const
|
||||||
// ***************************************************
|
// ***************************************************
|
||||||
{
|
{
|
||||||
return layer->GetName();
|
return layer->getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned Technology::LayerMap::_GetHashValue(Name name) const
|
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
|
Layer* Technology::LayerMap::_GetNextElement(Layer* layer) const
|
||||||
// *************************************************************
|
// *************************************************************
|
||||||
{
|
{
|
||||||
return layer->_GetNextOfTechnologyLayerMap();
|
return layer->_getNextOfTechnologyLayerMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Technology::LayerMap::_SetNextElement(Layer* layer, Layer* nextLayer) const
|
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()
|
Technology_BasicLayers::Technology_BasicLayers()
|
||||||
// *********************************************
|
// *********************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_technology(NULL),
|
_technology(NULL),
|
||||||
_mask(0)
|
_mask(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Technology_BasicLayers::Technology_BasicLayers(const Technology* technology, const Layer::Mask& mask)
|
Technology_BasicLayers::Technology_BasicLayers(const Technology* technology, const Layer::Mask& mask)
|
||||||
// **************************************************************************************************
|
// **************************************************************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_technology(technology),
|
_technology(technology),
|
||||||
_mask(mask)
|
_mask(mask)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Technology_BasicLayers::Technology_BasicLayers(const Technology_BasicLayers& basicLayers)
|
Technology_BasicLayers::Technology_BasicLayers(const Technology_BasicLayers& basicLayers)
|
||||||
// **************************************************************************************
|
// **************************************************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_technology(basicLayers._technology),
|
_technology(basicLayers._technology),
|
||||||
_mask(basicLayers._mask)
|
_mask(basicLayers._mask)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Technology_BasicLayers& Technology_BasicLayers::operator=(const Technology_BasicLayers& basicLayers)
|
Technology_BasicLayers& Technology_BasicLayers::operator=(const Technology_BasicLayers& basicLayers)
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
{
|
{
|
||||||
_technology = basicLayers._technology;
|
_technology = basicLayers._technology;
|
||||||
_mask = basicLayers._mask;
|
_mask = basicLayers._mask;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Collection<BasicLayer*>* Technology_BasicLayers::GetClone() const
|
Collection<BasicLayer*>* Technology_BasicLayers::GetClone() const
|
||||||
// **************************************************************
|
// **************************************************************
|
||||||
{
|
{
|
||||||
return new Technology_BasicLayers(*this);
|
return new Technology_BasicLayers(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Locator<BasicLayer*>* Technology_BasicLayers::GetLocator() const
|
Locator<BasicLayer*>* Technology_BasicLayers::GetLocator() const
|
||||||
// *************************************************************
|
// *************************************************************
|
||||||
{
|
{
|
||||||
return new Locator(_technology, _mask);
|
return new Locator(_technology, _mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
string Technology_BasicLayers::_GetString() const
|
string Technology_BasicLayers::_GetString() const
|
||||||
// **********************************************
|
// **********************************************
|
||||||
{
|
{
|
||||||
string s = "<" + _TName("Technology::BasicLayers");
|
string s = "<" + _TName("Technology::BasicLayers");
|
||||||
if (_technology) {
|
if (_technology) {
|
||||||
s += " " + GetString(_technology);
|
s += " " + GetString(_technology);
|
||||||
s += " " + GetString(_mask);
|
s += " " + GetString(_mask);
|
||||||
}
|
}
|
||||||
s += ">";
|
s += ">";
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -568,82 +305,82 @@ string Technology_BasicLayers::_GetString() const
|
||||||
|
|
||||||
Technology_BasicLayers::Locator::Locator()
|
Technology_BasicLayers::Locator::Locator()
|
||||||
// ***************************************
|
// ***************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_technology(NULL),
|
_technology(NULL),
|
||||||
_mask(0),
|
_mask(0),
|
||||||
_basicLayerLocator()
|
_basicLayerLocator()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Technology_BasicLayers::Locator::Locator(const Technology* technology, const Layer::Mask& mask)
|
Technology_BasicLayers::Locator::Locator(const Technology* technology, const Layer::Mask& mask)
|
||||||
// ********************************************************************************************
|
// ********************************************************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_technology(technology),
|
_technology(technology),
|
||||||
_mask(mask),
|
_mask(mask),
|
||||||
_basicLayerLocator()
|
_basicLayerLocator()
|
||||||
{
|
{
|
||||||
if (_technology) {
|
if (_technology) {
|
||||||
_basicLayerLocator = _technology->GetBasicLayers().GetLocator();
|
_basicLayerLocator = _technology->GetBasicLayers().GetLocator();
|
||||||
while (_basicLayerLocator.IsValid() && !(_basicLayerLocator.GetElement()->GetMask() & _mask))
|
while (_basicLayerLocator.IsValid() && !(_basicLayerLocator.GetElement()->getMask() & _mask))
|
||||||
_basicLayerLocator.Progress();
|
_basicLayerLocator.Progress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Technology_BasicLayers::Locator::Locator(const Locator& locator)
|
Technology_BasicLayers::Locator::Locator(const Locator& locator)
|
||||||
// *************************************************************
|
// *************************************************************
|
||||||
: Inherit(),
|
: Inherit(),
|
||||||
_technology(locator._technology),
|
_technology(locator._technology),
|
||||||
_mask(locator._mask),
|
_mask(locator._mask),
|
||||||
_basicLayerLocator(locator._basicLayerLocator)
|
_basicLayerLocator(locator._basicLayerLocator)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Technology_BasicLayers::Locator& Technology_BasicLayers::Locator::operator=(const Locator& locator)
|
Technology_BasicLayers::Locator& Technology_BasicLayers::Locator::operator=(const Locator& locator)
|
||||||
// ************************************************************************************************
|
// ************************************************************************************************
|
||||||
{
|
{
|
||||||
_technology = locator._technology;
|
_technology = locator._technology;
|
||||||
_mask = locator._mask;
|
_mask = locator._mask;
|
||||||
_basicLayerLocator = locator._basicLayerLocator;
|
_basicLayerLocator = locator._basicLayerLocator;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicLayer* Technology_BasicLayers::Locator::GetElement() const
|
BasicLayer* Technology_BasicLayers::Locator::GetElement() const
|
||||||
// ************************************************************
|
// ************************************************************
|
||||||
{
|
{
|
||||||
return _basicLayerLocator.GetElement();
|
return _basicLayerLocator.GetElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
Locator<BasicLayer*>* Technology_BasicLayers::Locator::GetClone() const
|
Locator<BasicLayer*>* Technology_BasicLayers::Locator::GetClone() const
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
{
|
{
|
||||||
return new Locator(*this);
|
return new Locator(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Technology_BasicLayers::Locator::IsValid() const
|
bool Technology_BasicLayers::Locator::IsValid() const
|
||||||
// **************************************************
|
// **************************************************
|
||||||
{
|
{
|
||||||
return _basicLayerLocator.IsValid();
|
return _basicLayerLocator.IsValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Technology_BasicLayers::Locator::Progress()
|
void Technology_BasicLayers::Locator::Progress()
|
||||||
// *********************************************
|
// *********************************************
|
||||||
{
|
{
|
||||||
do {
|
do {
|
||||||
_basicLayerLocator.Progress();
|
_basicLayerLocator.Progress();
|
||||||
}
|
}
|
||||||
while (_basicLayerLocator.IsValid() && !(_basicLayerLocator.GetElement()->GetMask() & _mask));
|
while (_basicLayerLocator.IsValid() && !(_basicLayerLocator.GetElement()->getMask() & _mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
string Technology_BasicLayers::Locator::_GetString() const
|
string Technology_BasicLayers::Locator::_GetString() const
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
{
|
{
|
||||||
string s = "<" + _TName("Technology::BasicLayers::Locator");
|
string s = "<" + _TName("Technology::BasicLayers::Locator");
|
||||||
if (_technology) {
|
if (_technology) {
|
||||||
s += " " + GetString(_technology);
|
s += " " + GetString(_technology);
|
||||||
s += " " + GetString(_mask);
|
s += " " + GetString(_mask);
|
||||||
}
|
}
|
||||||
s += ">";
|
s += ">";
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
|
@ -63,7 +63,6 @@ class Technology : public DBo {
|
||||||
protected: Technology(DataBase* dataBase, const Name& name);
|
protected: Technology(DataBase* dataBase, const Name& name);
|
||||||
|
|
||||||
public: static Technology* Create(DataBase* dataBase, const Name& name);
|
public: static Technology* Create(DataBase* dataBase, const Name& name);
|
||||||
public: static Technology* CreateFromFile(DataBase* dataBase, const string& filePathName);
|
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
// *********
|
// *********
|
||||||
|
|
|
@ -70,7 +70,7 @@ Box Vertical::GetBoundingBox() const
|
||||||
Box Vertical::GetBoundingBox(const BasicLayer* basicLayer) 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 size = GetHalfWidth() + _GetSize(basicLayer);
|
||||||
Unit extention = _GetExtention(basicLayer);
|
Unit extention = _GetExtention(basicLayer);
|
||||||
|
|
|
@ -181,12 +181,12 @@ CellWidget::CellWidget(Cell* cell,
|
||||||
if (technology) {
|
if (technology) {
|
||||||
for_each_basic_layer(basiclayer, technology->GetBasicLayers()) {
|
for_each_basic_layer(basiclayer, technology->GetBasicLayers()) {
|
||||||
_basicLayersBrush[basiclayer] =
|
_basicLayersBrush[basiclayer] =
|
||||||
::getBrush(basiclayer->GetFillPattern(),
|
::getBrush(basiclayer->getFillPattern(),
|
||||||
basiclayer->GetRedValue(),
|
basiclayer->getRedValue(),
|
||||||
basiclayer->GetGreenValue(),
|
basiclayer->getGreenValue(),
|
||||||
basiclayer->GetBlueValue());
|
basiclayer->getBlueValue());
|
||||||
_basicLayersPen[basiclayer] =
|
_basicLayersPen[basiclayer] =
|
||||||
QPen(QColor(basiclayer->GetRedValue(), basiclayer->GetGreenValue(), basiclayer->GetBlueValue()));
|
QPen(QColor(basiclayer->getRedValue(), basiclayer->getGreenValue(), basiclayer->getBlueValue()));
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -768,7 +768,7 @@ CellWidget::isVisible(BasicLayer* layer) const
|
||||||
//throw Error(NULL_LAYER, __FILE__, __LINE__);
|
//throw Error(NULL_LAYER, __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (_visibleLayerMask & layer->GetMask());
|
return (_visibleLayerMask & layer->getMask());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -778,7 +778,7 @@ CellWidget::isDrawable(BasicLayer* layer) const
|
||||||
//throw Error(NULL_LAYER, __FILE__, __LINE__);
|
//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 (isVisible(layer) != visible) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
_visibleLayerMask |= layer->GetMask();
|
_visibleLayerMask |= layer->getMask();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_visibleLayerMask &= ~layer->GetMask();
|
_visibleLayerMask &= ~layer->getMask();
|
||||||
}
|
}
|
||||||
|
|
||||||
onSetVisible(layer, visible);
|
onSetVisible(layer, visible);
|
||||||
|
@ -925,7 +925,7 @@ CellWidget::setVisible(BasicLayer* layer,
|
||||||
// invalidate();
|
// invalidate();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (cell && !cell->GetSlices(layer->GetMask()).IsEmpty() && isDrawable(layer)) {
|
if (cell && !cell->GetSlices(layer->getMask()).IsEmpty() && isDrawable(layer)) {
|
||||||
invalidate();
|
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 {
|
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 (slice->GetBoundingBox().intersect(updateArea)) {
|
||||||
//if ((basicLayer == _layer->_GetSymbolicBasicLayer()) || (3 < view->GetScale()))
|
//if ((basicLayer == _layer->_GetSymbolicBasicLayer()) || (3 < view->GetScale()))
|
||||||
for_each_go(go, slice->GetGosUnder(updateArea)) {
|
for_each_go(go, slice->GetGosUnder(updateArea)) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ LayersWidget::LayersWidget(QWidget* parent)
|
||||||
//connect(checkBox, SIGNAL(toggled(bool)),
|
//connect(checkBox, SIGNAL(toggled(bool)),
|
||||||
// renderArea, SLOT(setAntialiased(bool)));
|
// renderArea, SLOT(setAntialiased(bool)));
|
||||||
|
|
||||||
string layerName = GetString(basicLayer->GetName());
|
string layerName = GetString(basicLayer->getName());
|
||||||
QLabel* label = new QLabel(tr(layerName.c_str()));
|
QLabel* label = new QLabel(tr(layerName.c_str()));
|
||||||
widgets.insert(label);
|
widgets.insert(label);
|
||||||
mainLayout->addWidget(label, line, 1, Qt::AlignRight);
|
mainLayout->addWidget(label, line, 1, Qt::AlignRight);
|
||||||
|
|
Loading…
Reference in New Issue