![]() |
Vault
4.1
|
VRectT defines a rectangle. More...
#include <vgeometry.h>
Public Member Functions | |
| VRectT (const VPointT< T > &leftTop, const VSizeT< T > &size) | |
| VRectT (const VPointT< T > &leftTop, const VPointT< T > &rightBottom) | |
| VRectT (VBinaryIOStream &stream) | |
| VRectT (T left, T top, T width, T height) | |
| void | readFromStream (VBinaryIOStream &stream) |
| void | writeToStream (VBinaryIOStream &stream) const |
| VPointT< T > | getLeftTop () const |
| VPointT< T > | getRightBottom () const |
| VPointT< T > | getRightTop () const |
| VPointT< T > | getLeftBottom () const |
| VSizeT< T > | getSize () const |
| T | getLeft () const |
| T | getTop () const |
| T | getRight () const |
| T | getBottom () const |
| T | getWidth () const |
| T | getHeight () const |
| VPointT< T > | getCenter () const |
| VLineT< T > | getTopSide () const |
| The "edge" functions return lines that are "normalized", preferring to point +x, then +y. | |
| VLineT< T > | getRightSide () const |
| VLineT< T > | getBottomSide () const |
| VLineT< T > | getLeftSide () const |
| VRectT< T > | normalized () const |
| void | moveTo (const VPointT< T > &leftTop) |
| void | translate (T dx, T dy) |
| void | translate (const VPointT< T > &offset) |
| void | setSize (const VSizeT< T > &size) |
| void | setWidth (T width) |
| void | setHeight (T height) |
| void | setBounds (T left, T top, T right, T bottom) |
| void | setLeft (T left) |
| void | setTop (T top) |
| void | setRight (T right) |
| void | setBottom (T bottom) |
| bool | contains (const VPointT< T > &p) const |
| void | expandTo (const VPointT< T > &p) |
| VRectT< T > | united (const VRectT< T > &r) const |
| VRectT< T > | intersected (const VRectT< T > &r) const |
| VPointT< T > | getNearestVertex (const VPointT< T > &testPoint) const |
| Returns the corner of the rectangle nearest to the supplied point. | |
| VLineT< T > | getNearestSide (const VPointT< T > &testPoint) const |
| Returns the side of the rectangle that is nearest to the supplied point. | |
| VLineT< T > | getNearestSide (const VPointT< T > &testPoint, VPoint &nearestPoint) const |
| Returns the side of the rectangle that is nearest to the supplied point. | |
Static Public Member Functions | |
| static bool | equal (const VRectT< T > &r1, const VRectT< T > &r2) |
| static bool | notEqual (const VRectT< T > &r1, const VRectT< T > &r2) |
Friends | |
| bool | operator== (const VRectT< T > &r1, const VRectT< T > &r2) |
| bool | operator!= (const VRectT< T > &r1, const VRectT< T > &r2) |
VRectT defines a rectangle.
VRect uses VDouble coordinates; VIRect uses int coordinates.
Definition at line 506 of file vgeometry.h.
The "edge" functions return lines that are "normalized", preferring to point +x, then +y.
Definition at line 537 of file vgeometry.h.
| VPointT<T> VRectT< T >::getNearestVertex | ( | const VPointT< T > & | testPoint | ) | const [inline] |
Returns the corner of the rectangle nearest to the supplied point.
| testPoint | a point to test proximity |
Definition at line 635 of file vgeometry.h.
| VLineT<T> VRectT< T >::getNearestSide | ( | const VPointT< T > & | testPoint | ) | const [inline] |
Returns the side of the rectangle that is nearest to the supplied point.
If the test point is in a "dead zone" where the nearest point on a side is a vertex, there is currently no guarantee which of the two candidate sides will be returned.
| testPoint | a point to test proximity |
Definition at line 649 of file vgeometry.h.
| VLineT<T> VRectT< T >::getNearestSide | ( | const VPointT< T > & | testPoint, |
| VPoint & | nearestPoint | ||
| ) | const [inline] |
Returns the side of the rectangle that is nearest to the supplied point.
If the test point is in a "dead zone" where the nearest point on a side is a vertex, there is currently no guarantee which of the two candidate sides will be returned, and the returned nearestPoint will a vertex (shared by the two possible sides).
| testPoint | a point to test proximity |
| nearestPoint | returned value, the point (on the line segment) that is nearest to the test point |
Definition at line 665 of file vgeometry.h.