Rectangles in the plane.
More...
#include <rectangle.h>
|
| Rectangles2 () |
| Empty.
|
|
| Rectangles2 (const Vector2 &, const Vector2 &, const double &, const double &) |
| Create a rectangle in the xy-plane, centered at the origin. More...
|
|
| Rectangles2 (const Box2 &) |
| Create a rectangle from a box. More...
|
|
| ~Rectangles2 () |
| Empty.
|
|
Vector2 | Vertex (int) const |
| Returns the k-th vertex of the rectangle. More...
|
|
double | Width () const |
| Return the width.
|
|
double | Height () const |
| Return the height.
|
|
double | R (const Vector2 &) const |
| Compute the squared distance between a point and the rectangle. More...
|
|
Vector2 | Normal (const Vector2 &) const |
| Compute the vector distance between the box and a point. More...
|
|
Box2 | GetBox () const |
| Compute the embedding box.
|
|
Rectangles | ToRectangles () const |
| Convert to a rectangle.
|
|
bool | Intersect (const Circle2 &) const |
| Check the interscetion with a circle. More...
|
|
bool | Intersect (const Rectangles2 &) const |
| Check the intersection with another rectangle. More...
|
|
void | Rotate (const Matrix2 &) |
| Rotate the rectangle. More...
|
|
void | Translate (const Vector2 &) |
| Translate the rectangle. More...
|
|
void | Scale (const double &) |
| Scale the rectangle. More...
|
|
QPolygonF | GetQtPolygon () const |
| Convert the rectangle into a Qt polygon.
|
|
void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| Draw a polygon. More...
|
|
|
static double | epsilon = 1.0e-8 |
| Internal \epsilon; constant.
|
|
◆ Rectangles2() [1/2]
Rectangles2::Rectangles2 |
( |
const Vector2 & |
c, |
|
|
const Vector2 & |
x, |
|
|
const double & |
a, |
|
|
const double & |
b |
|
) |
| |
|
explicit |
Create a rectangle in the xy-plane, centered at the origin.
- Parameters
-
c | Center. |
x | Base vector. |
a,b | Size, the rectangle will be twice as large. |
◆ Rectangles2() [2/2]
Rectangles2::Rectangles2 |
( |
const Box2 & |
box | ) |
|
|
explicit |
Create a rectangle from a box.
- Parameters
-
◆ Draw()
void Rectangles2::Draw |
( |
QGraphicsScene & |
scene, |
|
|
const QPen & |
pen = QPen() , |
|
|
const QBrush & |
brush = QBrush() |
|
) |
| const |
Draw a polygon.
- Parameters
-
scene | Graphics scene. |
pen | The pen. |
brush | The brush. |
◆ Intersect() [1/2]
bool Rectangles2::Intersect |
( |
const Circle2 & |
circle | ) |
const |
Check the interscetion with a circle.
- Parameters
-
◆ Intersect() [2/2]
bool Rectangles2::Intersect |
( |
const Rectangles2 & |
rectangle | ) |
const |
Check the intersection with another rectangle.
- Parameters
-
◆ Normal()
Compute the vector distance between the box and a point.
- Parameters
-
◆ Overlap()
bool Rectangles2::Overlap |
( |
const Rectangles2 & |
other | ) |
const |
|
protected |
Overlapping test for intersection algorithm.
- Parameters
-
◆ R()
double Rectangles2::R |
( |
const Vector2 & |
p | ) |
const |
Compute the squared distance between a point and the rectangle.
- Parameters
-
◆ Rotate()
void Rectangles2::Rotate |
( |
const Matrix2 & |
r | ) |
|
Rotate the rectangle.
- Parameters
-
◆ Scale()
void Rectangles2::Scale |
( |
const double & |
s | ) |
|
Scale the rectangle.
- Parameters
-
◆ Translate()
void Rectangles2::Translate |
( |
const Vector2 & |
t | ) |
|
Translate the rectangle.
- Parameters
-
◆ Vertex()
Vector2 Rectangles2::Vertex |
( |
int |
k | ) |
const |
|
inline |