tlp::Rectangle< Obj > Struct Template Reference
[Basic]
class for rectangle
More...
#include <Rectangle.h>
List of all members.
Public Member Functions
- Rectangle ()
- Rectangle (const Obj xmin, const Obj ymin, const Obj xmax, const Obj ymax)
- Rectangle (const tlp::BoundingBox &b)
- Rectangle (const Vector< Obj, 2 > &min, const Vector< Obj, 2 > &max)
- bool intersect (const Rectangle &r) const
- bool intersect (const Rectangle &r, Rectangle &intersection) const
- bool isValid () const
- bool isInside (const Vector< Obj, 2 > &p) const
- bool isInside (const Rectangle &r) const
- void translate (const tlp::Vector< Obj, 2 > &v)
- Obj width () const
- Obj height () const
- Obj surface () const
- Obj aspectRatio () const
- Vector< Obj, 2 > center () const
Detailed Description
template<typename Obj>
struct tlp::Rectangle< Obj >
class for rectangle
Enables to both create and manipulate a 2D Axis Aligned Rectangle
Author : <a href=www.tulip-software.org>Tulip team
Constructor & Destructor Documentation
Create a new invalid rectangle
Create a new rectangle with (*this)[0] = min = (xmin, ymin); (*this)[1] = max = (xmax, ymax);
- Warning:
- the rectangle must be valid (tested in debug mode)
Create a new Rectangle from a Bounding Box correct conversion from 3D -> 2D
- Warning:
- the rectangle must be valid (tested in debug mode)
create a new Rectangle
- Warning:
- the rectangle must be valid (tested in debug mode)
Member Function Documentation
Return the aspect ratio of the reactangle a value between [0..1]
- Warning:
- the rectangle must be valid (tested in debug mode)
Return the center of a rectangle
- Warning:
- the rectangle must be valid (tested in debug mode)
Return the height of the rectangle
- Warning:
- the rectangle must be valid (tested in debug mode)
- Returns:
- the true if there is an intersection else false, the intersection parameter is used to stored the Rectangle pf intersection (if it exists).
- Warning:
- the rectangle must be valid (tested in debug mode)
- Returns:
- true if r intersect "this".
- Warning:
- the rectangle must be valid (tested in debug mode)
- Returns:
- true if r is inside or equal to the AARectangle
- Warning:
- the rectangle must be valid (tested in debug mode)
Return true if point is stricly inside the AARectangle
- Warning:
- the rectangle must be valid (tested in debug mode)
- Returns:
- true if the Rectangle is well define [0] min corner, [1] max corner.
Return the surface of the rectangle
- Warning:
- the rectangle must be valid (tested in debug mode)
Translate "this" by vector v
- Warning:
- the rectangle must be valid (tested in debug mode)
Return the width of the rectangle
- Warning:
- the rectangle must be valid (tested in debug mode)