beginning new convention for methods

This commit is contained in:
Christophe Alexandre 2008-01-04 15:28:35 +00:00
parent bc11b86deb
commit b9a119320a
22 changed files with 3112 additions and 3117 deletions

View File

@ -18,327 +18,321 @@ namespace Hurricane {
Box::Box() Box::Box()
// ******* // *******
: _xMin(1), : _xMin(1),
_yMin(1), _yMin(1),
_xMax(-1), _xMax(-1),
_yMax(-1) _yMax(-1)
{ {}
}
Box::Box(const Unit& x, const Unit& y) Box::Box(const Unit& x, const Unit& y)
// *********************************** // ***********************************
: _xMin(x), : _xMin(x),
_yMin(y), _yMin(y),
_xMax(x), _xMax(x),
_yMax(y) _yMax(y)
{ {}
}
Box::Box(const Point& point) Box::Box(const Point& point)
// ************************* // *************************
: _xMin(point.GetX()), : _xMin(point.getX()),
_yMin(point.GetY()), _yMin(point.getY()),
_xMax(point.GetX()), _xMax(point.getX()),
_yMax(point.GetY()) _yMax(point.getY())
{ {}
}
Box::Box(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2) Box::Box(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2)
// ********************************************************************* // *********************************************************************
: _xMin(min(x1, x2)), : _xMin(min(x1, x2)),
_yMin(min(y1, y2)), _yMin(min(y1, y2)),
_xMax(max(x1, x2)), _xMax(max(x1, x2)),
_yMax(max(y1, y2)) _yMax(max(y1, y2))
{ {}
}
Box::Box(const Point& point1, const Point& point2) Box::Box(const Point& point1, const Point& point2)
// *********************************************** // ***********************************************
: _xMin(min(point1.GetX(), point2.GetX())), : _xMin(min(point1.getX(), point2.getX())),
_yMin(min(point1.GetY(), point2.GetY())), _yMin(min(point1.getY(), point2.getY())),
_xMax(max(point1.GetX(), point2.GetX())), _xMax(max(point1.getX(), point2.getX())),
_yMax(max(point1.GetY(), point2.GetY())) _yMax(max(point1.getY(), point2.getY()))
{ {}
}
Box::Box(const Box& box) Box::Box(const Box& box)
// ********************* // *********************
: _xMin(box._xMin), : _xMin(box._xMin),
_yMin(box._yMin), _yMin(box._yMin),
_xMax(box._xMax), _xMax(box._xMax),
_yMax(box._yMax) _yMax(box._yMax)
{ {}
}
Box& Box::operator=(const Box& box) Box& Box::operator=(const Box& box)
// ******************************** // ********************************
{ {
_xMin = box._xMin; _xMin = box._xMin;
_yMin = box._yMin; _yMin = box._yMin;
_xMax = box._xMax; _xMax = box._xMax;
_yMax = box._yMax; _yMax = box._yMax;
return *this; return *this;
} }
bool Box::operator==(const Box& box) const bool Box::operator==(const Box& box) const
// *************************************** // ***************************************
{ {
return (!IsEmpty() && return (!isEmpty() &&
!box.IsEmpty() && !box.isEmpty() &&
(_xMin == box._xMin) && (_xMin == box._xMin) &&
(_yMin == box._yMin) && (_yMin == box._yMin) &&
(_xMax == box._xMax) && (_xMax == box._xMax) &&
(_yMax == box._yMax)); (_yMax == box._yMax));
} }
bool Box::operator!=(const Box& box) const bool Box::operator!=(const Box& box) const
// *************************************** // ***************************************
{ {
return (IsEmpty() || return (isEmpty() ||
box.IsEmpty() || box.isEmpty() ||
(_xMin != box._xMin) || (_xMin != box._xMin) ||
(_yMin != box._yMin) || (_yMin != box._yMin) ||
(_xMax != box._xMax) || (_xMax != box._xMax) ||
(_yMax != box._yMax)); (_yMax != box._yMax));
} }
Box Box::GetUnion(const Box& box) const Box Box::getUnion(const Box& box) const
// ************************************ // ************************************
{ {
if (IsEmpty() && box.IsEmpty()) return Box(); if (isEmpty() && box.isEmpty()) return Box();
return Box(min(_xMin, box._xMin), return Box(min(_xMin, box._xMin),
min(_yMin, box._yMin), min(_yMin, box._yMin),
max(_xMax, box._xMax), max(_xMax, box._xMax),
max(_yMax, box._yMax)); max(_yMax, box._yMax));
} }
Box Box::GetIntersection(const Box& box) const Box Box::getIntersection(const Box& box) const
// ******************************************* // *******************************************
{ {
if (!Intersect(box)) return Box(); if (!intersect(box)) return Box();
return Box(max(_xMin, box._xMin), return Box(max(_xMin, box._xMin),
max(_yMin, box._yMin), max(_yMin, box._yMin),
min(_xMax, box._xMax), min(_xMax, box._xMax),
min(_yMax, box._yMax)); min(_yMax, box._yMax));
} }
Unit Box::ManhattanDistance(const Point& pt) const Unit Box::manhattanDistance(const Point& pt) const
// *********************************************** // ***********************************************
{ {
Unit dist = 0; Unit dist = 0;
if (IsEmpty()) if (isEmpty())
throw Error("Can't compute distance to an empty Box"); throw Error("Can't compute distance to an empty Box");
if (pt.GetX() < _xMin) dist = _xMin - pt.GetX(); if (pt.getX() < _xMin) dist = _xMin - pt.getX();
else if (pt.GetX() > _xMax) dist = pt.GetX() - _xMax; else if (pt.getX() > _xMax) dist = pt.getX() - _xMax;
// else dist = 0; // else dist = 0;
if (pt.GetY() < _yMin) dist += _yMin - pt.GetY(); if (pt.getY() < _yMin) dist += _yMin - pt.getY();
else if (pt.GetY() > _yMax) dist += pt.GetY() - _yMax; else if (pt.getY() > _yMax) dist += pt.getY() - _yMax;
// else dist += 0; // else dist += 0;
return dist; return dist;
} }
Unit Box::ManhattanDistance(const Box& box) const Unit Box::manhattanDistance(const Box& box) const
// ********************************************** // **********************************************
{ {
if (IsEmpty() || box.IsEmpty()) if (isEmpty() || box.isEmpty())
throw Error("Can't compute distance to an empty Box"); throw Error("Can't compute distance to an empty Box");
Unit dx, dy; Unit dx, dy;
if ((dx=box.GetXMin() - _xMax) < 0) if ((dx=box.getXMin() - _xMax) < 0)
if ((dx=_xMin-box.GetXMax()) < 0) dx=0; if ((dx=_xMin-box.getXMax()) < 0) dx=0;
if ((dy=box.GetYMin() - _yMax) < 0) if ((dy=box.getYMin() - _yMax) < 0)
if ((dy=_yMin-box.GetYMax()) < 0) dy=0; if ((dy=_yMin-box.getYMax()) < 0) dy=0;
return dx+dy; return dx+dy;
} }
bool Box::IsEmpty() const bool Box::isEmpty() const
// ********************** // **********************
{ {
return ((_xMax < _xMin) || (_yMax < _yMin)); return ((_xMax < _xMin) || (_yMax < _yMin));
} }
bool Box::IsFlat() const bool Box::isFlat() const
// ********************* // *********************
{ {
return (!IsEmpty() && return (!isEmpty() &&
(((_xMin == _xMax) && (_yMin < _yMax)) || (((_xMin == _xMax) && (_yMin < _yMax)) ||
((_xMin < _xMax) && (_yMin == _yMax)))); ((_xMin < _xMax) && (_yMin == _yMax))));
} }
bool Box::IsPonctual() const bool Box::isPonctual() const
// ************************* // *************************
{ {
return (!IsEmpty() && (_xMax == _xMin) && (_yMax == _yMin)); return (!isEmpty() && (_xMax == _xMin) && (_yMax == _yMin));
} }
bool Box::Contains(const Unit& x, const Unit& y) const bool Box::contains(const Unit& x, const Unit& y) const
// *************************************************** // ***************************************************
{ {
return (!IsEmpty() && return (!isEmpty() &&
(_xMin <= x) && (_xMin <= x) &&
(_yMin <= y) && (_yMin <= y) &&
(x <= _xMax) && (x <= _xMax) &&
(y <= _yMax)); (y <= _yMax));
} }
bool Box::Contains(const Point& point) const bool Box::contains(const Point& point) const
// ***************************************** // *****************************************
{ {
return Contains(point.GetX(), point.GetY()); return contains(point.getX(), point.getY());
} }
bool Box::Contains(const Box& box) const bool Box::contains(const Box& box) const
// ************************************* // *************************************
{ {
return (!IsEmpty() && return (!isEmpty() &&
!box.IsEmpty() && !box.isEmpty() &&
(_xMin <= box._xMin) && (_xMin <= box._xMin) &&
(box._xMax <= _xMax) && (box._xMax <= _xMax) &&
(_yMin <= box._yMin) && (_yMin <= box._yMin) &&
(box._yMax <= _yMax)); (box._yMax <= _yMax));
} }
bool Box::Intersect(const Box& box) const bool Box::intersect(const Box& box) const
// ************************************** // **************************************
{ {
return (!IsEmpty() && return (!isEmpty() &&
!box.IsEmpty() && !box.isEmpty() &&
!((_xMax < box._xMin) || !((_xMax < box._xMin) ||
(box._xMax < _xMin) || (box._xMax < _xMin) ||
(_yMax < box._yMin) || (_yMax < box._yMin) ||
(box._yMax < _yMin))); (box._yMax < _yMin)));
} }
bool Box::IsConstrainedBy(const Box& box) const bool Box::isConstrainedBy(const Box& box) const
// ******************************************** // ********************************************
{ {
return (!IsEmpty() && return (!isEmpty() &&
!box.IsEmpty() && !box.isEmpty() &&
((_xMin == box.GetXMin()) || ((_xMin == box.getXMin()) ||
(_yMin == box.GetYMin()) || (_yMin == box.getYMin()) ||
(_xMax == box.GetXMax()) || (_xMax == box.getXMax()) ||
(_yMax == box.GetYMax()))); (_yMax == box.getYMax())));
} }
Box& Box::MakeEmpty() Box& Box::makeEmpty()
// ****************** // ******************
{ {
_xMin = 1; _xMin = 1;
_yMin = 1; _yMin = 1;
_xMax = -1; _xMax = -1;
_yMax = -1; _yMax = -1;
return *this; return *this;
} }
Box& Box::Inflate(const Unit& d) Box& Box::inflate(const Unit& d)
// ***************************** // *****************************
{ {
return Inflate(d, d, d, d); return inflate(d, d, d, d);
} }
Box& Box::Inflate(const Unit& dx, const Unit& dy) Box& Box::inflate(const Unit& dx, const Unit& dy)
// ********************************************** // **********************************************
{ {
return Inflate(dx, dy, dx, dy); return inflate(dx, dy, dx, dy);
} }
Box& Box::Inflate(const Unit& dxMin, const Unit& dyMin, const Unit& dxMax, const Unit& dyMax) Box& Box::inflate(const Unit& dxMin, const Unit& dyMin, const Unit& dxMax, const Unit& dyMax)
// ****************************************************************************************** // ******************************************************************************************
{ {
if (!IsEmpty()) { if (!isEmpty()) {
_xMin -= dxMin; _xMin -= dxMin;
_yMin -= dyMin; _yMin -= dyMin;
_xMax += dxMax; _xMax += dxMax;
_yMax += dyMax; _yMax += dyMax;
} }
return *this; return *this;
} }
Box& Box::ShrinkByFactor(double factor) Box& Box::shrinkByFactor(double factor)
// ************************************** // **************************************
{ {
assert((0 <= factor) && (factor <= 1)); assert((0 <= factor) && (factor <= 1));
Unit dx=GetUnit(0.5*(1- factor) * (GetValue(_xMax) - GetValue(_xMin))); Unit dx=GetUnit(0.5*(1- factor) * (GetValue(_xMax) - GetValue(_xMin)));
Unit dy=GetUnit(0.5*(1- factor) * (GetValue(_yMax) - GetValue(_yMin))); Unit dy=GetUnit(0.5*(1- factor) * (GetValue(_yMax) - GetValue(_yMin)));
return Inflate(-dx, -dy); return inflate(-dx, -dy);
} }
Box& Box::Merge(const Unit& x, const Unit& y) Box& Box::merge(const Unit& x, const Unit& y)
// ****************************************** // ******************************************
{ {
if (IsEmpty()) { if (isEmpty()) {
_xMin = x; _xMin = x;
_yMin = y; _yMin = y;
_xMax = x; _xMax = x;
_yMax = y; _yMax = y;
} }
else { else {
_xMin = min(_xMin, x); _xMin = min(_xMin, x);
_yMin = min(_yMin, y); _yMin = min(_yMin, y);
_xMax = max(_xMax, x); _xMax = max(_xMax, x);
_yMax = max(_yMax, y); _yMax = max(_yMax, y);
} }
return *this; return *this;
} }
Box& Box::Merge(const Point& point) Box& Box::merge(const Point& point)
// ******************************** // ********************************
{ {
return Merge(point.GetX(), point.GetY()); return merge(point.getX(), point.getY());
} }
Box& Box::Merge(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2) Box& Box::merge(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2)
// **************************************************************************** // ****************************************************************************
{ {
Merge(x1, y1); merge(x1, y1);
Merge(x2, y2); merge(x2, y2);
return *this; return *this;
} }
Box& Box::Merge(const Box& box) Box& Box::merge(const Box& box)
// **************************** // ****************************
{ {
if (!box.IsEmpty()) { if (!box.isEmpty()) {
Merge(box.GetXMin(), box.GetYMin()); merge(box.getXMin(), box.getYMin());
Merge(box.GetXMax(), box.GetYMax()); merge(box.getXMax(), box.getYMax());
} }
return *this; return *this;
} }
Box& Box::Translate(const Unit& dx, const Unit& dy) Box& Box::translate(const Unit& dx, const Unit& dy)
// ************************************************ // ************************************************
{ {
if (!IsEmpty()) { if (!isEmpty()) {
_xMin += dx; _xMin += dx;
_yMin += dy; _yMin += dy;
_xMax += dx; _xMax += dx;
_yMax += dy; _yMax += dy;
} }
return *this; return *this;
} }
string Box::_GetString() const string Box::_GetString() const
// *************************** // ***************************
{ {
if (IsEmpty()) if (isEmpty())
return "<" + _TName("Box") + " empty>"; return "<" + _TName("Box") + " empty>";
else else
return "<" + _TName("Box") + " " + return "<" + _TName("Box") + " " +
GetValueString(_xMin) + " " + GetValueString(_yMin) + " " + GetValueString(_xMin) + " " + GetValueString(_yMin) + " " +
GetValueString(_xMax) + " " + GetValueString(_yMax) + GetValueString(_xMax) + " " + GetValueString(_yMax) +
">"; ">";
} }
Record* Box::_GetRecord() const Record* Box::_GetRecord() const
// ********************** // **********************
{ {
if (IsEmpty()) return NULL; if (isEmpty()) return NULL;
Record* record = new Record(GetString(this)); Record* record = new Record(GetString(this));
record->Add(GetSlot("XMin", &_xMin)); record->Add(GetSlot("XMin", &_xMin));
record->Add(GetSlot("YMin", &_yMin)); record->Add(GetSlot("YMin", &_yMin));
record->Add(GetSlot("XMax", &_xMax)); record->Add(GetSlot("XMax", &_xMax));
record->Add(GetSlot("YMax", &_yMax)); record->Add(GetSlot("YMax", &_yMax));
return record; return record;
} }

View File

@ -24,92 +24,94 @@ class Box {
// Attributes // Attributes
// ********** // **********
private: Unit _xMin;
private: Unit _yMin; private: Unit _xMin;
private: Unit _xMax; private: Unit _yMin;
private: Unit _yMax; private: Unit _xMax;
private: Unit _yMax;
// constructors // constructors
// ************ // ************
public: Box(); public: Box();
public: Box(const Unit& x, const Unit& y); public: Box(const Unit& x, const Unit& y);
public: Box(const Point& point); public: Box(const Point& point);
public: Box(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2); public: Box(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2);
public: Box(const Point& point1, const Point& point2); public: Box(const Point& point1, const Point& point2);
public: Box(const Box& box); public: Box(const Box& box);
// Operators // Operators
// ********* // *********
public: Box& operator=(const Box& box); public: Box& operator=(const Box& box);
public: bool operator==(const Box& box) const; public: bool operator==(const Box& box) const;
public: bool operator!=(const Box& box) const; public: bool operator!=(const Box& box) const;
// Accessors // Accessors
// ********* // *********
public: const Unit& GetXMin() const {return _xMin;}; public: const Unit& getXMin() const {return _xMin;};
public: const Unit& GetYMin() const {return _yMin;}; public: const Unit& getYMin() const {return _yMin;};
public: const Unit& GetXMax() const {return _xMax;}; public: const Unit& getXMax() const {return _xMax;};
public: const Unit& GetYMax() const {return _yMax;}; public: const Unit& getYMax() const {return _yMax;};
public: Unit GetXCenter() const {return ((_xMin + _xMax) / 2);}; public: Unit getXCenter() const {return ((_xMin + _xMax) / 2);};
public: Unit GetYCenter() const {return ((_yMin + _yMax) / 2);}; public: Unit getYCenter() const {return ((_yMin + _yMax) / 2);};
public: Point GetCenter() const {return Point(GetXCenter(), GetYCenter());}; public: Point getCenter() const {return Point(getXCenter(), getYCenter());};
public: Unit GetWidth() const {return (_xMax - _xMin);}; public: Unit getWidth() const {return (_xMax - _xMin);};
public: Unit GetHalfWidth() const {return (GetWidth() / 2);}; public: Unit getHalfWidth() const {return (getWidth() / 2);};
public: Unit GetHeight() const {return (_yMax - _yMin);}; public: Unit getHeight() const {return (_yMax - _yMin);};
public: Unit GetHalfHeight() const {return (GetHeight() / 2);}; public: Unit getHalfHeight() const {return (getHeight() / 2);};
public: Box GetUnion(const Box& box) const; public: Box getUnion(const Box& box) const;
public: Box GetIntersection(const Box& box) const; public: Box getIntersection(const Box& box) const;
public: Unit ManhattanDistance(const Point& pt) const; public: Unit manhattanDistance(const Point& pt) const;
public: Unit ManhattanDistance(const Box& box) const; public: Unit manhattanDistance(const Box& box) const;
// Predicates // Predicates
// ********** // **********
public: bool IsEmpty() const; public: bool isEmpty() const;
public: bool IsFlat() const; public: bool isFlat() const;
public: bool IsPonctual() const; public: bool isPonctual() const;
public: bool Contains(const Unit& x, const Unit& y) const; public: bool contains(const Unit& x, const Unit& y) const;
public: bool Contains(const Point& point) const; public: bool contains(const Point& point) const;
public: bool Contains(const Box& box) const; public: bool contains(const Box& box) const;
public: bool Intersect(const Box& box) const; public: bool intersect(const Box& box) const;
public: bool IsConstrainedBy(const Box& box) const; public: bool isConstrainedBy(const Box& box) const;
// Updators // Updators
// ******** // ********
public: Box& MakeEmpty(); public: Box& makeEmpty();
public: Box& Inflate(const Unit& d); public: Box& inflate(const Unit& d);
public: Box& Inflate(const Unit& dx, const Unit& dy); public: Box& inflate(const Unit& dx, const Unit& dy);
public: Box& Inflate(const Unit& dxMin, const Unit& dyMin, const Unit& dxMax, const Unit& dyMax); public: Box& inflate(const Unit& dxMin, const Unit& dyMin, const Unit& dxMax, const Unit& dyMax);
public: Box& ShrinkByFactor(double factor); // 0 <= factor <= 1 public: Box& shrinkByFactor(double factor); // 0 <= factor <= 1
public: Box& Merge(const Unit& x, const Unit& y); public: Box& merge(const Unit& x, const Unit& y);
public: Box& Merge(const Point& point); public: Box& merge(const Point& point);
public: Box& Merge(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2); public: Box& merge(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2);
public: Box& Merge(const Box& box); public: Box& merge(const Box& box);
public: Box& Translate(const Unit& dx, const Unit& dy); public: Box& translate(const Unit& dx, const Unit& dy);
// Others // Others
// ****** // ******
public: string _GetTypeName() const { return _TName("Box"); }; public: string _GetTypeName() const { return _TName("Box"); };
public: string _GetString() const; public: string _GetString() const;
public: Record* _GetRecord() const; public: Record* _GetRecord() const;
}; };

View File

@ -27,58 +27,58 @@ namespace Hurricane {
Cell::Cell(Library* library, const Name& name) Cell::Cell(Library* library, const Name& name)
// ******************************************* // *******************************************
: Inherit(), : Inherit(),
_library(library), _library(library),
_name(name), _name(name),
_instanceMap(), _instanceMap(),
_quadTree(), _quadTree(),
_slaveInstanceSet(), _slaveInstanceSet(),
_netMap(), _netMap(),
_sliceMap(), _sliceMap(),
_markerSet(), _markerSet(),
//_viewSet(), //_viewSet(),
_abutmentBox(), _abutmentBox(),
_boundingBox(), _boundingBox(),
_isTerminal(true), _isTerminal(true),
_isPad(false), _isPad(false),
_nextOfLibraryCellMap(NULL), _nextOfLibraryCellMap(NULL),
_nextOfSymbolCellSet(NULL), _nextOfSymbolCellSet(NULL),
_slaveEntityMap() _slaveEntityMap()
{ {
if (!_library) if (!_library)
throw Error("Can't create " + _TName("Cell") + " : null library"); throw Error("Can't create " + _TName("Cell") + " : null library");
if (name.IsEmpty()) if (name.IsEmpty())
throw Error("Can't create " + _TName("Cell") + " : empty name"); throw Error("Can't create " + _TName("Cell") + " : empty name");
if (_library->GetCell(_name)) if (_library->GetCell(_name))
throw Error("Can't create " + _TName("Cell") + " : already exists"); throw Error("Can't create " + _TName("Cell") + " : already exists");
} }
Cell* Cell::Create(Library* library, const Name& name) Cell* Cell::Create(Library* library, const Name& name)
// *************************************************** // ***************************************************
{ {
Cell* cell = new Cell(library, name); Cell* cell = new Cell(library, name);
cell->_PostCreate(); cell->_PostCreate();
return cell; return cell;
} }
Box Cell::GetBoundingBox() const Box Cell::GetBoundingBox() const
// ***************************** // *****************************
{ {
if (_boundingBox.IsEmpty()) { if (_boundingBox.isEmpty()) {
Box& boundingBox = (Box&)_boundingBox; Box& boundingBox = (Box&)_boundingBox;
boundingBox = _abutmentBox; boundingBox = _abutmentBox;
boundingBox.Merge(_quadTree.GetBoundingBox()); boundingBox.merge(_quadTree.GetBoundingBox());
for_each_slice(slice, GetSlices()) { for_each_slice(slice, GetSlices()) {
boundingBox.Merge(slice->GetBoundingBox()); boundingBox.merge(slice->GetBoundingBox());
end_for; end_for;
} }
} }
return _boundingBox; return _boundingBox;
} }
bool Cell::IsLeaf() const bool Cell::IsLeaf() const
@ -90,41 +90,41 @@ bool Cell::IsLeaf() const
bool Cell::IsCalledBy(Cell* cell) const bool Cell::IsCalledBy(Cell* cell) const
// ************************************ // ************************************
{ {
for_each_instance(instance, cell->GetInstances()) { for_each_instance(instance, cell->GetInstances()) {
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
if (masterCell == this) return true; if (masterCell == this) return true;
if (IsCalledBy(masterCell)) return true; if (IsCalledBy(masterCell)) return true;
end_for; end_for;
} }
return false; return false;
} }
void Cell::SetName(const Name& name) void Cell::SetName(const Name& name)
// ********************************* // *********************************
{ {
if (name != _name) { if (name != _name) {
if (name.IsEmpty()) if (name.IsEmpty())
throw Error("Can't change " + _TName("Cell") + " name : empty name"); throw Error("Can't change " + _TName("Cell") + " name : empty name");
if (_library->GetCell(name)) if (_library->GetCell(name))
throw Error("Can't change " + _TName("Cell") + " name : already exists"); throw Error("Can't change " + _TName("Cell") + " name : already exists");
_library->_GetCellMap()._Remove(this); _library->_GetCellMap()._Remove(this);
_name = name; _name = name;
_library->_GetCellMap()._Insert(this); _library->_GetCellMap()._Insert(this);
} }
} }
void Cell::SetAbutmentBox(const Box& abutmentBox) void Cell::SetAbutmentBox(const Box& abutmentBox)
// ********************************************** // **********************************************
{ {
if (abutmentBox != _abutmentBox) { if (abutmentBox != _abutmentBox) {
if (!_abutmentBox.IsEmpty() && if (!_abutmentBox.isEmpty() &&
(abutmentBox.IsEmpty() || !abutmentBox.Contains(_abutmentBox))) (abutmentBox.isEmpty() || !abutmentBox.contains(_abutmentBox)))
_Unfit(_abutmentBox); _Unfit(_abutmentBox);
_abutmentBox = abutmentBox; _abutmentBox = abutmentBox;
_Fit(_abutmentBox); _Fit(_abutmentBox);
} }
} }
void Cell::FlattenNets(bool buildRings) void Cell::FlattenNets(bool buildRings)
@ -199,102 +199,102 @@ void Cell::FlattenNets(bool buildRings)
void Cell::Materialize() void Cell::Materialize()
// ********************* // *********************
{ {
for_each_instance(instance, GetInstances()) instance->Materialize(); end_for; for_each_instance(instance, GetInstances()) instance->Materialize(); end_for;
for_each_net(net, GetNets()) net->Materialize(); end_for; for_each_net(net, GetNets()) net->Materialize(); end_for;
for_each_marker(marker, GetMarkers()) marker->Materialize(); end_for; for_each_marker(marker, GetMarkers()) marker->Materialize(); end_for;
} }
void Cell::Unmaterialize() void Cell::Unmaterialize()
// *********************** // ***********************
{ {
for_each_instance(instance, GetInstances()) instance->Unmaterialize(); end_for; for_each_instance(instance, GetInstances()) instance->Unmaterialize(); end_for;
for_each_net(net, GetNets()) net->Unmaterialize(); end_for; for_each_net(net, GetNets()) net->Unmaterialize(); end_for;
for_each_marker(marker, GetMarkers()) marker->Unmaterialize(); end_for; for_each_marker(marker, GetMarkers()) marker->Unmaterialize(); end_for;
} }
void Cell::_PostCreate() void Cell::_PostCreate()
// ********************* // *********************
{ {
_library->_GetCellMap()._Insert(this); _library->_GetCellMap()._Insert(this);
Inherit::_PostCreate(); Inherit::_PostCreate();
} }
void Cell::_PreDelete() void Cell::_PreDelete()
// ******************** // ********************
{ {
Inherit::_PreDelete(); Inherit::_PreDelete();
while(_slaveEntityMap.size()) { while(_slaveEntityMap.size()) {
_slaveEntityMap.begin()->second->Delete(); _slaveEntityMap.begin()->second->Delete();
} }
//for_each_view(view, GetViews()) view->SetCell(NULL); end_for; //for_each_view(view, GetViews()) view->SetCell(NULL); end_for;
for_each_marker(marker, GetMarkers()) marker->Delete(); end_for; for_each_marker(marker, GetMarkers()) marker->Delete(); end_for;
for_each_instance(slaveInstance, GetSlaveInstances()) slaveInstance->Delete(); end_for; for_each_instance(slaveInstance, GetSlaveInstances()) slaveInstance->Delete(); end_for;
for_each_instance(instance, GetInstances()) instance->Delete(); end_for; for_each_instance(instance, GetInstances()) instance->Delete(); end_for;
for_each_net(net, GetNets()) net->Delete(); end_for; for_each_net(net, GetNets()) net->Delete(); end_for;
for_each_slice(slice, GetSlices()) slice->_Delete(); end_for; for_each_slice(slice, GetSlices()) slice->_Delete(); end_for;
_library->_GetCellMap()._Remove(this); _library->_GetCellMap()._Remove(this);
} }
string Cell::_GetString() const string Cell::_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* Cell::_GetRecord() const Record* Cell::_GetRecord() const
// *********************** // ***********************
{ {
Record* record = Inherit::_GetRecord(); Record* record = Inherit::_GetRecord();
if (record) { if (record) {
record->Add(GetSlot("Library", _library)); record->Add(GetSlot("Library", _library));
record->Add(GetSlot("Name", &_name)); record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("Instances", &_instanceMap)); record->Add(GetSlot("Instances", &_instanceMap));
record->Add(GetSlot("QuadTree", &_quadTree)); record->Add(GetSlot("QuadTree", &_quadTree));
record->Add(GetSlot("SlaveInstances", &_slaveInstanceSet)); record->Add(GetSlot("SlaveInstances", &_slaveInstanceSet));
record->Add(GetSlot("Nets", &_netMap)); record->Add(GetSlot("Nets", &_netMap));
record->Add(GetSlot("Pins", &_pinMap)); record->Add(GetSlot("Pins", &_pinMap));
record->Add(GetSlot("Slices", &_sliceMap)); record->Add(GetSlot("Slices", &_sliceMap));
record->Add(GetSlot("Markers", &_markerSet)); record->Add(GetSlot("Markers", &_markerSet));
//record->Add(GetSlot("Views", &_viewSet)); //record->Add(GetSlot("Views", &_viewSet));
record->Add(GetSlot("AbutmentBox", &_abutmentBox)); record->Add(GetSlot("AbutmentBox", &_abutmentBox));
record->Add(GetSlot("BoundingBox", &_boundingBox)); record->Add(GetSlot("BoundingBox", &_boundingBox));
record->Add(GetSlot("IsTerminal", &_isTerminal)); record->Add(GetSlot("IsTerminal", &_isTerminal));
record->Add(GetSlot("IsFlattenLeaf", &_isFlattenLeaf)); record->Add(GetSlot("IsFlattenLeaf", &_isFlattenLeaf));
//record->Add(GetSlot("Symbol", _symbol)); //record->Add(GetSlot("Symbol", _symbol));
} }
return record; return record;
} }
void Cell::_Fit(const Box& box) void Cell::_Fit(const Box& box)
// **************************** // ****************************
{ {
if (box.IsEmpty()) return; if (box.isEmpty()) return;
if (_boundingBox.IsEmpty()) return; if (_boundingBox.isEmpty()) return;
if (_boundingBox.Contains(box)) return; if (_boundingBox.contains(box)) return;
_boundingBox.Merge(box); _boundingBox.merge(box);
for_each_instance(instance, GetSlaveInstances()) { for_each_instance(instance, GetSlaveInstances()) {
instance->GetCell()->_Fit(instance->GetTransformation().GetBox(box)); instance->GetCell()->_Fit(instance->GetTransformation().GetBox(box));
end_for; end_for;
} }
} }
void Cell::_Unfit(const Box& box) void Cell::_Unfit(const Box& box)
// ****************************** // ******************************
{ {
if (box.IsEmpty()) return; if (box.isEmpty()) return;
if (_boundingBox.IsEmpty()) return; if (_boundingBox.isEmpty()) return;
if (!_boundingBox.IsConstrainedBy(box)) return; if (!_boundingBox.isConstrainedBy(box)) return;
_boundingBox.MakeEmpty(); _boundingBox.makeEmpty();
for_each_instance(instance, GetSlaveInstances()) { for_each_instance(instance, GetSlaveInstances()) {
instance->GetCell()->_Unfit(instance->GetTransformation().GetBox(box)); instance->GetCell()->_Unfit(instance->GetTransformation().GetBox(box));
end_for; end_for;
} }
} }
void Cell::_AddSlaveEntity(Entity* entity, Entity* slaveEntity) void Cell::_AddSlaveEntity(Entity* entity, Entity* slaveEntity)
@ -339,52 +339,52 @@ void Cell::_GetSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, Sl
//// ************************************* //// *************************************
//{ //{
// return true; // return true;
// //if (view->GetCell() == this) return true; // //if (view->GetCell() == this) return true;
// //
// //if (is_a<MapView*>(view)) return true; // //if (is_a<MapView*>(view)) return true;
// //
// //return (1 < (double)view->GetScreenSize(_boundingBox.GetHeight())); // //return (1 < (double)view->GetScreenSize(_boundingBox.GetHeight()));
//// return (100 < ((double)view->GetScreenSize(_boundingBox.GetWidth()) * //// return (100 < ((double)view->GetScreenSize(_boundingBox.GetWidth()) *
//// (double)view->GetScreenSize(_boundingBox.GetHeight()))); //// (double)view->GetScreenSize(_boundingBox.GetHeight())));
//} //}
// //
//bool Cell::_ContentIsDrawable(View* view) const //bool Cell::_ContentIsDrawable(View* view) const
//// ******************************************** //// ********************************************
//{ //{
// if (IsTerminal()) return false; // if (IsTerminal()) return false;
// //
// return true; // return true;
// //
// //if (view->GetCell() == this) return true; // //if (view->GetCell() == this) return true;
// //
// //if (is_a<MapView*>(view)) return false; // //if (is_a<MapView*>(view)) return false;
// //
// //return (40 < (double)view->GetScreenSize(_boundingBox.GetHeight())); // //return (40 < (double)view->GetScreenSize(_boundingBox.GetHeight()));
//// return (400 < ((double)view->GetScreenSize(_boundingBox.GetWidth()) * //// return (400 < ((double)view->GetScreenSize(_boundingBox.GetWidth()) *
//// (double)view->GetScreenSize(_boundingBox.GetHeight()))); //// (double)view->GetScreenSize(_boundingBox.GetHeight())));
//} //}
// //
//void Cell::_DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation) //void Cell::_DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation)
//// ********************************************************************************************** //// **********************************************************************************************
//{ //{
//// if (_IsDrawable(view)) { // To avoid irregular display of instances phantoms //// if (_IsDrawable(view)) { // To avoid irregular display of instances phantoms
//// if (!_ContentIsDrawable(view)) //// if (!_ContentIsDrawable(view))
//// view->FillRectangle(transformation.GetBox(GetAbutmentBox())); //// view->FillRectangle(transformation.GetBox(GetAbutmentBox()));
//// else { //// else {
//// for_each_instance(instance, GetInstancesUnder(updateArea)) { //// for_each_instance(instance, GetInstancesUnder(updateArea)) {
//// instance->_DrawPhantoms(view, updateArea, transformation); //// instance->_DrawPhantoms(view, updateArea, transformation);
//// end_for; //// end_for;
//// } //// }
//// } //// }
//// } //// }
//} //}
// //
//void Cell::_DrawBoundaries(View* view, const Box& updateArea, const Transformation& transformation) //void Cell::_DrawBoundaries(View* view, const Box& updateArea, const Transformation& transformation)
//// ************************************************************************************************ //// ************************************************************************************************
//{ //{
// // if (_IsDrawable(view)) { // To avoid irregular display of instances phantoms // // if (_IsDrawable(view)) { // To avoid irregular display of instances phantoms
// // view->DrawRectangle(transformation.GetBox(GetAbutmentBox())); // // view->DrawRectangle(transformation.GetBox(GetAbutmentBox()));
// // if (_ContentIsDrawable(view)) { // // if (_ContentIsDrawable(view)) {
// // for_each_instance(instance, GetInstancesUnder(updateArea)) { // // for_each_instance(instance, GetInstancesUnder(updateArea)) {
// // instance->_DrawBoundaries(view, updateArea, transformation); // // instance->_DrawBoundaries(view, updateArea, transformation);
// // end_for; // // end_for;
@ -396,70 +396,70 @@ void Cell::_GetSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, Sl
//void Cell::_DrawContent(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) //void Cell::_DrawContent(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// **************************************************************************************************** //// ****************************************************************************************************
//{ //{
//// if (_IsDrawable(view)) { //// if (_IsDrawable(view)) {
//// if (_ContentIsDrawable(view)) { //// if (_ContentIsDrawable(view)) {
//// view->CheckForDisplayInterruption(); //// view->CheckForDisplayInterruption();
//// for_each_instance(instance, GetInstancesUnder(updateArea)) { //// for_each_instance(instance, GetInstancesUnder(updateArea)) {
//// instance->_Draw(view, basicLayer, updateArea, transformation); //// instance->_Draw(view, basicLayer, updateArea, transformation);
//// end_for; //// end_for;
//// } //// }
//// for_each_slice(slice, GetSlices()) { //// for_each_slice(slice, GetSlices()) {
//// slice->_Draw(view, basicLayer, updateArea, transformation); //// slice->_Draw(view, basicLayer, updateArea, transformation);
//// end_for; //// end_for;
//// } //// }
//// } //// }
//// } //// }
//} //}
// //
//void Cell::_DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation) //void Cell::_DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation)
//// ********************************************************************************************* //// *********************************************************************************************
//{ //{
//// if (_IsDrawable(view)) { //// if (_IsDrawable(view)) {
//// if (_ContentIsDrawable(view)) { //// if (_ContentIsDrawable(view)) {
//// for_each_instance(instance, GetInstancesUnder(updateArea)) { //// for_each_instance(instance, GetInstancesUnder(updateArea)) {
//// instance->_DrawRubbers(view, updateArea, transformation); //// instance->_DrawRubbers(view, updateArea, transformation);
//// end_for; //// end_for;
//// } //// }
//// for_each_rubber(rubber, GetRubbersUnder(updateArea)) { //// for_each_rubber(rubber, GetRubbersUnder(updateArea)) {
//// rubber->_Draw(view, NULL, updateArea, transformation); //// rubber->_Draw(view, NULL, updateArea, transformation);
//// end_for; //// end_for;
//// } //// }
//// } //// }
//// } //// }
//} //}
// //
//void Cell::_DrawMarkers(View* view, const Box& updateArea, const Transformation& transformation) //void Cell::_DrawMarkers(View* view, const Box& updateArea, const Transformation& transformation)
//// ********************************************************************************************* //// *********************************************************************************************
//{ //{
//// if (_IsDrawable(view)) { //// if (_IsDrawable(view)) {
//// if (_ContentIsDrawable(view)) { //// if (_ContentIsDrawable(view)) {
//// for_each_instance(instance, GetInstancesUnder(updateArea)) { //// for_each_instance(instance, GetInstancesUnder(updateArea)) {
//// instance->_DrawMarkers(view, updateArea, transformation); //// instance->_DrawMarkers(view, updateArea, transformation);
//// end_for; //// end_for;
//// } //// }
//// for_each_marker(marker, GetMarkersUnder(updateArea)) { //// for_each_marker(marker, GetMarkersUnder(updateArea)) {
//// marker->_Draw(view, NULL, updateArea, transformation); //// marker->_Draw(view, NULL, updateArea, transformation);
//// end_for; //// end_for;
//// } //// }
//// } //// }
//// } //// }
//} //}
// //
//void Cell::_DrawDisplaySlots(View* view, const Box& area, const Box& updateArea, const Transformation& transformation) //void Cell::_DrawDisplaySlots(View* view, const Box& area, const Box& updateArea, const Transformation& transformation)
//// ******************************************************************************************************************** //// ********************************************************************************************************************
//{ //{
//// if (_IsDrawable(view)) { //// if (_IsDrawable(view)) {
//// if (_ContentIsDrawable(view)) { //// if (_ContentIsDrawable(view)) {
//// for_each_instance(instance, GetInstancesUnder(updateArea)) { //// for_each_instance(instance, GetInstancesUnder(updateArea)) {
//// instance->_DrawDisplaySlots(view, area, updateArea, transformation); //// instance->_DrawDisplaySlots(view, area, updateArea, transformation);
//// end_for; //// end_for;
//// } //// }
//// for_each_display_slot(displaySlot, GetDisplaySlots(this)) { //// for_each_display_slot(displaySlot, GetDisplaySlots(this)) {
//// view->_DrawDisplaySlot(displaySlot, area, updateArea, transformation); //// view->_DrawDisplaySlot(displaySlot, area, updateArea, transformation);
//// end_for; //// end_for;
//// } //// }
//// } //// }
//// } //// }
//} //}
// //
// **************************************************************************************************** // ****************************************************************************************************
@ -468,32 +468,32 @@ void Cell::_GetSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, Sl
Cell::InstanceMap::InstanceMap() Cell::InstanceMap::InstanceMap()
// ***************************** // *****************************
: Inherit() : Inherit()
{ {
} }
Name Cell::InstanceMap::_GetKey(Instance* instance) const Name Cell::InstanceMap::_GetKey(Instance* instance) const
// ****************************************************** // ******************************************************
{ {
return instance->GetName(); return instance->GetName();
} }
unsigned Cell::InstanceMap::_GetHashValue(Name name) const unsigned Cell::InstanceMap::_GetHashValue(Name name) const
// ******************************************************* // *******************************************************
{ {
return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8; return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8;
} }
Instance* Cell::InstanceMap::_GetNextElement(Instance* instance) const Instance* Cell::InstanceMap::_GetNextElement(Instance* instance) const
// ******************************************************************* // *******************************************************************
{ {
return instance->_GetNextOfCellInstanceMap(); return instance->_GetNextOfCellInstanceMap();
} }
void Cell::InstanceMap::_SetNextElement(Instance* instance, Instance* nextInstance) const void Cell::InstanceMap::_SetNextElement(Instance* instance, Instance* nextInstance) const
// ************************************************************************************** // **************************************************************************************
{ {
instance->_SetNextOfCellInstanceMap(nextInstance); instance->_SetNextOfCellInstanceMap(nextInstance);
} }
@ -504,26 +504,26 @@ void Cell::InstanceMap::_SetNextElement(Instance* instance, Instance* nextInstan
Cell::SlaveInstanceSet::SlaveInstanceSet() Cell::SlaveInstanceSet::SlaveInstanceSet()
// *************************************** // ***************************************
: Inherit() : Inherit()
{ {
} }
unsigned Cell::SlaveInstanceSet::_GetHashValue(Instance* slaveInstance) const unsigned Cell::SlaveInstanceSet::_GetHashValue(Instance* slaveInstance) const
// ************************************************************************** // **************************************************************************
{ {
return ( (unsigned int)( (unsigned long)slaveInstance ) ) / 8; return ( (unsigned int)( (unsigned long)slaveInstance ) ) / 8;
} }
Instance* Cell::SlaveInstanceSet::_GetNextElement(Instance* slaveInstance) const Instance* Cell::SlaveInstanceSet::_GetNextElement(Instance* slaveInstance) const
// ***************************************************************************** // *****************************************************************************
{ {
return slaveInstance->_GetNextOfCellSlaveInstanceSet(); return slaveInstance->_GetNextOfCellSlaveInstanceSet();
} }
void Cell::SlaveInstanceSet::_SetNextElement(Instance* slaveInstance, Instance* nextSlaveInstance) const void Cell::SlaveInstanceSet::_SetNextElement(Instance* slaveInstance, Instance* nextSlaveInstance) const
// **************************************************************************************************** // ****************************************************************************************************
{ {
slaveInstance->_SetNextOfCellSlaveInstanceSet(nextSlaveInstance); slaveInstance->_SetNextOfCellSlaveInstanceSet(nextSlaveInstance);
} }
@ -534,32 +534,32 @@ void Cell::SlaveInstanceSet::_SetNextElement(Instance* slaveInstance, Instance*
Cell::NetMap::NetMap() Cell::NetMap::NetMap()
// ******************* // *******************
: Inherit() : Inherit()
{ {
} }
Name Cell::NetMap::_GetKey(Net* net) const Name Cell::NetMap::_GetKey(Net* net) const
// *************************************** // ***************************************
{ {
return net->GetName(); return net->GetName();
} }
unsigned Cell::NetMap::_GetHashValue(Name name) const unsigned Cell::NetMap::_GetHashValue(Name name) const
// ************************************************** // **************************************************
{ {
return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8; return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8;
} }
Net* Cell::NetMap::_GetNextElement(Net* net) const Net* Cell::NetMap::_GetNextElement(Net* net) const
// *********************************************** // ***********************************************
{ {
return net->_GetNextOfCellNetMap(); return net->_GetNextOfCellNetMap();
} }
void Cell::NetMap::_SetNextElement(Net* net, Net* nextNet) const void Cell::NetMap::_SetNextElement(Net* net, Net* nextNet) const
// ************************************************************* // *************************************************************
{ {
net->_SetNextOfCellNetMap(nextNet); net->_SetNextOfCellNetMap(nextNet);
} }
@ -569,32 +569,32 @@ void Cell::NetMap::_SetNextElement(Net* net, Net* nextNet) const
Cell::PinMap::PinMap() Cell::PinMap::PinMap()
// ******************* // *******************
: Inherit() : Inherit()
{ {
} }
Name Cell::PinMap::_GetKey(Pin* pin) const Name Cell::PinMap::_GetKey(Pin* pin) const
// *************************************** // ***************************************
{ {
return pin->GetName(); return pin->GetName();
} }
unsigned Cell::PinMap::_GetHashValue(Name name) const unsigned Cell::PinMap::_GetHashValue(Name name) const
// ************************************************** // **************************************************
{ {
return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8; return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8;
} }
Pin* Cell::PinMap::_GetNextElement(Pin* pin) const Pin* Cell::PinMap::_GetNextElement(Pin* pin) const
// *********************************************** // ***********************************************
{ {
return pin->_GetNextOfCellPinMap(); return pin->_GetNextOfCellPinMap();
} }
void Cell::PinMap::_SetNextElement(Pin* pin, Pin* nextPin) const void Cell::PinMap::_SetNextElement(Pin* pin, Pin* nextPin) const
// ************************************************************* // *************************************************************
{ {
pin->_SetNextOfCellPinMap(nextPin); pin->_SetNextOfCellPinMap(nextPin);
} }
@ -604,32 +604,32 @@ void Cell::PinMap::_SetNextElement(Pin* pin, Pin* nextPin) const
Cell::SliceMap::SliceMap() Cell::SliceMap::SliceMap()
// *********************** // ***********************
: Inherit() : Inherit()
{ {
} }
const Layer* Cell::SliceMap::_GetKey(Slice* slice) const const Layer* Cell::SliceMap::_GetKey(Slice* slice) const
// ***************************************************** // *****************************************************
{ {
return slice->GetLayer(); return slice->GetLayer();
} }
unsigned Cell::SliceMap::_GetHashValue(const Layer* layer) const unsigned Cell::SliceMap::_GetHashValue(const Layer* layer) const
// ************************************************************* // *************************************************************
{ {
return ( (unsigned int)( (unsigned long)layer ) ) / 8; return ( (unsigned int)( (unsigned long)layer ) ) / 8;
} }
Slice* Cell::SliceMap::_GetNextElement(Slice* slice) const Slice* Cell::SliceMap::_GetNextElement(Slice* slice) const
// ******************************************************* // *******************************************************
{ {
return slice->_GetNextOfCellSliceMap(); return slice->_GetNextOfCellSliceMap();
} }
void Cell::SliceMap::_SetNextElement(Slice* slice, Slice* nextSlice) const void Cell::SliceMap::_SetNextElement(Slice* slice, Slice* nextSlice) const
// *********************************************************************** // ***********************************************************************
{ {
slice->_SetNextOfCellSliceMap(nextSlice); slice->_SetNextOfCellSliceMap(nextSlice);
}; };
@ -640,26 +640,26 @@ void Cell::SliceMap::_SetNextElement(Slice* slice, Slice* nextSlice) const
Cell::MarkerSet::MarkerSet() Cell::MarkerSet::MarkerSet()
// ************************* // *************************
: Inherit() : Inherit()
{ {
} }
unsigned Cell::MarkerSet::_GetHashValue(Marker* marker) const unsigned Cell::MarkerSet::_GetHashValue(Marker* marker) const
// ********************************************************** // **********************************************************
{ {
return ( (unsigned int)( (unsigned long)marker ) ) / 8; return ( (unsigned int)( (unsigned long)marker ) ) / 8;
} }
Marker* Cell::MarkerSet::_GetNextElement(Marker* marker) const Marker* Cell::MarkerSet::_GetNextElement(Marker* marker) const
// *********************************************************** // ***********************************************************
{ {
return marker->_GetNextOfCellMarkerSet(); return marker->_GetNextOfCellMarkerSet();
} }
void Cell::MarkerSet::_SetNextElement(Marker* marker, Marker* nextMarker) const void Cell::MarkerSet::_SetNextElement(Marker* marker, Marker* nextMarker) const
// **************************************************************************** // ****************************************************************************
{ {
marker->_SetNextOfCellMarkerSet(nextMarker); marker->_SetNextOfCellMarkerSet(nextMarker);
} }
@ -670,26 +670,26 @@ void Cell::MarkerSet::_SetNextElement(Marker* marker, Marker* nextMarker) const
// //
//Cell::ViewSet::ViewSet() //Cell::ViewSet::ViewSet()
//// ********************* //// *********************
//: Inherit() //: Inherit()
//{ //{
//} //}
// //
//unsigned Cell::ViewSet::_GetHashValue(View* view) const //unsigned Cell::ViewSet::_GetHashValue(View* view) const
//// **************************************************** //// ****************************************************
//{ //{
// return ( (unsigned int)( (unsigned long)view ) ) / 8; // return ( (unsigned int)( (unsigned long)view ) ) / 8;
//} //}
// //
//View* Cell::ViewSet::_GetNextElement(View* view) const //View* Cell::ViewSet::_GetNextElement(View* view) const
//// *************************************************** //// ***************************************************
//{ //{
// return view->_GetNextOfCellViewSet(); // return view->_GetNextOfCellViewSet();
//} //}
// //
//void Cell::ViewSet::_SetNextElement(View* view, View* nextView) const //void Cell::ViewSet::_SetNextElement(View* view, View* nextView) const
//// ****************************************************************** //// ******************************************************************
//{ //{
// view->_SetNextOfCellViewSet(nextView); // view->_SetNextOfCellViewSet(nextView);
//} //}
// //
// //

View File

@ -1272,14 +1272,14 @@ Rubbers Cell::GetRubbers() const
Rubbers Cell::GetRubbersUnder(const Box& area) const Rubbers Cell::GetRubbersUnder(const Box& area) const
// ************************************************* // *************************************************
{ {
// return (area.IsEmpty()) ? Rubbers() : _quadTree.GetGosUnder(area).GetSubSet<Rubber*>(); // return (area.isEmpty()) ? Rubbers() : _quadTree.GetGosUnder(area).GetSubSet<Rubber*>();
return SubTypeCollection<Go*, Rubber*>(_quadTree.GetGosUnder(area)); return SubTypeCollection<Go*, Rubber*>(_quadTree.GetGosUnder(area));
} }
Markers Cell::GetMarkersUnder(const Box& area) const Markers Cell::GetMarkersUnder(const Box& area) const
// ************************************************* // *************************************************
{ {
// return (area.IsEmpty()) ? Markers() : _quadTree.GetGosUnder(area).GetSubSet<Marker*>(); // return (area.isEmpty()) ? Markers() : _quadTree.GetGosUnder(area).GetSubSet<Marker*>();
return SubTypeCollection<Go*, Marker*>(_quadTree.GetGosUnder(area)); return SubTypeCollection<Go*, Marker*>(_quadTree.GetGosUnder(area));
} }
@ -1793,7 +1793,7 @@ Cell_ComponentsUnder::Locator::Locator(const Cell* cell, const Box& area, const
_componentLocator(), _componentLocator(),
_component(NULL) _component(NULL)
{ {
if (_cell && !_area.IsEmpty()) { if (_cell && !_area.isEmpty()) {
_sliceLocator = _cell->GetSlices(_mask).GetLocator(); _sliceLocator = _cell->GetSlices(_mask).GetLocator();
while (!_component && _sliceLocator.IsValid()) { while (!_component && _sliceLocator.IsValid()) {
Slice* slice = _sliceLocator.GetElement(); Slice* slice = _sliceLocator.GetElement();
@ -2260,7 +2260,7 @@ Cell_OccurrencesUnder::Locator::Locator(const Cell* cell, const Box& area, unsig
_instanceLocator(), _instanceLocator(),
_occurrenceLocator() _occurrenceLocator()
{ {
if (_cell && !_area.IsEmpty()) { if (_cell && !_area.isEmpty()) {
_componentLocator = _cell->GetComponentsUnder(_area).GetLocator(); _componentLocator = _cell->GetComponentsUnder(_area).GetLocator();
if (_componentLocator.IsValid()) if (_componentLocator.IsValid())
_state = 1; _state = 1;
@ -2718,7 +2718,7 @@ Cell_LeafInstanceOccurrencesUnder::Locator::Locator(const Cell* cell, const Box&
_nonLeafInstanceLocator(), _nonLeafInstanceLocator(),
_occurrenceLocator() _occurrenceLocator()
{ {
if (_cell && !_area.IsEmpty()) { if (_cell && !_area.isEmpty()) {
_leafInstanceLocator = _cell->GetLeafInstancesUnder(_area).GetLocator(); _leafInstanceLocator = _cell->GetLeafInstancesUnder(_area).GetLocator();
if (_leafInstanceLocator.IsValid()) if (_leafInstanceLocator.IsValid())
_state = 1; _state = 1;
@ -3127,7 +3127,7 @@ Cell_TerminalInstanceOccurrencesUnder::Locator::Locator(const Cell* cell, const
_nonTerminalInstanceLocator(), _nonTerminalInstanceLocator(),
_occurrenceLocator() _occurrenceLocator()
{ {
if (_cell && !_area.IsEmpty()) { if (_cell && !_area.isEmpty()) {
_terminalInstanceLocator = _cell->GetTerminalInstancesUnder(_area).GetLocator(); _terminalInstanceLocator = _cell->GetTerminalInstancesUnder(_area).GetLocator();
if (_terminalInstanceLocator.IsValid()) if (_terminalInstanceLocator.IsValid())
_state = 1; _state = 1;
@ -3574,7 +3574,7 @@ Cell_ComponentOccurrencesUnder::Locator::Locator(const Cell* cell, const Box& ar
_instanceLocator(), _instanceLocator(),
_occurrenceLocator() _occurrenceLocator()
{ {
if (_cell && !_area.IsEmpty() && (_mask != 0)) { if (_cell && !_area.isEmpty() && (_mask != 0)) {
_componentLocator = _cell->GetComponentsUnder(_area, _mask).GetLocator(); _componentLocator = _cell->GetComponentsUnder(_area, _mask).GetLocator();
if (_componentLocator.IsValid()) if (_componentLocator.IsValid())
_state = 1; _state = 1;

View File

@ -53,7 +53,7 @@ class Component_IsUnderFilter : public Filter<Component*> {
public: virtual bool Accept(Component* component) const public: virtual bool Accept(Component* component) const
// **************************************************** // ****************************************************
{ {
return _area.Intersect(component->GetBoundingBox()); return _area.intersect(component->GetBoundingBox());
}; };
public: virtual string _GetString() const public: virtual string _GetString() const
@ -490,7 +490,7 @@ void Component::_SetRubber(Rubber* rubber)
// Box area(point); // Box area(point);
// area.Inflate(aperture); // area.Inflate(aperture);
// for_each_basic_layer(basicLayer, GetLayer()->GetBasicLayers()) { // for_each_basic_layer(basicLayer, GetLayer()->GetBasicLayers()) {
// if (view->IsVisible(basicLayer) && GetBoundingBox(basicLayer).Intersect(area)) // if (view->IsVisible(basicLayer) && GetBoundingBox(basicLayer).intersect(area))
// return true; // return true;
// end_for; // end_for;
// } // }
@ -933,7 +933,7 @@ double GetArea ( Component* component )
{ {
Box bb = component->GetBoundingBox (); Box bb = component->GetBoundingBox ();
return GetValue(bb.GetWidth()) * GetValue(bb.GetHeight()); return GetValue(bb.getWidth()) * GetValue(bb.getHeight());
} }

View File

@ -172,7 +172,7 @@ Point Contact::GetPosition() const
// ******************************* // *******************************
{ {
Component* anchor = GetAnchor(); Component* anchor = GetAnchor();
return (!anchor) ? Point(_dx, _dy) : anchor->GetPosition().Translate(_dx, _dy); return (!anchor) ? Point(_dx, _dy) : anchor->GetPosition().translate(_dx, _dy);
} }
Box Contact::GetBoundingBox() const Box Contact::GetBoundingBox() const
@ -180,7 +180,7 @@ Box Contact::GetBoundingBox() const
{ {
Unit size = _GetSize(); Unit size = _GetSize();
return Box(GetPosition()).Inflate(GetHalfWidth() + size, GetHalfHeight() + size); return Box(GetPosition()).inflate(GetHalfWidth() + size, GetHalfHeight() + size);
} }
Box Contact::GetBoundingBox(BasicLayer* basicLayer) const Box Contact::GetBoundingBox(BasicLayer* basicLayer) const
@ -190,7 +190,7 @@ Box Contact::GetBoundingBox(BasicLayer* basicLayer) const
Unit size = _GetSize(basicLayer); Unit size = _GetSize(basicLayer);
return Box(GetPosition()).Inflate(GetHalfWidth() + size, GetHalfHeight() + size); return Box(GetPosition()).inflate(GetHalfWidth() + size, GetHalfHeight() + size);
} }
Component* Contact::GetAnchor() const Component* Contact::GetAnchor() const
@ -275,7 +275,7 @@ void Contact::SetPosition(const Unit& x, const Unit& y)
void Contact::SetPosition(const Point& position) void Contact::SetPosition(const Point& position)
// ********************************************* // *********************************************
{ {
SetPosition(position.GetX(), position.GetY()); SetPosition(position.getX(), position.getY());
} }
void Contact::SetDx(const Unit& dx) void Contact::SetDx(const Unit& dx)

View File

@ -26,7 +26,7 @@ DRCError::DRCError(Cell* cell, const Name& name, const Box& boundingBox)
if (_name.IsEmpty()) if (_name.IsEmpty())
throw Error("Can't create " + _TName("DRCError") + " : empty name"); throw Error("Can't create " + _TName("DRCError") + " : empty name");
if (_boundingBox.IsEmpty()) if (_boundingBox.isEmpty())
throw Error("Can't create " + _TName("DRCError") + " : empty bounding box"); throw Error("Can't create " + _TName("DRCError") + " : empty bounding box");
} }
@ -45,7 +45,7 @@ void DRCError::Translate(const Unit& dx, const Unit& dy)
{ {
if ((dx != 0) || (dy != 0)) { if ((dx != 0) || (dy != 0)) {
Invalidate(false); Invalidate(false);
_boundingBox.Translate(dx, dy); _boundingBox.translate(dx, dy);
} }
} }

View File

@ -64,7 +64,7 @@ Box Horizontal::GetBoundingBox() const
Unit size = GetHalfWidth() + _GetSize(); Unit size = GetHalfWidth() + _GetSize();
Unit extention = _GetExtention(); Unit extention = _GetExtention();
return Box(GetSourceX(), _y, GetTargetX(), _y).Inflate(extention, size); return Box(GetSourceX(), _y, GetTargetX(), _y).inflate(extention, size);
} }
Box Horizontal::GetBoundingBox(BasicLayer* basicLayer) const Box Horizontal::GetBoundingBox(BasicLayer* basicLayer) const
@ -75,7 +75,7 @@ Box Horizontal::GetBoundingBox(BasicLayer* basicLayer) const
Unit size = GetHalfWidth() + _GetSize(basicLayer); Unit size = GetHalfWidth() + _GetSize(basicLayer);
Unit extention = _GetExtention(basicLayer); Unit extention = _GetExtention(basicLayer);
return Box(GetSourceX(), _y, GetTargetX(), _y).Inflate(extention, size); return Box(GetSourceX(), _y, GetTargetX(), _y).inflate(extention, size);
} }
Unit Horizontal::GetSourceX() const Unit Horizontal::GetSourceX() const

View File

@ -511,7 +511,7 @@ static bool IsConnex(const Occurrence& componentOccurrence1, const Occurrence& c
for_each_basic_layer(basicLayer2, layer2->GetBasicLayers()) { for_each_basic_layer(basicLayer2, layer2->GetBasicLayers()) {
if (basicLayer1->GetExtractMask() & basicLayer2->GetExtractMask()) { if (basicLayer1->GetExtractMask() & basicLayer2->GetExtractMask()) {
Box box2 = transformation2.GetBox(component2->GetBoundingBox(basicLayer2)); Box box2 = transformation2.GetBox(component2->GetBoundingBox(basicLayer2));
if (box1.Intersect(box2)) return true; if (box1.intersect(box2)) return true;
} }
end_for; end_for;
} }
@ -766,7 +766,7 @@ void HyperNet_NetOccurrencesUnder::Locator::Progress()
for_each_component(component, net->GetComponents()) { for_each_component(component, net->GetComponents()) {
Occurrence occurrence = Occurrence(component, path); Occurrence occurrence = Occurrence(component, path);
Box area = occurrence.GetBoundingBox(); Box area = occurrence.GetBoundingBox();
if (! area.Intersect (_area)) { if (! area.intersect (_area)) {
// Outside useful area // Outside useful area
} else if (is_a<Plug*>(component)) { } else if (is_a<Plug*>(component)) {
// Will be processed below // Will be processed below
@ -774,7 +774,7 @@ void HyperNet_NetOccurrencesUnder::Locator::Progress()
// Don't go through the Rubbers (go only trough connecting layers) // Don't go through the Rubbers (go only trough connecting layers)
} else { } else {
//if (_allowInterruption && !((i++) % 200)) gtk_check_for_interruption(); //if (_allowInterruption && !((i++) % 200)) gtk_check_for_interruption();
Box under = area.GetIntersection (_area); Box under = area.getIntersection (_area);
for_each_occurrence(occurrence2, cell->GetOccurrencesUnder(under)) { for_each_occurrence(occurrence2, cell->GetOccurrencesUnder(under)) {
if (is_a<Component*>(occurrence2.GetEntity())) { if (is_a<Component*>(occurrence2.GetEntity())) {
Component* component2 = (Component*)occurrence2.GetEntity(); Component* component2 = (Component*)occurrence2.GetEntity();

View File

@ -23,129 +23,129 @@ namespace Hurricane {
class Instance_IsUnderFilter : public Filter<Instance*> { class Instance_IsUnderFilter : public Filter<Instance*> {
// **************************************************** // ****************************************************
public: Box _area; public: Box _area;
public: Instance_IsUnderFilter(const Box& area) public: Instance_IsUnderFilter(const Box& area)
// ******************************************** // ********************************************
: _area(area) : _area(area)
{ {
}; };
public: Instance_IsUnderFilter(const Instance_IsUnderFilter& filter) public: Instance_IsUnderFilter(const Instance_IsUnderFilter& filter)
// ***************************************************************** // *****************************************************************
: _area(filter._area) : _area(filter._area)
{ {
}; };
public: Instance_IsUnderFilter& operator=(const Instance_IsUnderFilter& filter) public: Instance_IsUnderFilter& operator=(const Instance_IsUnderFilter& filter)
// **************************************************************************** // ****************************************************************************
{ {
_area = filter._area; _area = filter._area;
return *this; return *this;
}; };
public: virtual Filter<Instance*>* GetClone() const public: virtual Filter<Instance*>* GetClone() const
// ************************************************ // ************************************************
{ {
return new Instance_IsUnderFilter(*this); return new Instance_IsUnderFilter(*this);
}; };
public: virtual bool Accept(Instance* instance) const public: virtual bool Accept(Instance* instance) const
// ************************************************** // **************************************************
{ {
return _area.Intersect(instance->GetBoundingBox()); return _area.intersect(instance->GetBoundingBox());
}; };
public: virtual string _GetString() const public: virtual string _GetString() const
// ************************************** // **************************************
{ {
return "<" + _TName("Instance::IsUnderFilter") + " " + GetString(_area) + ">"; return "<" + _TName("Instance::IsUnderFilter") + " " + GetString(_area) + ">";
}; };
}; };
class Instance_IsTerminalFilter : public Filter<Instance*> { class Instance_IsTerminalFilter : public Filter<Instance*> {
// ******************************************************* // *******************************************************
public: Instance_IsTerminalFilter() {}; public: Instance_IsTerminalFilter() {};
public: Instance_IsTerminalFilter(const Instance_IsTerminalFilter& filter) {}; public: Instance_IsTerminalFilter(const Instance_IsTerminalFilter& filter) {};
public: Instance_IsTerminalFilter& operator=(const Instance_IsTerminalFilter& filter) {return *this;}; public: Instance_IsTerminalFilter& operator=(const Instance_IsTerminalFilter& filter) {return *this;};
public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsTerminalFilter(*this);}; public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsTerminalFilter(*this);};
public: virtual bool Accept(Instance* instance) const {return instance->IsTerminal();}; public: virtual bool Accept(Instance* instance) const {return instance->IsTerminal();};
public: virtual string _GetString() const {return "<" + _TName("Instance::IsTerminalFilter") + ">";}; public: virtual string _GetString() const {return "<" + _TName("Instance::IsTerminalFilter") + ">";};
}; };
class Instance_IsLeafFilter : public Filter<Instance*> { class Instance_IsLeafFilter : public Filter<Instance*> {
// ******************************************************* // *******************************************************
public: Instance_IsLeafFilter() {}; public: Instance_IsLeafFilter() {};
public: Instance_IsLeafFilter(const Instance_IsLeafFilter& filter) {}; public: Instance_IsLeafFilter(const Instance_IsLeafFilter& filter) {};
public: Instance_IsLeafFilter& operator=(const Instance_IsLeafFilter& filter) {return *this;}; public: Instance_IsLeafFilter& operator=(const Instance_IsLeafFilter& filter) {return *this;};
public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsLeafFilter(*this);}; public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsLeafFilter(*this);};
public: virtual bool Accept(Instance* instance) const {return instance->IsLeaf();}; public: virtual bool Accept(Instance* instance) const {return instance->IsLeaf();};
public: virtual string _GetString() const {return "<" + _TName("Instance::IsLeafFilter") + ">";}; public: virtual string _GetString() const {return "<" + _TName("Instance::IsLeafFilter") + ">";};
}; };
class Instance_IsUnplacedFilter : public Filter<Instance*> { class Instance_IsUnplacedFilter : public Filter<Instance*> {
// ******************************************************* // *******************************************************
public: Instance_IsUnplacedFilter() {}; public: Instance_IsUnplacedFilter() {};
public: Instance_IsUnplacedFilter(const Instance_IsUnplacedFilter& filter) {}; public: Instance_IsUnplacedFilter(const Instance_IsUnplacedFilter& filter) {};
public: Instance_IsUnplacedFilter& operator=(const Instance_IsUnplacedFilter& filter) {return *this;}; public: Instance_IsUnplacedFilter& operator=(const Instance_IsUnplacedFilter& filter) {return *this;};
public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsUnplacedFilter(*this);}; public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsUnplacedFilter(*this);};
public: virtual bool Accept(Instance* instance) const {return instance->IsUnplaced();}; public: virtual bool Accept(Instance* instance) const {return instance->IsUnplaced();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsUnplacedFilter>");}; public: virtual string _GetString() const {return "<" + _TName("Net::IsUnplacedFilter>");};
}; };
class Instance_IsPlacedFilter : public Filter<Instance*> { class Instance_IsPlacedFilter : public Filter<Instance*> {
// ***************************************************** // *****************************************************
public: Instance_IsPlacedFilter() {}; public: Instance_IsPlacedFilter() {};
public: Instance_IsPlacedFilter(const Instance_IsPlacedFilter& filter) {}; public: Instance_IsPlacedFilter(const Instance_IsPlacedFilter& filter) {};
public: Instance_IsPlacedFilter& operator=(const Instance_IsPlacedFilter& filter) {return *this;}; public: Instance_IsPlacedFilter& operator=(const Instance_IsPlacedFilter& filter) {return *this;};
public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsPlacedFilter(*this);}; public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsPlacedFilter(*this);};
public: virtual bool Accept(Instance* instance) const {return instance->IsPlaced();}; public: virtual bool Accept(Instance* instance) const {return instance->IsPlaced();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsPlacedFilter>");}; public: virtual string _GetString() const {return "<" + _TName("Net::IsPlacedFilter>");};
}; };
class Instance_IsFixedFilter : public Filter<Instance*> { class Instance_IsFixedFilter : public Filter<Instance*> {
// ***************************************************** // *****************************************************
public: Instance_IsFixedFilter() {}; public: Instance_IsFixedFilter() {};
public: Instance_IsFixedFilter(const Instance_IsFixedFilter& filter) {}; public: Instance_IsFixedFilter(const Instance_IsFixedFilter& filter) {};
public: Instance_IsFixedFilter& operator=(const Instance_IsFixedFilter& filter) {return *this;}; public: Instance_IsFixedFilter& operator=(const Instance_IsFixedFilter& filter) {return *this;};
public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsFixedFilter(*this);}; public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsFixedFilter(*this);};
public: virtual bool Accept(Instance* instance) const {return instance->IsFixed();}; public: virtual bool Accept(Instance* instance) const {return instance->IsFixed();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsFixedFilter>");}; public: virtual string _GetString() const {return "<" + _TName("Net::IsFixedFilter>");};
}; };
@ -155,53 +155,53 @@ class Instance_IsFixedFilter : public Filter<Instance*> {
Instance::Instance(Cell* cell, const Name& name, Cell* masterCell, const Transformation& transformation, const PlacementStatus& placementstatus, bool secureFlag) Instance::Instance(Cell* cell, const Name& name, Cell* masterCell, const Transformation& transformation, const PlacementStatus& placementstatus, bool secureFlag)
// **************************************************************************************************** // ****************************************************************************************************
: Inherit(), : Inherit(),
_cell(cell), _cell(cell),
_name(name), _name(name),
_masterCell(masterCell), _masterCell(masterCell),
_transformation(transformation), _transformation(transformation),
_placementStatus(placementstatus), _placementStatus(placementstatus),
_plugMap(), _plugMap(),
_sharedPathMap(), _sharedPathMap(),
_nextOfCellInstanceMap(NULL), _nextOfCellInstanceMap(NULL),
_nextOfCellSlaveInstanceSet(NULL) _nextOfCellSlaveInstanceSet(NULL)
{ {
if (!_cell) if (!_cell)
throw Error("Can't create " + _TName("Instance") + " : null cell"); throw Error("Can't create " + _TName("Instance") + " : null cell");
if (name.IsEmpty()) if (name.IsEmpty())
throw Error("Can't create " + _TName("Instance") + " : empty name"); throw Error("Can't create " + _TName("Instance") + " : empty name");
if (_cell->GetInstance(_name)) if (_cell->GetInstance(_name))
throw Error("Can't create " + _TName("Instance") + " : already exists"); throw Error("Can't create " + _TName("Instance") + " : already exists");
if (!_masterCell) if (!_masterCell)
throw Error("Can't create " + _TName("Instance") + " : null master cell"); throw Error("Can't create " + _TName("Instance") + " : null master cell");
if (secureFlag && _cell->IsCalledBy(_masterCell)) if (secureFlag && _cell->IsCalledBy(_masterCell))
throw Error("Can't create " + _TName("Instance") + " : cyclic construction"); throw Error("Can't create " + _TName("Instance") + " : cyclic construction");
} }
Instance* Instance::Create(Cell* cell, const Name& name, Cell* masterCell, bool secureFlag) Instance* Instance::Create(Cell* cell, const Name& name, Cell* masterCell, bool secureFlag)
// **************************************************************************************** // ****************************************************************************************
{ {
Instance* instance = Instance* instance =
new Instance(cell, name, masterCell, Transformation(), PlacementStatus(), secureFlag); new Instance(cell, name, masterCell, Transformation(), PlacementStatus(), secureFlag);
instance->_PostCreate(); instance->_PostCreate();
return instance; return instance;
} }
Instance* Instance::Create(Cell* cell, const Name& name, Cell* masterCell, const Transformation& transformation, const PlacementStatus& placementstatus, bool secureFlag) Instance* Instance::Create(Cell* cell, const Name& name, Cell* masterCell, const Transformation& transformation, const PlacementStatus& placementstatus, bool secureFlag)
// **************************************************************************************************** // ****************************************************************************************************
{ {
Instance* instance = Instance* instance =
new Instance(cell, name, masterCell, transformation, placementstatus, secureFlag); new Instance(cell, name, masterCell, transformation, placementstatus, secureFlag);
instance->_PostCreate(); instance->_PostCreate();
return instance; return instance;
} }
Box Instance::GetBoundingBox() const Box Instance::GetBoundingBox() const
@ -213,19 +213,19 @@ Box Instance::GetBoundingBox() const
Plugs Instance::GetConnectedPlugs() const Plugs Instance::GetConnectedPlugs() const
// ************************************** // **************************************
{ {
return GetPlugs().GetSubSet(Plug::GetIsConnectedFilter()); return GetPlugs().GetSubSet(Plug::GetIsConnectedFilter());
} }
Plugs Instance::GetUnconnectedPlugs() const Plugs Instance::GetUnconnectedPlugs() const
// **************************************** // ****************************************
{ {
return GetPlugs().GetSubSet(Plug::GetIsUnconnectedFilter()); return GetPlugs().GetSubSet(Plug::GetIsUnconnectedFilter());
} }
Path Instance::GetPath(const Path& tailPath) const Path Instance::GetPath(const Path& tailPath) const
// *********************************************** // ***********************************************
{ {
return Path((Instance*)this, tailPath); return Path((Instance*)this, tailPath);
} }
Box Instance::GetAbutmentBox() const Box Instance::GetAbutmentBox() const
@ -237,31 +237,31 @@ Box Instance::GetAbutmentBox() const
bool Instance::IsTerminal() const bool Instance::IsTerminal() const
// ****************************** // ******************************
{ {
return GetMasterCell()->IsTerminal(); return GetMasterCell()->IsTerminal();
} }
bool Instance::IsLeaf() const bool Instance::IsLeaf() const
// ************************** // **************************
{ {
return GetMasterCell()->IsLeaf(); return GetMasterCell()->IsLeaf();
} }
InstanceFilter Instance::GetIsUnderFilter(const Box& area) InstanceFilter Instance::GetIsUnderFilter(const Box& area)
// ******************************************************* // *******************************************************
{ {
return Instance_IsUnderFilter(area); return Instance_IsUnderFilter(area);
} }
InstanceFilter Instance::GetIsTerminalFilter() InstanceFilter Instance::GetIsTerminalFilter()
// ******************************************* // *******************************************
{ {
return Instance_IsTerminalFilter(); return Instance_IsTerminalFilter();
} }
InstanceFilter Instance::GetIsLeafFilter() InstanceFilter Instance::GetIsLeafFilter()
// ******************************************* // *******************************************
{ {
return Instance_IsLeafFilter(); return Instance_IsLeafFilter();
} }
InstanceFilter Instance::GetIsUnplacedFilter() InstanceFilter Instance::GetIsUnplacedFilter()
@ -291,287 +291,287 @@ InstanceFilter Instance::GetIsNotUnplacedFilter()
void Instance::Materialize() void Instance::Materialize()
// ************************* // *************************
{ {
if (!IsMaterialized()) { if (!IsMaterialized()) {
Box boundingBox = GetBoundingBox(); Box boundingBox = GetBoundingBox();
if (!boundingBox.IsEmpty()) { if (!boundingBox.isEmpty()) {
QuadTree* quadTree = _cell->_GetQuadTree(); QuadTree* quadTree = _cell->_GetQuadTree();
quadTree->Insert(this); quadTree->Insert(this);
_cell->_Fit(quadTree->GetBoundingBox()); _cell->_Fit(quadTree->GetBoundingBox());
} }
} }
} }
void Instance::Unmaterialize() void Instance::Unmaterialize()
// *************************** // ***************************
{ {
if (IsMaterialized()) { if (IsMaterialized()) {
_cell->_Unfit(GetBoundingBox()); _cell->_Unfit(GetBoundingBox());
_cell->_GetQuadTree()->Remove(this); _cell->_GetQuadTree()->Remove(this);
} }
} }
void Instance::Invalidate(bool propagateFlag) void Instance::Invalidate(bool propagateFlag)
// ****************************************** // ******************************************
{ {
Inherit::Invalidate(false); Inherit::Invalidate(false);
if (propagateFlag) { if (propagateFlag) {
for_each_plug(plug, GetConnectedPlugs()) { for_each_plug(plug, GetConnectedPlugs()) {
plug->Invalidate(true); plug->Invalidate(true);
end_for; end_for;
} }
} }
} }
void Instance::Translate(const Unit& dx, const Unit& dy) void Instance::Translate(const Unit& dx, const Unit& dy)
// ***************************************************** // *****************************************************
{ {
if ((dx != 0) || (dy !=0)) { if ((dx != 0) || (dy !=0)) {
Point translation = _transformation.GetTranslation(); Point translation = _transformation.GetTranslation();
Unit x = translation.GetX() + dx; Unit x = translation.getX() + dx;
Unit y = translation.GetY() + dy; Unit y = translation.getY() + dy;
Transformation::Orientation orientation = _transformation.GetOrientation(); Transformation::Orientation orientation = _transformation.GetOrientation();
SetTransformation(Transformation(x, y, orientation)); SetTransformation(Transformation(x, y, orientation));
} }
} }
void Instance::SetName(const Name& name) void Instance::SetName(const Name& name)
// ************************************* // *************************************
{ {
if (name != _name) { if (name != _name) {
if (name.IsEmpty()) if (name.IsEmpty())
throw Error("Can't change instance name : empty name"); throw Error("Can't change instance name : empty name");
if (_cell->GetInstance(name)) if (_cell->GetInstance(name))
throw Error("Can't change instance name : already exists"); throw Error("Can't change instance name : already exists");
_cell->_GetInstanceMap()._Remove(this); _cell->_GetInstanceMap()._Remove(this);
_name = name; _name = name;
_cell->_GetInstanceMap()._Insert(this); _cell->_GetInstanceMap()._Insert(this);
} }
} }
void Instance::SetTransformation(const Transformation& transformation) void Instance::SetTransformation(const Transformation& transformation)
// ******************************************************************* // *******************************************************************
{ {
if (transformation != _transformation) { if (transformation != _transformation) {
Invalidate(true); Invalidate(true);
_transformation = transformation; _transformation = transformation;
} }
} }
void Instance::SetPlacementStatus(const PlacementStatus& placementstatus) void Instance::SetPlacementStatus(const PlacementStatus& placementstatus)
// ********************************************************************** // **********************************************************************
{ {
// if (placementstatus != _placementStatus) { // if (placementstatus != _placementStatus) {
// Invalidate(true); // Invalidate(true);
_placementStatus = placementstatus; _placementStatus = placementstatus;
// } // }
} }
void Instance::SetMasterCell(Cell* masterCell, bool secureFlag) void Instance::SetMasterCell(Cell* masterCell, bool secureFlag)
// ************************************************************ // ************************************************************
{ {
if (masterCell != _masterCell) { if (masterCell != _masterCell) {
if (!masterCell) if (!masterCell)
throw Error("Can't set master : null master cell"); throw Error("Can't set master : null master cell");
if (secureFlag && _cell->IsCalledBy(masterCell)) if (secureFlag && _cell->IsCalledBy(masterCell))
throw Error("Can't set master : cyclic construction"); throw Error("Can't set master : cyclic construction");
list<Plug*> connectedPlugList; list<Plug*> connectedPlugList;
list<Net*> masterNetList; list<Net*> masterNetList;
for_each_plug(plug, GetConnectedPlugs()) { for_each_plug(plug, GetConnectedPlugs()) {
Net* masterNet = masterCell->GetNet(plug->GetMasterNet()->GetName()); Net* masterNet = masterCell->GetNet(plug->GetMasterNet()->GetName());
if (!masterNet || !masterNet->IsExternal()) if (!masterNet || !masterNet->IsExternal())
throw Error("Can't set master (bad master net matching)"); throw Error("Can't set master (bad master net matching)");
connectedPlugList.push_back(plug); connectedPlugList.push_back(plug);
masterNetList.push_back(masterNet); masterNetList.push_back(masterNet);
end_for; end_for;
} }
for_each_shared_path(sharedPath, _GetSharedPathes()) { for_each_shared_path(sharedPath, _GetSharedPathes()) {
if (!sharedPath->GetTailSharedPath()) if (!sharedPath->GetTailSharedPath())
// if the tail is empty the SharedPath isn't impacted by the change // if the tail is empty the SharedPath isn't impacted by the change
delete sharedPath; delete sharedPath;
end_for; end_for;
} }
Invalidate(true); Invalidate(true);
for_each_plug(plug, GetUnconnectedPlugs()) { for_each_plug(plug, GetUnconnectedPlugs()) {
plug->_Delete(); plug->_Delete();
end_for; end_for;
} }
while (!connectedPlugList.empty() && !masterNetList.empty()) { while (!connectedPlugList.empty() && !masterNetList.empty()) {
Plug* plug = connectedPlugList.front(); Plug* plug = connectedPlugList.front();
Net* masterNet = masterNetList.front(); Net* masterNet = masterNetList.front();
_plugMap._Remove(plug); _plugMap._Remove(plug);
plug->_SetMasterNet(masterNet); plug->_SetMasterNet(masterNet);
_plugMap._Insert(plug); _plugMap._Insert(plug);
connectedPlugList.pop_front(); connectedPlugList.pop_front();
masterNetList.pop_front(); masterNetList.pop_front();
} }
_masterCell->_GetSlaveInstanceSet()._Remove(this); _masterCell->_GetSlaveInstanceSet()._Remove(this);
_masterCell = masterCell; _masterCell = masterCell;
_masterCell->_GetSlaveInstanceSet()._Insert(this); _masterCell->_GetSlaveInstanceSet()._Insert(this);
for_each_net(externalNet, _masterCell->GetExternalNets()) { for_each_net(externalNet, _masterCell->GetExternalNets()) {
if (!GetPlug(externalNet)) Plug::_Create(this, externalNet); if (!GetPlug(externalNet)) Plug::_Create(this, externalNet);
end_for; end_for;
} }
} }
} }
void Instance::_PostCreate() void Instance::_PostCreate()
// ************************* // *************************
{ {
_cell->_GetInstanceMap()._Insert(this); _cell->_GetInstanceMap()._Insert(this);
_masterCell->_GetSlaveInstanceSet()._Insert(this); _masterCell->_GetSlaveInstanceSet()._Insert(this);
for_each_net(externalNet, _masterCell->GetExternalNets()) { for_each_net(externalNet, _masterCell->GetExternalNets()) {
Plug::_Create(this, externalNet); Plug::_Create(this, externalNet);
end_for; end_for;
} }
Inherit::_PostCreate(); Inherit::_PostCreate();
} }
void Instance::_PreDelete() void Instance::_PreDelete()
// ************************ // ************************
{ {
for_each_shared_path(sharedPath, _GetSharedPathes()) delete sharedPath; end_for; for_each_shared_path(sharedPath, _GetSharedPathes()) delete sharedPath; end_for;
Inherit::_PreDelete(); Inherit::_PreDelete();
for_each_plug(plug, GetPlugs()) plug->_Delete(); end_for; for_each_plug(plug, GetPlugs()) plug->_Delete(); end_for;
_masterCell->_GetSlaveInstanceSet()._Remove(this); _masterCell->_GetSlaveInstanceSet()._Remove(this);
_cell->_GetInstanceMap()._Remove(this); _cell->_GetInstanceMap()._Remove(this);
} }
string Instance::_GetString() const string Instance::_GetString() const
// ******************************** // ********************************
{ {
string s = Inherit::_GetString(); string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name)); s.insert(s.length() - 1, " " + GetString(_name));
s.insert(s.length() - 1, " " + GetString(_masterCell->GetName())); s.insert(s.length() - 1, " " + GetString(_masterCell->GetName()));
return s; return s;
} }
Record* Instance::_GetRecord() const Record* Instance::_GetRecord() const
// *************************** // ***************************
{ {
Record* record = Inherit::_GetRecord(); Record* record = Inherit::_GetRecord();
if (record) { if (record) {
record->Add(GetSlot("Cell", _cell)); record->Add(GetSlot("Cell", _cell));
record->Add(GetSlot("Name", &_name)); record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("MasterCell", _masterCell)); record->Add(GetSlot("MasterCell", _masterCell));
record->Add(GetSlot("Transformation", &_transformation)); record->Add(GetSlot("Transformation", &_transformation));
record->Add(GetSlot("PlacementStatus", _placementStatus)); record->Add(GetSlot("PlacementStatus", _placementStatus));
record->Add(GetSlot("XCenter", GetValue(GetAbutmentBox().GetXCenter()))); record->Add(GetSlot("XCenter", GetValue(GetAbutmentBox().getXCenter())));
record->Add(GetSlot("YCenter", GetValue(GetAbutmentBox().GetYCenter()))); record->Add(GetSlot("YCenter", GetValue(GetAbutmentBox().getYCenter())));
record->Add(GetSlot("Plugs", &_plugMap)); record->Add(GetSlot("Plugs", &_plugMap));
record->Add(GetSlot("SharedPathes", &_sharedPathMap)); record->Add(GetSlot("SharedPathes", &_sharedPathMap));
} }
return record; return record;
} }
//void Instance::_DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation) //void Instance::_DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation)
//// ************************************************************************************************** //// **************************************************************************************************
//{ //{
// Symbol* symbol = _masterCell->GetSymbol(); // Symbol* symbol = _masterCell->GetSymbol();
// if (!symbol) { // if (!symbol) {
// Box masterArea = updateArea; // Box masterArea = updateArea;
// Transformation masterTransformation = _transformation; // Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea); // _transformation.GetInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation); // transformation.ApplyOn(masterTransformation);
// _masterCell->_DrawPhantoms(view, masterArea, masterTransformation); // _masterCell->_DrawPhantoms(view, masterArea, masterTransformation);
// } // }
//} //}
// //
//void Instance::_DrawBoundaries(View* view, const Box& updateArea, const Transformation& transformation) //void Instance::_DrawBoundaries(View* view, const Box& updateArea, const Transformation& transformation)
//// **************************************************************************************************** //// ****************************************************************************************************
//{ //{
// Box masterArea = updateArea; // Box masterArea = updateArea;
// Transformation masterTransformation = _transformation; // Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea); // _transformation.GetInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation); // transformation.ApplyOn(masterTransformation);
// Symbol* symbol = _masterCell->GetSymbol(); // Symbol* symbol = _masterCell->GetSymbol();
// if (!symbol) // if (!symbol)
// _masterCell->_DrawBoundaries(view, masterArea, masterTransformation); // _masterCell->_DrawBoundaries(view, masterArea, masterTransformation);
// else // else
// _masterCell->GetSymbol()->_Draw(view, masterArea, masterTransformation); // _masterCell->GetSymbol()->_Draw(view, masterArea, masterTransformation);
//} //}
// //
//void Instance::_DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation) //void Instance::_DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation)
//// ************************************************************************************************* //// *************************************************************************************************
//{ //{
// Box masterArea = updateArea; // Box masterArea = updateArea;
// Transformation masterTransformation = _transformation; // Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea); // _transformation.GetInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation); // transformation.ApplyOn(masterTransformation);
// _masterCell->_DrawRubbers(view, masterArea, masterTransformation); // _masterCell->_DrawRubbers(view, masterArea, masterTransformation);
//} //}
// //
//void Instance::_DrawMarkers(View* view, const Box& updateArea, const Transformation& transformation) //void Instance::_DrawMarkers(View* view, const Box& updateArea, const Transformation& transformation)
//// ************************************************************************************************* //// *************************************************************************************************
//{ //{
// Box masterArea = updateArea; // Box masterArea = updateArea;
// Transformation masterTransformation = _transformation; // Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea); // _transformation.GetInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation); // transformation.ApplyOn(masterTransformation);
// _masterCell->_DrawMarkers(view, masterArea, masterTransformation); // _masterCell->_DrawMarkers(view, masterArea, masterTransformation);
//} //}
// //
//void Instance::_DrawDisplaySlots(View* view, const Box& area, const Box& updateArea, const Transformation& transformation) //void Instance::_DrawDisplaySlots(View* view, const Box& area, const Box& updateArea, const Transformation& transformation)
//// *********************************************************************************************************************** //// ***********************************************************************************************************************
//{ //{
// Box masterArea = updateArea; // Box masterArea = updateArea;
// Transformation masterTransformation = _transformation; // Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea); // _transformation.GetInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation); // transformation.ApplyOn(masterTransformation);
// _masterCell->_DrawDisplaySlots(view, area, masterArea, masterTransformation); // _masterCell->_DrawDisplaySlots(view, area, masterArea, masterTransformation);
//} //}
// //
//bool Instance::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const //bool Instance::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const
//// **************************************************************************************** //// ****************************************************************************************
//{ //{
// Symbol* symbol = _masterCell->GetSymbol(); // Symbol* symbol = _masterCell->GetSymbol();
// if (!symbol) // if (!symbol)
// return (view->PhantomsAreVisible() || view->BoundariesAreVisible()) && // return (view->PhantomsAreVisible() || view->BoundariesAreVisible()) &&
// GetAbutmentBox().Intersect(Box(point).Inflate(aperture)); // GetAbutmentBox().intersect(Box(point).Inflate(aperture));
// else { // else {
// Point masterPoint = point; // Point masterPoint = point;
// _transformation.GetInvert().ApplyOn(masterPoint); // _transformation.GetInvert().ApplyOn(masterPoint);
// return (view->BoundariesAreVisible() && symbol->_IsInterceptedBy(view, masterPoint, aperture)); // return (view->BoundariesAreVisible() && symbol->_IsInterceptedBy(view, masterPoint, aperture));
// } // }
//} //}
// //
//void Instance::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) //void Instance::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// **************************************************************************************************** //// ****************************************************************************************************
//{ //{
// Symbol* symbol = _masterCell->GetSymbol(); // Symbol* symbol = _masterCell->GetSymbol();
// if (!symbol) { // if (!symbol) {
// Box masterArea = updateArea; // Box masterArea = updateArea;
// Transformation masterTransformation = _transformation; // Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea); // _transformation.GetInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation); // transformation.ApplyOn(masterTransformation);
// _masterCell->_DrawContent(view, basicLayer, masterArea, masterTransformation); // _masterCell->_DrawContent(view, basicLayer, masterArea, masterTransformation);
// } // }
//} //}
// //
//void Instance::_Highlight(View* view, const Box& updateArea, const Transformation& transformation) //void Instance::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
//// *********************************************************************************************** //// ***********************************************************************************************
//{ //{
// Symbol* symbol = _masterCell->GetSymbol(); // Symbol* symbol = _masterCell->GetSymbol();
// if (!symbol) { // if (!symbol) {
// Box abutmentBox = transformation.GetBox(GetAbutmentBox()); // Box abutmentBox = transformation.GetBox(GetAbutmentBox());
// view->FillRectangle(abutmentBox); // view->FillRectangle(abutmentBox);
// view->DrawRectangle(abutmentBox); // view->DrawRectangle(abutmentBox);
// //
// if ( view->GetScale() > 1 ) // if ( view->GetScale() > 1 )
// { // {
@ -583,14 +583,14 @@ Record* Instance::_GetRecord() const
// view->DrawString ( text, abutmentBox.GetXMin(), abutmentBox.GetYMax() ); // view->DrawString ( text, abutmentBox.GetXMin(), abutmentBox.GetYMax() );
// } // }
// } // }
// } // }
// else { // else {
// Box masterArea = updateArea; // Box masterArea = updateArea;
// Transformation masterTransformation = _transformation; // Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea); // _transformation.GetInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation); // transformation.ApplyOn(masterTransformation);
// symbol->_Highlight(view, masterArea, masterTransformation); // symbol->_Highlight(view, masterArea, masterTransformation);
// } // }
//} //}
// //
@ -600,32 +600,32 @@ Record* Instance::_GetRecord() const
Instance::PlugMap::PlugMap() Instance::PlugMap::PlugMap()
// ************************* // *************************
: Inherit() : Inherit()
{ {
} }
const Net* Instance::PlugMap::_GetKey(Plug* plug) const const Net* Instance::PlugMap::_GetKey(Plug* plug) const
// **************************************************** // ****************************************************
{ {
return plug->GetMasterNet(); return plug->GetMasterNet();
} }
unsigned Instance::PlugMap::_GetHashValue(const Net* masterNet) const unsigned Instance::PlugMap::_GetHashValue(const Net* masterNet) const
// ****************************************************************** // ******************************************************************
{ {
return ( (unsigned int)( (unsigned long)masterNet ) ) / 8; return ( (unsigned int)( (unsigned long)masterNet ) ) / 8;
} }
Plug* Instance::PlugMap::_GetNextElement(Plug* plug) const Plug* Instance::PlugMap::_GetNextElement(Plug* plug) const
// ******************************************************* // *******************************************************
{ {
return plug->_GetNextOfInstancePlugMap(); return plug->_GetNextOfInstancePlugMap();
} }
void Instance::PlugMap::_SetNextElement(Plug* plug, Plug* nextPlug) const void Instance::PlugMap::_SetNextElement(Plug* plug, Plug* nextPlug) const
// ********************************************************************** // **********************************************************************
{ {
plug->_SetNextOfInstancePlugMap(nextPlug); plug->_SetNextOfInstancePlugMap(nextPlug);
} }
@ -636,32 +636,32 @@ void Instance::PlugMap::_SetNextElement(Plug* plug, Plug* nextPlug) const
Instance::SharedPathMap::SharedPathMap() Instance::SharedPathMap::SharedPathMap()
// ************************************* // *************************************
: Inherit() : Inherit()
{ {
} }
const SharedPath* Instance::SharedPathMap::_GetKey(SharedPath* sharedPath) const const SharedPath* Instance::SharedPathMap::_GetKey(SharedPath* sharedPath) const
// ***************************************************************************** // *****************************************************************************
{ {
return sharedPath->GetTailSharedPath(); return sharedPath->GetTailSharedPath();
} }
unsigned Instance::SharedPathMap::_GetHashValue(const SharedPath* tailSharedPath) const unsigned Instance::SharedPathMap::_GetHashValue(const SharedPath* tailSharedPath) const
// ************************************************************************************ // ************************************************************************************
{ {
return ( (unsigned int)( (unsigned long)tailSharedPath ) ) / 8; return ( (unsigned int)( (unsigned long)tailSharedPath ) ) / 8;
} }
SharedPath* Instance::SharedPathMap::_GetNextElement(SharedPath* sharedPath) const SharedPath* Instance::SharedPathMap::_GetNextElement(SharedPath* sharedPath) const
// ******************************************************************************* // *******************************************************************************
{ {
return sharedPath->_GetNextOfInstanceSharedPathMap(); return sharedPath->_GetNextOfInstanceSharedPathMap();
} }
void Instance::SharedPathMap::_SetNextElement(SharedPath* sharedPath, SharedPath* nextSharedPath) const void Instance::SharedPathMap::_SetNextElement(SharedPath* sharedPath, SharedPath* nextSharedPath) const
// **************************************************************************************************** // ****************************************************************************************************
{ {
sharedPath->_SetNextOfInstanceSharedPathMap(nextSharedPath); sharedPath->_SetNextOfInstanceSharedPathMap(nextSharedPath);
}; };
// **************************************************************************************************** // ****************************************************************************************************
@ -670,13 +670,13 @@ void Instance::SharedPathMap::_SetNextElement(SharedPath* sharedPath, SharedPath
Instance::PlacementStatus::PlacementStatus(const Code& code) Instance::PlacementStatus::PlacementStatus(const Code& code)
// ********************************************************* // *********************************************************
: _code(code) : _code(code)
{ {
} }
Instance::PlacementStatus::PlacementStatus(const PlacementStatus& placementstatus) Instance::PlacementStatus::PlacementStatus(const PlacementStatus& placementstatus)
// ******************************************************************************* // *******************************************************************************
: _code(placementstatus._code) : _code(placementstatus._code)
{ {
} }
@ -684,7 +684,7 @@ Instance::PlacementStatus& Instance::PlacementStatus::operator=(const PlacementS
// **************************************************************************************************** // ****************************************************************************************************
{ {
_code = placementstatus._code; _code = placementstatus._code;
return *this; return *this;
} }
string Instance::PlacementStatus::_GetString() const string Instance::PlacementStatus::_GetString() const
@ -696,9 +696,9 @@ string Instance::PlacementStatus::_GetString() const
Record* Instance::PlacementStatus::_GetRecord() const Record* Instance::PlacementStatus::_GetRecord() const
// ******************************************** // ********************************************
{ {
Record* record = new Record(GetString(this)); Record* record = new Record(GetString(this));
record->Add(GetSlot("Code", &_code)); record->Add(GetSlot("Code", &_code));
return record; return record;
} }
} // End of Hurricane namespace. } // End of Hurricane namespace.

File diff suppressed because it is too large Load Diff

View File

@ -143,8 +143,8 @@ class Net : public Entity {
public: const Type& GetType() const {return _type;}; public: const Type& GetType() const {return _type;};
public: const Direction& GetDirection() const {return _direction;}; public: const Direction& GetDirection() const {return _direction;};
public: const Point& GetPosition() const {return _position;}; public: const Point& GetPosition() const {return _position;};
public: const Unit& GetX() const {return _position.GetX();}; public: const Unit& GetX() const {return _position.getX();};
public: const Unit& GetY() const {return _position.GetY();}; public: const Unit& GetY() const {return _position.getY();};
public: Components GetComponents() const {return _componentSet.GetElements();}; public: Components GetComponents() const {return _componentSet.GetElements();};
public: Rubbers GetRubbers() const {return _rubberSet.GetElements();}; public: Rubbers GetRubbers() const {return _rubberSet.GetElements();};
public: RoutingPads GetRoutingPads() const; public: RoutingPads GetRoutingPads() const;

View File

@ -22,122 +22,122 @@ namespace Hurricane {
Pad::Pad(Net* net, Layer* layer, const Box& boundingBox) Pad::Pad(Net* net, Layer* layer, const Box& boundingBox)
// ***************************************************** // *****************************************************
: Inherit(net), : Inherit(net),
_layer(layer), _layer(layer),
_boundingBox(boundingBox) _boundingBox(boundingBox)
{ {
if (!_layer) if (!_layer)
throw Error("Can't create " + _TName("Pad") + " : null layer"); throw Error("Can't create " + _TName("Pad") + " : null layer");
if (_boundingBox.IsEmpty()) if (_boundingBox.isEmpty())
throw Error("Can't create " + _TName("Pad") + " : empty bounding box"); throw Error("Can't create " + _TName("Pad") + " : empty bounding box");
} }
Pad* Pad::Create(Net* net, Layer* layer, const Box& boundingBox) Pad* Pad::Create(Net* net, Layer* layer, const Box& boundingBox)
// ************************************************************* // *************************************************************
{ {
Pad* pad = new Pad(net, layer, boundingBox); Pad* pad = new Pad(net, layer, boundingBox);
pad->_PostCreate(); pad->_PostCreate();
return pad; return pad;
} }
Unit Pad::GetX() const Unit Pad::GetX() const
// ******************* // *******************
{ {
return 0; return 0;
} }
Unit Pad::GetY() const Unit Pad::GetY() const
// ******************* // *******************
{ {
return 0; return 0;
} }
Box Pad::GetBoundingBox() const 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;
} }
Box Pad::GetBoundingBox(BasicLayer* basicLayer) const Box Pad::GetBoundingBox(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;
} }
void Pad::Translate(const Unit& dx, const Unit& dy) void Pad::Translate(const Unit& dx, const Unit& dy)
// ************************************************ // ************************************************
{ {
if ((dx != 0) || (dy != 0)) { if ((dx != 0) || (dy != 0)) {
Invalidate(true); Invalidate(true);
_boundingBox.Translate(dx, dy); _boundingBox.translate(dx, dy);
} }
} }
void Pad::SetBoundingBox(const Box& boundingBox) void Pad::SetBoundingBox(const Box& boundingBox)
// ********************************************* // *********************************************
{ {
if (_boundingBox.IsEmpty()) if (_boundingBox.isEmpty())
throw Error("Can't set bounding box : empty bounding box"); throw Error("Can't set bounding box : empty bounding box");
if (boundingBox != _boundingBox) { if (boundingBox != _boundingBox) {
Invalidate(true); Invalidate(true);
_boundingBox = boundingBox; _boundingBox = boundingBox;
} }
} }
string Pad::_GetString() const 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;
} }
Record* Pad::_GetRecord() const Record* Pad::_GetRecord() const
// ********************** // **********************
{ {
Record* record = Inherit::_GetRecord(); Record* record = Inherit::_GetRecord();
if (record) { if (record) {
record->Add(GetSlot("Layer", _layer)); record->Add(GetSlot("Layer", _layer));
record->Add(GetSlot("BoundingBox", &_boundingBox)); record->Add(GetSlot("BoundingBox", &_boundingBox));
} }
return record; return record;
} }
//void Pad::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) //void Pad::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// **************************************************************************************************** //// ****************************************************************************************************
//{ //{
// Unit width = _boundingBox.GetWidth(); // Unit width = _boundingBox.GetWidth();
// Unit height = _boundingBox.GetHeight(); // Unit height = _boundingBox.GetHeight();
// if (1 < view->GetScreenSize(max(width, height))) { // if (1 < view->GetScreenSize(max(width, height))) {
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer))); // basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
// view->DrawRectangle(transformation.GetBox(GetBoundingBox(basicLayer))); // PROVISOIREMENT // view->DrawRectangle(transformation.GetBox(GetBoundingBox(basicLayer))); // PROVISOIREMENT
// } // }
//} //}
// //
//void Pad::_Highlight(View* view, const Box& updateArea, const Transformation& transformation) //void Pad::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
//// ****************************************************************************************** //// ******************************************************************************************
//{ //{
// for_each_basic_layer(basicLayer, GetLayer()->GetBasicLayers()) { // for_each_basic_layer(basicLayer, GetLayer()->GetBasicLayers()) {
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer))); // basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
// view->DrawRectangle(transformation.GetBox(GetBoundingBox(basicLayer))); // PROVISOIREMENT // view->DrawRectangle(transformation.GetBox(GetBoundingBox(basicLayer))); // PROVISOIREMENT
// end_for; // end_for;
// } // }
//} //}
// //

View File

@ -17,94 +17,94 @@ namespace Hurricane {
Point::Point() Point::Point()
// *********** // ***********
: _x(0), : _x(0),
_y(0) _y(0)
{ {
} }
Point::Point(const Unit& x, const Unit& y) Point::Point(const Unit& x, const Unit& y)
// *************************************** // ***************************************
: _x(x), : _x(x),
_y(y) _y(y)
{ {
} }
Point::Point(const Point& point) Point::Point(const Point& point)
// ***************************** // *****************************
: _x(point._x), : _x(point._x),
_y(point._y) _y(point._y)
{ {
} }
Point& Point::operator=(const Point& point) Point& Point::operator=(const Point& point)
// **************************************** // ****************************************
{ {
_x = point._x; _x = point._x;
_y = point._y; _y = point._y;
return *this; return *this;
} }
bool Point::operator==(const Point& point) const bool Point::operator==(const Point& point) const
// ********************************************* // *********************************************
{ {
return ((_x == point._x) && (_y == point._y)); return ((_x == point._x) && (_y == point._y));
} }
bool Point::operator!=(const Point& point) const bool Point::operator!=(const Point& point) const
// ********************************************* // *********************************************
{ {
return ((_x != point._x) || (_y != point._y)); return ((_x != point._x) || (_y != point._y));
} }
Point Point::operator+(const Point& point) const Point Point::operator+(const Point& point) const
// ********************************************* // *********************************************
{ {
return Point(_x+point._x,_y+point._y); return Point(_x+point._x,_y+point._y);
} }
Point Point::operator-(const Point& point) const Point Point::operator-(const Point& point) const
// ********************************************* // *********************************************
{ {
return Point(_x-point._x,_y-point._y); return Point(_x-point._x,_y-point._y);
} }
Point& Point::operator+=(const Point &point) Point& Point::operator+=(const Point &point)
// ***************************************** // *****************************************
{ {
_x += point._x; _x += point._x;
_y += point._y; _y += point._y;
return *this; return *this;
} }
Point& Point::operator-=(const Point &point) Point& Point::operator-=(const Point &point)
// ***************************************** // *****************************************
{ {
_x -= point._x; _x -= point._x;
_y -= point._y; _y -= point._y;
return *this; return *this;
} }
Point& Point::Translate(const Unit& dx, const Unit& dy) Point& Point::translate(const Unit& dx, const Unit& dy)
// **************************************************** // ****************************************************
{ {
_x += dx; _x += dx;
_y += dy; _y += dy;
return *this; return *this;
} }
string Point::_GetString() const string Point::_GetString() const
// ***************************** // *****************************
{ {
return "<" + _TName("Point") + " " + GetValueString(_x) + " " + GetValueString(_y) + ">"; return "<" + _TName("Point") + " " + GetValueString(_x) + " " + GetValueString(_y) + ">";
} }
Record* Point::_GetRecord() const Record* Point::_GetRecord() const
// ****************************** // ******************************
{ {
Record* record = new Record(GetString(this)); Record* record = new Record(GetString(this));
record->Add(GetSlot("X", &_x)); record->Add(GetSlot("X", &_x));
record->Add(GetSlot("Y", &_y)); record->Add(GetSlot("Y", &_y));
return record; return record;
} }

View File

@ -24,53 +24,52 @@ class Point {
// Attributes // Attributes
// ********** // **********
private: Unit _x; private: Unit _x;
private: Unit _y; private: Unit _y;
// Constructors // Constructors
// ************ // ************
public: Point(); public: Point();
public: Point(const Unit& x, const Unit& y); public: Point(const Unit& x, const Unit& y);
public: Point(const Point& point); public: Point(const Point& point);
// Operators // Operators
// ********* // *********
public: Point& operator=(const Point& point); public: Point& operator=(const Point& point);
public: bool operator==(const Point& point) const; public: bool operator==(const Point& point) const;
public: bool operator!=(const Point& point) const; public: bool operator!=(const Point& point) const;
public: Point operator+(const Point& point) const; public: Point operator+(const Point& point) const;
public: Point operator-(const Point& point) const; public: Point operator-(const Point& point) const;
public: Point& operator+=(const Point& point); public: Point& operator+=(const Point& point);
public: Point& operator-=(const Point& point); public: Point& operator-=(const Point& point);
// Accessors // Accessors
// ********* // *********
public: const Unit& GetX() const {return _x;}; public: const Unit& getX() const {return _x;};
public: const Unit& GetY() const {return _y;}; public: const Unit& getY() const {return _y;};
public: Unit manhattanDistance(const Point pt) const
public: Unit ManhattanDistance(const Point pt) const { return abs(_x - pt.getX()) + abs(_y - pt.getY()); }
{return abs(_x - pt.GetX()) + abs(_y - pt.GetY());};
// Updators // Updators
// ******** // ********
public: void SetX(const Unit& x) {_x = x;}; public: void setX(const Unit& x) {_x = x;};
public: void SetY(const Unit& y) {_y = y;}; public: void setY(const Unit& y) {_y = y;};
public: Point& Translate(const Unit& dx, const Unit& dy); public: Point& translate(const Unit& dx, const Unit& dy);
// Others // Others
// ****** // ******
public: string _GetTypeName() const { return _TName("Point"); }; public: string _GetTypeName() const { return _TName("Point"); };
public: string _GetString() const; public: string _GetString() const;
public: Record* _GetRecord() const; public: Record* _GetRecord() const;
}; };

File diff suppressed because it is too large Load Diff

View File

@ -49,13 +49,13 @@ Reference* Reference::Create(Cell* cell, const Name& name, Unit x, Unit y)
Reference* Reference::Create(Cell* cell, const Name& name, const Point& point) Reference* Reference::Create(Cell* cell, const Name& name, const Point& point)
// *************************************************************************** // ***************************************************************************
{ {
return Create(cell,name,point.GetX(),point.GetY()); return Create(cell,name,point.getX(),point.getY());
} }
Box Reference::GetBoundingBox() const Box Reference::GetBoundingBox() const
// *********************************** // ***********************************
{ {
return Box(_point).Inflate(_extend); return Box(_point).inflate(_extend);
} }
void Reference::Translate(const Unit& dx, const Unit& dy) void Reference::Translate(const Unit& dx, const Unit& dy)
@ -63,7 +63,7 @@ void Reference::Translate(const Unit& dx, const Unit& dy)
{ {
if ((dx != 0) || (dy != 0)) { if ((dx != 0) || (dy != 0)) {
Invalidate(false); Invalidate(false);
_point.Translate(dx, dy); _point.translate(dx, dy);
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -30,9 +30,9 @@ namespace Hurricane {
RoutingPad::RoutingPad(Net* net, const Point& p, Occurrence occurrence ) RoutingPad::RoutingPad(Net* net, const Point& p, Occurrence occurrence )
// ********************************************************************************** // **********************************************************************************
: Inherit(net), : Inherit(net),
_x(p.GetX()), _x(p.getX()),
_y(p.GetY()), _y(p.getY()),
_occurrence(occurrence) _occurrence(occurrence)
{ {
} }
@ -40,18 +40,18 @@ RoutingPad::RoutingPad(Net* net, const Point& p, Occurrence occurrence )
RoutingPad* RoutingPad::Create(Net* net, Occurrence occurrence) RoutingPad* RoutingPad::Create(Net* net, Occurrence occurrence)
// *********************************************************** // ***********************************************************
{ {
if (!net) if (!net)
throw Error ("Can't create RoutingPad : NULL net"); throw Error ("Can't create RoutingPad : NULL net");
if (!occurrence.IsValid()) if (!occurrence.IsValid())
throw Error ("Can't create RoutingPag : Invalid occurrence"); throw Error ("Can't create RoutingPag : Invalid occurrence");
//TODO Gerer une contruction avec un composant externe, mais ce n'est pas prioritaire //TODO Gerer une contruction avec un composant externe, mais ce n'est pas prioritaire
Plug* plug = NULL; Plug* plug = NULL;
Pin* pin = NULL; Pin* pin = NULL;
Contact* contact = NULL; Contact* contact = NULL;
Point position; Point position;
if ( (plug = dynamic_cast<Plug*>(occurrence.GetEntity()) ) ) { if ( (plug = dynamic_cast<Plug*>(occurrence.GetEntity()) ) ) {
position = occurrence.GetPath().GetTransformation().GetPoint( plug->GetPosition() ); position = occurrence.GetPath().GetTransformation().GetPoint( plug->GetPosition() );
} else if ( (pin = dynamic_cast<Pin*>(occurrence.GetEntity()) ) ) { } else if ( (pin = dynamic_cast<Pin*>(occurrence.GetEntity()) ) ) {
position = occurrence.GetPath().GetTransformation().GetPoint( pin->GetPosition() ); position = occurrence.GetPath().GetTransformation().GetPoint( pin->GetPosition() );
@ -62,11 +62,11 @@ RoutingPad* RoutingPad::Create(Net* net, Occurrence occurrence)
if ( !plug && !pin && !contact ) if ( !plug && !pin && !contact )
throw Error ("Can't create RoutingPad : plug or pin occurrence *required*"); throw Error ("Can't create RoutingPad : plug or pin occurrence *required*");
RoutingPad* routingPad = new RoutingPad(net, position, occurrence); RoutingPad* routingPad = new RoutingPad(net, position, occurrence);
routingPad->_PostCreate(); routingPad->_PostCreate();
return routingPad; return routingPad;
} }
void RoutingPad::_PostCreate() void RoutingPad::_PostCreate()
@ -81,13 +81,13 @@ void RoutingPad::_PostCreate()
Unit RoutingPad::GetX() const Unit RoutingPad::GetX() const
// *********************** // ***********************
{ {
return _x; return _x;
} }
Unit RoutingPad::GetY() const Unit RoutingPad::GetY() const
// *********************** // ***********************
{ {
return _y; return _y;
} }
Box RoutingPad::GetBoundingBox() const Box RoutingPad::GetBoundingBox() const
@ -143,25 +143,25 @@ Point RoutingPad::GetTargetPosition() const
Unit RoutingPad::GetSourceX() const Unit RoutingPad::GetSourceX() const
// ******************************** // ********************************
{ {
return GetSourcePosition().GetX(); return GetSourcePosition().getX();
} }
Unit RoutingPad::GetSourceY() const Unit RoutingPad::GetSourceY() const
// ******************************** // ********************************
{ {
return GetSourcePosition().GetY(); return GetSourcePosition().getY();
} }
Unit RoutingPad::GetTargetX() const Unit RoutingPad::GetTargetX() const
// ******************************** // ********************************
{ {
return GetTargetPosition().GetX(); return GetTargetPosition().getX();
} }
Unit RoutingPad::GetTargetY() const Unit RoutingPad::GetTargetY() const
// ******************************** // ********************************
{ {
return GetTargetPosition().GetY(); return GetTargetPosition().getY();
} }
Point RoutingPad::GetCenter() const Point RoutingPad::GetCenter() const
@ -178,43 +178,43 @@ Point RoutingPad::GetCenter() const
void RoutingPad::Translate(const Unit& dx, const Unit& dy) void RoutingPad::Translate(const Unit& dx, const Unit& dy)
// **************************************************** // ****************************************************
{ {
if ((dx != 0) || (dy != 0)) { if ((dx != 0) || (dy != 0)) {
Invalidate(true); Invalidate(true);
_x += dx; _x += dx;
_y += dy; _y += dy;
} }
} }
void RoutingPad::SetX(const Unit& x) void RoutingPad::SetX(const Unit& x)
// ****************************** // ******************************
{ {
SetPosition(x, GetY()); SetPosition(x, GetY());
} }
void RoutingPad::SetY(const Unit& y) void RoutingPad::SetY(const Unit& y)
// ****************************** // ******************************
{ {
SetPosition(GetX(), y); SetPosition(GetX(), y);
} }
void RoutingPad::SetPosition(const Unit& x, const Unit& y) void RoutingPad::SetPosition(const Unit& x, const Unit& y)
// **************************************************** // ****************************************************
{ {
SetOffset(x, y); SetOffset(x, y);
} }
void RoutingPad::SetPosition(const Point& position) void RoutingPad::SetPosition(const Point& position)
// ********************************************* // *********************************************
{ {
SetPosition(position.GetX(), position.GetY()); SetPosition(position.getX(), position.getY());
} }
void RoutingPad::SetOffset(const Unit& x, const Unit& y) void RoutingPad::SetOffset(const Unit& x, const Unit& y)
// **************************************************** // ****************************************************
{ {
Invalidate(true); Invalidate(true);
_x = x; _x = x;
_y = y; _y = y;
} }
void RoutingPad::_PreDelete() void RoutingPad::_PreDelete()
@ -235,24 +235,24 @@ void RoutingPad::_PreDelete()
string RoutingPad::_GetString() const string RoutingPad::_GetString() const
// ******************************* // *******************************
{ {
string s = Inherit::_GetString(); string s = Inherit::_GetString();
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, "] "); s.insert(s.length() - 1, "] ");
s.insert(s.length() - 1, GetString(_occurrence)); s.insert(s.length() - 1, GetString(_occurrence));
return s; return s;
} }
Record* RoutingPad::_GetRecord() const Record* RoutingPad::_GetRecord() const
// ************************** // **************************
{ {
Record* record = Inherit::_GetRecord(); Record* record = Inherit::_GetRecord();
if (record) { if (record) {
record->Add(GetSlot("X", &_x)); record->Add(GetSlot("X", &_x));
record->Add(GetSlot("Y", &_y)); record->Add(GetSlot("Y", &_y));
record->Add(GetSlot("Occurrence",_occurrence)); record->Add(GetSlot("Occurrence",_occurrence));
} }
return record; return record;
} }
Component* RoutingPad::_GetEntityAsComponent () const Component* RoutingPad::_GetEntityAsComponent () const
@ -276,19 +276,19 @@ Segment* RoutingPad::_GetEntityAsSegment () const
//bool RoutingPad::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const //bool RoutingPad::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const
//// ****************************************************************************************** //// ******************************************************************************************
//{ //{
// Layer* layer = GetLayer(); // Layer* layer = GetLayer();
// Box boundingBox ( GetBoundingBox() ); // Box boundingBox ( GetBoundingBox() );
// Box area ( point ); // Box area ( point );
// //
// area.Inflate ( aperture ); // area.Inflate ( aperture );
// //
// for_each_basic_layer(basicLayer, layer->GetBasicLayers()) { // for_each_basic_layer(basicLayer, layer->GetBasicLayers()) {
// if (view->IsVisible(basicLayer)) // if (view->IsVisible(basicLayer))
// if (boundingBox.Intersect(area)) return true; // if (boundingBox.Intersect(area)) return true;
// end_for; // end_for;
// } // }
// //
// return false; // return false;
//} //}
// //
// //
@ -334,11 +334,11 @@ void RoutingPad::SetExternalComponent(Component* component)
Horizontal* horizontal = dynamic_cast<Horizontal*>(component); Horizontal* horizontal = dynamic_cast<Horizontal*>(component);
if ( horizontal ) { if ( horizontal ) {
SetX ( 0 ); SetX ( 0 );
SetY ( position.GetY() ); SetY ( position.getY() );
} else { } else {
Vertical* vertical = dynamic_cast<Vertical*>(component); Vertical* vertical = dynamic_cast<Vertical*>(component);
if ( vertical ) { if ( vertical ) {
SetX ( position.GetX() ); SetX ( position.getX() );
SetY ( 0 ); SetY ( 0 );
} else } else
SetPosition ( position ); SetPosition ( position );
@ -387,40 +387,40 @@ void RoutingPad::RestorePlugOccurrence()
RoutingPad::Builder::Builder(const string& token) RoutingPad::Builder::Builder(const string& token)
// ******************************************* // *******************************************
: Inherit(token), : Inherit(token),
_layer(NULL), _layer(NULL),
_x(0), _x(0),
_y(0), _y(0),
_width(0), _width(0),
_height(0) _height(0)
{ {
} }
void RoutingPad::Builder::Scan(InputFile& inputFile, char*& arguments) void RoutingPad::Builder::Scan(InputFile& inputFile, char*& arguments)
// **************************************************************** // ****************************************************************
{ {
Inherit::Scan(inputFile, arguments); Inherit::Scan(inputFile, arguments);
unsigned layerId; unsigned layerId;
unsigned n; unsigned n;
if (r != 6) if (r != 6)
throw Error("Can't create RoutingPad : syntax error"); throw Error("Can't create RoutingPad : syntax error");
arguments = &arguments[n]; arguments = &arguments[n];
DBo* dbo = inputFile.GetDBo(layerId); DBo* dbo = inputFile.GetDBo(layerId);
if (!dbo || !is_a<Layer*>(dbo)) if (!dbo || !is_a<Layer*>(dbo))
throw Error("Can't create RoutingPad : bad layer"); throw Error("Can't create RoutingPad : bad layer");
_layer = (Layer*)dbo; _layer = (Layer*)dbo;
} }
DBo* RoutingPad::Builder::CreateDBo() DBo* RoutingPad::Builder::CreateDBo()
// ******************************* // *******************************
{ {
return RoutingPad::Create(GetNet(), GetLayer(), GetX(), GetY(), GetWidth(), GetHeight()); return RoutingPad::Create(GetNet(), GetLayer(), getX(), getY(), GetWidth(), GetHeight());
} }
RoutingPad::Builder ROUTINGPAD_BUILDER("RP"); RoutingPad::Builder ROUTINGPAD_BUILDER("RP");

View File

@ -56,7 +56,7 @@ Cell* Rubber::GetCell() const
Point Rubber::GetCenter() const Point Rubber::GetCenter() const
// **************************** // ****************************
{ {
return GetBoundingBox().GetCenter(); return GetBoundingBox().getCenter();
} }
Point Rubber::GetBarycenter() const Point Rubber::GetBarycenter() const
@ -66,9 +66,9 @@ Point Rubber::GetBarycenter() const
Unit x = 0; Unit x = 0;
Unit y = 0; Unit y = 0;
for_each_hook(hook, GetHooks()) { for_each_hook(hook, GetHooks()) {
Point position = hook->GetComponent()->GetBoundingBox().GetCenter(); Point position = hook->GetComponent()->GetBoundingBox().getCenter();
x += position.GetX() / n; x += position.getX() / n;
y += position.GetY() / n; y += position.getY() / n;
end_for; end_for;
} }
return Point(x,y); return Point(x,y);
@ -77,13 +77,13 @@ Point Rubber::GetBarycenter() const
Box Rubber::GetBoundingBox() const Box Rubber::GetBoundingBox() const
// ******************************* // *******************************
{ {
if (_boundingBox.IsEmpty()) if (_boundingBox.isEmpty())
{ {
Rubber* rubber = const_cast<Rubber*>(this); Rubber* rubber = const_cast<Rubber*>(this);
Box& boundingBox = rubber->_boundingBox; Box& boundingBox = rubber->_boundingBox;
for_each_hook(hook, GetHooks()) { for_each_hook(hook, GetHooks()) {
Point position = hook->GetComponent()->GetBoundingBox().GetCenter(); Point position = hook->GetComponent()->GetBoundingBox().getCenter();
boundingBox.Merge(position); boundingBox.merge(position);
end_for; end_for;
} }
} }
@ -245,14 +245,14 @@ void Rubber::Invalidate(bool propagateFlag)
// **************************************** // ****************************************
{ {
Inherit::Invalidate(false); Inherit::Invalidate(false);
_boundingBox.MakeEmpty(); _boundingBox.makeEmpty();
} }
//bool Rubber::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const //bool Rubber::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const
//// ************************************************************************************** //// **************************************************************************************
//{ //{
// double x = GetValue(point.GetX()); // double x = GetValue(point.getX());
// double y = GetValue(point.GetY()); // double y = GetValue(point.getY());
// double a = GetValue(aperture); // double a = GetValue(aperture);
// Point origin; // Point origin;
// //
@ -277,12 +277,12 @@ void Rubber::Invalidate(bool propagateFlag)
// default: // default:
// throw Error("Unknown RubberDisplayType"); // throw Error("Unknown RubberDisplayType");
// } // }
// double xo = GetValue(origin.GetX()); // double xo = GetValue(origin.getX());
// double yo = GetValue(origin.GetY()); // double yo = GetValue(origin.getY());
// for_each_hook(hook, GetHooks()) { // for_each_hook(hook, GetHooks()) {
// Point extremity = extremity = hook->GetComponent()->GetBoundingBox().GetCenter(); // Point extremity = extremity = hook->GetComponent()->GetBoundingBox().getCenter();
// double xe = GetValue(extremity.GetX()); // double xe = GetValue(extremity.getX());
// double ye = GetValue(extremity.GetY()); // double ye = GetValue(extremity.getY());
// double xp = xo; // double xp = xo;
// double yp = yo; // double yp = yo;
// if (xo != xe) xp = (((xe - xo) / (ye - yo)) * (y - yo)) + xo; // if (xo != xe) xp = (((xe - xo) / (ye - yo)) * (y - yo)) + xo;
@ -307,7 +307,7 @@ void Rubber::Invalidate(bool propagateFlag)
// { // {
// center = transformation.GetPoint(GetCenter()); // center = transformation.GetPoint(GetCenter());
// for_each_hook(hook, GetHooks()) { // for_each_hook(hook, GetHooks()) {
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter(); // Point position = hook->GetComponent()->GetBoundingBox().getCenter();
// view->DrawLine(center, transformation.GetPoint(position)); // view->DrawLine(center, transformation.GetPoint(position));
// end_for; // end_for;
// } // }
@ -317,7 +317,7 @@ void Rubber::Invalidate(bool propagateFlag)
// { // {
// center = transformation.GetPoint(GetBarycenter()); // center = transformation.GetPoint(GetBarycenter());
// for_each_hook(hook, GetHooks()) { // for_each_hook(hook, GetHooks()) {
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter(); // Point position = hook->GetComponent()->GetBoundingBox().getCenter();
// view->DrawLine(center, transformation.GetPoint(position)); // view->DrawLine(center, transformation.GetPoint(position));
// end_for; // end_for;
// } // }
@ -327,8 +327,8 @@ void Rubber::Invalidate(bool propagateFlag)
// { // {
// center = transformation.GetPoint(GetBarycenter()); // center = transformation.GetPoint(GetBarycenter());
// for_each_hook(hook, GetHooks()) { // for_each_hook(hook, GetHooks()) {
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter(); // Point position = hook->GetComponent()->GetBoundingBox().getCenter();
// Point crosspoint (position.GetX(), center.GetY()); // Point crosspoint (position.getX(), center.getY());
// view->DrawLine(position, crosspoint); // view->DrawLine(position, crosspoint);
// view->DrawLine(crosspoint, center); // view->DrawLine(crosspoint, center);
// end_for; // end_for;
@ -344,7 +344,7 @@ void Rubber::Invalidate(bool propagateFlag)
// //
typedef struct pcmp_s { typedef struct pcmp_s {
bool operator() (const Point& p1, const Point& p2) const { bool operator() (const Point& p1, const Point& p2) const {
return (p1.GetX() < p2.GetX()) || ( (p1.GetX() == p2.GetX()) && (p1.GetY() < p2.GetY()) ); return (p1.getX() < p2.getX()) || ( (p1.getX() == p2.getX()) && (p1.getY() < p2.getY()) );
} }
} pcmp_t; } pcmp_t;
@ -359,7 +359,7 @@ typedef struct pcmp_s {
// { // {
// center = transformation.GetPoint(GetCenter()); // center = transformation.GetPoint(GetCenter());
// for_each_hook(hook, GetHooks()) { // for_each_hook(hook, GetHooks()) {
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter(); // Point position = hook->GetComponent()->GetBoundingBox().getCenter();
// view->DrawLine(center, transformation.GetPoint(position)); // view->DrawLine(center, transformation.GetPoint(position));
// end_for; // end_for;
// } // }
@ -369,7 +369,7 @@ typedef struct pcmp_s {
// { // {
// center = transformation.GetPoint(GetBarycenter()); // center = transformation.GetPoint(GetBarycenter());
// for_each_hook(hook, GetHooks()) { // for_each_hook(hook, GetHooks()) {
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter(); // Point position = hook->GetComponent()->GetBoundingBox().getCenter();
// view->DrawLine(center, transformation.GetPoint(position)); // view->DrawLine(center, transformation.GetPoint(position));
// end_for; // end_for;
// } // }
@ -380,13 +380,13 @@ typedef struct pcmp_s {
// set <Point, pcmp_t> pset; // set <Point, pcmp_t> pset;
// for_each_hook (hook, GetHooks()) // for_each_hook (hook, GetHooks())
// { // {
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter(); // Point position = hook->GetComponent()->GetBoundingBox().getCenter();
// pset.insert (position); // pset.insert (position);
// end_for; // end_for;
// } // }
// center = transformation.GetPoint(GetBarycenter()); // center = transformation.GetPoint(GetBarycenter());
// Unit lastXup = center.GetX(); // Unit lastXup = center.getX();
// Unit lastXlo = center.GetX(); // Unit lastXlo = center.getX();
// for ( // for (
// set<Point, pcmp_t>::iterator pit = pset.begin(); // set<Point, pcmp_t>::iterator pit = pset.begin();
// pit != pset.end(); // pit != pset.end();
@ -394,29 +394,29 @@ typedef struct pcmp_s {
// ) // )
// { // {
// Point position (*pit); // Point position (*pit);
// Point crosspoint (position.GetX(), center.GetY()); // Point crosspoint (position.getX(), center.getY());
// Point connxpoint (center); // Point connxpoint (center);
// if (position.GetY() > center.GetY()) // if (position.getY() > center.getY())
// { // {
// // en haut // // en haut
// if ( (position.GetX() - lastXup) < (position.GetY() - center.GetY()) ) // if ( (position.getX() - lastXup) < (position.getY() - center.getY()) )
// { // {
// crosspoint.SetX (lastXup); // crosspoint.SetX (lastXup);
// crosspoint.SetY (position.GetY()); // crosspoint.SetY (position.getY());
// connxpoint.SetX (lastXup); // connxpoint.SetX (lastXup);
// } // }
// else // else
// lastXup = position.GetX(); // lastXup = position.getX();
// } else { // } else {
// // en bas // // en bas
// if ( (position.GetX() - lastXlo) < (center.GetY() - position.GetY()) ) // if ( (position.getX() - lastXlo) < (center.getY() - position.getY()) )
// { // {
// crosspoint.SetX (lastXlo); // crosspoint.SetX (lastXlo);
// crosspoint.SetY (position.GetY()); // crosspoint.SetY (position.getY());
// connxpoint.SetX (lastXlo); // connxpoint.SetX (lastXlo);
// } // }
// else // else
// lastXlo = position.GetX(); // lastXlo = position.getX();
// } // }
// //
// //

View File

@ -61,8 +61,8 @@ Transformation::Transformation(const Unit& tx, const Unit& ty, const Orientation
Transformation::Transformation(const Point& translation, const Orientation& orientation) Transformation::Transformation(const Point& translation, const Orientation& orientation)
// ************************************************************************************* // *************************************************************************************
: _tx(translation.GetX()), : _tx(translation.getX()),
_ty(translation.GetY()), _ty(translation.getY()),
_orientation(orientation) _orientation(orientation)
{ {
} }
@ -115,13 +115,13 @@ Unit Transformation::GetY(const Unit& x, const Unit& y) const
Unit Transformation::GetX(const Point& point) const Unit Transformation::GetX(const Point& point) const
// ************************************************ // ************************************************
{ {
return GetX(point.GetX(), point.GetY()); return GetX(point.getX(), point.getY());
} }
Unit Transformation::GetY(const Point& point) const Unit Transformation::GetY(const Point& point) const
// ************************************************ // ************************************************
{ {
return GetY(point.GetX(), point.GetY()); return GetY(point.getX(), point.getY());
} }
Unit Transformation::GetDx(const Unit& dx, const Unit& dy) const Unit Transformation::GetDx(const Unit& dx, const Unit& dy) const
@ -145,7 +145,7 @@ Point Transformation::GetPoint(const Unit& x, const Unit& y) const
Point Transformation::GetPoint(const Point& point) const Point Transformation::GetPoint(const Point& point) const
// ***************************************************** // *****************************************************
{ {
return GetPoint(point.GetX(), point.GetY()); return GetPoint(point.getX(), point.getY());
} }
Box Transformation::GetBox(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2) const Box Transformation::GetBox(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2) const
@ -157,14 +157,14 @@ Box Transformation::GetBox(const Unit& x1, const Unit& y1, const Unit& x2, const
Box Transformation::GetBox(const Point& point1, const Point& point2) const Box Transformation::GetBox(const Point& point1, const Point& point2) const
// *********************************************************************** // ***********************************************************************
{ {
return GetBox(point1.GetX(), point1.GetY(), point2.GetX(), point2.GetY()); return GetBox(point1.getX(), point1.getY(), point2.getX(), point2.getY());
} }
Box Transformation::GetBox(const Box& box) const Box Transformation::GetBox(const Box& box) const
// ********************************************* // *********************************************
{ {
if (box.IsEmpty()) return box; if (box.isEmpty()) return box;
return GetBox(box.GetXMin(), box.GetYMin(), box.GetXMax(), box.GetYMax()); return GetBox(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax());
} }
Transformation Transformation::GetTransformation(const Transformation& transformation) const Transformation Transformation::GetTransformation(const Transformation& transformation) const

View File

@ -64,7 +64,7 @@ Box Vertical::GetBoundingBox() const
Unit size = GetHalfWidth() + _GetSize(); Unit size = GetHalfWidth() + _GetSize();
Unit extention = _GetExtention(); Unit extention = _GetExtention();
return Box(_x, GetSourceY(), _x, GetTargetY()).Inflate(size, extention); return Box(_x, GetSourceY(), _x, GetTargetY()).inflate(size, extention);
} }
Box Vertical::GetBoundingBox(BasicLayer* basicLayer) const Box Vertical::GetBoundingBox(BasicLayer* basicLayer) const
@ -75,7 +75,7 @@ Box Vertical::GetBoundingBox(BasicLayer* basicLayer) const
Unit size = GetHalfWidth() + _GetSize(basicLayer); Unit size = GetHalfWidth() + _GetSize(basicLayer);
Unit extention = _GetExtention(basicLayer); Unit extention = _GetExtention(basicLayer);
return Box(_x, GetSourceY(), _x, GetTargetY()).Inflate(size, extention); return Box(_x, GetSourceY(), _x, GetTargetY()).inflate(size, extention);
} }
Unit Vertical::GetSourceY() const Unit Vertical::GetSourceY() const