Overview     Modules     Class Hierarchy     Classes     Members  

tlp::Rectangle< Obj > Struct Template Reference
[Basic]

#include <Rectangle.h>

Inherits tlp::Array< Vector< Obj, 2 >, 2 >.

Inheritance diagram for tlp::Rectangle< Obj >:

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

Collaboration graph
[legend]
List of all members.

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

Public Member Functions


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); Validity is 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 validity of the new Rectangle is 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 Validity is checked 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]

template<typename Obj>
Vector<Obj, 2> tlp::Rectangle< Obj >::center  )  const [inline]
 

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

template<typename Obj>
Obj tlp::Rectangle< Obj >::height  )  const [inline]
 

Return the height of the rectangle The Rectangle must be valid (tested in debug)

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).

template<typename Obj>
bool tlp::Rectangle< Obj >::intersect const Rectangle< Obj > &  r  )  const [inline]
 

Returns:
true if r intersect "this".

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 Validity of Rectangles is 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 validity of the current rectangle is 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 The Rectangle must be valid (tested in debug)

template<typename Obj>
void tlp::Rectangle< Obj >::translate const tlp::Vector< Obj, 2 > &  v  )  [inline]
 

Translate "this" by vector v validity of the Rectangle is tested in debubg

template<typename Obj>
Obj tlp::Rectangle< Obj >::width  )  const [inline]
 

Return the width of the rectangle The Rectangle must be valid (tested in debug)



Tulip Software by LaBRI Visualization Team    2001 - 2010