Rapicorn - Experimental UI Toolkit - Source Code  13.07.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Types | Public Member Functions
Rapicorn::Region Class Reference

The Region class manages areas defined through a list of rectangles. More...

#include <region.hh>

List of all members.

Public Types

enum  ContainedType { OUTSIDE, INSIDE, PARTIAL }

Public Member Functions

 Region ()
 Construct an empty Region.
 Region (const Region &region)
 Copy-construct a Region.
 Region (const Rect &rectangle)
 Construct a Region covering rectangle.
 Region (const Point &pt1, const Point &pt2)
 Construct a Region covering a rectangle defined by two points.
Regionoperator= (const Region &region)
 Region assignment.
void clear ()
 Forces an empty Region.
bool empty () const
 Returns whether the Region is empty.
bool equal (const Region &other) const
 Returns whether two Regions cover the same area.
int cmp (const Region &other) const
 Provides linear ordering for regions.
void swap (Region &other)
 Swaps the contents of two Regions.
Rect extents () const
 Provides rectangle extents of the region.
bool contains (const Point &point) const
 Test if point is inside Region.
bool contains (double x, double y) const
 Point test with coordinates.
ContainedType contains (const Rect &rect) const
 Returns if Region covers rect fully, partially or not at all.
ContainedType contains (const Region &other) const
 Returns if Region covers other fully, partially or not at all.
void list_rects (vector< Rect > &rects) const
 Provides a list of rectangles that define Region.
uint count_rects () const
 Provides the number of rectangles that cover Region.
void add (const Rect &rect)
 Adds a rectangle to the Region.
void add (const Region &other)
 Causes Region to contain the union with other.
void subtract (const Region &subtrahend)
 Removes subtrahend from Region.
void intersect (const Region &other)
 Causes Region to contain the intersection with other.
void exor (const Region &other)
 Causes Region to contain the XOR composition with other.
void translate (double dx, double dy)
 Shifts Region by dx, dy.
void affine (const Affine &affine)
 Transforms Region by affine.
double epsilon () const
 Returns the precision (granularity) between fractional digits.
String string ()
 Describes Region in a string.
 ~Region ()
 Public destructor, Region is a simple copyable structure.

Detailed Description

The Region class manages areas defined through a list of rectangles.

Region implements various common operations on areas which can be covered by a list of rectangles. Region calculations use fixed point arithmetics, so only a small number of fractional digits are supported (2 decimals, fractions are represented by 8 bit), and rectangle sizes are also limited (rectangle dimensions shouldn't exceed 3.6e16, i.e. 2^55).


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines