Overview | Modules | Class Hierarchy | Classes | Members

Public Member Functions
tlp::Rectangle< Obj > Struct Template Reference
Basic

class for rectangle More...

`#include <Rectangle.h>`

Inheritance diagram for tlp::Rectangle< Obj >:
[legend]
Collaboration diagram for tlp::Rectangle< Obj >:
[legend]

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

template<typename Obj>

tlp::Rectangle< Obj >::Rectangle | ( |  | ) | `[inline]`

Create a new invalid rectangle

template<typename Obj>

tlp::Rectangle< Obj >::Rectangle | ( | const Obj | xmin,
|  | const Obj | ymin,
|  | const Obj | xmax,
|  | const Obj | ymax
| ) |  | `[inline]`

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)

template<typename Obj>

tlp::Rectangle< Obj >::Rectangle | ( | const tlp::BoundingBox & | b | ) | `[inline]`

Create a new Rectangle from a Bounding Box correct conversion from 3D -> 2D

Warning:
  the rectangle must be valid (tested in debug mode)

template<typename Obj>

tlp::Rectangle< Obj >::Rectangle | ( | const Vector< Obj, 2 > & | min,
|  | const Vector< Obj, 2 > & | max
| ) |  | `[inline]`

create a new Rectangle

Warning:
  the rectangle must be valid (tested in debug mode)

## Member Function Documentation

template<typename Obj>

Obj tlp::Rectangle< Obj >::aspectRatio | ( |  | ) | const`[inline]`

Return the aspect ratio of the reactangle a value between [0..1]

Warning:
  the rectangle must be valid (tested in debug mode)

template<typename Obj>

Vector<Obj, 2> tlp::Rectangle< Obj >::center | ( |  | ) | const`[inline]`

Return the center of a rectangle

Warning:
  the rectangle must be valid (tested in debug mode)

template<typename Obj>

Obj tlp::Rectangle< Obj >::height | ( |  | ) | const`[inline]`

Return the height of the rectangle

Warning:
  the rectangle must be valid (tested in debug mode)

template<typename Obj>

bool tlp::Rectangle< Obj >::intersect | ( | const Rectangle< Obj > & | r,
|  | Rectangle< Obj > & | intersection
| ) |  | const`[inline]`

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)

template<typename Obj>

bool tlp::Rectangle< Obj >::intersect | ( | const Rectangle< Obj > & | r | ) | const`[inline]`

Returns:
  true if r intersect "this".

Warning:
  the rectangle must be valid (tested in debug mode)

template<typename Obj>

bool tlp::Rectangle< Obj >::isInside | ( | const Vector< Obj, 2 > & | p | ) | const`[inline]`

Return true if point is stricly inside the AARectangle

Warning:
  the rectangle must be valid (tested in debug mode)

template<typename Obj>

bool tlp::Rectangle< Obj >::isInside | ( | const Rectangle< Obj > & | r | ) | const`[inline]`

Returns:
  true if r is inside or equal to the AARectangle

Warning:
  the rectangle must be valid (tested in debug mode)

template<typename Obj>

bool tlp::Rectangle< Obj >::isValid | ( |  | ) | const`[inline]`

Returns:
  true if the Rectangle is well define [0] min corner, [1] max corner.

template<typename Obj>

Obj tlp::Rectangle< Obj >::surface | ( |  | ) | const`[inline]`

Return the surface of the rectangle

Warning:
  the rectangle must be valid (tested in debug mode)

template<typename Obj>

void tlp::Rectangle< Obj >::translate | ( | const tlp::Vector< Obj, 2 > & | v | ) | `[inline]`

Translate "this" by vector v

Warning:
  the rectangle must be valid (tested in debug mode)

template<typename Obj>

Obj tlp::Rectangle< Obj >::width | ( |  | ) | const`[inline]`

Return the width of the rectangle

Warning:
  the rectangle must be valid (tested in debug mode)

Tulip Software by LaBRI Visualization Team 2001 - 2012