Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Geometric class. More...
#include <ilviews/base/region.h>
Public Member Functions | |
IlvRegion (const IlvRegion &) | |
Constructor. | |
IlvRegion (const IlvRect &rect) | |
Constructor. | |
IlvRegion () | |
Constructor. | |
void | add (const IlvRegion ®ion) |
Adds a region to this region. | |
void | add (const IlvRect &rect) |
Adds a rectangle to this region. | |
void | apply (const IlvTransformer *t) |
Transforms this region. | |
const IlvRect & | boundingBox () const |
Gets the region bounding box. | |
void | compact () |
Compacts the rectangles of this region. | |
void | computeDifference (const IlvRect &rect1, const IlvRect &rect2) |
Computes a new region as the difference of the two specified rectangles. | |
IlBoolean | contains (const IlvRect &rect) const |
Tests is a rectangle is covered by this region. | |
IlBoolean | contains (const IlvPoint &point) const |
Tests if a point is located in this region. | |
IlvRegion * | copy () const |
Copies a region. | |
void | empty () |
Removes all the rectangle from this region. | |
IlUShort | getCardinal () const |
Gets the number of stored rectangles. | |
const IlvRect & | getRect (IlUShort idx) const |
Gets one rectangle of this region. | |
void | grow (IlvPos dw, IlvPos dh) |
Enlarges a region. | |
void | intersection (const IlvRegion ®ion) |
Computes the intersection with another region. | |
void | intersection (const IlvRect &rect) |
Computes the intersection with a rectangle. | |
IlBoolean | intersects (const IlvRegion ®ion) const |
Tests whether another region intersects this region. | |
IlBoolean | intersects (const IlvRect &rect) const |
Tests if a rectangle intersects this region. | |
void | inverse (const IlvTransformer *t) |
Inverse transforms a region. | |
IlBoolean | isEmpty () const |
Tests if the region is empty. | |
IlBoolean | isFull () const |
Tests if the region is full. | |
const IlvRegion & | operator= (const IlvRegion &) |
Assigns a region. | |
void | subtract (const IlvRect &rect) |
Subtracts a rectangle from this region. | |
void | translate (IlvPos x, IlvPos y) |
Translates a region. |
Geometric class.
Library: display
The IlvRegion
class maintains a list of rectangles (instances of the class IlvRect
to speed up internal tasks related to regions of interest, such as redrawing operations. A region is created by specifying a rectangle or a region. It can also be created empty.
IlvRect
. IlvRegion::IlvRegion | ( | ) |
Constructor.
This constructor initializes a new empty region.
IlvRegion::IlvRegion | ( | const IlvRect & | rect | ) |
Constructor.
This constructor initializes a new region that contains a single rectangle.
rect | The initial rectangle stored in this region. |
IlvRegion::IlvRegion | ( | const IlvRegion & | ) |
Constructor.
This constructor initializes a new region by creating a copy of region
.
void IlvRegion::add | ( | const IlvRegion & | region | ) |
Adds a region to this region.
region | The region to add. |
void IlvRegion::add | ( | const IlvRect & | rect | ) |
Adds a rectangle to this region.
rect | The rectangle to add. |
void IlvRegion::apply | ( | const IlvTransformer * | t | ) |
Transforms this region.
The resulting object has all its rectangles transformed.
t | The transformer to be applied. |
const IlvRect& IlvRegion::boundingBox | ( | ) | const |
Gets the region bounding box.
void IlvRegion::compact | ( | ) |
Compacts the rectangles of this region.
Calling this method ensures that no rectangle of the region is intersecting with another rectangle of the region.
Computes a new region as the difference of the two specified rectangles.
This method calls the empty
method before filling the region with the difference of rect1 less rect2.
rect1 | The initial rectangle. | |
rect2 | The rectangle to subtract. |
Tests is a rectangle is covered by this region.
rect | The rectangle that is tested. |
IlTrue
if rect is entirely inside one of the rectangles stored in this region. If rect is not contained in any of this region's rectangles, it returns IlFalse
. Tests if a point is located in this region.
point | The point that is tested. |
IlTrue
if point is inside one of the rectangles stored in this region. If point is outside all of the region's rectangles, it returns IlFalse
. IlvRegion* IlvRegion::copy | ( | ) | const |
Copies a region.
This member function creates and returns a new object that is the exact copy of this
.
void IlvRegion::empty | ( | ) |
Removes all the rectangle from this region.
The resulting object is an empty region.
IlUShort IlvRegion::getCardinal | ( | ) | const |
Gets the number of stored rectangles.
Gets one rectangle of this region.
idx | The index of the rectangle you want to retrieve. |
0
. Enlarges a region.
All rectangles are enlarged, resulting in an enlarged region.
dw | The horizontal growing value. | |
dh | The vertical growing value. |
void IlvRegion::intersection | ( | const IlvRegion & | region | ) |
Computes the intersection with another region.
Sets the current region so it becomes the result of the intersection of the whole region with another region.
region | The region from which the intersection is computed. |
void IlvRegion::intersection | ( | const IlvRect & | rect | ) |
Computes the intersection with a rectangle.
Sets the current region so it becomes the result of the intersection of the whole region with a rectangle.
rect | The rectangle from which the intersection is computed. |
Tests whether another region intersects this region.
region | The region that is tested. |
IlTrue
if region intersects with any of the rectangles stored in this region. If region does not intersect with any of these rectangles, it returns IlFalse
. Tests if a rectangle intersects this region.
rect | The rectangle that is tested. |
IlTrue
if rect intersects with any of the rectangles stored in this region. If rect does not intersect with any of these rectangles, it returns IlFalse
. void IlvRegion::inverse | ( | const IlvTransformer * | t | ) |
Inverse transforms a region.
The resulting object has all its rectangles inversely transformed.
t | The transformer which inverse to be applied. |
IlBoolean IlvRegion::isEmpty | ( | ) | const |
Tests if the region is empty.
An empty region is a region that contains no point or rectangle at all.
IlTrue
if this object does not store any rectangle or if all the rectangles it contains have null dimensions. Otherwise, it returns IlFalse
. IlBoolean IlvRegion::isFull | ( | ) | const |
Tests if the region is full.
A full region is a region that contains every possible point or rectangle.
IlTrue
if this object corresponds to a full region. Otherwise, it returns IlFalse
. Assigns a region.
region | The region that must be assigned. |
void IlvRegion::subtract | ( | const IlvRect & | rect | ) |
Subtracts a rectangle from this region.
rect | The rectangle to subtract. |
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.