beginning new convention for methods
This commit is contained in:
parent
bc11b86deb
commit
b9a119320a
|
@ -18,327 +18,321 @@ namespace Hurricane {
|
|||
|
||||
Box::Box()
|
||||
// *******
|
||||
: _xMin(1),
|
||||
_yMin(1),
|
||||
_xMax(-1),
|
||||
_yMax(-1)
|
||||
{
|
||||
}
|
||||
: _xMin(1),
|
||||
_yMin(1),
|
||||
_xMax(-1),
|
||||
_yMax(-1)
|
||||
{}
|
||||
|
||||
Box::Box(const Unit& x, const Unit& y)
|
||||
// ***********************************
|
||||
: _xMin(x),
|
||||
_yMin(y),
|
||||
_xMax(x),
|
||||
_yMax(y)
|
||||
{
|
||||
}
|
||||
: _xMin(x),
|
||||
_yMin(y),
|
||||
_xMax(x),
|
||||
_yMax(y)
|
||||
{}
|
||||
|
||||
Box::Box(const Point& point)
|
||||
// *************************
|
||||
: _xMin(point.GetX()),
|
||||
_yMin(point.GetY()),
|
||||
_xMax(point.GetX()),
|
||||
_yMax(point.GetY())
|
||||
{
|
||||
}
|
||||
: _xMin(point.getX()),
|
||||
_yMin(point.getY()),
|
||||
_xMax(point.getX()),
|
||||
_yMax(point.getY())
|
||||
{}
|
||||
|
||||
Box::Box(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2)
|
||||
// *********************************************************************
|
||||
: _xMin(min(x1, x2)),
|
||||
_yMin(min(y1, y2)),
|
||||
_xMax(max(x1, x2)),
|
||||
_yMax(max(y1, y2))
|
||||
{
|
||||
}
|
||||
: _xMin(min(x1, x2)),
|
||||
_yMin(min(y1, y2)),
|
||||
_xMax(max(x1, x2)),
|
||||
_yMax(max(y1, y2))
|
||||
{}
|
||||
|
||||
Box::Box(const Point& point1, const Point& point2)
|
||||
// ***********************************************
|
||||
: _xMin(min(point1.GetX(), point2.GetX())),
|
||||
_yMin(min(point1.GetY(), point2.GetY())),
|
||||
_xMax(max(point1.GetX(), point2.GetX())),
|
||||
_yMax(max(point1.GetY(), point2.GetY()))
|
||||
{
|
||||
}
|
||||
: _xMin(min(point1.getX(), point2.getX())),
|
||||
_yMin(min(point1.getY(), point2.getY())),
|
||||
_xMax(max(point1.getX(), point2.getX())),
|
||||
_yMax(max(point1.getY(), point2.getY()))
|
||||
{}
|
||||
|
||||
Box::Box(const Box& box)
|
||||
// *********************
|
||||
: _xMin(box._xMin),
|
||||
_yMin(box._yMin),
|
||||
_xMax(box._xMax),
|
||||
_yMax(box._yMax)
|
||||
{
|
||||
}
|
||||
: _xMin(box._xMin),
|
||||
_yMin(box._yMin),
|
||||
_xMax(box._xMax),
|
||||
_yMax(box._yMax)
|
||||
{}
|
||||
|
||||
Box& Box::operator=(const Box& box)
|
||||
// ********************************
|
||||
{
|
||||
_xMin = box._xMin;
|
||||
_yMin = box._yMin;
|
||||
_xMax = box._xMax;
|
||||
_yMax = box._yMax;
|
||||
return *this;
|
||||
_xMin = box._xMin;
|
||||
_yMin = box._yMin;
|
||||
_xMax = box._xMax;
|
||||
_yMax = box._yMax;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool Box::operator==(const Box& box) const
|
||||
// ***************************************
|
||||
{
|
||||
return (!IsEmpty() &&
|
||||
!box.IsEmpty() &&
|
||||
(_xMin == box._xMin) &&
|
||||
(_yMin == box._yMin) &&
|
||||
(_xMax == box._xMax) &&
|
||||
(_yMax == box._yMax));
|
||||
return (!isEmpty() &&
|
||||
!box.isEmpty() &&
|
||||
(_xMin == box._xMin) &&
|
||||
(_yMin == box._yMin) &&
|
||||
(_xMax == box._xMax) &&
|
||||
(_yMax == box._yMax));
|
||||
}
|
||||
|
||||
bool Box::operator!=(const Box& box) const
|
||||
// ***************************************
|
||||
{
|
||||
return (IsEmpty() ||
|
||||
box.IsEmpty() ||
|
||||
(_xMin != box._xMin) ||
|
||||
(_yMin != box._yMin) ||
|
||||
(_xMax != box._xMax) ||
|
||||
(_yMax != box._yMax));
|
||||
return (isEmpty() ||
|
||||
box.isEmpty() ||
|
||||
(_xMin != box._xMin) ||
|
||||
(_yMin != box._yMin) ||
|
||||
(_xMax != box._xMax) ||
|
||||
(_yMax != box._yMax));
|
||||
}
|
||||
|
||||
Box Box::GetUnion(const Box& box) const
|
||||
Box Box::getUnion(const Box& box) const
|
||||
// ************************************
|
||||
{
|
||||
if (IsEmpty() && box.IsEmpty()) return Box();
|
||||
return Box(min(_xMin, box._xMin),
|
||||
min(_yMin, box._yMin),
|
||||
max(_xMax, box._xMax),
|
||||
max(_yMax, box._yMax));
|
||||
if (isEmpty() && box.isEmpty()) return Box();
|
||||
return Box(min(_xMin, box._xMin),
|
||||
min(_yMin, box._yMin),
|
||||
max(_xMax, box._xMax),
|
||||
max(_yMax, box._yMax));
|
||||
}
|
||||
|
||||
Box Box::GetIntersection(const Box& box) const
|
||||
Box Box::getIntersection(const Box& box) const
|
||||
// *******************************************
|
||||
{
|
||||
if (!Intersect(box)) return Box();
|
||||
return Box(max(_xMin, box._xMin),
|
||||
max(_yMin, box._yMin),
|
||||
min(_xMax, box._xMax),
|
||||
min(_yMax, box._yMax));
|
||||
if (!intersect(box)) return Box();
|
||||
return Box(max(_xMin, box._xMin),
|
||||
max(_yMin, box._yMin),
|
||||
min(_xMax, box._xMax),
|
||||
min(_yMax, box._yMax));
|
||||
}
|
||||
|
||||
Unit Box::ManhattanDistance(const Point& pt) const
|
||||
Unit Box::manhattanDistance(const Point& pt) const
|
||||
// ***********************************************
|
||||
{
|
||||
Unit dist = 0;
|
||||
if (IsEmpty())
|
||||
throw Error("Can't compute distance to an empty Box");
|
||||
if (pt.GetX() < _xMin) dist = _xMin - pt.GetX();
|
||||
else if (pt.GetX() > _xMax) dist = pt.GetX() - _xMax;
|
||||
// else dist = 0;
|
||||
if (pt.GetY() < _yMin) dist += _yMin - pt.GetY();
|
||||
else if (pt.GetY() > _yMax) dist += pt.GetY() - _yMax;
|
||||
// else dist += 0;
|
||||
return dist;
|
||||
Unit dist = 0;
|
||||
if (isEmpty())
|
||||
throw Error("Can't compute distance to an empty Box");
|
||||
if (pt.getX() < _xMin) dist = _xMin - pt.getX();
|
||||
else if (pt.getX() > _xMax) dist = pt.getX() - _xMax;
|
||||
// else dist = 0;
|
||||
if (pt.getY() < _yMin) dist += _yMin - pt.getY();
|
||||
else if (pt.getY() > _yMax) dist += pt.getY() - _yMax;
|
||||
// else dist += 0;
|
||||
return dist;
|
||||
}
|
||||
|
||||
Unit Box::ManhattanDistance(const Box& box) const
|
||||
Unit Box::manhattanDistance(const Box& box) const
|
||||
// **********************************************
|
||||
{
|
||||
if (IsEmpty() || box.IsEmpty())
|
||||
throw Error("Can't compute distance to an empty Box");
|
||||
Unit dx, dy;
|
||||
if ((dx=box.GetXMin() - _xMax) < 0)
|
||||
if ((dx=_xMin-box.GetXMax()) < 0) dx=0;
|
||||
if ((dy=box.GetYMin() - _yMax) < 0)
|
||||
if ((dy=_yMin-box.GetYMax()) < 0) dy=0;
|
||||
return dx+dy;
|
||||
if (isEmpty() || box.isEmpty())
|
||||
throw Error("Can't compute distance to an empty Box");
|
||||
Unit dx, dy;
|
||||
if ((dx=box.getXMin() - _xMax) < 0)
|
||||
if ((dx=_xMin-box.getXMax()) < 0) dx=0;
|
||||
if ((dy=box.getYMin() - _yMax) < 0)
|
||||
if ((dy=_yMin-box.getYMax()) < 0) dy=0;
|
||||
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() &&
|
||||
(((_xMin == _xMax) && (_yMin < _yMax)) ||
|
||||
((_xMin < _xMax) && (_yMin == _yMax))));
|
||||
return (!isEmpty() &&
|
||||
(((_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() &&
|
||||
(_xMin <= x) &&
|
||||
(_yMin <= y) &&
|
||||
(x <= _xMax) &&
|
||||
(y <= _yMax));
|
||||
return (!isEmpty() &&
|
||||
(_xMin <= x) &&
|
||||
(_yMin <= y) &&
|
||||
(x <= _xMax) &&
|
||||
(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() &&
|
||||
!box.IsEmpty() &&
|
||||
(_xMin <= box._xMin) &&
|
||||
(box._xMax <= _xMax) &&
|
||||
(_yMin <= box._yMin) &&
|
||||
(box._yMax <= _yMax));
|
||||
return (!isEmpty() &&
|
||||
!box.isEmpty() &&
|
||||
(_xMin <= box._xMin) &&
|
||||
(box._xMax <= _xMax) &&
|
||||
(_yMin <= box._yMin) &&
|
||||
(box._yMax <= _yMax));
|
||||
}
|
||||
|
||||
bool Box::Intersect(const Box& box) const
|
||||
bool Box::intersect(const Box& box) const
|
||||
// **************************************
|
||||
{
|
||||
return (!IsEmpty() &&
|
||||
!box.IsEmpty() &&
|
||||
!((_xMax < box._xMin) ||
|
||||
(box._xMax < _xMin) ||
|
||||
(_yMax < box._yMin) ||
|
||||
(box._yMax < _yMin)));
|
||||
return (!isEmpty() &&
|
||||
!box.isEmpty() &&
|
||||
!((_xMax < box._xMin) ||
|
||||
(box._xMax < _xMin) ||
|
||||
(_yMax < box._yMin) ||
|
||||
(box._yMax < _yMin)));
|
||||
}
|
||||
|
||||
bool Box::IsConstrainedBy(const Box& box) const
|
||||
bool Box::isConstrainedBy(const Box& box) const
|
||||
// ********************************************
|
||||
{
|
||||
return (!IsEmpty() &&
|
||||
!box.IsEmpty() &&
|
||||
((_xMin == box.GetXMin()) ||
|
||||
(_yMin == box.GetYMin()) ||
|
||||
(_xMax == box.GetXMax()) ||
|
||||
(_yMax == box.GetYMax())));
|
||||
return (!isEmpty() &&
|
||||
!box.isEmpty() &&
|
||||
((_xMin == box.getXMin()) ||
|
||||
(_yMin == box.getYMin()) ||
|
||||
(_xMax == box.getXMax()) ||
|
||||
(_yMax == box.getYMax())));
|
||||
}
|
||||
|
||||
Box& Box::MakeEmpty()
|
||||
Box& Box::makeEmpty()
|
||||
// ******************
|
||||
{
|
||||
_xMin = 1;
|
||||
_yMin = 1;
|
||||
_xMax = -1;
|
||||
_yMax = -1;
|
||||
return *this;
|
||||
_xMin = 1;
|
||||
_yMin = 1;
|
||||
_xMax = -1;
|
||||
_yMax = -1;
|
||||
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()) {
|
||||
_xMin -= dxMin;
|
||||
_yMin -= dyMin;
|
||||
_xMax += dxMax;
|
||||
_yMax += dyMax;
|
||||
}
|
||||
return *this;
|
||||
if (!isEmpty()) {
|
||||
_xMin -= dxMin;
|
||||
_yMin -= dyMin;
|
||||
_xMax += dxMax;
|
||||
_yMax += dyMax;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Box& Box::ShrinkByFactor(double factor)
|
||||
Box& Box::shrinkByFactor(double factor)
|
||||
// **************************************
|
||||
{
|
||||
assert((0 <= factor) && (factor <= 1));
|
||||
Unit dx=GetUnit(0.5*(1- factor) * (GetValue(_xMax) - GetValue(_xMin)));
|
||||
Unit dy=GetUnit(0.5*(1- factor) * (GetValue(_yMax) - GetValue(_yMin)));
|
||||
return Inflate(-dx, -dy);
|
||||
assert((0 <= factor) && (factor <= 1));
|
||||
Unit dx=GetUnit(0.5*(1- factor) * (GetValue(_xMax) - GetValue(_xMin)));
|
||||
Unit dy=GetUnit(0.5*(1- factor) * (GetValue(_yMax) - GetValue(_yMin)));
|
||||
return inflate(-dx, -dy);
|
||||
}
|
||||
|
||||
Box& Box::Merge(const Unit& x, const Unit& y)
|
||||
Box& Box::merge(const Unit& x, const Unit& y)
|
||||
// ******************************************
|
||||
{
|
||||
if (IsEmpty()) {
|
||||
_xMin = x;
|
||||
_yMin = y;
|
||||
_xMax = x;
|
||||
_yMax = y;
|
||||
}
|
||||
else {
|
||||
_xMin = min(_xMin, x);
|
||||
_yMin = min(_yMin, y);
|
||||
_xMax = max(_xMax, x);
|
||||
_yMax = max(_yMax, y);
|
||||
}
|
||||
return *this;
|
||||
if (isEmpty()) {
|
||||
_xMin = x;
|
||||
_yMin = y;
|
||||
_xMax = x;
|
||||
_yMax = y;
|
||||
}
|
||||
else {
|
||||
_xMin = min(_xMin, x);
|
||||
_yMin = min(_yMin, y);
|
||||
_xMax = max(_xMax, x);
|
||||
_yMax = max(_yMax, y);
|
||||
}
|
||||
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(x2, y2);
|
||||
return *this;
|
||||
merge(x1, y1);
|
||||
merge(x2, y2);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Box& Box::Merge(const Box& box)
|
||||
Box& Box::merge(const Box& box)
|
||||
// ****************************
|
||||
{
|
||||
if (!box.IsEmpty()) {
|
||||
Merge(box.GetXMin(), box.GetYMin());
|
||||
Merge(box.GetXMax(), box.GetYMax());
|
||||
}
|
||||
return *this;
|
||||
if (!box.isEmpty()) {
|
||||
merge(box.getXMin(), box.getYMin());
|
||||
merge(box.getXMax(), box.getYMax());
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Box& Box::Translate(const Unit& dx, const Unit& dy)
|
||||
Box& Box::translate(const Unit& dx, const Unit& dy)
|
||||
// ************************************************
|
||||
{
|
||||
if (!IsEmpty()) {
|
||||
_xMin += dx;
|
||||
_yMin += dy;
|
||||
_xMax += dx;
|
||||
_yMax += dy;
|
||||
}
|
||||
return *this;
|
||||
if (!isEmpty()) {
|
||||
_xMin += dx;
|
||||
_yMin += dy;
|
||||
_xMax += dx;
|
||||
_yMax += dy;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
string Box::_GetString() const
|
||||
// ***************************
|
||||
{
|
||||
if (IsEmpty())
|
||||
return "<" + _TName("Box") + " empty>";
|
||||
else
|
||||
return "<" + _TName("Box") + " " +
|
||||
GetValueString(_xMin) + " " + GetValueString(_yMin) + " " +
|
||||
GetValueString(_xMax) + " " + GetValueString(_yMax) +
|
||||
">";
|
||||
if (isEmpty())
|
||||
return "<" + _TName("Box") + " empty>";
|
||||
else
|
||||
return "<" + _TName("Box") + " " +
|
||||
GetValueString(_xMin) + " " + GetValueString(_yMin) + " " +
|
||||
GetValueString(_xMax) + " " + GetValueString(_yMax) +
|
||||
">";
|
||||
}
|
||||
|
||||
Record* Box::_GetRecord() const
|
||||
// **********************
|
||||
{
|
||||
if (IsEmpty()) return NULL;
|
||||
if (isEmpty()) return NULL;
|
||||
|
||||
Record* record = new Record(GetString(this));
|
||||
record->Add(GetSlot("XMin", &_xMin));
|
||||
record->Add(GetSlot("YMin", &_yMin));
|
||||
record->Add(GetSlot("XMax", &_xMax));
|
||||
record->Add(GetSlot("YMax", &_yMax));
|
||||
return record;
|
||||
Record* record = new Record(GetString(this));
|
||||
record->Add(GetSlot("XMin", &_xMin));
|
||||
record->Add(GetSlot("YMin", &_yMin));
|
||||
record->Add(GetSlot("XMax", &_xMax));
|
||||
record->Add(GetSlot("YMax", &_yMax));
|
||||
return record;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -24,92 +24,94 @@ class Box {
|
|||
// Attributes
|
||||
// **********
|
||||
|
||||
private: Unit _xMin;
|
||||
private: Unit _yMin;
|
||||
private: Unit _xMax;
|
||||
private: Unit _yMax;
|
||||
|
||||
private: Unit _xMin;
|
||||
private: Unit _yMin;
|
||||
private: Unit _xMax;
|
||||
private: Unit _yMax;
|
||||
|
||||
// constructors
|
||||
// ************
|
||||
|
||||
public: Box();
|
||||
public: Box();
|
||||
|
||||
public: Box(const Unit& x, const Unit& y);
|
||||
public: Box(const Point& point);
|
||||
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 Unit& x, const Unit& y);
|
||||
public: Box(const Point& point);
|
||||
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 Box& box);
|
||||
public: Box(const Box& box);
|
||||
|
||||
// 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
|
||||
// *********
|
||||
|
||||
public: const Unit& GetXMin() const {return _xMin;};
|
||||
public: const Unit& GetYMin() const {return _yMin;};
|
||||
public: const Unit& GetXMax() const {return _xMax;};
|
||||
public: const Unit& GetYMax() const {return _yMax;};
|
||||
public: const Unit& getXMin() const {return _xMin;};
|
||||
public: const Unit& getYMin() const {return _yMin;};
|
||||
public: const Unit& getXMax() const {return _xMax;};
|
||||
public: const Unit& getYMax() const {return _yMax;};
|
||||
|
||||
public: Unit GetXCenter() const {return ((_xMin + _xMax) / 2);};
|
||||
public: Unit GetYCenter() const {return ((_yMin + _yMax) / 2);};
|
||||
public: Point GetCenter() const {return Point(GetXCenter(), GetYCenter());};
|
||||
public: Unit getXCenter() const {return ((_xMin + _xMax) / 2);};
|
||||
public: Unit getYCenter() const {return ((_yMin + _yMax) / 2);};
|
||||
public: Point getCenter() const {return Point(getXCenter(), getYCenter());};
|
||||
|
||||
public: Unit GetWidth() const {return (_xMax - _xMin);};
|
||||
public: Unit GetHalfWidth() const {return (GetWidth() / 2);};
|
||||
public: Unit GetHeight() const {return (_yMax - _yMin);};
|
||||
public: Unit GetHalfHeight() const {return (GetHeight() / 2);};
|
||||
public: Unit getWidth() const {return (_xMax - _xMin);};
|
||||
public: Unit getHalfWidth() const {return (getWidth() / 2);};
|
||||
public: Unit getHeight() const {return (_yMax - _yMin);};
|
||||
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: Unit ManhattanDistance(const Point& pt) const;
|
||||
public: Unit ManhattanDistance(const Box& box) const;
|
||||
public: Box getIntersection(const Box& box) const;
|
||||
public: Unit manhattanDistance(const Point& pt) const;
|
||||
public: Unit manhattanDistance(const Box& box) const;
|
||||
|
||||
// Predicates
|
||||
// **********
|
||||
|
||||
public: bool IsEmpty() const;
|
||||
public: bool IsFlat() const;
|
||||
public: bool IsPonctual() const;
|
||||
public: bool isEmpty() const;
|
||||
public: bool isFlat() const;
|
||||
public: bool isPonctual() const;
|
||||
|
||||
public: bool Contains(const Unit& x, const Unit& y) const;
|
||||
public: bool Contains(const Point& point) const;
|
||||
public: bool Contains(const Box& box) const;
|
||||
public: bool contains(const Unit& x, const Unit& y) const;
|
||||
public: bool contains(const Point& point) 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
|
||||
// ********
|
||||
|
||||
public: Box& MakeEmpty();
|
||||
public: Box& makeEmpty();
|
||||
|
||||
public: Box& Inflate(const Unit& d);
|
||||
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& ShrinkByFactor(double factor); // 0 <= factor <= 1
|
||||
public: Box& inflate(const Unit& d);
|
||||
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& shrinkByFactor(double factor); // 0 <= factor <= 1
|
||||
|
||||
public: Box& Merge(const Unit& x, const Unit& y);
|
||||
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 Box& box);
|
||||
public: Box& merge(const Unit& x, const Unit& y);
|
||||
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 Box& box);
|
||||
|
||||
public: Box& Translate(const Unit& dx, const Unit& dy);
|
||||
public: Box& translate(const Unit& dx, const Unit& dy);
|
||||
|
||||
// Others
|
||||
// ******
|
||||
|
||||
|
||||
public: string _GetTypeName() const { return _TName("Box"); };
|
||||
public: string _GetString() const;
|
||||
public: Record* _GetRecord() const;
|
||||
public: string _GetString() const;
|
||||
public: Record* _GetRecord() const;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -27,58 +27,58 @@ namespace Hurricane {
|
|||
|
||||
Cell::Cell(Library* library, const Name& name)
|
||||
// *******************************************
|
||||
: Inherit(),
|
||||
_library(library),
|
||||
_name(name),
|
||||
_instanceMap(),
|
||||
_quadTree(),
|
||||
_slaveInstanceSet(),
|
||||
_netMap(),
|
||||
_sliceMap(),
|
||||
_markerSet(),
|
||||
//_viewSet(),
|
||||
_abutmentBox(),
|
||||
_boundingBox(),
|
||||
_isTerminal(true),
|
||||
_isPad(false),
|
||||
_nextOfLibraryCellMap(NULL),
|
||||
_nextOfSymbolCellSet(NULL),
|
||||
: Inherit(),
|
||||
_library(library),
|
||||
_name(name),
|
||||
_instanceMap(),
|
||||
_quadTree(),
|
||||
_slaveInstanceSet(),
|
||||
_netMap(),
|
||||
_sliceMap(),
|
||||
_markerSet(),
|
||||
//_viewSet(),
|
||||
_abutmentBox(),
|
||||
_boundingBox(),
|
||||
_isTerminal(true),
|
||||
_isPad(false),
|
||||
_nextOfLibraryCellMap(NULL),
|
||||
_nextOfSymbolCellSet(NULL),
|
||||
_slaveEntityMap()
|
||||
{
|
||||
if (!_library)
|
||||
throw Error("Can't create " + _TName("Cell") + " : null library");
|
||||
if (!_library)
|
||||
throw Error("Can't create " + _TName("Cell") + " : null library");
|
||||
|
||||
if (name.IsEmpty())
|
||||
throw Error("Can't create " + _TName("Cell") + " : empty name");
|
||||
if (name.IsEmpty())
|
||||
throw Error("Can't create " + _TName("Cell") + " : empty name");
|
||||
|
||||
if (_library->GetCell(_name))
|
||||
throw Error("Can't create " + _TName("Cell") + " : already exists");
|
||||
if (_library->GetCell(_name))
|
||||
throw Error("Can't create " + _TName("Cell") + " : already exists");
|
||||
}
|
||||
|
||||
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
|
||||
// *****************************
|
||||
{
|
||||
if (_boundingBox.IsEmpty()) {
|
||||
Box& boundingBox = (Box&)_boundingBox;
|
||||
boundingBox = _abutmentBox;
|
||||
boundingBox.Merge(_quadTree.GetBoundingBox());
|
||||
for_each_slice(slice, GetSlices()) {
|
||||
boundingBox.Merge(slice->GetBoundingBox());
|
||||
end_for;
|
||||
}
|
||||
}
|
||||
|
||||
return _boundingBox;
|
||||
if (_boundingBox.isEmpty()) {
|
||||
Box& boundingBox = (Box&)_boundingBox;
|
||||
boundingBox = _abutmentBox;
|
||||
boundingBox.merge(_quadTree.GetBoundingBox());
|
||||
for_each_slice(slice, GetSlices()) {
|
||||
boundingBox.merge(slice->GetBoundingBox());
|
||||
end_for;
|
||||
}
|
||||
}
|
||||
|
||||
return _boundingBox;
|
||||
}
|
||||
|
||||
bool Cell::IsLeaf() const
|
||||
|
@ -90,41 +90,41 @@ bool Cell::IsLeaf() const
|
|||
bool Cell::IsCalledBy(Cell* cell) const
|
||||
// ************************************
|
||||
{
|
||||
for_each_instance(instance, cell->GetInstances()) {
|
||||
Cell* masterCell = instance->GetMasterCell();
|
||||
if (masterCell == this) return true;
|
||||
if (IsCalledBy(masterCell)) return true;
|
||||
end_for;
|
||||
}
|
||||
return false;
|
||||
for_each_instance(instance, cell->GetInstances()) {
|
||||
Cell* masterCell = instance->GetMasterCell();
|
||||
if (masterCell == this) return true;
|
||||
if (IsCalledBy(masterCell)) return true;
|
||||
end_for;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Cell::SetName(const Name& name)
|
||||
// *********************************
|
||||
{
|
||||
if (name != _name) {
|
||||
if (name.IsEmpty())
|
||||
throw Error("Can't change " + _TName("Cell") + " name : empty name");
|
||||
if (name != _name) {
|
||||
if (name.IsEmpty())
|
||||
throw Error("Can't change " + _TName("Cell") + " name : empty name");
|
||||
|
||||
if (_library->GetCell(name))
|
||||
throw Error("Can't change " + _TName("Cell") + " name : already exists");
|
||||
if (_library->GetCell(name))
|
||||
throw Error("Can't change " + _TName("Cell") + " name : already exists");
|
||||
|
||||
_library->_GetCellMap()._Remove(this);
|
||||
_name = name;
|
||||
_library->_GetCellMap()._Insert(this);
|
||||
}
|
||||
_library->_GetCellMap()._Remove(this);
|
||||
_name = name;
|
||||
_library->_GetCellMap()._Insert(this);
|
||||
}
|
||||
}
|
||||
|
||||
void Cell::SetAbutmentBox(const Box& abutmentBox)
|
||||
// **********************************************
|
||||
{
|
||||
if (abutmentBox != _abutmentBox) {
|
||||
if (!_abutmentBox.IsEmpty() &&
|
||||
(abutmentBox.IsEmpty() || !abutmentBox.Contains(_abutmentBox)))
|
||||
_Unfit(_abutmentBox);
|
||||
_abutmentBox = abutmentBox;
|
||||
_Fit(_abutmentBox);
|
||||
}
|
||||
if (abutmentBox != _abutmentBox) {
|
||||
if (!_abutmentBox.isEmpty() &&
|
||||
(abutmentBox.isEmpty() || !abutmentBox.contains(_abutmentBox)))
|
||||
_Unfit(_abutmentBox);
|
||||
_abutmentBox = abutmentBox;
|
||||
_Fit(_abutmentBox);
|
||||
}
|
||||
}
|
||||
|
||||
void Cell::FlattenNets(bool buildRings)
|
||||
|
@ -199,102 +199,102 @@ void Cell::FlattenNets(bool buildRings)
|
|||
void Cell::Materialize()
|
||||
// *********************
|
||||
{
|
||||
for_each_instance(instance, GetInstances()) instance->Materialize(); end_for;
|
||||
for_each_net(net, GetNets()) net->Materialize(); end_for;
|
||||
for_each_marker(marker, GetMarkers()) marker->Materialize(); end_for;
|
||||
for_each_instance(instance, GetInstances()) instance->Materialize(); end_for;
|
||||
for_each_net(net, GetNets()) net->Materialize(); end_for;
|
||||
for_each_marker(marker, GetMarkers()) marker->Materialize(); end_for;
|
||||
}
|
||||
|
||||
void Cell::Unmaterialize()
|
||||
// ***********************
|
||||
{
|
||||
for_each_instance(instance, GetInstances()) instance->Unmaterialize(); end_for;
|
||||
for_each_net(net, GetNets()) net->Unmaterialize(); end_for;
|
||||
for_each_marker(marker, GetMarkers()) marker->Unmaterialize(); end_for;
|
||||
for_each_instance(instance, GetInstances()) instance->Unmaterialize(); end_for;
|
||||
for_each_net(net, GetNets()) net->Unmaterialize(); end_for;
|
||||
for_each_marker(marker, GetMarkers()) marker->Unmaterialize(); end_for;
|
||||
}
|
||||
|
||||
void Cell::_PostCreate()
|
||||
// *********************
|
||||
{
|
||||
_library->_GetCellMap()._Insert(this);
|
||||
_library->_GetCellMap()._Insert(this);
|
||||
|
||||
Inherit::_PostCreate();
|
||||
Inherit::_PostCreate();
|
||||
}
|
||||
|
||||
void Cell::_PreDelete()
|
||||
// ********************
|
||||
{
|
||||
Inherit::_PreDelete();
|
||||
Inherit::_PreDelete();
|
||||
|
||||
while(_slaveEntityMap.size()) {
|
||||
_slaveEntityMap.begin()->second->Delete();
|
||||
}
|
||||
|
||||
//for_each_view(view, GetViews()) view->SetCell(NULL); end_for;
|
||||
for_each_marker(marker, GetMarkers()) marker->Delete(); end_for;
|
||||
for_each_instance(slaveInstance, GetSlaveInstances()) slaveInstance->Delete(); end_for;
|
||||
for_each_instance(instance, GetInstances()) instance->Delete(); end_for;
|
||||
for_each_net(net, GetNets()) net->Delete(); end_for;
|
||||
for_each_slice(slice, GetSlices()) slice->_Delete(); end_for;
|
||||
//for_each_view(view, GetViews()) view->SetCell(NULL); end_for;
|
||||
for_each_marker(marker, GetMarkers()) marker->Delete(); end_for;
|
||||
for_each_instance(slaveInstance, GetSlaveInstances()) slaveInstance->Delete(); end_for;
|
||||
for_each_instance(instance, GetInstances()) instance->Delete(); end_for;
|
||||
for_each_net(net, GetNets()) net->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 s = Inherit::_GetString();
|
||||
s.insert(s.length() - 1, " " + GetString(_name));
|
||||
return s;
|
||||
string s = Inherit::_GetString();
|
||||
s.insert(s.length() - 1, " " + GetString(_name));
|
||||
return s;
|
||||
}
|
||||
|
||||
Record* Cell::_GetRecord() const
|
||||
// ***********************
|
||||
{
|
||||
Record* record = Inherit::_GetRecord();
|
||||
if (record) {
|
||||
record->Add(GetSlot("Library", _library));
|
||||
record->Add(GetSlot("Name", &_name));
|
||||
record->Add(GetSlot("Instances", &_instanceMap));
|
||||
record->Add(GetSlot("QuadTree", &_quadTree));
|
||||
record->Add(GetSlot("SlaveInstances", &_slaveInstanceSet));
|
||||
record->Add(GetSlot("Nets", &_netMap));
|
||||
record->Add(GetSlot("Pins", &_pinMap));
|
||||
record->Add(GetSlot("Slices", &_sliceMap));
|
||||
record->Add(GetSlot("Markers", &_markerSet));
|
||||
//record->Add(GetSlot("Views", &_viewSet));
|
||||
record->Add(GetSlot("AbutmentBox", &_abutmentBox));
|
||||
record->Add(GetSlot("BoundingBox", &_boundingBox));
|
||||
record->Add(GetSlot("IsTerminal", &_isTerminal));
|
||||
record->Add(GetSlot("IsFlattenLeaf", &_isFlattenLeaf));
|
||||
//record->Add(GetSlot("Symbol", _symbol));
|
||||
}
|
||||
return record;
|
||||
Record* record = Inherit::_GetRecord();
|
||||
if (record) {
|
||||
record->Add(GetSlot("Library", _library));
|
||||
record->Add(GetSlot("Name", &_name));
|
||||
record->Add(GetSlot("Instances", &_instanceMap));
|
||||
record->Add(GetSlot("QuadTree", &_quadTree));
|
||||
record->Add(GetSlot("SlaveInstances", &_slaveInstanceSet));
|
||||
record->Add(GetSlot("Nets", &_netMap));
|
||||
record->Add(GetSlot("Pins", &_pinMap));
|
||||
record->Add(GetSlot("Slices", &_sliceMap));
|
||||
record->Add(GetSlot("Markers", &_markerSet));
|
||||
//record->Add(GetSlot("Views", &_viewSet));
|
||||
record->Add(GetSlot("AbutmentBox", &_abutmentBox));
|
||||
record->Add(GetSlot("BoundingBox", &_boundingBox));
|
||||
record->Add(GetSlot("IsTerminal", &_isTerminal));
|
||||
record->Add(GetSlot("IsFlattenLeaf", &_isFlattenLeaf));
|
||||
//record->Add(GetSlot("Symbol", _symbol));
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
void Cell::_Fit(const Box& box)
|
||||
// ****************************
|
||||
{
|
||||
if (box.IsEmpty()) return;
|
||||
if (_boundingBox.IsEmpty()) return;
|
||||
if (_boundingBox.Contains(box)) return;
|
||||
_boundingBox.Merge(box);
|
||||
for_each_instance(instance, GetSlaveInstances()) {
|
||||
instance->GetCell()->_Fit(instance->GetTransformation().GetBox(box));
|
||||
end_for;
|
||||
}
|
||||
if (box.isEmpty()) return;
|
||||
if (_boundingBox.isEmpty()) return;
|
||||
if (_boundingBox.contains(box)) return;
|
||||
_boundingBox.merge(box);
|
||||
for_each_instance(instance, GetSlaveInstances()) {
|
||||
instance->GetCell()->_Fit(instance->GetTransformation().GetBox(box));
|
||||
end_for;
|
||||
}
|
||||
}
|
||||
|
||||
void Cell::_Unfit(const Box& box)
|
||||
// ******************************
|
||||
{
|
||||
if (box.IsEmpty()) return;
|
||||
if (_boundingBox.IsEmpty()) return;
|
||||
if (!_boundingBox.IsConstrainedBy(box)) return;
|
||||
_boundingBox.MakeEmpty();
|
||||
for_each_instance(instance, GetSlaveInstances()) {
|
||||
instance->GetCell()->_Unfit(instance->GetTransformation().GetBox(box));
|
||||
end_for;
|
||||
}
|
||||
if (box.isEmpty()) return;
|
||||
if (_boundingBox.isEmpty()) return;
|
||||
if (!_boundingBox.isConstrainedBy(box)) return;
|
||||
_boundingBox.makeEmpty();
|
||||
for_each_instance(instance, GetSlaveInstances()) {
|
||||
instance->GetCell()->_Unfit(instance->GetTransformation().GetBox(box));
|
||||
end_for;
|
||||
}
|
||||
}
|
||||
|
||||
void Cell::_AddSlaveEntity(Entity* entity, Entity* slaveEntity)
|
||||
|
@ -339,52 +339,52 @@ void Cell::_GetSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, Sl
|
|||
//// *************************************
|
||||
//{
|
||||
// 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 (100 < ((double)view->GetScreenSize(_boundingBox.GetWidth()) *
|
||||
//// (double)view->GetScreenSize(_boundingBox.GetHeight())));
|
||||
// //return (1 < (double)view->GetScreenSize(_boundingBox.GetHeight()));
|
||||
//// return (100 < ((double)view->GetScreenSize(_boundingBox.GetWidth()) *
|
||||
//// (double)view->GetScreenSize(_boundingBox.GetHeight())));
|
||||
//}
|
||||
//
|
||||
//bool Cell::_ContentIsDrawable(View* view) const
|
||||
//// ********************************************
|
||||
//{
|
||||
// if (IsTerminal()) return false;
|
||||
// if (IsTerminal()) return false;
|
||||
//
|
||||
// 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 (400 < ((double)view->GetScreenSize(_boundingBox.GetWidth()) *
|
||||
//// (double)view->GetScreenSize(_boundingBox.GetHeight())));
|
||||
// //return (40 < (double)view->GetScreenSize(_boundingBox.GetHeight()));
|
||||
//// return (400 < ((double)view->GetScreenSize(_boundingBox.GetWidth()) *
|
||||
//// (double)view->GetScreenSize(_boundingBox.GetHeight())));
|
||||
//}
|
||||
//
|
||||
//void Cell::_DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation)
|
||||
//// **********************************************************************************************
|
||||
//{
|
||||
//// if (_IsDrawable(view)) { // To avoid irregular display of instances phantoms
|
||||
//// if (!_ContentIsDrawable(view))
|
||||
//// view->FillRectangle(transformation.GetBox(GetAbutmentBox()));
|
||||
//// else {
|
||||
//// if (_IsDrawable(view)) { // To avoid irregular display of instances phantoms
|
||||
//// if (!_ContentIsDrawable(view))
|
||||
//// view->FillRectangle(transformation.GetBox(GetAbutmentBox()));
|
||||
//// else {
|
||||
//// for_each_instance(instance, GetInstancesUnder(updateArea)) {
|
||||
//// instance->_DrawPhantoms(view, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//}
|
||||
//
|
||||
//void Cell::_DrawBoundaries(View* view, const Box& updateArea, const Transformation& transformation)
|
||||
//// ************************************************************************************************
|
||||
//{
|
||||
// // if (_IsDrawable(view)) { // To avoid irregular display of instances phantoms
|
||||
// // view->DrawRectangle(transformation.GetBox(GetAbutmentBox()));
|
||||
// // if (_ContentIsDrawable(view)) {
|
||||
// // view->DrawRectangle(transformation.GetBox(GetAbutmentBox()));
|
||||
// // if (_ContentIsDrawable(view)) {
|
||||
// // for_each_instance(instance, GetInstancesUnder(updateArea)) {
|
||||
// // instance->_DrawBoundaries(view, updateArea, transformation);
|
||||
// // 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)
|
||||
//// ****************************************************************************************************
|
||||
//{
|
||||
//// if (_IsDrawable(view)) {
|
||||
//// if (_ContentIsDrawable(view)) {
|
||||
//// view->CheckForDisplayInterruption();
|
||||
//// if (_IsDrawable(view)) {
|
||||
//// if (_ContentIsDrawable(view)) {
|
||||
//// view->CheckForDisplayInterruption();
|
||||
//// for_each_instance(instance, GetInstancesUnder(updateArea)) {
|
||||
//// instance->_Draw(view, basicLayer, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// for_each_slice(slice, GetSlices()) {
|
||||
//// slice->_Draw(view, basicLayer, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//// for_each_slice(slice, GetSlices()) {
|
||||
//// slice->_Draw(view, basicLayer, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//}
|
||||
//
|
||||
//void Cell::_DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation)
|
||||
//// *********************************************************************************************
|
||||
//{
|
||||
//// if (_IsDrawable(view)) {
|
||||
//// if (_ContentIsDrawable(view)) {
|
||||
//// if (_IsDrawable(view)) {
|
||||
//// if (_ContentIsDrawable(view)) {
|
||||
//// for_each_instance(instance, GetInstancesUnder(updateArea)) {
|
||||
//// instance->_DrawRubbers(view, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// for_each_rubber(rubber, GetRubbersUnder(updateArea)) {
|
||||
//// rubber->_Draw(view, NULL, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//// for_each_rubber(rubber, GetRubbersUnder(updateArea)) {
|
||||
//// rubber->_Draw(view, NULL, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//}
|
||||
//
|
||||
//void Cell::_DrawMarkers(View* view, const Box& updateArea, const Transformation& transformation)
|
||||
//// *********************************************************************************************
|
||||
//{
|
||||
//// if (_IsDrawable(view)) {
|
||||
//// if (_ContentIsDrawable(view)) {
|
||||
//// if (_IsDrawable(view)) {
|
||||
//// if (_ContentIsDrawable(view)) {
|
||||
//// for_each_instance(instance, GetInstancesUnder(updateArea)) {
|
||||
//// instance->_DrawMarkers(view, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// for_each_marker(marker, GetMarkersUnder(updateArea)) {
|
||||
//// marker->_Draw(view, NULL, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//// for_each_marker(marker, GetMarkersUnder(updateArea)) {
|
||||
//// marker->_Draw(view, NULL, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//}
|
||||
//
|
||||
//void Cell::_DrawDisplaySlots(View* view, const Box& area, const Box& updateArea, const Transformation& transformation)
|
||||
//// ********************************************************************************************************************
|
||||
//{
|
||||
//// if (_IsDrawable(view)) {
|
||||
//// if (_ContentIsDrawable(view)) {
|
||||
//// if (_IsDrawable(view)) {
|
||||
//// if (_ContentIsDrawable(view)) {
|
||||
//// for_each_instance(instance, GetInstancesUnder(updateArea)) {
|
||||
//// instance->_DrawDisplaySlots(view, area, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// for_each_display_slot(displaySlot, GetDisplaySlots(this)) {
|
||||
//// view->_DrawDisplaySlot(displaySlot, area, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// for_each_display_slot(displaySlot, GetDisplaySlots(this)) {
|
||||
//// view->_DrawDisplaySlot(displaySlot, area, updateArea, transformation);
|
||||
//// end_for;
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//// }
|
||||
//}
|
||||
//
|
||||
// ****************************************************************************************************
|
||||
|
@ -468,32 +468,32 @@ void Cell::_GetSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, Sl
|
|||
|
||||
Cell::InstanceMap::InstanceMap()
|
||||
// *****************************
|
||||
: Inherit()
|
||||
: Inherit()
|
||||
{
|
||||
}
|
||||
|
||||
Name Cell::InstanceMap::_GetKey(Instance* instance) const
|
||||
// ******************************************************
|
||||
{
|
||||
return instance->GetName();
|
||||
return instance->GetName();
|
||||
}
|
||||
|
||||
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
|
||||
// *******************************************************************
|
||||
{
|
||||
return instance->_GetNextOfCellInstanceMap();
|
||||
return instance->_GetNextOfCellInstanceMap();
|
||||
}
|
||||
|
||||
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()
|
||||
// ***************************************
|
||||
: Inherit()
|
||||
: Inherit()
|
||||
{
|
||||
}
|
||||
|
||||
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
|
||||
// *****************************************************************************
|
||||
{
|
||||
return slaveInstance->_GetNextOfCellSlaveInstanceSet();
|
||||
return slaveInstance->_GetNextOfCellSlaveInstanceSet();
|
||||
}
|
||||
|
||||
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()
|
||||
// *******************
|
||||
: Inherit()
|
||||
: Inherit()
|
||||
{
|
||||
}
|
||||
|
||||
Name Cell::NetMap::_GetKey(Net* net) const
|
||||
// ***************************************
|
||||
{
|
||||
return net->GetName();
|
||||
return net->GetName();
|
||||
}
|
||||
|
||||
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
|
||||
// ***********************************************
|
||||
{
|
||||
return net->_GetNextOfCellNetMap();
|
||||
return net->_GetNextOfCellNetMap();
|
||||
}
|
||||
|
||||
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()
|
||||
// *******************
|
||||
: Inherit()
|
||||
: Inherit()
|
||||
{
|
||||
}
|
||||
|
||||
Name Cell::PinMap::_GetKey(Pin* pin) const
|
||||
// ***************************************
|
||||
{
|
||||
return pin->GetName();
|
||||
return pin->GetName();
|
||||
}
|
||||
|
||||
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
|
||||
// ***********************************************
|
||||
{
|
||||
return pin->_GetNextOfCellPinMap();
|
||||
return pin->_GetNextOfCellPinMap();
|
||||
}
|
||||
|
||||
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()
|
||||
// ***********************
|
||||
: Inherit()
|
||||
: Inherit()
|
||||
{
|
||||
}
|
||||
|
||||
const Layer* Cell::SliceMap::_GetKey(Slice* slice) const
|
||||
// *****************************************************
|
||||
{
|
||||
return slice->GetLayer();
|
||||
return slice->GetLayer();
|
||||
}
|
||||
|
||||
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
|
||||
// *******************************************************
|
||||
{
|
||||
return slice->_GetNextOfCellSliceMap();
|
||||
return slice->_GetNextOfCellSliceMap();
|
||||
}
|
||||
|
||||
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()
|
||||
// *************************
|
||||
: Inherit()
|
||||
: Inherit()
|
||||
{
|
||||
}
|
||||
|
||||
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
|
||||
// ***********************************************************
|
||||
{
|
||||
return marker->_GetNextOfCellMarkerSet();
|
||||
return marker->_GetNextOfCellMarkerSet();
|
||||
}
|
||||
|
||||
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()
|
||||
//// *********************
|
||||
//: Inherit()
|
||||
//: Inherit()
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//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
|
||||
//// ***************************************************
|
||||
//{
|
||||
// return view->_GetNextOfCellViewSet();
|
||||
// return view->_GetNextOfCellViewSet();
|
||||
//}
|
||||
//
|
||||
//void Cell::ViewSet::_SetNextElement(View* view, View* nextView) const
|
||||
//// ******************************************************************
|
||||
//{
|
||||
// view->_SetNextOfCellViewSet(nextView);
|
||||
// view->_SetNextOfCellViewSet(nextView);
|
||||
//}
|
||||
//
|
||||
//
|
||||
|
|
|
@ -1272,14 +1272,14 @@ Rubbers Cell::GetRubbers() 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));
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -1793,7 +1793,7 @@ Cell_ComponentsUnder::Locator::Locator(const Cell* cell, const Box& area, const
|
|||
_componentLocator(),
|
||||
_component(NULL)
|
||||
{
|
||||
if (_cell && !_area.IsEmpty()) {
|
||||
if (_cell && !_area.isEmpty()) {
|
||||
_sliceLocator = _cell->GetSlices(_mask).GetLocator();
|
||||
while (!_component && _sliceLocator.IsValid()) {
|
||||
Slice* slice = _sliceLocator.GetElement();
|
||||
|
@ -2260,7 +2260,7 @@ Cell_OccurrencesUnder::Locator::Locator(const Cell* cell, const Box& area, unsig
|
|||
_instanceLocator(),
|
||||
_occurrenceLocator()
|
||||
{
|
||||
if (_cell && !_area.IsEmpty()) {
|
||||
if (_cell && !_area.isEmpty()) {
|
||||
_componentLocator = _cell->GetComponentsUnder(_area).GetLocator();
|
||||
if (_componentLocator.IsValid())
|
||||
_state = 1;
|
||||
|
@ -2718,7 +2718,7 @@ Cell_LeafInstanceOccurrencesUnder::Locator::Locator(const Cell* cell, const Box&
|
|||
_nonLeafInstanceLocator(),
|
||||
_occurrenceLocator()
|
||||
{
|
||||
if (_cell && !_area.IsEmpty()) {
|
||||
if (_cell && !_area.isEmpty()) {
|
||||
_leafInstanceLocator = _cell->GetLeafInstancesUnder(_area).GetLocator();
|
||||
if (_leafInstanceLocator.IsValid())
|
||||
_state = 1;
|
||||
|
@ -3127,7 +3127,7 @@ Cell_TerminalInstanceOccurrencesUnder::Locator::Locator(const Cell* cell, const
|
|||
_nonTerminalInstanceLocator(),
|
||||
_occurrenceLocator()
|
||||
{
|
||||
if (_cell && !_area.IsEmpty()) {
|
||||
if (_cell && !_area.isEmpty()) {
|
||||
_terminalInstanceLocator = _cell->GetTerminalInstancesUnder(_area).GetLocator();
|
||||
if (_terminalInstanceLocator.IsValid())
|
||||
_state = 1;
|
||||
|
@ -3574,7 +3574,7 @@ Cell_ComponentOccurrencesUnder::Locator::Locator(const Cell* cell, const Box& ar
|
|||
_instanceLocator(),
|
||||
_occurrenceLocator()
|
||||
{
|
||||
if (_cell && !_area.IsEmpty() && (_mask != 0)) {
|
||||
if (_cell && !_area.isEmpty() && (_mask != 0)) {
|
||||
_componentLocator = _cell->GetComponentsUnder(_area, _mask).GetLocator();
|
||||
if (_componentLocator.IsValid())
|
||||
_state = 1;
|
||||
|
|
|
@ -53,7 +53,7 @@ class Component_IsUnderFilter : public Filter<Component*> {
|
|||
public: virtual bool Accept(Component* component) const
|
||||
// ****************************************************
|
||||
{
|
||||
return _area.Intersect(component->GetBoundingBox());
|
||||
return _area.intersect(component->GetBoundingBox());
|
||||
};
|
||||
|
||||
public: virtual string _GetString() const
|
||||
|
@ -490,7 +490,7 @@ void Component::_SetRubber(Rubber* rubber)
|
|||
// Box area(point);
|
||||
// area.Inflate(aperture);
|
||||
// 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;
|
||||
// end_for;
|
||||
// }
|
||||
|
@ -933,7 +933,7 @@ double GetArea ( Component* component )
|
|||
{
|
||||
Box bb = component->GetBoundingBox ();
|
||||
|
||||
return GetValue(bb.GetWidth()) * GetValue(bb.GetHeight());
|
||||
return GetValue(bb.getWidth()) * GetValue(bb.getHeight());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ Point Contact::GetPosition() const
|
|||
// *******************************
|
||||
{
|
||||
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
|
||||
|
@ -180,7 +180,7 @@ Box Contact::GetBoundingBox() const
|
|||
{
|
||||
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
|
||||
|
@ -190,7 +190,7 @@ Box Contact::GetBoundingBox(BasicLayer* basicLayer) const
|
|||
|
||||
Unit size = _GetSize(basicLayer);
|
||||
|
||||
return Box(GetPosition()).Inflate(GetHalfWidth() + size, GetHalfHeight() + size);
|
||||
return Box(GetPosition()).inflate(GetHalfWidth() + size, GetHalfHeight() + size);
|
||||
}
|
||||
|
||||
Component* Contact::GetAnchor() const
|
||||
|
@ -275,7 +275,7 @@ void Contact::SetPosition(const Unit& x, const Unit& y)
|
|||
void Contact::SetPosition(const Point& position)
|
||||
// *********************************************
|
||||
{
|
||||
SetPosition(position.GetX(), position.GetY());
|
||||
SetPosition(position.getX(), position.getY());
|
||||
}
|
||||
|
||||
void Contact::SetDx(const Unit& dx)
|
||||
|
|
|
@ -26,7 +26,7 @@ DRCError::DRCError(Cell* cell, const Name& name, const Box& boundingBox)
|
|||
if (_name.IsEmpty())
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ void DRCError::Translate(const Unit& dx, const Unit& dy)
|
|||
{
|
||||
if ((dx != 0) || (dy != 0)) {
|
||||
Invalidate(false);
|
||||
_boundingBox.Translate(dx, dy);
|
||||
_boundingBox.translate(dx, dy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ Box Horizontal::GetBoundingBox() const
|
|||
Unit size = GetHalfWidth() + _GetSize();
|
||||
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
|
||||
|
@ -75,7 +75,7 @@ Box Horizontal::GetBoundingBox(BasicLayer* basicLayer) const
|
|||
Unit size = GetHalfWidth() + _GetSize(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
|
||||
|
|
|
@ -511,7 +511,7 @@ static bool IsConnex(const Occurrence& componentOccurrence1, const Occurrence& c
|
|||
for_each_basic_layer(basicLayer2, layer2->GetBasicLayers()) {
|
||||
if (basicLayer1->GetExtractMask() & basicLayer2->GetExtractMask()) {
|
||||
Box box2 = transformation2.GetBox(component2->GetBoundingBox(basicLayer2));
|
||||
if (box1.Intersect(box2)) return true;
|
||||
if (box1.intersect(box2)) return true;
|
||||
}
|
||||
end_for;
|
||||
}
|
||||
|
@ -766,7 +766,7 @@ void HyperNet_NetOccurrencesUnder::Locator::Progress()
|
|||
for_each_component(component, net->GetComponents()) {
|
||||
Occurrence occurrence = Occurrence(component, path);
|
||||
Box area = occurrence.GetBoundingBox();
|
||||
if (! area.Intersect (_area)) {
|
||||
if (! area.intersect (_area)) {
|
||||
// Outside useful area
|
||||
} else if (is_a<Plug*>(component)) {
|
||||
// Will be processed below
|
||||
|
@ -774,7 +774,7 @@ void HyperNet_NetOccurrencesUnder::Locator::Progress()
|
|||
// Don't go through the Rubbers (go only trough connecting layers)
|
||||
} else {
|
||||
//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)) {
|
||||
if (is_a<Component*>(occurrence2.GetEntity())) {
|
||||
Component* component2 = (Component*)occurrence2.GetEntity();
|
||||
|
|
|
@ -23,129 +23,129 @@ namespace Hurricane {
|
|||
class Instance_IsUnderFilter : public Filter<Instance*> {
|
||||
// ****************************************************
|
||||
|
||||
public: Box _area;
|
||||
public: Box _area;
|
||||
|
||||
public: Instance_IsUnderFilter(const Box& area)
|
||||
// ********************************************
|
||||
: _area(area)
|
||||
{
|
||||
};
|
||||
public: Instance_IsUnderFilter(const Box& area)
|
||||
// ********************************************
|
||||
: _area(area)
|
||||
{
|
||||
};
|
||||
|
||||
public: Instance_IsUnderFilter(const Instance_IsUnderFilter& filter)
|
||||
// *****************************************************************
|
||||
: _area(filter._area)
|
||||
{
|
||||
};
|
||||
public: Instance_IsUnderFilter(const Instance_IsUnderFilter& filter)
|
||||
// *****************************************************************
|
||||
: _area(filter._area)
|
||||
{
|
||||
};
|
||||
|
||||
public: Instance_IsUnderFilter& operator=(const Instance_IsUnderFilter& filter)
|
||||
// ****************************************************************************
|
||||
{
|
||||
_area = filter._area;
|
||||
return *this;
|
||||
};
|
||||
public: Instance_IsUnderFilter& operator=(const Instance_IsUnderFilter& filter)
|
||||
// ****************************************************************************
|
||||
{
|
||||
_area = filter._area;
|
||||
return *this;
|
||||
};
|
||||
|
||||
public: virtual Filter<Instance*>* GetClone() const
|
||||
// ************************************************
|
||||
{
|
||||
return new Instance_IsUnderFilter(*this);
|
||||
};
|
||||
public: virtual Filter<Instance*>* GetClone() const
|
||||
// ************************************************
|
||||
{
|
||||
return new Instance_IsUnderFilter(*this);
|
||||
};
|
||||
|
||||
public: virtual bool Accept(Instance* instance) const
|
||||
// **************************************************
|
||||
{
|
||||
return _area.Intersect(instance->GetBoundingBox());
|
||||
};
|
||||
public: virtual bool Accept(Instance* instance) const
|
||||
// **************************************************
|
||||
{
|
||||
return _area.intersect(instance->GetBoundingBox());
|
||||
};
|
||||
|
||||
public: virtual string _GetString() const
|
||||
// **************************************
|
||||
{
|
||||
return "<" + _TName("Instance::IsUnderFilter") + " " + GetString(_area) + ">";
|
||||
};
|
||||
public: virtual string _GetString() const
|
||||
// **************************************
|
||||
{
|
||||
return "<" + _TName("Instance::IsUnderFilter") + " " + GetString(_area) + ">";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
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*> {
|
||||
// *******************************************************
|
||||
|
||||
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*> {
|
||||
// *******************************************************
|
||||
|
||||
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*> {
|
||||
// *****************************************************
|
||||
|
||||
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*> {
|
||||
// *****************************************************
|
||||
|
||||
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)
|
||||
// ****************************************************************************************************
|
||||
: Inherit(),
|
||||
_cell(cell),
|
||||
_name(name),
|
||||
_masterCell(masterCell),
|
||||
_transformation(transformation),
|
||||
_placementStatus(placementstatus),
|
||||
_plugMap(),
|
||||
_sharedPathMap(),
|
||||
_nextOfCellInstanceMap(NULL),
|
||||
_nextOfCellSlaveInstanceSet(NULL)
|
||||
: Inherit(),
|
||||
_cell(cell),
|
||||
_name(name),
|
||||
_masterCell(masterCell),
|
||||
_transformation(transformation),
|
||||
_placementStatus(placementstatus),
|
||||
_plugMap(),
|
||||
_sharedPathMap(),
|
||||
_nextOfCellInstanceMap(NULL),
|
||||
_nextOfCellSlaveInstanceSet(NULL)
|
||||
{
|
||||
if (!_cell)
|
||||
throw Error("Can't create " + _TName("Instance") + " : null cell");
|
||||
if (!_cell)
|
||||
throw Error("Can't create " + _TName("Instance") + " : null cell");
|
||||
|
||||
if (name.IsEmpty())
|
||||
throw Error("Can't create " + _TName("Instance") + " : empty name");
|
||||
if (name.IsEmpty())
|
||||
throw Error("Can't create " + _TName("Instance") + " : empty name");
|
||||
|
||||
if (_cell->GetInstance(_name))
|
||||
throw Error("Can't create " + _TName("Instance") + " : already exists");
|
||||
if (_cell->GetInstance(_name))
|
||||
throw Error("Can't create " + _TName("Instance") + " : already exists");
|
||||
|
||||
if (!_masterCell)
|
||||
throw Error("Can't create " + _TName("Instance") + " : null master cell");
|
||||
if (!_masterCell)
|
||||
throw Error("Can't create " + _TName("Instance") + " : null master cell");
|
||||
|
||||
if (secureFlag && _cell->IsCalledBy(_masterCell))
|
||||
throw Error("Can't create " + _TName("Instance") + " : cyclic construction");
|
||||
if (secureFlag && _cell->IsCalledBy(_masterCell))
|
||||
throw Error("Can't create " + _TName("Instance") + " : cyclic construction");
|
||||
}
|
||||
|
||||
Instance* Instance::Create(Cell* cell, const Name& name, Cell* masterCell, bool secureFlag)
|
||||
// ****************************************************************************************
|
||||
{
|
||||
Instance* instance =
|
||||
new Instance(cell, name, masterCell, Transformation(), PlacementStatus(), secureFlag);
|
||||
Instance* instance =
|
||||
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 =
|
||||
new Instance(cell, name, masterCell, transformation, placementstatus, secureFlag);
|
||||
Instance* instance =
|
||||
new Instance(cell, name, masterCell, transformation, placementstatus, secureFlag);
|
||||
|
||||
instance->_PostCreate();
|
||||
instance->_PostCreate();
|
||||
|
||||
return instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
Box Instance::GetBoundingBox() const
|
||||
|
@ -213,19 +213,19 @@ Box Instance::GetBoundingBox() const
|
|||
Plugs Instance::GetConnectedPlugs() const
|
||||
// **************************************
|
||||
{
|
||||
return GetPlugs().GetSubSet(Plug::GetIsConnectedFilter());
|
||||
return GetPlugs().GetSubSet(Plug::GetIsConnectedFilter());
|
||||
}
|
||||
|
||||
Plugs Instance::GetUnconnectedPlugs() const
|
||||
// ****************************************
|
||||
{
|
||||
return GetPlugs().GetSubSet(Plug::GetIsUnconnectedFilter());
|
||||
return GetPlugs().GetSubSet(Plug::GetIsUnconnectedFilter());
|
||||
}
|
||||
|
||||
Path Instance::GetPath(const Path& tailPath) const
|
||||
// ***********************************************
|
||||
{
|
||||
return Path((Instance*)this, tailPath);
|
||||
return Path((Instance*)this, tailPath);
|
||||
}
|
||||
|
||||
Box Instance::GetAbutmentBox() const
|
||||
|
@ -237,31 +237,31 @@ Box Instance::GetAbutmentBox() const
|
|||
bool Instance::IsTerminal() const
|
||||
// ******************************
|
||||
{
|
||||
return GetMasterCell()->IsTerminal();
|
||||
return GetMasterCell()->IsTerminal();
|
||||
}
|
||||
|
||||
bool Instance::IsLeaf() const
|
||||
// **************************
|
||||
{
|
||||
return GetMasterCell()->IsLeaf();
|
||||
return GetMasterCell()->IsLeaf();
|
||||
}
|
||||
|
||||
InstanceFilter Instance::GetIsUnderFilter(const Box& area)
|
||||
// *******************************************************
|
||||
{
|
||||
return Instance_IsUnderFilter(area);
|
||||
return Instance_IsUnderFilter(area);
|
||||
}
|
||||
|
||||
InstanceFilter Instance::GetIsTerminalFilter()
|
||||
// *******************************************
|
||||
{
|
||||
return Instance_IsTerminalFilter();
|
||||
return Instance_IsTerminalFilter();
|
||||
}
|
||||
|
||||
InstanceFilter Instance::GetIsLeafFilter()
|
||||
// *******************************************
|
||||
{
|
||||
return Instance_IsLeafFilter();
|
||||
return Instance_IsLeafFilter();
|
||||
}
|
||||
|
||||
InstanceFilter Instance::GetIsUnplacedFilter()
|
||||
|
@ -291,287 +291,287 @@ InstanceFilter Instance::GetIsNotUnplacedFilter()
|
|||
void Instance::Materialize()
|
||||
// *************************
|
||||
{
|
||||
if (!IsMaterialized()) {
|
||||
Box boundingBox = GetBoundingBox();
|
||||
if (!boundingBox.IsEmpty()) {
|
||||
QuadTree* quadTree = _cell->_GetQuadTree();
|
||||
quadTree->Insert(this);
|
||||
_cell->_Fit(quadTree->GetBoundingBox());
|
||||
}
|
||||
}
|
||||
if (!IsMaterialized()) {
|
||||
Box boundingBox = GetBoundingBox();
|
||||
if (!boundingBox.isEmpty()) {
|
||||
QuadTree* quadTree = _cell->_GetQuadTree();
|
||||
quadTree->Insert(this);
|
||||
_cell->_Fit(quadTree->GetBoundingBox());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Instance::Unmaterialize()
|
||||
// ***************************
|
||||
{
|
||||
if (IsMaterialized()) {
|
||||
_cell->_Unfit(GetBoundingBox());
|
||||
_cell->_GetQuadTree()->Remove(this);
|
||||
}
|
||||
if (IsMaterialized()) {
|
||||
_cell->_Unfit(GetBoundingBox());
|
||||
_cell->_GetQuadTree()->Remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
void Instance::Invalidate(bool propagateFlag)
|
||||
// ******************************************
|
||||
{
|
||||
Inherit::Invalidate(false);
|
||||
Inherit::Invalidate(false);
|
||||
|
||||
if (propagateFlag) {
|
||||
for_each_plug(plug, GetConnectedPlugs()) {
|
||||
plug->Invalidate(true);
|
||||
end_for;
|
||||
}
|
||||
}
|
||||
if (propagateFlag) {
|
||||
for_each_plug(plug, GetConnectedPlugs()) {
|
||||
plug->Invalidate(true);
|
||||
end_for;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Instance::Translate(const Unit& dx, const Unit& dy)
|
||||
// *****************************************************
|
||||
{
|
||||
if ((dx != 0) || (dy !=0)) {
|
||||
Point translation = _transformation.GetTranslation();
|
||||
Unit x = translation.GetX() + dx;
|
||||
Unit y = translation.GetY() + dy;
|
||||
Transformation::Orientation orientation = _transformation.GetOrientation();
|
||||
SetTransformation(Transformation(x, y, orientation));
|
||||
}
|
||||
if ((dx != 0) || (dy !=0)) {
|
||||
Point translation = _transformation.GetTranslation();
|
||||
Unit x = translation.getX() + dx;
|
||||
Unit y = translation.getY() + dy;
|
||||
Transformation::Orientation orientation = _transformation.GetOrientation();
|
||||
SetTransformation(Transformation(x, y, orientation));
|
||||
}
|
||||
}
|
||||
|
||||
void Instance::SetName(const Name& name)
|
||||
// *************************************
|
||||
{
|
||||
if (name != _name) {
|
||||
if (name.IsEmpty())
|
||||
throw Error("Can't change instance name : empty name");
|
||||
if (name != _name) {
|
||||
if (name.IsEmpty())
|
||||
throw Error("Can't change instance name : empty name");
|
||||
|
||||
if (_cell->GetInstance(name))
|
||||
throw Error("Can't change instance name : already exists");
|
||||
if (_cell->GetInstance(name))
|
||||
throw Error("Can't change instance name : already exists");
|
||||
|
||||
_cell->_GetInstanceMap()._Remove(this);
|
||||
_name = name;
|
||||
_cell->_GetInstanceMap()._Insert(this);
|
||||
}
|
||||
_cell->_GetInstanceMap()._Remove(this);
|
||||
_name = name;
|
||||
_cell->_GetInstanceMap()._Insert(this);
|
||||
}
|
||||
}
|
||||
|
||||
void Instance::SetTransformation(const Transformation& transformation)
|
||||
// *******************************************************************
|
||||
{
|
||||
if (transformation != _transformation) {
|
||||
Invalidate(true);
|
||||
_transformation = transformation;
|
||||
}
|
||||
if (transformation != _transformation) {
|
||||
Invalidate(true);
|
||||
_transformation = transformation;
|
||||
}
|
||||
}
|
||||
|
||||
void Instance::SetPlacementStatus(const PlacementStatus& placementstatus)
|
||||
// **********************************************************************
|
||||
{
|
||||
// if (placementstatus != _placementStatus) {
|
||||
// Invalidate(true);
|
||||
// if (placementstatus != _placementStatus) {
|
||||
// Invalidate(true);
|
||||
_placementStatus = placementstatus;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
void Instance::SetMasterCell(Cell* masterCell, bool secureFlag)
|
||||
// ************************************************************
|
||||
{
|
||||
if (masterCell != _masterCell) {
|
||||
if (masterCell != _masterCell) {
|
||||
|
||||
if (!masterCell)
|
||||
throw Error("Can't set master : null master cell");
|
||||
if (!masterCell)
|
||||
throw Error("Can't set master : null master cell");
|
||||
|
||||
if (secureFlag && _cell->IsCalledBy(masterCell))
|
||||
throw Error("Can't set master : cyclic construction");
|
||||
if (secureFlag && _cell->IsCalledBy(masterCell))
|
||||
throw Error("Can't set master : cyclic construction");
|
||||
|
||||
list<Plug*> connectedPlugList;
|
||||
list<Net*> masterNetList;
|
||||
for_each_plug(plug, GetConnectedPlugs()) {
|
||||
Net* masterNet = masterCell->GetNet(plug->GetMasterNet()->GetName());
|
||||
if (!masterNet || !masterNet->IsExternal())
|
||||
throw Error("Can't set master (bad master net matching)");
|
||||
connectedPlugList.push_back(plug);
|
||||
masterNetList.push_back(masterNet);
|
||||
end_for;
|
||||
}
|
||||
list<Plug*> connectedPlugList;
|
||||
list<Net*> masterNetList;
|
||||
for_each_plug(plug, GetConnectedPlugs()) {
|
||||
Net* masterNet = masterCell->GetNet(plug->GetMasterNet()->GetName());
|
||||
if (!masterNet || !masterNet->IsExternal())
|
||||
throw Error("Can't set master (bad master net matching)");
|
||||
connectedPlugList.push_back(plug);
|
||||
masterNetList.push_back(masterNet);
|
||||
end_for;
|
||||
}
|
||||
|
||||
for_each_shared_path(sharedPath, _GetSharedPathes()) {
|
||||
if (!sharedPath->GetTailSharedPath())
|
||||
// if the tail is empty the SharedPath isn't impacted by the change
|
||||
delete sharedPath;
|
||||
end_for;
|
||||
}
|
||||
for_each_shared_path(sharedPath, _GetSharedPathes()) {
|
||||
if (!sharedPath->GetTailSharedPath())
|
||||
// if the tail is empty the SharedPath isn't impacted by the change
|
||||
delete sharedPath;
|
||||
end_for;
|
||||
}
|
||||
|
||||
Invalidate(true);
|
||||
Invalidate(true);
|
||||
|
||||
for_each_plug(plug, GetUnconnectedPlugs()) {
|
||||
plug->_Delete();
|
||||
end_for;
|
||||
}
|
||||
for_each_plug(plug, GetUnconnectedPlugs()) {
|
||||
plug->_Delete();
|
||||
end_for;
|
||||
}
|
||||
|
||||
while (!connectedPlugList.empty() && !masterNetList.empty()) {
|
||||
Plug* plug = connectedPlugList.front();
|
||||
Net* masterNet = masterNetList.front();
|
||||
_plugMap._Remove(plug);
|
||||
plug->_SetMasterNet(masterNet);
|
||||
_plugMap._Insert(plug);
|
||||
connectedPlugList.pop_front();
|
||||
masterNetList.pop_front();
|
||||
}
|
||||
while (!connectedPlugList.empty() && !masterNetList.empty()) {
|
||||
Plug* plug = connectedPlugList.front();
|
||||
Net* masterNet = masterNetList.front();
|
||||
_plugMap._Remove(plug);
|
||||
plug->_SetMasterNet(masterNet);
|
||||
_plugMap._Insert(plug);
|
||||
connectedPlugList.pop_front();
|
||||
masterNetList.pop_front();
|
||||
}
|
||||
|
||||
_masterCell->_GetSlaveInstanceSet()._Remove(this);
|
||||
_masterCell = masterCell;
|
||||
_masterCell->_GetSlaveInstanceSet()._Insert(this);
|
||||
_masterCell->_GetSlaveInstanceSet()._Remove(this);
|
||||
_masterCell = masterCell;
|
||||
_masterCell->_GetSlaveInstanceSet()._Insert(this);
|
||||
|
||||
for_each_net(externalNet, _masterCell->GetExternalNets()) {
|
||||
if (!GetPlug(externalNet)) Plug::_Create(this, externalNet);
|
||||
end_for;
|
||||
}
|
||||
}
|
||||
for_each_net(externalNet, _masterCell->GetExternalNets()) {
|
||||
if (!GetPlug(externalNet)) Plug::_Create(this, externalNet);
|
||||
end_for;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Instance::_PostCreate()
|
||||
// *************************
|
||||
{
|
||||
_cell->_GetInstanceMap()._Insert(this);
|
||||
_masterCell->_GetSlaveInstanceSet()._Insert(this);
|
||||
_cell->_GetInstanceMap()._Insert(this);
|
||||
_masterCell->_GetSlaveInstanceSet()._Insert(this);
|
||||
|
||||
for_each_net(externalNet, _masterCell->GetExternalNets()) {
|
||||
Plug::_Create(this, externalNet);
|
||||
end_for;
|
||||
}
|
||||
for_each_net(externalNet, _masterCell->GetExternalNets()) {
|
||||
Plug::_Create(this, externalNet);
|
||||
end_for;
|
||||
}
|
||||
|
||||
Inherit::_PostCreate();
|
||||
Inherit::_PostCreate();
|
||||
}
|
||||
|
||||
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);
|
||||
_cell->_GetInstanceMap()._Remove(this);
|
||||
_masterCell->_GetSlaveInstanceSet()._Remove(this);
|
||||
_cell->_GetInstanceMap()._Remove(this);
|
||||
}
|
||||
|
||||
string Instance::_GetString() const
|
||||
// ********************************
|
||||
{
|
||||
string s = Inherit::_GetString();
|
||||
s.insert(s.length() - 1, " " + GetString(_name));
|
||||
s.insert(s.length() - 1, " " + GetString(_masterCell->GetName()));
|
||||
return s;
|
||||
string s = Inherit::_GetString();
|
||||
s.insert(s.length() - 1, " " + GetString(_name));
|
||||
s.insert(s.length() - 1, " " + GetString(_masterCell->GetName()));
|
||||
return s;
|
||||
}
|
||||
|
||||
Record* Instance::_GetRecord() const
|
||||
// ***************************
|
||||
{
|
||||
Record* record = Inherit::_GetRecord();
|
||||
if (record) {
|
||||
record->Add(GetSlot("Cell", _cell));
|
||||
record->Add(GetSlot("Name", &_name));
|
||||
record->Add(GetSlot("MasterCell", _masterCell));
|
||||
record->Add(GetSlot("Transformation", &_transformation));
|
||||
record->Add(GetSlot("PlacementStatus", _placementStatus));
|
||||
record->Add(GetSlot("XCenter", GetValue(GetAbutmentBox().GetXCenter())));
|
||||
record->Add(GetSlot("YCenter", GetValue(GetAbutmentBox().GetYCenter())));
|
||||
record->Add(GetSlot("Plugs", &_plugMap));
|
||||
record->Add(GetSlot("SharedPathes", &_sharedPathMap));
|
||||
}
|
||||
return record;
|
||||
Record* record = Inherit::_GetRecord();
|
||||
if (record) {
|
||||
record->Add(GetSlot("Cell", _cell));
|
||||
record->Add(GetSlot("Name", &_name));
|
||||
record->Add(GetSlot("MasterCell", _masterCell));
|
||||
record->Add(GetSlot("Transformation", &_transformation));
|
||||
record->Add(GetSlot("PlacementStatus", _placementStatus));
|
||||
record->Add(GetSlot("XCenter", GetValue(GetAbutmentBox().getXCenter())));
|
||||
record->Add(GetSlot("YCenter", GetValue(GetAbutmentBox().getYCenter())));
|
||||
record->Add(GetSlot("Plugs", &_plugMap));
|
||||
record->Add(GetSlot("SharedPathes", &_sharedPathMap));
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
//void Instance::_DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation)
|
||||
//// **************************************************************************************************
|
||||
//{
|
||||
// Symbol* symbol = _masterCell->GetSymbol();
|
||||
// if (!symbol) {
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// _masterCell->_DrawPhantoms(view, masterArea, masterTransformation);
|
||||
// }
|
||||
// Symbol* symbol = _masterCell->GetSymbol();
|
||||
// if (!symbol) {
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// _masterCell->_DrawPhantoms(view, masterArea, masterTransformation);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//void Instance::_DrawBoundaries(View* view, const Box& updateArea, const Transformation& transformation)
|
||||
//// ****************************************************************************************************
|
||||
//{
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// Symbol* symbol = _masterCell->GetSymbol();
|
||||
// if (!symbol)
|
||||
// _masterCell->_DrawBoundaries(view, masterArea, masterTransformation);
|
||||
// else
|
||||
// _masterCell->GetSymbol()->_Draw(view, masterArea, masterTransformation);
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// Symbol* symbol = _masterCell->GetSymbol();
|
||||
// if (!symbol)
|
||||
// _masterCell->_DrawBoundaries(view, masterArea, masterTransformation);
|
||||
// else
|
||||
// _masterCell->GetSymbol()->_Draw(view, masterArea, masterTransformation);
|
||||
//}
|
||||
//
|
||||
//void Instance::_DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation)
|
||||
//// *************************************************************************************************
|
||||
//{
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// _masterCell->_DrawRubbers(view, masterArea, masterTransformation);
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// _masterCell->_DrawRubbers(view, masterArea, masterTransformation);
|
||||
//}
|
||||
//
|
||||
//void Instance::_DrawMarkers(View* view, const Box& updateArea, const Transformation& transformation)
|
||||
//// *************************************************************************************************
|
||||
//{
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// _masterCell->_DrawMarkers(view, masterArea, masterTransformation);
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// _masterCell->_DrawMarkers(view, masterArea, masterTransformation);
|
||||
//}
|
||||
//
|
||||
//void Instance::_DrawDisplaySlots(View* view, const Box& area, const Box& updateArea, const Transformation& transformation)
|
||||
//// ***********************************************************************************************************************
|
||||
//{
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// _masterCell->_DrawDisplaySlots(view, area, masterArea, masterTransformation);
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// _masterCell->_DrawDisplaySlots(view, area, masterArea, masterTransformation);
|
||||
//}
|
||||
//
|
||||
//bool Instance::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const
|
||||
//// ****************************************************************************************
|
||||
//{
|
||||
// Symbol* symbol = _masterCell->GetSymbol();
|
||||
// if (!symbol)
|
||||
// return (view->PhantomsAreVisible() || view->BoundariesAreVisible()) &&
|
||||
// GetAbutmentBox().Intersect(Box(point).Inflate(aperture));
|
||||
// else {
|
||||
// Point masterPoint = point;
|
||||
// _transformation.GetInvert().ApplyOn(masterPoint);
|
||||
// return (view->BoundariesAreVisible() && symbol->_IsInterceptedBy(view, masterPoint, aperture));
|
||||
// }
|
||||
// Symbol* symbol = _masterCell->GetSymbol();
|
||||
// if (!symbol)
|
||||
// return (view->PhantomsAreVisible() || view->BoundariesAreVisible()) &&
|
||||
// GetAbutmentBox().intersect(Box(point).Inflate(aperture));
|
||||
// else {
|
||||
// Point masterPoint = point;
|
||||
// _transformation.GetInvert().ApplyOn(masterPoint);
|
||||
// return (view->BoundariesAreVisible() && symbol->_IsInterceptedBy(view, masterPoint, aperture));
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//void Instance::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
|
||||
//// ****************************************************************************************************
|
||||
//{
|
||||
// Symbol* symbol = _masterCell->GetSymbol();
|
||||
// if (!symbol) {
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// _masterCell->_DrawContent(view, basicLayer, masterArea, masterTransformation);
|
||||
// }
|
||||
// Symbol* symbol = _masterCell->GetSymbol();
|
||||
// if (!symbol) {
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// _masterCell->_DrawContent(view, basicLayer, masterArea, masterTransformation);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//void Instance::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
|
||||
//// ***********************************************************************************************
|
||||
//{
|
||||
// Symbol* symbol = _masterCell->GetSymbol();
|
||||
// if (!symbol) {
|
||||
// Box abutmentBox = transformation.GetBox(GetAbutmentBox());
|
||||
// view->FillRectangle(abutmentBox);
|
||||
// view->DrawRectangle(abutmentBox);
|
||||
// Symbol* symbol = _masterCell->GetSymbol();
|
||||
// if (!symbol) {
|
||||
// Box abutmentBox = transformation.GetBox(GetAbutmentBox());
|
||||
// view->FillRectangle(abutmentBox);
|
||||
// view->DrawRectangle(abutmentBox);
|
||||
//
|
||||
// if ( view->GetScale() > 1 )
|
||||
// {
|
||||
|
@ -583,14 +583,14 @@ Record* Instance::_GetRecord() const
|
|||
// view->DrawString ( text, abutmentBox.GetXMin(), abutmentBox.GetYMax() );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// symbol->_Highlight(view, masterArea, masterTransformation);
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// Box masterArea = updateArea;
|
||||
// Transformation masterTransformation = _transformation;
|
||||
// _transformation.GetInvert().ApplyOn(masterArea);
|
||||
// transformation.ApplyOn(masterTransformation);
|
||||
// symbol->_Highlight(view, masterArea, masterTransformation);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
|
||||
|
@ -600,32 +600,32 @@ Record* Instance::_GetRecord() const
|
|||
|
||||
Instance::PlugMap::PlugMap()
|
||||
// *************************
|
||||
: Inherit()
|
||||
: Inherit()
|
||||
{
|
||||
}
|
||||
|
||||
const Net* Instance::PlugMap::_GetKey(Plug* plug) const
|
||||
// ****************************************************
|
||||
{
|
||||
return plug->GetMasterNet();
|
||||
return plug->GetMasterNet();
|
||||
}
|
||||
|
||||
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
|
||||
// *******************************************************
|
||||
{
|
||||
return plug->_GetNextOfInstancePlugMap();
|
||||
return plug->_GetNextOfInstancePlugMap();
|
||||
}
|
||||
|
||||
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()
|
||||
// *************************************
|
||||
: Inherit()
|
||||
: Inherit()
|
||||
{
|
||||
}
|
||||
|
||||
const SharedPath* Instance::SharedPathMap::_GetKey(SharedPath* sharedPath) const
|
||||
// *****************************************************************************
|
||||
{
|
||||
return sharedPath->GetTailSharedPath();
|
||||
return sharedPath->GetTailSharedPath();
|
||||
}
|
||||
|
||||
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
|
||||
// *******************************************************************************
|
||||
{
|
||||
return sharedPath->_GetNextOfInstanceSharedPathMap();
|
||||
return sharedPath->_GetNextOfInstanceSharedPathMap();
|
||||
}
|
||||
|
||||
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)
|
||||
// *********************************************************
|
||||
: _code(code)
|
||||
: _code(code)
|
||||
{
|
||||
}
|
||||
|
||||
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;
|
||||
return *this;
|
||||
return *this;
|
||||
}
|
||||
|
||||
string Instance::PlacementStatus::_GetString() const
|
||||
|
@ -696,9 +696,9 @@ string Instance::PlacementStatus::_GetString() const
|
|||
Record* Instance::PlacementStatus::_GetRecord() const
|
||||
// ********************************************
|
||||
{
|
||||
Record* record = new Record(GetString(this));
|
||||
record->Add(GetSlot("Code", &_code));
|
||||
return record;
|
||||
Record* record = new Record(GetString(this));
|
||||
record->Add(GetSlot("Code", &_code));
|
||||
return record;
|
||||
}
|
||||
|
||||
} // End of Hurricane namespace.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -143,8 +143,8 @@ class Net : public Entity {
|
|||
public: const Type& GetType() const {return _type;};
|
||||
public: const Direction& GetDirection() const {return _direction;};
|
||||
public: const Point& GetPosition() const {return _position;};
|
||||
public: const Unit& GetX() const {return _position.GetX();};
|
||||
public: const Unit& GetY() const {return _position.GetY();};
|
||||
public: const Unit& GetX() const {return _position.getX();};
|
||||
public: const Unit& GetY() const {return _position.getY();};
|
||||
public: Components GetComponents() const {return _componentSet.GetElements();};
|
||||
public: Rubbers GetRubbers() const {return _rubberSet.GetElements();};
|
||||
public: RoutingPads GetRoutingPads() const;
|
||||
|
|
|
@ -22,122 +22,122 @@ namespace Hurricane {
|
|||
Pad::Pad(Net* net, Layer* layer, const Box& boundingBox)
|
||||
// *****************************************************
|
||||
: Inherit(net),
|
||||
_layer(layer),
|
||||
_boundingBox(boundingBox)
|
||||
_layer(layer),
|
||||
_boundingBox(boundingBox)
|
||||
{
|
||||
if (!_layer)
|
||||
throw Error("Can't create " + _TName("Pad") + " : null layer");
|
||||
if (!_layer)
|
||||
throw Error("Can't create " + _TName("Pad") + " : null layer");
|
||||
|
||||
if (_boundingBox.IsEmpty())
|
||||
throw Error("Can't create " + _TName("Pad") + " : empty bounding box");
|
||||
if (_boundingBox.isEmpty())
|
||||
throw Error("Can't create " + _TName("Pad") + " : empty bounding box");
|
||||
}
|
||||
|
||||
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
|
||||
// *******************
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Unit Pad::GetY() const
|
||||
// *******************
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Box Pad::GetBoundingBox() const
|
||||
// ****************************
|
||||
{
|
||||
Box boundingBox = _boundingBox;
|
||||
Box boundingBox = _boundingBox;
|
||||
|
||||
if (is_a<CompositeLayer*>(_layer))
|
||||
boundingBox.Inflate(((CompositeLayer*)_layer)->GetMaximalPadSize());
|
||||
if (is_a<CompositeLayer*>(_layer))
|
||||
boundingBox.inflate(((CompositeLayer*)_layer)->GetMaximalPadSize());
|
||||
|
||||
return boundingBox;
|
||||
return boundingBox;
|
||||
}
|
||||
|
||||
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))
|
||||
boundingBox.Inflate(((CompositeLayer*)_layer)->GetPadSize(basicLayer));
|
||||
if (is_a<CompositeLayer*>(_layer))
|
||||
boundingBox.inflate(((CompositeLayer*)_layer)->GetPadSize(basicLayer));
|
||||
|
||||
return boundingBox;
|
||||
return boundingBox;
|
||||
}
|
||||
|
||||
void Pad::Translate(const Unit& dx, const Unit& dy)
|
||||
// ************************************************
|
||||
{
|
||||
if ((dx != 0) || (dy != 0)) {
|
||||
Invalidate(true);
|
||||
_boundingBox.Translate(dx, dy);
|
||||
}
|
||||
if ((dx != 0) || (dy != 0)) {
|
||||
Invalidate(true);
|
||||
_boundingBox.translate(dx, dy);
|
||||
}
|
||||
}
|
||||
|
||||
void Pad::SetBoundingBox(const Box& boundingBox)
|
||||
// *********************************************
|
||||
{
|
||||
if (_boundingBox.IsEmpty())
|
||||
throw Error("Can't set bounding box : empty bounding box");
|
||||
if (_boundingBox.isEmpty())
|
||||
throw Error("Can't set bounding box : empty bounding box");
|
||||
|
||||
if (boundingBox != _boundingBox) {
|
||||
Invalidate(true);
|
||||
_boundingBox = boundingBox;
|
||||
}
|
||||
if (boundingBox != _boundingBox) {
|
||||
Invalidate(true);
|
||||
_boundingBox = boundingBox;
|
||||
}
|
||||
}
|
||||
|
||||
string Pad::_GetString() const
|
||||
// ***************************
|
||||
{
|
||||
string s = Inherit::_GetString();
|
||||
s.insert(s.length() - 1, " " + GetString(_layer->GetName()));
|
||||
s.insert(s.length() - 1, " " + GetString(_boundingBox));
|
||||
return s;
|
||||
string s = Inherit::_GetString();
|
||||
s.insert(s.length() - 1, " " + GetString(_layer->GetName()));
|
||||
s.insert(s.length() - 1, " " + GetString(_boundingBox));
|
||||
return s;
|
||||
}
|
||||
|
||||
Record* Pad::_GetRecord() const
|
||||
// **********************
|
||||
{
|
||||
Record* record = Inherit::_GetRecord();
|
||||
if (record) {
|
||||
record->Add(GetSlot("Layer", _layer));
|
||||
record->Add(GetSlot("BoundingBox", &_boundingBox));
|
||||
}
|
||||
return record;
|
||||
Record* record = Inherit::_GetRecord();
|
||||
if (record) {
|
||||
record->Add(GetSlot("Layer", _layer));
|
||||
record->Add(GetSlot("BoundingBox", &_boundingBox));
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
//void Pad::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
|
||||
//// ****************************************************************************************************
|
||||
//{
|
||||
// Unit width = _boundingBox.GetWidth();
|
||||
// Unit height = _boundingBox.GetHeight();
|
||||
// if (1 < view->GetScreenSize(max(width, height))) {
|
||||
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
|
||||
// view->DrawRectangle(transformation.GetBox(GetBoundingBox(basicLayer))); // PROVISOIREMENT
|
||||
// }
|
||||
// Unit width = _boundingBox.GetWidth();
|
||||
// Unit height = _boundingBox.GetHeight();
|
||||
// if (1 < view->GetScreenSize(max(width, height))) {
|
||||
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
|
||||
// view->DrawRectangle(transformation.GetBox(GetBoundingBox(basicLayer))); // PROVISOIREMENT
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//void Pad::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
|
||||
//// ******************************************************************************************
|
||||
//{
|
||||
// for_each_basic_layer(basicLayer, GetLayer()->GetBasicLayers()) {
|
||||
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
|
||||
// view->DrawRectangle(transformation.GetBox(GetBoundingBox(basicLayer))); // PROVISOIREMENT
|
||||
// end_for;
|
||||
// }
|
||||
// for_each_basic_layer(basicLayer, GetLayer()->GetBasicLayers()) {
|
||||
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
|
||||
// view->DrawRectangle(transformation.GetBox(GetBoundingBox(basicLayer))); // PROVISOIREMENT
|
||||
// end_for;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
|
||||
|
|
|
@ -17,94 +17,94 @@ namespace Hurricane {
|
|||
|
||||
Point::Point()
|
||||
// ***********
|
||||
: _x(0),
|
||||
_y(0)
|
||||
: _x(0),
|
||||
_y(0)
|
||||
{
|
||||
}
|
||||
|
||||
Point::Point(const Unit& x, const Unit& y)
|
||||
// ***************************************
|
||||
: _x(x),
|
||||
_y(y)
|
||||
: _x(x),
|
||||
_y(y)
|
||||
{
|
||||
}
|
||||
|
||||
Point::Point(const Point& point)
|
||||
// *****************************
|
||||
: _x(point._x),
|
||||
_y(point._y)
|
||||
: _x(point._x),
|
||||
_y(point._y)
|
||||
{
|
||||
}
|
||||
|
||||
Point& Point::operator=(const Point& point)
|
||||
// ****************************************
|
||||
{
|
||||
_x = point._x;
|
||||
_y = point._y;
|
||||
return *this;
|
||||
_x = point._x;
|
||||
_y = point._y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
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
|
||||
// *********************************************
|
||||
{
|
||||
return ((_x != point._x) || (_y != point._y));
|
||||
return ((_x != point._x) || (_y != point._y));
|
||||
}
|
||||
|
||||
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
|
||||
// *********************************************
|
||||
{
|
||||
return Point(_x-point._x,_y-point._y);
|
||||
return Point(_x-point._x,_y-point._y);
|
||||
}
|
||||
|
||||
Point& Point::operator+=(const Point &point)
|
||||
// *****************************************
|
||||
{
|
||||
_x += point._x;
|
||||
_y += point._y;
|
||||
return *this;
|
||||
_x += point._x;
|
||||
_y += point._y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Point& Point::operator-=(const Point &point)
|
||||
// *****************************************
|
||||
{
|
||||
_x -= point._x;
|
||||
_y -= point._y;
|
||||
return *this;
|
||||
_x -= point._x;
|
||||
_y -= point._y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Point& Point::Translate(const Unit& dx, const Unit& dy)
|
||||
Point& Point::translate(const Unit& dx, const Unit& dy)
|
||||
// ****************************************************
|
||||
{
|
||||
_x += dx;
|
||||
_y += dy;
|
||||
return *this;
|
||||
_x += dx;
|
||||
_y += dy;
|
||||
return *this;
|
||||
}
|
||||
|
||||
string Point::_GetString() const
|
||||
// *****************************
|
||||
{
|
||||
return "<" + _TName("Point") + " " + GetValueString(_x) + " " + GetValueString(_y) + ">";
|
||||
return "<" + _TName("Point") + " " + GetValueString(_x) + " " + GetValueString(_y) + ">";
|
||||
}
|
||||
|
||||
Record* Point::_GetRecord() const
|
||||
// ******************************
|
||||
{
|
||||
Record* record = new Record(GetString(this));
|
||||
record->Add(GetSlot("X", &_x));
|
||||
record->Add(GetSlot("Y", &_y));
|
||||
return record;
|
||||
Record* record = new Record(GetString(this));
|
||||
record->Add(GetSlot("X", &_x));
|
||||
record->Add(GetSlot("Y", &_y));
|
||||
return record;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -24,53 +24,52 @@ class Point {
|
|||
// Attributes
|
||||
// **********
|
||||
|
||||
private: Unit _x;
|
||||
private: Unit _y;
|
||||
private: Unit _x;
|
||||
private: Unit _y;
|
||||
|
||||
// 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
|
||||
// *********
|
||||
|
||||
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);
|
||||
public: Point& operator-=(const Point& point);
|
||||
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);
|
||||
|
||||
// Accessors
|
||||
// *********
|
||||
|
||||
public: const Unit& GetX() const {return _x;};
|
||||
public: const Unit& GetY() const {return _y;};
|
||||
|
||||
public: Unit ManhattanDistance(const Point pt) const
|
||||
{return abs(_x - pt.GetX()) + abs(_y - pt.GetY());};
|
||||
public: const Unit& getX() const {return _x;};
|
||||
public: const Unit& getY() const {return _y;};
|
||||
public: Unit manhattanDistance(const Point pt) const
|
||||
{ return abs(_x - pt.getX()) + abs(_y - pt.getY()); }
|
||||
|
||||
// Updators
|
||||
// ********
|
||||
|
||||
public: void SetX(const Unit& x) {_x = x;};
|
||||
public: void SetY(const Unit& y) {_y = y;};
|
||||
public: Point& Translate(const Unit& dx, const Unit& dy);
|
||||
public: void setX(const Unit& x) {_x = x;};
|
||||
public: void setY(const Unit& y) {_y = y;};
|
||||
public: Point& translate(const Unit& dx, const Unit& dy);
|
||||
|
||||
// Others
|
||||
// ******
|
||||
|
||||
public: string _GetTypeName() const { return _TName("Point"); };
|
||||
public: string _GetString() const;
|
||||
public: Record* _GetRecord() const;
|
||||
public: string _GetString() const;
|
||||
public: Record* _GetRecord() const;
|
||||
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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)
|
||||
// ***************************************************************************
|
||||
{
|
||||
return Create(cell,name,point.GetX(),point.GetY());
|
||||
return Create(cell,name,point.getX(),point.getY());
|
||||
}
|
||||
|
||||
Box Reference::GetBoundingBox() const
|
||||
// ***********************************
|
||||
{
|
||||
return Box(_point).Inflate(_extend);
|
||||
return Box(_point).inflate(_extend);
|
||||
}
|
||||
|
||||
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)) {
|
||||
Invalidate(false);
|
||||
_point.Translate(dx, dy);
|
||||
_point.translate(dx, dy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -30,9 +30,9 @@ namespace Hurricane {
|
|||
RoutingPad::RoutingPad(Net* net, const Point& p, Occurrence occurrence )
|
||||
// **********************************************************************************
|
||||
: Inherit(net),
|
||||
_x(p.GetX()),
|
||||
_y(p.GetY()),
|
||||
_occurrence(occurrence)
|
||||
_x(p.getX()),
|
||||
_y(p.getY()),
|
||||
_occurrence(occurrence)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -40,18 +40,18 @@ RoutingPad::RoutingPad(Net* net, const Point& p, Occurrence occurrence )
|
|||
RoutingPad* RoutingPad::Create(Net* net, Occurrence occurrence)
|
||||
// ***********************************************************
|
||||
{
|
||||
if (!net)
|
||||
throw Error ("Can't create RoutingPad : NULL net");
|
||||
if (!occurrence.IsValid())
|
||||
throw Error ("Can't create RoutingPag : Invalid occurrence");
|
||||
if (!net)
|
||||
throw Error ("Can't create RoutingPad : NULL net");
|
||||
if (!occurrence.IsValid())
|
||||
throw Error ("Can't create RoutingPag : Invalid occurrence");
|
||||
|
||||
//TODO Gerer une contruction avec un composant externe, mais ce n'est pas prioritaire
|
||||
Plug* plug = NULL;
|
||||
Plug* plug = NULL;
|
||||
Pin* pin = NULL;
|
||||
Contact* contact = NULL;
|
||||
Point position;
|
||||
|
||||
if ( (plug = dynamic_cast<Plug*>(occurrence.GetEntity()) ) ) {
|
||||
if ( (plug = dynamic_cast<Plug*>(occurrence.GetEntity()) ) ) {
|
||||
position = occurrence.GetPath().GetTransformation().GetPoint( plug->GetPosition() );
|
||||
} else if ( (pin = dynamic_cast<Pin*>(occurrence.GetEntity()) ) ) {
|
||||
position = occurrence.GetPath().GetTransformation().GetPoint( pin->GetPosition() );
|
||||
|
@ -62,11 +62,11 @@ RoutingPad* RoutingPad::Create(Net* net, Occurrence occurrence)
|
|||
if ( !plug && !pin && !contact )
|
||||
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()
|
||||
|
@ -81,13 +81,13 @@ void RoutingPad::_PostCreate()
|
|||
Unit RoutingPad::GetX() const
|
||||
// ***********************
|
||||
{
|
||||
return _x;
|
||||
return _x;
|
||||
}
|
||||
|
||||
Unit RoutingPad::GetY() const
|
||||
// ***********************
|
||||
{
|
||||
return _y;
|
||||
return _y;
|
||||
}
|
||||
|
||||
Box RoutingPad::GetBoundingBox() const
|
||||
|
@ -143,25 +143,25 @@ Point RoutingPad::GetTargetPosition() const
|
|||
Unit RoutingPad::GetSourceX() const
|
||||
// ********************************
|
||||
{
|
||||
return GetSourcePosition().GetX();
|
||||
return GetSourcePosition().getX();
|
||||
}
|
||||
|
||||
Unit RoutingPad::GetSourceY() const
|
||||
// ********************************
|
||||
{
|
||||
return GetSourcePosition().GetY();
|
||||
return GetSourcePosition().getY();
|
||||
}
|
||||
|
||||
Unit RoutingPad::GetTargetX() const
|
||||
// ********************************
|
||||
{
|
||||
return GetTargetPosition().GetX();
|
||||
return GetTargetPosition().getX();
|
||||
}
|
||||
|
||||
Unit RoutingPad::GetTargetY() const
|
||||
// ********************************
|
||||
{
|
||||
return GetTargetPosition().GetY();
|
||||
return GetTargetPosition().getY();
|
||||
}
|
||||
|
||||
Point RoutingPad::GetCenter() const
|
||||
|
@ -178,43 +178,43 @@ Point RoutingPad::GetCenter() const
|
|||
void RoutingPad::Translate(const Unit& dx, const Unit& dy)
|
||||
// ****************************************************
|
||||
{
|
||||
if ((dx != 0) || (dy != 0)) {
|
||||
Invalidate(true);
|
||||
_x += dx;
|
||||
_y += dy;
|
||||
}
|
||||
if ((dx != 0) || (dy != 0)) {
|
||||
Invalidate(true);
|
||||
_x += dx;
|
||||
_y += dy;
|
||||
}
|
||||
}
|
||||
|
||||
void RoutingPad::SetX(const Unit& x)
|
||||
// ******************************
|
||||
{
|
||||
SetPosition(x, GetY());
|
||||
SetPosition(x, GetY());
|
||||
}
|
||||
|
||||
void RoutingPad::SetY(const Unit& y)
|
||||
// ******************************
|
||||
{
|
||||
SetPosition(GetX(), y);
|
||||
SetPosition(GetX(), y);
|
||||
}
|
||||
|
||||
void RoutingPad::SetPosition(const Unit& x, const Unit& y)
|
||||
// ****************************************************
|
||||
{
|
||||
SetOffset(x, y);
|
||||
SetOffset(x, y);
|
||||
}
|
||||
|
||||
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)
|
||||
// ****************************************************
|
||||
{
|
||||
Invalidate(true);
|
||||
_x = x;
|
||||
_y = y;
|
||||
Invalidate(true);
|
||||
_x = x;
|
||||
_y = y;
|
||||
}
|
||||
|
||||
void RoutingPad::_PreDelete()
|
||||
|
@ -235,24 +235,24 @@ void RoutingPad::_PreDelete()
|
|||
string RoutingPad::_GetString() const
|
||||
// *******************************
|
||||
{
|
||||
string s = Inherit::_GetString();
|
||||
s.insert(s.length() - 1, " [" + GetValueString(GetX()));
|
||||
s.insert(s.length() - 1, " " + GetValueString(GetY()));
|
||||
s.insert(s.length() - 1, "] ");
|
||||
string s = Inherit::_GetString();
|
||||
s.insert(s.length() - 1, " [" + GetValueString(GetX()));
|
||||
s.insert(s.length() - 1, " " + GetValueString(GetY()));
|
||||
s.insert(s.length() - 1, "] ");
|
||||
s.insert(s.length() - 1, GetString(_occurrence));
|
||||
return s;
|
||||
return s;
|
||||
}
|
||||
|
||||
Record* RoutingPad::_GetRecord() const
|
||||
// **************************
|
||||
{
|
||||
Record* record = Inherit::_GetRecord();
|
||||
if (record) {
|
||||
record->Add(GetSlot("X", &_x));
|
||||
record->Add(GetSlot("Y", &_y));
|
||||
Record* record = Inherit::_GetRecord();
|
||||
if (record) {
|
||||
record->Add(GetSlot("X", &_x));
|
||||
record->Add(GetSlot("Y", &_y));
|
||||
record->Add(GetSlot("Occurrence",_occurrence));
|
||||
}
|
||||
return record;
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
Component* RoutingPad::_GetEntityAsComponent () const
|
||||
|
@ -276,19 +276,19 @@ Segment* RoutingPad::_GetEntityAsSegment () const
|
|||
//bool RoutingPad::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const
|
||||
//// ******************************************************************************************
|
||||
//{
|
||||
// Layer* layer = GetLayer();
|
||||
// Layer* layer = GetLayer();
|
||||
// Box boundingBox ( GetBoundingBox() );
|
||||
// Box area ( point );
|
||||
// Box area ( point );
|
||||
//
|
||||
// area.Inflate ( aperture );
|
||||
// area.Inflate ( aperture );
|
||||
//
|
||||
// for_each_basic_layer(basicLayer, layer->GetBasicLayers()) {
|
||||
// if (view->IsVisible(basicLayer))
|
||||
// if (boundingBox.Intersect(area)) return true;
|
||||
// end_for;
|
||||
// }
|
||||
// for_each_basic_layer(basicLayer, layer->GetBasicLayers()) {
|
||||
// if (view->IsVisible(basicLayer))
|
||||
// if (boundingBox.Intersect(area)) return true;
|
||||
// end_for;
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
// return false;
|
||||
//}
|
||||
//
|
||||
//
|
||||
|
@ -334,11 +334,11 @@ void RoutingPad::SetExternalComponent(Component* component)
|
|||
Horizontal* horizontal = dynamic_cast<Horizontal*>(component);
|
||||
if ( horizontal ) {
|
||||
SetX ( 0 );
|
||||
SetY ( position.GetY() );
|
||||
SetY ( position.getY() );
|
||||
} else {
|
||||
Vertical* vertical = dynamic_cast<Vertical*>(component);
|
||||
if ( vertical ) {
|
||||
SetX ( position.GetX() );
|
||||
SetX ( position.getX() );
|
||||
SetY ( 0 );
|
||||
} else
|
||||
SetPosition ( position );
|
||||
|
@ -387,40 +387,40 @@ void RoutingPad::RestorePlugOccurrence()
|
|||
|
||||
RoutingPad::Builder::Builder(const string& token)
|
||||
// *******************************************
|
||||
: Inherit(token),
|
||||
_layer(NULL),
|
||||
_x(0),
|
||||
_y(0),
|
||||
_width(0),
|
||||
_height(0)
|
||||
: Inherit(token),
|
||||
_layer(NULL),
|
||||
_x(0),
|
||||
_y(0),
|
||||
_width(0),
|
||||
_height(0)
|
||||
{
|
||||
}
|
||||
|
||||
void RoutingPad::Builder::Scan(InputFile& inputFile, char*& arguments)
|
||||
// ****************************************************************
|
||||
{
|
||||
Inherit::Scan(inputFile, arguments);
|
||||
Inherit::Scan(inputFile, arguments);
|
||||
|
||||
unsigned layerId;
|
||||
unsigned n;
|
||||
unsigned layerId;
|
||||
unsigned n;
|
||||
|
||||
|
||||
if (r != 6)
|
||||
throw Error("Can't create RoutingPad : syntax error");
|
||||
if (r != 6)
|
||||
throw Error("Can't create RoutingPad : syntax error");
|
||||
|
||||
arguments = &arguments[n];
|
||||
arguments = &arguments[n];
|
||||
|
||||
DBo* dbo = inputFile.GetDBo(layerId);
|
||||
if (!dbo || !is_a<Layer*>(dbo))
|
||||
throw Error("Can't create RoutingPad : bad layer");
|
||||
DBo* dbo = inputFile.GetDBo(layerId);
|
||||
if (!dbo || !is_a<Layer*>(dbo))
|
||||
throw Error("Can't create RoutingPad : bad layer");
|
||||
|
||||
_layer = (Layer*)dbo;
|
||||
_layer = (Layer*)dbo;
|
||||
}
|
||||
|
||||
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");
|
||||
|
|
|
@ -56,7 +56,7 @@ Cell* Rubber::GetCell() const
|
|||
Point Rubber::GetCenter() const
|
||||
// ****************************
|
||||
{
|
||||
return GetBoundingBox().GetCenter();
|
||||
return GetBoundingBox().getCenter();
|
||||
}
|
||||
|
||||
Point Rubber::GetBarycenter() const
|
||||
|
@ -66,9 +66,9 @@ Point Rubber::GetBarycenter() const
|
|||
Unit x = 0;
|
||||
Unit y = 0;
|
||||
for_each_hook(hook, GetHooks()) {
|
||||
Point position = hook->GetComponent()->GetBoundingBox().GetCenter();
|
||||
x += position.GetX() / n;
|
||||
y += position.GetY() / n;
|
||||
Point position = hook->GetComponent()->GetBoundingBox().getCenter();
|
||||
x += position.getX() / n;
|
||||
y += position.getY() / n;
|
||||
end_for;
|
||||
}
|
||||
return Point(x,y);
|
||||
|
@ -77,13 +77,13 @@ Point Rubber::GetBarycenter() const
|
|||
Box Rubber::GetBoundingBox() const
|
||||
// *******************************
|
||||
{
|
||||
if (_boundingBox.IsEmpty())
|
||||
if (_boundingBox.isEmpty())
|
||||
{
|
||||
Rubber* rubber = const_cast<Rubber*>(this);
|
||||
Box& boundingBox = rubber->_boundingBox;
|
||||
for_each_hook(hook, GetHooks()) {
|
||||
Point position = hook->GetComponent()->GetBoundingBox().GetCenter();
|
||||
boundingBox.Merge(position);
|
||||
Point position = hook->GetComponent()->GetBoundingBox().getCenter();
|
||||
boundingBox.merge(position);
|
||||
end_for;
|
||||
}
|
||||
}
|
||||
|
@ -245,14 +245,14 @@ void Rubber::Invalidate(bool propagateFlag)
|
|||
// ****************************************
|
||||
{
|
||||
Inherit::Invalidate(false);
|
||||
_boundingBox.MakeEmpty();
|
||||
_boundingBox.makeEmpty();
|
||||
}
|
||||
|
||||
//bool Rubber::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const
|
||||
//// **************************************************************************************
|
||||
//{
|
||||
// double x = GetValue(point.GetX());
|
||||
// double y = GetValue(point.GetY());
|
||||
// double x = GetValue(point.getX());
|
||||
// double y = GetValue(point.getY());
|
||||
// double a = GetValue(aperture);
|
||||
// Point origin;
|
||||
//
|
||||
|
@ -277,12 +277,12 @@ void Rubber::Invalidate(bool propagateFlag)
|
|||
// default:
|
||||
// throw Error("Unknown RubberDisplayType");
|
||||
// }
|
||||
// double xo = GetValue(origin.GetX());
|
||||
// double yo = GetValue(origin.GetY());
|
||||
// double xo = GetValue(origin.getX());
|
||||
// double yo = GetValue(origin.getY());
|
||||
// for_each_hook(hook, GetHooks()) {
|
||||
// Point extremity = extremity = hook->GetComponent()->GetBoundingBox().GetCenter();
|
||||
// double xe = GetValue(extremity.GetX());
|
||||
// double ye = GetValue(extremity.GetY());
|
||||
// Point extremity = extremity = hook->GetComponent()->GetBoundingBox().getCenter();
|
||||
// double xe = GetValue(extremity.getX());
|
||||
// double ye = GetValue(extremity.getY());
|
||||
// double xp = xo;
|
||||
// double yp = yo;
|
||||
// if (xo != xe) xp = (((xe - xo) / (ye - yo)) * (y - yo)) + xo;
|
||||
|
@ -307,7 +307,7 @@ void Rubber::Invalidate(bool propagateFlag)
|
|||
// {
|
||||
// center = transformation.GetPoint(GetCenter());
|
||||
// for_each_hook(hook, GetHooks()) {
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter();
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().getCenter();
|
||||
// view->DrawLine(center, transformation.GetPoint(position));
|
||||
// end_for;
|
||||
// }
|
||||
|
@ -317,7 +317,7 @@ void Rubber::Invalidate(bool propagateFlag)
|
|||
// {
|
||||
// center = transformation.GetPoint(GetBarycenter());
|
||||
// for_each_hook(hook, GetHooks()) {
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter();
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().getCenter();
|
||||
// view->DrawLine(center, transformation.GetPoint(position));
|
||||
// end_for;
|
||||
// }
|
||||
|
@ -327,8 +327,8 @@ void Rubber::Invalidate(bool propagateFlag)
|
|||
// {
|
||||
// center = transformation.GetPoint(GetBarycenter());
|
||||
// for_each_hook(hook, GetHooks()) {
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter();
|
||||
// Point crosspoint (position.GetX(), center.GetY());
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().getCenter();
|
||||
// Point crosspoint (position.getX(), center.getY());
|
||||
// view->DrawLine(position, crosspoint);
|
||||
// view->DrawLine(crosspoint, center);
|
||||
// end_for;
|
||||
|
@ -344,7 +344,7 @@ void Rubber::Invalidate(bool propagateFlag)
|
|||
//
|
||||
typedef struct pcmp_s {
|
||||
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;
|
||||
|
||||
|
@ -359,7 +359,7 @@ typedef struct pcmp_s {
|
|||
// {
|
||||
// center = transformation.GetPoint(GetCenter());
|
||||
// for_each_hook(hook, GetHooks()) {
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter();
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().getCenter();
|
||||
// view->DrawLine(center, transformation.GetPoint(position));
|
||||
// end_for;
|
||||
// }
|
||||
|
@ -369,7 +369,7 @@ typedef struct pcmp_s {
|
|||
// {
|
||||
// center = transformation.GetPoint(GetBarycenter());
|
||||
// for_each_hook(hook, GetHooks()) {
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter();
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().getCenter();
|
||||
// view->DrawLine(center, transformation.GetPoint(position));
|
||||
// end_for;
|
||||
// }
|
||||
|
@ -380,13 +380,13 @@ typedef struct pcmp_s {
|
|||
// set <Point, pcmp_t> pset;
|
||||
// for_each_hook (hook, GetHooks())
|
||||
// {
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().GetCenter();
|
||||
// Point position = hook->GetComponent()->GetBoundingBox().getCenter();
|
||||
// pset.insert (position);
|
||||
// end_for;
|
||||
// }
|
||||
// center = transformation.GetPoint(GetBarycenter());
|
||||
// Unit lastXup = center.GetX();
|
||||
// Unit lastXlo = center.GetX();
|
||||
// Unit lastXup = center.getX();
|
||||
// Unit lastXlo = center.getX();
|
||||
// for (
|
||||
// set<Point, pcmp_t>::iterator pit = pset.begin();
|
||||
// pit != pset.end();
|
||||
|
@ -394,29 +394,29 @@ typedef struct pcmp_s {
|
|||
// )
|
||||
// {
|
||||
// Point position (*pit);
|
||||
// Point crosspoint (position.GetX(), center.GetY());
|
||||
// Point crosspoint (position.getX(), center.getY());
|
||||
// Point connxpoint (center);
|
||||
// if (position.GetY() > center.GetY())
|
||||
// if (position.getY() > center.getY())
|
||||
// {
|
||||
// // en haut
|
||||
// if ( (position.GetX() - lastXup) < (position.GetY() - center.GetY()) )
|
||||
// if ( (position.getX() - lastXup) < (position.getY() - center.getY()) )
|
||||
// {
|
||||
// crosspoint.SetX (lastXup);
|
||||
// crosspoint.SetY (position.GetY());
|
||||
// crosspoint.SetY (position.getY());
|
||||
// connxpoint.SetX (lastXup);
|
||||
// }
|
||||
// else
|
||||
// lastXup = position.GetX();
|
||||
// lastXup = position.getX();
|
||||
// } else {
|
||||
// // en bas
|
||||
// if ( (position.GetX() - lastXlo) < (center.GetY() - position.GetY()) )
|
||||
// if ( (position.getX() - lastXlo) < (center.getY() - position.getY()) )
|
||||
// {
|
||||
// crosspoint.SetX (lastXlo);
|
||||
// crosspoint.SetY (position.GetY());
|
||||
// crosspoint.SetY (position.getY());
|
||||
// connxpoint.SetX (lastXlo);
|
||||
// }
|
||||
// else
|
||||
// lastXlo = position.GetX();
|
||||
// lastXlo = position.getX();
|
||||
// }
|
||||
//
|
||||
//
|
||||
|
|
|
@ -61,8 +61,8 @@ Transformation::Transformation(const Unit& tx, const Unit& ty, const Orientation
|
|||
|
||||
Transformation::Transformation(const Point& translation, const Orientation& orientation)
|
||||
// *************************************************************************************
|
||||
: _tx(translation.GetX()),
|
||||
_ty(translation.GetY()),
|
||||
: _tx(translation.getX()),
|
||||
_ty(translation.getY()),
|
||||
_orientation(orientation)
|
||||
{
|
||||
}
|
||||
|
@ -115,13 +115,13 @@ Unit Transformation::GetY(const Unit& x, const Unit& y) 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
|
||||
// ************************************************
|
||||
{
|
||||
return GetY(point.GetX(), point.GetY());
|
||||
return GetY(point.getX(), point.getY());
|
||||
}
|
||||
|
||||
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
|
||||
// *****************************************************
|
||||
{
|
||||
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
|
||||
|
@ -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
|
||||
// ***********************************************************************
|
||||
{
|
||||
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
|
||||
// *********************************************
|
||||
{
|
||||
if (box.IsEmpty()) return box;
|
||||
return GetBox(box.GetXMin(), box.GetYMin(), box.GetXMax(), box.GetYMax());
|
||||
if (box.isEmpty()) return box;
|
||||
return GetBox(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax());
|
||||
}
|
||||
|
||||
Transformation Transformation::GetTransformation(const Transformation& transformation) const
|
||||
|
|
|
@ -64,7 +64,7 @@ Box Vertical::GetBoundingBox() const
|
|||
Unit size = GetHalfWidth() + _GetSize();
|
||||
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
|
||||
|
@ -75,7 +75,7 @@ Box Vertical::GetBoundingBox(BasicLayer* basicLayer) const
|
|||
Unit size = GetHalfWidth() + _GetSize(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
|
||||
|
|
Loading…
Reference in New Issue