HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_BoundingRectT< T > Class Template Reference

#include <UT_BoundingRect.h>

Public Types

typedef UT_BoundingRectT< Tthis_type
 

Public Member Functions

 UT_BoundingRectT ()
 
 UT_BoundingRectT (T xmin, T ymin, T xmax, T ymax)
 
 UT_BoundingRectT (const UT_Vector2T< T > &lowerbound, const UT_Vector2T< T > &upperbound)
 
template<typename U >
 UT_BoundingRectT (const UT_BoundingRectT< U > &src)
 
T operator() (unsigned m, unsigned n) const
 
Toperator() (unsigned m, unsigned n)
 
int operator== (const UT_BoundingRectT< T > &brect) const
 
bool operator!= (const UT_BoundingRectT< T > &brect) const
 
int contains (const UT_Vector2T< T > &pt) const
 
int contains (const UT_Vector2T< T > &pt, T tol) const
 
int contains (T x, T y) const
 
UT_Vector2T< TclosestPoint (const UT_Vector2T< T > &pt) const
 
int isInside (const UT_BoundingRectT< T > &brect) const
 
int intersects (const UT_Vector2T< T > &v0, const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2) const
 
int intersects (const UT_Vector2T< T > &v0, const UT_Vector2T< T > &v1) const
 
int intersects (const UT_BoundingRectT< T > &rect) const
 
int intersects (const UT_BoundingRectT< T > &rect, T tol) const
 
bool intersectIfOverlapping (const UT_BoundingRectT< T > &src)
 
void intersectBounds (const UT_BoundingRectT< T > &src)
 
void clampX (T min, T max)
 
void clampY (T min, T max)
 
bool isValid () const
 Check whether the bounding box contains at least one point. More...
 
void makeInvalid ()
 
void initBounds ()
 
void initBounds (const UT_Vector2T< T > &pt)
 
void initBounds (T x, T y)
 
void initBounds (T xmin, T xmax, T ymin, T ymax)
 
void initBounds (const fpreal32 *v)
 
void initBounds (const fpreal64 *v)
 
void initBounds (const UT_BoundingRectT< T > &rect)
 
void initMaxBounds ()
 Initialize the box to the largest size. More...
 
void enlargeBounds (const UT_Vector2T< T > &pt)
 
void enlargeBounds (T x, T y)
 
void enlargeBounds (const fpreal32 *v)
 
void enlargeBounds (const fpreal64 *v)
 
void enlargeBounds (T xmin, T xmax, T ymin, T ymax)
 
void enlargeBounds (const UT_BoundingRectT< T > &rect)
 
void expandBounds (T dx, T dy)
 
void stretch (T percent=0.001, T min=0.001)
 
void translate (T x, T y)
 
void scale (T xscale, T yscale)
 
uint8 cohenSutherland (const UT_BoundingRectT< T > &box) const
 
T sizeX () const
 
T sizeY () const
 
T centerX () const
 
T centerY () const
 
void project (T &x, T &y, int *touchx=0, int *touchy=0) const
 
T LX () const
 
T LY () const
 
T UX () const
 
T UY () const
 
TLX ()
 
TLY ()
 
TUX ()
 
TUY ()
 
void setX0 (T v)
 
void setX1 (T v)
 
void setY0 (T v)
 
void setY1 (T v)
 
T getX0 () const
 
T getX1 () const
 
T getY0 () const
 
T getY1 () const
 
TgetX0 ()
 
TgetX1 ()
 
TgetY0 ()
 
TgetY1 ()
 
T xmin () const
 
T xmax () const
 
T ymin () const
 
T ymax () const
 
T xsize () const
 
T ysize () const
 
int intersectRay (const UT_Vector2T< T > &orig, const UT_Vector2T< T > &dir, T tmax=1E17, T *distance=0, UT_Vector2T< T > *xsect=0) const
 
void dump (const char *msg="") const
 
void dump (std::ostream &os) const
 
bool save (UT_JSONWriter &w) const
 
bool save (UT_JSONValue &v) const
 
bool load (UT_JSONParser &p)
 
const TgetSerialized () const
 
const Tdata () const
 
Tdata ()
 
const Tbegin () const
 
const Tend () const
 
Tbegin ()
 
Tend ()
 

Public Attributes

union {
   T   vals [2][2]
 
   T   myFloats [4]
 
}; 
 

Friends

std::ostream & operator<< (std::ostream &os, const UT_BoundingRectT< T > &brect)
 
uint64 hash () const
 Compute UT_BoundingRect hash. More...
 
std::size_t hash_value (const this_type &t)
 Compute UT_BoundingRect hash. More...
 

Detailed Description

template<typename T>
class UT_BoundingRectT< T >

Definition at line 28 of file UT_BoundingRect.h.

Member Typedef Documentation

template<typename T>
typedef UT_BoundingRectT<T> UT_BoundingRectT< T >::this_type

Definition at line 31 of file UT_BoundingRect.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file UT_BoundingRect.h.

template<typename T>
UT_BoundingRectT< T >::UT_BoundingRectT ( T  xmin,
T  ymin,
T  xmax,
T  ymax 
)
inline

Definition at line 34 of file UT_BoundingRect.h.

template<typename T>
UT_BoundingRectT< T >::UT_BoundingRectT ( const UT_Vector2T< T > &  lowerbound,
const UT_Vector2T< T > &  upperbound 
)
inline

Definition at line 42 of file UT_BoundingRect.h.

template<typename T>
template<typename U >
UT_BoundingRectT< T >::UT_BoundingRectT ( const UT_BoundingRectT< U > &  src)
inlineexplicit

Definition at line 52 of file UT_BoundingRect.h.

Member Function Documentation

template<typename T>
const T* UT_BoundingRectT< T >::begin ( void  ) const
inline

Iterate over the data serially

Definition at line 389 of file UT_BoundingRect.h.

template<typename T>
T* UT_BoundingRectT< T >::begin ( void  )
inline

Iterate over the data serially

Definition at line 391 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::centerX ( ) const
inline

Definition at line 312 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::centerY ( ) const
inline

Definition at line 313 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::clampX ( T  min,
T  max 
)
inline

Definition at line 172 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::clampY ( T  min,
T  max 
)
inline

Definition at line 177 of file UT_BoundingRect.h.

template<typename T>
UT_Vector2T<T> UT_BoundingRectT< T >::closestPoint ( const UT_Vector2T< T > &  pt) const
inline

Definition at line 104 of file UT_BoundingRect.h.

template<typename T>
uint8 UT_BoundingRectT< T >::cohenSutherland ( const UT_BoundingRectT< T > &  box) const
inline

Definition at line 292 of file UT_BoundingRect.h.

template<typename T>
int UT_BoundingRectT< T >::contains ( const UT_Vector2T< T > &  pt) const
inline

Definition at line 83 of file UT_BoundingRect.h.

template<typename T>
int UT_BoundingRectT< T >::contains ( const UT_Vector2T< T > &  pt,
T  tol 
) const
inline

Definition at line 89 of file UT_BoundingRect.h.

template<typename T>
int UT_BoundingRectT< T >::contains ( T  x,
T  y 
) const
inline

Definition at line 99 of file UT_BoundingRect.h.

template<typename T>
const T* UT_BoundingRectT< T >::data ( ) const
inline

Access to the serialized data

Definition at line 383 of file UT_BoundingRect.h.

template<typename T>
T* UT_BoundingRectT< T >::data ( )
inline

Access to the serialized data

Definition at line 384 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::dump ( const char *  msg = "") const
template<typename T>
void UT_BoundingRectT< T >::dump ( std::ostream &  os) const
template<typename T>
const T* UT_BoundingRectT< T >::end ( void  ) const
inline

Iterate over the data serially

Definition at line 390 of file UT_BoundingRect.h.

template<typename T>
T* UT_BoundingRectT< T >::end ( void  )
inline

Iterate over the data serially

Definition at line 392 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::enlargeBounds ( const UT_Vector2T< T > &  pt)
inline

Definition at line 237 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::enlargeBounds ( T  x,
T  y 
)
inline

Definition at line 241 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::enlargeBounds ( const fpreal32 v)
inline

Definition at line 248 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::enlargeBounds ( const fpreal64 v)
inline

Definition at line 249 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::enlargeBounds ( T  xmin,
T  xmax,
T  ymin,
T  ymax 
)
inline

Definition at line 250 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::enlargeBounds ( const UT_BoundingRectT< T > &  rect)
inline

Definition at line 257 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::expandBounds ( T  dx,
T  dy 
)
inline

Definition at line 264 of file UT_BoundingRect.h.

template<typename T>
const T* UT_BoundingRectT< T >::getSerialized ( ) const
inline

Access to the serialized data

Definition at line 382 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::getX0 ( ) const
inline

Definition at line 336 of file UT_BoundingRect.h.

template<typename T>
T& UT_BoundingRectT< T >::getX0 ( )
inline

Definition at line 341 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::getX1 ( ) const
inline

Definition at line 337 of file UT_BoundingRect.h.

template<typename T>
T& UT_BoundingRectT< T >::getX1 ( )
inline

Definition at line 342 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::getY0 ( ) const
inline

Definition at line 338 of file UT_BoundingRect.h.

template<typename T>
T& UT_BoundingRectT< T >::getY0 ( )
inline

Definition at line 343 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::getY1 ( ) const
inline

Definition at line 339 of file UT_BoundingRect.h.

template<typename T>
T& UT_BoundingRectT< T >::getY1 ( )
inline

Definition at line 344 of file UT_BoundingRect.h.

template<typename T >
uint64 UT_BoundingRectT< T >::hash ( ) const

Compute UT_BoundingRect hash.

Compute a hash

Definition at line 24 of file UT_BoundingRectHash.h.

template<typename T>
void UT_BoundingRectT< T >::initBounds ( )
inline

Initialize the box such that

  • No points are contained in the box
  • The box occupies no position in space

Definition at line 194 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::initBounds ( const UT_Vector2T< T > &  pt)
inline

Definition at line 203 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::initBounds ( T  x,
T  y 
)
inline

Definition at line 208 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::initBounds ( T  xmin,
T  xmax,
T  ymin,
T  ymax 
)
inline

Definition at line 213 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::initBounds ( const fpreal32 v)
inline

Definition at line 218 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::initBounds ( const fpreal64 v)
inline

Definition at line 219 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::initBounds ( const UT_BoundingRectT< T > &  rect)
inline

Definition at line 220 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::initMaxBounds ( )
inline

Initialize the box to the largest size.

Definition at line 229 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::intersectBounds ( const UT_BoundingRectT< T > &  src)
inline

Definition at line 165 of file UT_BoundingRect.h.

template<typename T>
bool UT_BoundingRectT< T >::intersectIfOverlapping ( const UT_BoundingRectT< T > &  src)
inline

Definition at line 158 of file UT_BoundingRect.h.

template<typename T>
int UT_BoundingRectT< T >::intersectRay ( const UT_Vector2T< T > &  orig,
const UT_Vector2T< T > &  dir,
T  tmax = 1E17,
T distance = 0,
UT_Vector2T< T > *  xsect = 0 
) const
inline

Definition at line 177 of file UT_BoundingRectImpl.h.

template<typename T>
int UT_BoundingRectT< T >::intersects ( const UT_Vector2T< T > &  v0,
const UT_Vector2T< T > &  v1,
const UT_Vector2T< T > &  v2 
) const
inline

Definition at line 48 of file UT_BoundingRectImpl.h.

template<typename T>
int UT_BoundingRectT< T >::intersects ( const UT_Vector2T< T > &  v0,
const UT_Vector2T< T > &  v1 
) const
inline

Definition at line 26 of file UT_BoundingRectImpl.h.

template<typename T>
int UT_BoundingRectT< T >::intersects ( const UT_BoundingRectT< T > &  rect) const
inline

Definition at line 137 of file UT_BoundingRect.h.

template<typename T>
int UT_BoundingRectT< T >::intersects ( const UT_BoundingRectT< T > &  rect,
T  tol 
) const
inline

Definition at line 147 of file UT_BoundingRect.h.

template<typename T>
int UT_BoundingRectT< T >::isInside ( const UT_BoundingRectT< T > &  brect) const
inline

Definition at line 121 of file UT_BoundingRect.h.

template<typename T>
bool UT_BoundingRectT< T >::isValid ( void  ) const
inline

Check whether the bounding box contains at least one point.

Definition at line 184 of file UT_BoundingRect.h.

template<typename T>
bool UT_BoundingRectT< T >::load ( UT_JSONParser p)

Methods to serialize to a JSON stream. The vector is stored as an array of 4 reals (xmin, xmax, ymin, ymax)

template<typename T>
T UT_BoundingRectT< T >::LX ( ) const
inline

Definition at line 321 of file UT_BoundingRect.h.

template<typename T>
T& UT_BoundingRectT< T >::LX ( )
inline

Definition at line 326 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::LY ( ) const
inline

Definition at line 322 of file UT_BoundingRect.h.

template<typename T>
T& UT_BoundingRectT< T >::LY ( )
inline

Definition at line 327 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::makeInvalid ( )
inline

Definition at line 189 of file UT_BoundingRect.h.

template<typename T>
bool UT_BoundingRectT< T >::operator!= ( const UT_BoundingRectT< T > &  brect) const
inline

Definition at line 78 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::operator() ( unsigned  m,
unsigned  n 
) const
inline

Definition at line 60 of file UT_BoundingRect.h.

template<typename T>
T& UT_BoundingRectT< T >::operator() ( unsigned  m,
unsigned  n 
)
inline

Definition at line 65 of file UT_BoundingRect.h.

template<typename T>
int UT_BoundingRectT< T >::operator== ( const UT_BoundingRectT< T > &  brect) const
inline

Definition at line 71 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::project ( T x,
T y,
int touchx = 0,
int touchy = 0 
) const
inline

Definition at line 99 of file UT_BoundingRectImpl.h.

template<typename T>
bool UT_BoundingRectT< T >::save ( UT_JSONWriter w) const

Methods to serialize to a JSON stream. The vector is stored as an array of 4 reals (xmin, xmax, ymin, ymax)

template<typename T>
bool UT_BoundingRectT< T >::save ( UT_JSONValue v) const

Methods to serialize to a JSON stream. The vector is stored as an array of 4 reals (xmin, xmax, ymin, ymax)

template<typename T>
void UT_BoundingRectT< T >::scale ( T  xscale,
T  yscale 
)
inline

Definition at line 286 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::setX0 ( T  v)
inline

Definition at line 331 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::setX1 ( T  v)
inline

Definition at line 332 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::setY0 ( T  v)
inline

Definition at line 333 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::setY1 ( T  v)
inline

Definition at line 334 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::sizeX ( ) const
inline

Definition at line 309 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::sizeY ( ) const
inline

Definition at line 310 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::stretch ( T  percent = 0.001,
T  min = 0.001 
)
inline

Definition at line 271 of file UT_BoundingRect.h.

template<typename T>
void UT_BoundingRectT< T >::translate ( T  x,
T  y 
)
inline

Definition at line 279 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::UX ( ) const
inline

Definition at line 323 of file UT_BoundingRect.h.

template<typename T>
T& UT_BoundingRectT< T >::UX ( )
inline

Definition at line 328 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::UY ( ) const
inline

Definition at line 324 of file UT_BoundingRect.h.

template<typename T>
T& UT_BoundingRectT< T >::UY ( )
inline

Definition at line 329 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::xmax ( ) const
inline

Definition at line 347 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::xmin ( ) const
inline

Definition at line 346 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::xsize ( ) const
inline

Definition at line 351 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::ymax ( ) const
inline

Definition at line 349 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::ymin ( ) const
inline

Definition at line 348 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::ysize ( ) const
inline

Definition at line 352 of file UT_BoundingRect.h.

Friends And Related Function Documentation

template<typename T>
std::size_t hash_value ( const this_type t)
friend

Compute UT_BoundingRect hash.

Compute a hash

Definition at line 398 of file UT_BoundingRect.h.

template<typename T>
std::ostream& operator<< ( std::ostream &  os,
const UT_BoundingRectT< T > &  brect 
)
friend

Definition at line 363 of file UT_BoundingRect.h.

Member Data Documentation

union { ... }
template<typename T>
T UT_BoundingRectT< T >::myFloats[4]

Definition at line 403 of file UT_BoundingRect.h.

template<typename T>
T UT_BoundingRectT< T >::vals[2][2]

Definition at line 402 of file UT_BoundingRect.h.


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