OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TRegion, derived from TGdiObject, represents GDI abstract shapes or regions. More...
#include <owl/gdiobjec.h>
Public Types | |
enum | TEllipse { Ellipse } |
Defines the class-specific constant Ellipse, used to distinguish the ellipse constructor from the rectangle copy constructor. More... | |
typedef HRGN | THandle |
TRegion encapsulates an HRGN. | |
Public Member Functions | |
TRegion () | |
The default constructor creates an empty TRegion object. | |
TRegion (HRGN handle, TAutoDelete autoDelete=NoAutoDelete) | |
Creates a TRegion object and sets the Handle data member to the given borrowed handle. | |
TRegion (const TRegion ®ion) | |
This public copy constructor creates a copy of the given TRegion object as in: | |
TRegion (const TRect &rect) | |
Creates a region object from the given TRect object as in: | |
TRegion (const TRect &e, TEllipse) | |
Creates the elliptical TRegion object that inscribes the given rectangle E. | |
TRegion (const TRect &rect, const TSize &corner) | |
Creates a rounded rectangular TRegion object from the given rect corner. | |
TRegion (const TPoint *points, int count, int fillMode) | |
Creates a filled TRegion object from the polygons given by points and fillMode. | |
TRegion (const TPoint *points, const int *polyCounts, int count, int fillMode) | |
Creates a filled TRegion object from the poly-polygons given by points and fillMode. | |
template<size_t N> | |
TRegion (const TPoint(&points)[N], int fillMode) | |
Creates a filled TRegion object from the polygon given by an array of points and fillMode. | |
template<size_t N> | |
TRegion (const TPoint *points, const int(&polyCounts)[N], int fillMode) | |
Creates a filled TRegion object from the poly-polygons given by points and fillMode. | |
~TRegion () | |
void | SetRectRgn (const TRect &rect) |
Creates a rectangle of the size given by rect. | |
HRGN | GetHandle () const |
Returns the handle of the region with type HREGION. | |
operator HRGN () const | |
Typecast operator. | |
auto | Release () -> HRGN |
Returns the encapsulated handle of the region and relinquishes ownership. | |
bool | operator== (const TRegion &other) const |
Returns true if the regions are identical (equal in size and shape). | |
bool | operator!= (const TRegion &other) const |
Returns true if this region is not equal to the other region. | |
bool | Contains (const TPoint &point) const |
Returns true if this region contains the given point. | |
bool | Touches (const TRect &rect) const |
Returns true if this region touches the given rectangle. | |
int | GetRgnBox (TRect &box) const |
Finds the bounding rectangle (the minimum rectangle containing this region). | |
TRect | GetRgnBox () const |
Returns the bounding rectangle of the region. | |
TRegion & | operator= (const TRegion &source) |
Assigns the source region to this region. | |
TRegion & | operator+= (const TSize &delta) |
Adds the given delta to each point of this region to displace (translate) it by delta.x and delta.y. | |
TRegion & | operator-= (const TSize &delta) |
Subtracts the given delta from each point of this region to displace (translate) it by -delta.x and -delta.y. | |
TRegion & | operator-= (const TRegion &source) |
Creates a "difference" region consisting of all parts of this region that are not parts of the source region. | |
TRegion & | operator&= (const TRegion &source) |
Creates the intersection of this region with the given source region and returns a reference to the result. | |
TRegion & | operator&= (const TRect &source) |
Creates the intersection of this region with the given rectangle, and returns a reference to the result. | |
TRegion & | operator|= (const TRegion &source) |
Creates the union of this region and the given source region , and returns a reference to the result. | |
TRegion & | operator|= (const TRect &source) |
Creates the union of this region and the given rectangle, and returns a reference to the result. | |
TRegion & | operator^= (const TRegion &source) |
Creates the exclusive-or of this region and the given source region. | |
TRegion & | operator^= (const TRect &source) |
Creates the exclusive-or of this region and the given rectangle. | |
TRegion, derived from TGdiObject, represents GDI abstract shapes or regions.
TRegion can construct region objects with various shapes. Several operators are provided for combining and comparing regions.
Definition at line 581 of file gdiobjec.h.
TRegion encapsulates an HRGN.
Definition at line 585 of file gdiobjec.h.
Defines the class-specific constant Ellipse, used to distinguish the ellipse constructor from the rectangle copy constructor.
Enumerator | |
---|---|
Ellipse |
Definition at line 596 of file gdiobjec.h.
owl::TRegion::TRegion | ( | ) |
The default constructor creates an empty TRegion object.
ShouldDelete is set to true.
Definition at line 26 of file region.cpp.
References owl::TGdiBase::CheckValid(), owl::TGdiBase::Handle, and WARNX.
owl::TRegion::TRegion | ( | HRGN | handle, |
TAutoDelete | autoDelete = NoAutoDelete ) |
Creates a TRegion object and sets the Handle data member to the given borrowed handle.
The ShouldDelete data member defaults to false, ensuring that the borrowed handle is not deleted when the C++ object is destroyed. HRGN is the data type representing the handle to an abstract shape.
Definition at line 39 of file region.cpp.
owl::TRegion::TRegion | ( | const TRegion & | source | ) |
This public copy constructor creates a copy of the given TRegion object as in:
Definition at line 51 of file region.cpp.
References owl::TGdiBase::CheckValid(), owl::TGdiBase::Handle, and WARNX.
owl::TRegion::TRegion | ( | const TRect & | rect | ) |
Creates a region object from the given TRect object as in:
Definition at line 67 of file region.cpp.
References owl::TGdiBase::CheckValid(), owl::TGdiBase::Handle, and WARNX.
owl::TRegion::TRegion | ( | const TRect & | rect, |
TRegion::TEllipse | ) |
Creates the elliptical TRegion object that inscribes the given rectangle E.
The TEllipse argument distinguishes this constructor from the TRegion(const TRect& rect) constructor.
Definition at line 79 of file region.cpp.
References owl::TGdiBase::CheckValid(), owl::TGdiBase::Handle, and WARNX.
Creates a rounded rectangular TRegion object from the given rect corner.
Definition at line 89 of file region.cpp.
References owl::TGdiBase::CheckValid(), owl::TGdiBase::Handle, and WARNX.
Creates a filled TRegion object from the polygons given by points and fillMode.
Definition at line 100 of file region.cpp.
Creates a filled TRegion object from the poly-polygons given by points and fillMode.
The 'points' argument should point into an array of points for all the polygons, and polyCounts should point into an array containing the number of points in each polygon. The 'count' argument should specify the number of polygons.
Definition at line 119 of file region.cpp.
Creates a filled TRegion object from the polygon given by an array of points and fillMode.
Definition at line 607 of file gdiobjec.h.
|
inline |
Creates a filled TRegion object from the poly-polygons given by points and fillMode.
The 'points' argument should point into an array of points for all the polygons, and polyCounts should contain the number of points in each polygon.
Definition at line 616 of file gdiobjec.h.
owl::TRegion::~TRegion | ( | ) |
Definition at line 136 of file region.cpp.
References owl::TGdiBase::Handle, owl::TXGdi::Raise(), and owl::TGdiBase::ShouldDelete.
Returns true if this region contains the given point.
Definition at line 1466 of file gdiobjec.h.
References GetHandle().
|
inline |
Returns the handle of the region with type HREGION.
Definition at line 1417 of file gdiobjec.h.
References owl::TGdiBase::Handle.
|
inline |
Returns the bounding rectangle of the region.
Definition at line 1494 of file gdiobjec.h.
References GetHandle(), and GetRgnBox().
Finds the bounding rectangle (the minimum rectangle containing this region).
The resulting rectangle is placed in box and the returned values are as follows:
COMPLEXREGION Region
has overlapping borders.NULLREGION Region
is empty.SIMPLEREGION Region
has no overlapping borders. Definition at line 1486 of file gdiobjec.h.
References GetHandle().
|
inline |
Typecast operator.
HRGN is the data type representing the handle to a physical region.
Definition at line 1435 of file gdiobjec.h.
Returns true if this region is not equal to the other region.
Definition at line 1458 of file gdiobjec.h.
References GetHandle().
Creates the intersection of this region with the given rectangle, and returns a reference to the result.
Definition at line 148 of file region.cpp.
References TRegion(), and owl::TGdiBase::Handle.
Creates the intersection of this region with the given source region and returns a reference to the result.
Definition at line 1545 of file gdiobjec.h.
References GetHandle().
Adds the given delta to each point of this region to displace (translate) it by delta.x and delta.y.
Returns a reference to the resulting region.
Definition at line 1515 of file gdiobjec.h.
References GetHandle().
Creates a "difference" region consisting of all parts of this region that are not parts of the source region.
Returns a reference to the resulting region.
Definition at line 1535 of file gdiobjec.h.
References GetHandle().
Subtracts the given delta from each point of this region to displace (translate) it by -delta.x and -delta.y.
Returns a reference to the resulting region.
Definition at line 1525 of file gdiobjec.h.
References GetHandle().
Assigns the source region to this region.
A reference to the result is returned, allowing chained assignments.
Definition at line 1505 of file gdiobjec.h.
References GetHandle().
Returns true if the regions are identical (equal in size and shape).
Definition at line 1450 of file gdiobjec.h.
References GetHandle().
Creates the exclusive-or of this region and the given rectangle.
Returns a reference to the resulting region object.
Definition at line 170 of file region.cpp.
References TRegion(), and owl::TGdiBase::Handle.
Creates the exclusive-or of this region and the given source region.
Returns a reference to the resulting region object.
Definition at line 1565 of file gdiobjec.h.
References GetHandle().
Creates the union of this region and the given rectangle, and returns a reference to the result.
Definition at line 159 of file region.cpp.
References TRegion(), and owl::TGdiBase::Handle.
Creates the union of this region and the given source region , and returns a reference to the result.
Definition at line 1555 of file gdiobjec.h.
References GetHandle().
Returns the encapsulated handle of the region and relinquishes ownership.
Definition at line 1424 of file gdiobjec.h.
References PRECONDITION.
Creates a rectangle of the size given by rect.
Definition at line 1442 of file gdiobjec.h.
References GetHandle(), and SetRectRgn().
Returns true if this region touches the given rectangle.
Definition at line 1474 of file gdiobjec.h.
References GetHandle().