Region_t Class Reference

Class representing a region of non-overlapping rectangles, organized into horizontal stripes.

#include <UTGeometry.h>

List of all members.

Public Member Functions

 Region_t (bool main_thread_only=false)
 Region_t (const Rect_t &rect, bool main_thread_only=false)
 Region_t (const Region_t &copy, bool main_thread_only=false)
 ~Region_t ()
const Region_toperator= (const Region_t &copy)
const Region_toperator= (const Rect_t &copy)
const Region_toperator|= (const Rect_t &rect)
const Region_toperator+= (const Rect_t &rect)
const Region_toperator-= (const Rect_t &rect)
const Region_toperator&= (const Rect_t &rect)
const Region_toperator|= (const Region_t &other)
const Region_toperator+= (const Region_t &other)
const Region_toperator-= (const Region_t &other)
const Region_toperator&= (const Region_t &other)
bool operator== (const Region_t &other)
bool operator!= (const Region_t &other)
int CountRects () const
Rect_t RectAt (int index) const
void GetRectAt (out Rect_t *rect, int index) const
void Clear ()
void Shift (const Point_t &offset)
bool Contains (const Point_t &point) const
bool Overlapping (const Rect_t &rect) const
Rect_t BoundingBox () const
void GetBoundingBox (out Rect_t *bounding_box) const

Detailed Description

Definition at line 357 of file UTGeometry.h.


Constructor & Destructor Documentation

Region_t::Region_t ( bool  main_thread_only = false  ) 

Region constructor for an empty region. If main_thread_only is true, it will work somewhat more efficiently, but that can only be the case if this region will only be used from the main (GUI) thread, and once constructed, the Region_t cannot be modified from any thread other than the main thread. The Region_t class is not thread safe, this is merely an optimization for the sub-rectangle allocator.

Region_t::Region_t ( const Rect_t rect,
bool  main_thread_only = false 
)

Region constructor for a simple rectangle. It is assumed that this Region_t will be accessed from a thread other than the main thread, so sub-rectangles will be allocated using a somewhat less efficient mechanism than if an empty region was constructed with main_thread_only = true and then the contentsx were assigned.

Region_t::Region_t ( const Region_t copy,
bool  main_thread_only = false 
)

Copy constructor. If main_thread_only is true, it will work somewhat more efficiently, but that can only be the case if this region will only be used from the main (GUI) thread, and once constructed, the Region_t cannot be modified from any thread other than the main thread. The Region_t being copied from does not need to have the main_thread_only property set. The Region_t class is not thread safe, this is merely an optimization for the sub-rectangle allocator. Because the Region_t class is not thread-safe, naturally the Region_t being copied from cannot be modified from another thread while construction is ongoing.

Region_t::~Region_t (  ) 

Destructor.


Member Function Documentation

const Region_t& Region_t::operator= ( const Region_t copy  ) 

Assignment operator.

const Region_t& Region_t::operator= ( const Rect_t copy  ) 

Assignment operator.

const Region_t& Region_t::operator|= ( const Rect_t rect  ) 

Expands the region to include the entire area enclosed by rect.

const Region_t& Region_t::operator+= ( const Rect_t rect  ) 

Expands the region to include the entire area enclosed by rect.

const Region_t& Region_t::operator-= ( const Rect_t rect  ) 

Removes the specified rect from this region. Any rects which existed in the region and partially overlapped the rect to be removed will be split into multiple rects covering the non-overlapping portions of the original rects.

const Region_t& Region_t::operator&= ( const Rect_t rect  ) 

Crops the region to the area enclosed by rect.

const Region_t& Region_t::operator|= ( const Region_t other  ) 

Expands the region to include the entire area defined by other.

const Region_t& Region_t::operator+= ( const Region_t other  ) 

Expands the region to include the entire area enclosed by other.

const Region_t& Region_t::operator-= ( const Region_t other  ) 

Removes the specified region from this region. Any rects which existed in this region and partially overlapped one or more rects of the region to be removed will be split into multiple rects covering the non-overlapping portions of the original rects.

const Region_t& Region_t::operator&= ( const Region_t other  ) 

Crops the region to the area intersecting other.

bool Region_t::operator== ( const Region_t other  ) 

Returns whether this region is equal to the other.

bool Region_t::operator!= ( const Region_t other  )  [inline]

Returns whether this region is not equal to the other.

Definition at line 1577 of file UTGeometry.h.

int Region_t::CountRects (  )  const

Returns the number of rectangles defining the region.

Rect_t Region_t::RectAt ( int  index  )  const [inline]

Returns the rect at the specified index in the region. Even though it is const, this function is not thread safe for a given Region_t due to the indexing optimization mechanism.

Definition at line 1584 of file UTGeometry.h.

void Region_t::GetRectAt ( out Rect_t rect,
int  index 
) const

Returns the rect at the specified index in the region. Even though it is const, this function is not thread safe for a given Region_t due to the indexing optimization mechanism.

void Region_t::Clear (  ) 

Removes all rectangles, leaving an empty region.

void Region_t::Shift ( const Point_t offset  ) 

Adds the x and y values of the specified point to all rectangles in the region. Unlike the other geometry structs and classes, Region_t does not have operators +, -, +=, or -= a Point_t because in this case it would be ambiguous whether the point should be an offset or the region should be extended to include the point.

bool Region_t::Contains ( const Point_t point  )  const

Returns whether this region encloses the specified point.

bool Region_t::Overlapping ( const Rect_t rect  )  const

Returns true if this region (not its bounding box) at least partially overlaps the rectangle.

Rect_t Region_t::BoundingBox (  )  const [inline]

Returns the bounding box which would enclose the entire region.

Definition at line 1593 of file UTGeometry.h.

void Region_t::GetBoundingBox ( out Rect_t bounding_box  )  const

Returns the bounding box which would enclose the entire region.


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

Generated on Tue Dec 14 22:35:07 2010 for UT library by  doxygen 1.6.1