VTK
Public Member Functions | List of all members
vtkRect< T > Class Template Reference

templated base type for storage of 2D rectangles. More...

#include <vtkRect.h>

Inheritance diagram for vtkRect< T >:
[legend]
Collaboration diagram for vtkRect< T >:
[legend]

Public Member Functions

 vtkRect ()
 
 vtkRect (const T &x, const T &y, const T &width, const T &height)
 
 vtkRect (const T *init)
 
void SetX (const T &x)
 
const T & GetX () const
 
void SetY (const T &y)
 
const T & GetY () const
 
void SetWidth (const T &width)
 
const T & GetWidth () const
 
void SetHeight (const T &height)
 
const T & GetHeight () const
 
const T & GetLeft () const
 
GetRight () const
 
GetTop () const
 
const T & GetBottom () const
 
void Set (const T &x, const T &y, const T &width, const T &height)
 
vtkVector2< T > GetBottomLeft () const
 
vtkVector< T, 2 > GetTopLeft () const
 
vtkVector< T, 2 > GetBottomRight () const
 
vtkVector< T, 2 > GetTopRight () const
 
void AddPoint (const T point[2])
 
void AddPoint (T x, T y)
 
void AddRect (const vtkRect< T > &rect)
 
bool IntersectsWith (const vtkRect< T > &rect)
 
- Public Member Functions inherited from vtkVector< T, 4 >
 vtkVector ()
 
 vtkVector (const T &scalar)
 
 vtkVector (const T *init)
 
SquaredNorm () const
 
double Norm () const
 
double Normalize ()
 
vtkVector< T, Size > Normalized () const
 
Dot (const vtkVector< T, Size > &other) const
 
vtkVector< TR, Size > Cast () const
 
- Public Member Functions inherited from vtkTuple< T, Size >
int GetSize () const
 
 vtkTuple ()
 
 vtkTuple (const T &scalar)
 
 vtkTuple (const T *init)
 
T * GetData ()
 
const T * GetData () const
 
T & operator[] (int i)
 
const T & operator[] (int i) const
 
operator() (int i) const
 
bool Compare (const vtkTuple< T, Size > &other, const T &tol) const
 
template<typename TR >
vtkTuple< TR, Size > Cast () const
 

Additional Inherited Members

- Protected Attributes inherited from vtkTuple< T, Size >
Data [Size]
 

Detailed Description

template<typename T>
class vtkRect< T >

templated base type for storage of 2D rectangles.

This class is a templated data type for storing and manipulating rectangles. The memory layout is a contiguous array of the specified type, such that a float[4] can be cast to a vtkRectf and manipulated. Also a float[12] could be cast and used as a vtkRectf[3].

Tests:
vtkRect (Tests)

Definition at line 37 of file vtkRect.h.

Constructor & Destructor Documentation

template<typename T>
vtkRect< T >::vtkRect ( )
inline

Definition at line 40 of file vtkRect.h.

template<typename T>
vtkRect< T >::vtkRect ( const T &  x,
const T &  y,
const T &  width,
const T &  height 
)
inline

Definition at line 44 of file vtkRect.h.

template<typename T>
vtkRect< T >::vtkRect ( const T *  init)
inlineexplicit

Definition at line 52 of file vtkRect.h.

Member Function Documentation

template<typename T>
void vtkRect< T >::Set ( const T &  x,
const T &  y,
const T &  width,
const T &  height 
)
inline

Set the x, y components of the rectangle, and the width/height.

Definition at line 56 of file vtkRect.h.

template<typename T>
void vtkRect< T >::SetX ( const T &  x)
inline

Set the x component of the rectangle bottom corner, i.e. element 0.

Definition at line 66 of file vtkRect.h.

template<typename T>
const T& vtkRect< T >::GetX ( ) const
inline

Get the x component of the rectangle bottom corner, i.e. element 0.

Definition at line 69 of file vtkRect.h.

template<typename T>
void vtkRect< T >::SetY ( const T &  y)
inline

Set the y component of the rectangle bottom corner, i.e. element 1.

Definition at line 72 of file vtkRect.h.

template<typename T>
const T& vtkRect< T >::GetY ( ) const
inline

Get the y component of the rectangle bottom corner, i.e. element 1.

Definition at line 75 of file vtkRect.h.

template<typename T>
void vtkRect< T >::SetWidth ( const T &  width)
inline

Set the width of the rectanle, i.e. element 2.

Definition at line 78 of file vtkRect.h.

template<typename T>
const T& vtkRect< T >::GetWidth ( ) const
inline

Get the width of the rectangle, i.e. element 2.

Definition at line 81 of file vtkRect.h.

template<typename T>
void vtkRect< T >::SetHeight ( const T &  height)
inline

Set the height of the rectangle, i.e. element 3.

Definition at line 84 of file vtkRect.h.

template<typename T>
const T& vtkRect< T >::GetHeight ( ) const
inline

Get the height of the rectangle, i.e. element 3.

Definition at line 87 of file vtkRect.h.

template<typename T>
const T& vtkRect< T >::GetLeft ( ) const
inline

Get the left boundary of the rectangle along the X direction.

Definition at line 90 of file vtkRect.h.

template<typename T>
T vtkRect< T >::GetRight ( ) const
inline

Get the right boundary of the rectangle along the X direction.

Definition at line 93 of file vtkRect.h.

template<typename T>
T vtkRect< T >::GetTop ( ) const
inline

Get the top boundary of the rectangle along the Y direction.

Definition at line 96 of file vtkRect.h.

template<typename T>
const T& vtkRect< T >::GetBottom ( ) const
inline

Get the bottom boundary of the rectangle along the Y direction.

Definition at line 99 of file vtkRect.h.

template<typename T>
vtkVector2<T> vtkRect< T >::GetBottomLeft ( ) const
inline

Get the bottom left corner of the rect as a vtkVector.

Definition at line 103 of file vtkRect.h.

template<typename T>
vtkVector<T, 2> vtkRect< T >::GetTopLeft ( ) const
inline

Get the top left corner of the rect as a vtkVector.

Definition at line 111 of file vtkRect.h.

template<typename T>
vtkVector<T, 2> vtkRect< T >::GetBottomRight ( ) const
inline

Get the bottom right corner of the rect as a vtkVector.

Definition at line 119 of file vtkRect.h.

template<typename T>
vtkVector<T, 2> vtkRect< T >::GetTopRight ( ) const
inline

Get the bottom left corner of the rect as a vtkVector.

Definition at line 127 of file vtkRect.h.

template<typename T>
void vtkRect< T >::AddPoint ( const T  point[2])
inline

Expand this rect to contain the point passed in.

Definition at line 135 of file vtkRect.h.

template<typename T>
void vtkRect< T >::AddPoint ( x,
y 
)
inline

Expand this rect to contain the point passed in.

Definition at line 169 of file vtkRect.h.

template<typename T>
void vtkRect< T >::AddRect ( const vtkRect< T > &  rect)
inline

Expand this rect to contain the rect passed in.

Definition at line 178 of file vtkRect.h.

template<typename T>
bool vtkRect< T >::IntersectsWith ( const vtkRect< T > &  rect)
inline

Returns true if the rect argument overlaps this rect. If the upper bound of one rect is equal to the lower bound of the other rect, then this will return false (in that case, the rects would be considered to be adjacent but not overlapping).

Definition at line 223 of file vtkRect.h.


The documentation for this class was generated from the following file: