# Hurricane VLSI Database

List of all members | Public Member Functions
Hurricane::Box Class Reference

Box description (API) More...

## Public Member Functions
| Box ()
| Box (const DbU::Unit &x, const DbU::Unit &y)
| Box (const Point &point)
| Box (const DbU::Unit &x1, const DbU::Unit &y1, const DbU::Unit &x2, const DbU::Unit &y2)
| Box (const Point &point1, const Point &point2)
| Box (const Box &box)
Box & | operator= (const Box &box)
bool | operator== (const Box &box) const
bool | operator!= (const Box &box) const
const DbU::Unit & | getXMin () const
const DbU::Unit & | getYMin () const
const DbU::Unit & | getXMax () const
const DbU::Unit & | getYMax () const
DbU::Unit | getXCenter () const
DbU::Unit | getYCenter () const
Point | getCenter () const
DbU::Unit | getWidth () const
DbU::Unit | getHalfWidth () const
DbU::Unit | getHeight () const
DbU::Unit | getHalfHeight () const
Box | getUnion (const Box &box) const
Box | getIntersection (const Box &box) const
bool | isEmpty () const
bool | isFlat () const
bool | isPonctual () const
bool | contains (const DbU::Unit &x, const DbU::Unit &y) const
bool | contains (const Point &point) const
bool | contains (const Box &box) const
bool | intersect (const Box &box) const
bool | isConstrainedBy (const Box &box) const
Box & | makeEmpty ()
Box & | inflate (const DbU::Unit &d)
Box & | inflate (const DbU::Unit &dx, const DbU::Unit &dy)
Box & | inflate (const DbU::Unit &dxMin, const DbU::Unit &dyMin, const DbU::Unit &dxMax, const DbU::Unit &dyMax)
Box & | merge (const DbU::Unit &x, const DbU::Unit &y)
Box & | merge (const Point &point)
Box & | merge (const DbU::Unit &x1, const DbU::Unit &y1, const DbU::Unit &x2, const DbU::Unit &y2)
Box & | merge (const Box &box)
Box & | translate (const DbU::Unit &dx, const DbU::Unit &dy)

## Detailed Description

Box description (API)

# Introduction

Those objects represent rectangular boxes. They are defined by the values XMin, YMin, XMax and YMax which are representatives only when the box is not empty. A box is considered empty whenever it is not initialized or when it doesn't represent a real area like the intersection of two disjoint boxes.

# Remark on Modifiers

All the function described in the modifiers section returns a reference on the modified box, providing so the capability to apply to it a new modification as illustrated in the following example :

Box box1(0, 0, 100, 100);
Box box2(20, 20, 50, 150;
if (box1.inflate(3).merge(box2.translate(10, 10).inflate(-1, 1)).contains(20, 20)) {
// do we reach here ? that is the question !
}

## Constructor & Destructor Documentation

## ◆ Box() [1/6]

Hurricane::Box::Box | ( |  | ) |

Default constructor : the returned box is empty.

## ◆ Box() [2/6]

Hurricane::Box::Box | ( | const DbU::Unit & | x,
|  | const DbU::Unit & | y
| ) |  |

Builds a box of null size centered on the point defined by `<x>` and `<y>`.

## ◆ Box() [3/6]

Hurricane::Box::Box | ( | const Point & | point | ) |

Builds a box of null size centered on the point.

## ◆ Box() [4/6]

Hurricane::Box::Box | ( | const DbU::Unit & | x1,
|  | const DbU::Unit & | y1,
|  | const DbU::Unit & | x2,
|  | const DbU::Unit & | y2
| ) |  |

Builds the minimal box enclosing the two points defined by the coordinates `<x1>`, `<y1>` and `<x2>`, `<y2>`.

## ◆ Box() [5/6]

Hurricane::Box::Box | ( | const Point & | point1,
|  | const Point & | point2
| ) |  |

Builds the minimal box enclosing the two points.

## ◆ Box() [6/6]

Hurricane::Box::Box | ( | const Box & | box | ) |

Copy constructor.

## Member Function Documentation

## ◆ operator=()

Box & Hurricane::Box::operator= | ( | const Box & | box | ) |

Assignment operator.

## ◆ operator==()

bool Hurricane::Box::operator== | ( | const Box & | box | ) | const

Equality operator.

Remark: Two empty boxes are always different.

## ◆ operator!=()

bool Hurricane::Box::operator!= | ( | const Box & | box | ) | const

Difference operator.

## ◆ getXMin()

const DbU::Unit & Hurricane::Box::getXMin | ( |  | ) | const
| inline

Returns: the XMin value : meaningful only for a non empty box.

## ◆ getYMin()

const DbU::Unit & Hurricane::Box::getYMin | ( |  | ) | const
| inline

Returns: the YMin value : meaningful only for a non empty box.

## ◆ getXMax()

const DbU::Unit & Hurricane::Box::getXMax | ( |  | ) | const
| inline

Returns: the XMax value : meaningful only for a non empty box.

## ◆ getYMax()

const DbU::Unit & Hurricane::Box::getYMax | ( |  | ) | const
| inline

Returns: the YMax value : meaningful only for a non empty box.

## ◆ getXCenter()

DbU::Unit Hurricane::Box::getXCenter | ( |  | ) | const
| inline

Returns: the abscissa of the box center : meaningful only for a non empty box.

Referenced by getCenter().

## ◆ getYCenter()

DbU::Unit Hurricane::Box::getYCenter | ( |  | ) | const
| inline

Returns: the ordinate of the box center : meaningful only for a non empty box.

Referenced by getCenter().

## ◆ getCenter()

Point Hurricane::Box::getCenter | ( |  | ) | const
| inline

Returns: the box center point : meaningful only for a non empty box.

References getXCenter(), and getYCenter().

## ◆ getWidth()

DbU::Unit Hurricane::Box::getWidth | ( |  | ) | const
| inline

Returns: the box width : meaningful only for a non empty box.

Referenced by getHalfWidth().

## ◆ getHalfWidth()

DbU::Unit Hurricane::Box::getHalfWidth | ( |  | ) | const
| inline

Returns: the half box width : meaningful only for a non empty box.

References getWidth().

## ◆ getHeight()

DbU::Unit Hurricane::Box::getHeight | ( |  | ) | const
| inline

Returns: the box height : meaningful only for a non empty box.

Referenced by getHalfHeight().

## ◆ getHalfHeight()

DbU::Unit Hurricane::Box::getHalfHeight | ( |  | ) | const
| inline

Returns: the half box height : meaningful only for a non empty box.

References getHeight().

## ◆ getUnion()

Box Hurricane::Box::getUnion | ( | const Box & | box | ) | const

Returns: the smallest enclosing box containing the boxes `<this>` and `<box>`. The returned box may be empty if both are.

## ◆ getIntersection()

Box Hurricane::Box::getIntersection | ( | const Box & | box | ) | const

Returns: box representing the overlapping area. This box is empty if either one of the two boxes is empty or if they are disjoint.

## ◆ isEmpty()

bool Hurricane::Box::isEmpty | ( |  | ) | const

Returns: true if the box is empty, else false.

## ◆ isFlat()

bool Hurricane::Box::isFlat | ( |  | ) | const

Returns: true if the box is non void and if we have either ((XMin==XMax) an (YMin<YMax)) or ((XMin<XMax) and (YMin==YMax)).

## ◆ isPonctual()

bool Hurricane::Box::isPonctual | ( |  | ) | const

Returns: true if the box is reduced to a point, else false.

## ◆ contains() [1/3]

bool Hurricane::Box::contains | ( | const DbU::Unit & | x,
|  | const DbU::Unit & | y
| ) |  | const

Returns: true if the box is non empty and contains the point defined by the coordinates `<x>`, `<y>` else false.

## ◆ contains() [2/3]

bool Hurricane::Box::contains | ( | const Point & | point | ) | const

Returns: true if the box is non empty and contains the point `<point>`, else false.

## ◆ contains() [3/3]

bool Hurricane::Box::contains | ( | const Box & | box | ) | const

Returns: true if the two boxes are non empty and if the box `<this>` contains the box `<box>`, else false.

## ◆ intersect()

bool Hurricane::Box::intersect | ( | const Box & | box | ) | const

Returns: true if the two boxes are non empty and if they overlap, else false.

## ◆ isConstrainedBy()

bool Hurricane::Box::isConstrainedBy | ( | const Box & | box | ) | const

Returns: true if the two boxes are non empty, if the box `<this>` contains the box `<box>` and if those two boxes have at least a common border side, else false.

## ◆ makeEmpty()

Box & Hurricane::Box::makeEmpty | ( |  | ) |

Transforms the box into an empty one.

## ◆ inflate() [1/3]

Box & Hurricane::Box::inflate | ( | const DbU::Unit & | d | ) |

Expands (or contracts) the box, if not empty, in each direction of the quantity `<d>`. This quantity might be negative enough to transform it into an empty box.

## ◆ inflate() [2/3]

Box & Hurricane::Box::inflate | ( | const DbU::Unit & | dx,
|  | const DbU::Unit & | dy
| ) |  |

Expands (or contracts) the box, if not empty, horizontaly of the quantity `<dx>` and vertically of the quatity `<dy>`. Those quantities might be negative enough to transform it into an empty box.

## ◆ inflate() [3/3]

Box & Hurricane::Box::inflate | ( | const DbU::Unit & | dxMin,
|  | const DbU::Unit & | dyMin,
|  | const DbU::Unit & | dxMax,
|  | const DbU::Unit & | dyMax
| ) |  |

Expands (or contracts) the box, if not empty, on the left of the quantity `<dxMin>`, on the bottom of the quantity `<dyMin>`, on the right of the quantity `<dxMax>` and on the top of the quantity `<dyMax>`. Those quantities might be negative enough to transform it into an empty box.

## ◆ merge() [1/4]

Box & Hurricane::Box::merge | ( | const DbU::Unit & | x,
|  | const DbU::Unit & | y
| ) |  |

Expands the box in order that it encloses the point defined by coordinates `<x>` and `<y>`. If the box was initially empty it becomes reduced to the enclosed point.

## ◆ merge() [2/4]

Box & Hurricane::Box::merge | ( | const Point & | point | ) |

Expands the box in order that it encloses the point `<point>`. If the box was initially empty it becomes reduced to the enclosed point.

## ◆ merge() [3/4]

Box & Hurricane::Box::merge | ( | const DbU::Unit & | x1,
|  | const DbU::Unit & | y1,
|  | const DbU::Unit & | x2,
|  | const DbU::Unit & | y2
| ) |  |

Expands the box in order that it encloses the points defined by coordinates `<x1>`, `<y1>` and `<x2>`, `<y2>`.

## ◆ merge() [4/4]

Box & Hurricane::Box::merge | ( | const Box & | box | ) |

Expands the box in order that it encloses, if not empty, the box `<box>`. If the box `<this>` was initially empty it becomes reduced to the enclosed box.

## ◆ translate()

Box & Hurricane::Box::translate | ( | const DbU::Unit & | dx,
|  | const DbU::Unit & | dy
| ) |  |

translates the box, if not empty, of the quantities `<dx>` and `<dy>`.

The documentation for this class was generated from the following files:

- Box.h
- Box.dox

Generated by doxygen 1.8.14 on Sun Mar 8 2020 | Return to top of page

Hurricane VLSI Database | Copyright © 2000-2016 Bull S.A. All rights reserved