LibreOffice Module basegfx (master) 1
|
A two-dimensional interval over integers. More...
#include <b2ibox.hxx>
Public Types | |
typedef sal_Int32 | ValueType |
typedef Int32Traits | TraitsType |
Public Member Functions | |
B2IBox () | |
B2IBox (const B2ITuple &rTuple) | |
Create degenerate interval that's still empty. More... | |
B2IBox (sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2) | |
Create proper interval between the two given points. More... | |
B2IBox (const B2ITuple &rTuple1, const B2ITuple &rTuple2) | |
Create proper interval between the two given points. More... | |
bool | isEmpty () const |
Check if the interval set is empty. More... | |
bool | operator== (const B2IBox &rBox) const |
bool | operator!= (const B2IBox &rBox) const |
sal_Int32 | getMinX () const |
get lower bound of the set. returns arbitrary values for empty sets. More... | |
sal_Int32 | getMinY () const |
get lower bound of the set. returns arbitrary values for empty sets. More... | |
sal_Int32 | getMaxX () const |
get upper bound of the set. returns arbitrary values for empty sets. More... | |
sal_Int32 | getMaxY () const |
get upper bound of the set. returns arbitrary values for empty sets. More... | |
sal_Int64 | getWidth () const |
return difference between upper and lower X value. returns 0 for empty sets. More... | |
sal_Int64 | getHeight () const |
return difference between upper and lower Y value. returns 0 for empty sets. More... | |
bool | isInside (const B2ITuple &rTuple) const |
yields true if point is contained in set More... | |
void | expand (const B2ITuple &rTuple) |
add point to the set, expanding as necessary More... | |
void | intersect (const B2IBox &rBox) |
calc set intersection More... | |
Private Attributes | |
BasicBox | maRangeX |
BasicBox | maRangeY |
A two-dimensional interval over integers.
This is most easily depicted as a set of integers, bounded by a lower and an upper value - but excluding the upper value. All inbetween values are included in the set (see also http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
The set is half-open, i.e. the lower bound is included, the upper bound not (if you're used to the notation - we're talking about [a,b) here, compared to closed [a,b] or fully open intervals (a,b)).
If you don't need a half-open interval, check B2IRange.
That means, isInside(val) will return true also for values of val=a, but not for val=b.
Alternatively, consider this a rectangle, where the rightmost pixel column and the bottommost pixel row are excluded - this is much like polygon filling. As a result, filling a given rectangle with basebmp::BitmapDevice::fillPolyPolygon(), will affect exactly the same set of pixel as isInside() would return true for.
Definition at line 55 of file b2ibox.hxx.
Definition at line 59 of file b2ibox.hxx.
typedef sal_Int32 basegfx::B2IBox::ValueType |
Definition at line 58 of file b2ibox.hxx.
|
inline |
Definition at line 61 of file b2ibox.hxx.
|
inlineexplicit |
Create degenerate interval that's still empty.
Definition at line 64 of file b2ibox.hxx.
|
inline |
Create proper interval between the two given points.
Definition at line 71 of file b2ibox.hxx.
References basegfx::BasicRange< T, Traits >::expand(), maRangeX, and maRangeY.
Create proper interval between the two given points.
Definition at line 83 of file b2ibox.hxx.
References expand().
|
inline |
add point to the set, expanding as necessary
Definition at line 159 of file b2ibox.hxx.
References basegfx::BasicRange< T, Traits >::expand(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), maRangeX, and maRangeY.
Referenced by B2IBox().
|
inline |
return difference between upper and lower Y value. returns 0 for empty sets.
Definition at line 144 of file b2ibox.hxx.
References basegfx::BasicRange< T, Traits >::getRange(), and maRangeY.
|
inline |
get upper bound of the set. returns arbitrary values for empty sets.
Definition at line 126 of file b2ibox.hxx.
References basegfx::BasicRange< T, Traits >::getMaximum(), and maRangeX.
Referenced by basegfx::utils::getCohenSutherlandClipFlags().
|
inline |
get upper bound of the set. returns arbitrary values for empty sets.
Definition at line 132 of file b2ibox.hxx.
References basegfx::BasicRange< T, Traits >::getMaximum(), and maRangeY.
Referenced by basegfx::utils::getCohenSutherlandClipFlags().
|
inline |
get lower bound of the set. returns arbitrary values for empty sets.
Definition at line 114 of file b2ibox.hxx.
References basegfx::BasicRange< T, Traits >::getMinimum(), and maRangeX.
Referenced by basegfx::utils::getCohenSutherlandClipFlags().
|
inline |
get lower bound of the set. returns arbitrary values for empty sets.
Definition at line 120 of file b2ibox.hxx.
References basegfx::BasicRange< T, Traits >::getMinimum(), and maRangeY.
Referenced by basegfx::utils::getCohenSutherlandClipFlags().
|
inline |
return difference between upper and lower X value. returns 0 for empty sets.
Definition at line 138 of file b2ibox.hxx.
References basegfx::BasicRange< T, Traits >::getRange(), and maRangeX.
|
inline |
calc set intersection
Definition at line 166 of file b2ibox.hxx.
References basegfx::BasicRange< T, Traits >::intersect(), maRangeX, and maRangeY.
|
inline |
Check if the interval set is empty.
Definition at line 96 of file b2ibox.hxx.
References basegfx::BasicBox::isEmpty(), maRangeX, and maRangeY.
|
inline |
yields true if point is contained in set
Definition at line 150 of file b2ibox.hxx.
References basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), basegfx::BasicBox::isInside(), maRangeX, and maRangeY.
|
inline |
Definition at line 107 of file b2ibox.hxx.
|
inline |
Definition at line 101 of file b2ibox.hxx.
|
private |
Definition at line 173 of file b2ibox.hxx.
Referenced by B2IBox(), expand(), getMaxX(), getMinX(), getWidth(), intersect(), isEmpty(), isInside(), operator!=(), and operator==().
|
private |
Definition at line 174 of file b2ibox.hxx.
Referenced by B2IBox(), expand(), getHeight(), getMaxY(), getMinY(), intersect(), isEmpty(), isInside(), operator!=(), and operator==().