HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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
 
std::size_t hash_value (const this_type &t)
 

Detailed Description

template<typename T>
class UT_BoundingRectT< T >

Definition at line 29 of file UT_BoundingRect.h.

Member Typedef Documentation

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

Definition at line 32 of file UT_BoundingRect.h.

Constructor & Destructor Documentation

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

Definition at line 34 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 35 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 43 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 53 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 385 of file UT_BoundingRect.h.

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

Iterate over the data serially

Definition at line 387 of file UT_BoundingRect.h.

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

Definition at line 308 of file UT_BoundingRect.h.

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

Definition at line 309 of file UT_BoundingRect.h.

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

Definition at line 173 of file UT_BoundingRect.h.

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

Definition at line 178 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 105 of file UT_BoundingRect.h.

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

Definition at line 293 of file UT_BoundingRect.h.

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

Definition at line 84 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 90 of file UT_BoundingRect.h.

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

Definition at line 100 of file UT_BoundingRect.h.

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

Access to the serialized data

Definition at line 379 of file UT_BoundingRect.h.

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

Access to the serialized data

Definition at line 380 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 386 of file UT_BoundingRect.h.

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

Iterate over the data serially

Definition at line 388 of file UT_BoundingRect.h.

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

Definition at line 238 of file UT_BoundingRect.h.

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

Definition at line 242 of file UT_BoundingRect.h.

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

Definition at line 249 of file UT_BoundingRect.h.

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

Definition at line 250 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 251 of file UT_BoundingRect.h.

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

Definition at line 258 of file UT_BoundingRect.h.

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

Definition at line 265 of file UT_BoundingRect.h.

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

Access to the serialized data

Definition at line 378 of file UT_BoundingRect.h.

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

Definition at line 332 of file UT_BoundingRect.h.

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

Definition at line 337 of file UT_BoundingRect.h.

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

Definition at line 333 of file UT_BoundingRect.h.

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

Definition at line 338 of file UT_BoundingRect.h.

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

Definition at line 334 of file UT_BoundingRect.h.

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

Definition at line 339 of file UT_BoundingRect.h.

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

Definition at line 335 of file UT_BoundingRect.h.

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

Definition at line 340 of file UT_BoundingRect.h.

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

Compute a hash

Definition at line 393 of file UT_BoundingRect.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 195 of file UT_BoundingRect.h.

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

Definition at line 204 of file UT_BoundingRect.h.

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

Definition at line 209 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 214 of file UT_BoundingRect.h.

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

Definition at line 219 of file UT_BoundingRect.h.

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

Definition at line 220 of file UT_BoundingRect.h.

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

Definition at line 221 of file UT_BoundingRect.h.

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

Initialize the box to the largest size.

Definition at line 230 of file UT_BoundingRect.h.

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

Definition at line 166 of file UT_BoundingRect.h.

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

Definition at line 159 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 138 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 148 of file UT_BoundingRect.h.

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

Definition at line 122 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 185 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 317 of file UT_BoundingRect.h.

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

Definition at line 322 of file UT_BoundingRect.h.

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

Definition at line 318 of file UT_BoundingRect.h.

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

Definition at line 323 of file UT_BoundingRect.h.

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

Definition at line 190 of file UT_BoundingRect.h.

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

Definition at line 79 of file UT_BoundingRect.h.

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

Definition at line 61 of file UT_BoundingRect.h.

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

Definition at line 66 of file UT_BoundingRect.h.

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

Definition at line 72 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 287 of file UT_BoundingRect.h.

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

Definition at line 327 of file UT_BoundingRect.h.

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

Definition at line 328 of file UT_BoundingRect.h.

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

Definition at line 329 of file UT_BoundingRect.h.

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

Definition at line 330 of file UT_BoundingRect.h.

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

Definition at line 305 of file UT_BoundingRect.h.

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

Definition at line 306 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 272 of file UT_BoundingRect.h.

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

Definition at line 280 of file UT_BoundingRect.h.

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

Definition at line 319 of file UT_BoundingRect.h.

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

Definition at line 324 of file UT_BoundingRect.h.

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

Definition at line 320 of file UT_BoundingRect.h.

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

Definition at line 325 of file UT_BoundingRect.h.

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

Definition at line 343 of file UT_BoundingRect.h.

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

Definition at line 342 of file UT_BoundingRect.h.

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

Definition at line 347 of file UT_BoundingRect.h.

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

Definition at line 345 of file UT_BoundingRect.h.

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

Definition at line 344 of file UT_BoundingRect.h.

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

Definition at line 348 of file UT_BoundingRect.h.

Friends And Related Function Documentation

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

Compute a hash

Definition at line 394 of file UT_BoundingRect.h.

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

Definition at line 359 of file UT_BoundingRect.h.

Member Data Documentation

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

Definition at line 399 of file UT_BoundingRect.h.

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

Definition at line 398 of file UT_BoundingRect.h.


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