summaryrefslogtreecommitdiff
path: root/include/basegfx/range/b2irange.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-03 16:53:45 +0200
committerMichael Stahl <mstahl@redhat.com>2015-07-03 16:53:45 +0200
commita6f5770b4aaaa6506a22eae0d641ad48f9b6d239 (patch)
treea6c682cae9034bc67f23c410dd3d0227d36d680b /include/basegfx/range/b2irange.hxx
parent5bc343cc723f993ed112cf5c700e3f397527d671 (diff)
Revert "loplugin:unusedmethods sax,shell,stoc,basegfx"
The basegfx changes appear to break Windows builds. This reverts commit 3b32c5898ff4e744d3f18b00421b433500426d74.
Diffstat (limited to 'include/basegfx/range/b2irange.hxx')
-rw-r--r--include/basegfx/range/b2irange.hxx50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/basegfx/range/b2irange.hxx b/include/basegfx/range/b2irange.hxx
index 7a07229906af..65756dfb7600 100644
--- a/include/basegfx/range/b2irange.hxx
+++ b/include/basegfx/range/b2irange.hxx
@@ -178,6 +178,15 @@ namespace basegfx
);
}
+ /// return center point of set. returns (0,0) for empty sets.
+ B2DPoint getCenter() const
+ {
+ return B2DPoint(
+ maRangeX.getCenter(),
+ maRangeY.getCenter()
+ );
+ }
+
/// yields true if given point is contained in set
bool isInside(const B2ITuple& rTuple) const
{
@@ -187,6 +196,33 @@ namespace basegfx
);
}
+ /// yields true if rRange is inside, or equal to set
+ bool isInside(const B2IRange& rRange) const
+ {
+ return (
+ maRangeX.isInside(rRange.maRangeX)
+ && maRangeY.isInside(rRange.maRangeY)
+ );
+ }
+
+ /// yields true if rRange at least partly inside set
+ bool overlaps(const B2IRange& rRange) const
+ {
+ return (
+ maRangeX.overlaps(rRange.maRangeX)
+ && maRangeY.overlaps(rRange.maRangeY)
+ );
+ }
+
+ /// yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
+ bool overlapsMore(const B2IRange& rRange) const
+ {
+ return (
+ maRangeX.overlapsMore(rRange.maRangeX)
+ && maRangeY.overlapsMore(rRange.maRangeY)
+ );
+ }
+
/// add point to the set, expanding as necessary
void expand(const B2ITuple& rTuple)
{
@@ -194,6 +230,13 @@ namespace basegfx
maRangeY.expand(rTuple.getY());
}
+ /// add rRange to the set, expanding as necessary
+ void expand(const B2IRange& rRange)
+ {
+ maRangeX.expand(rRange.maRangeX);
+ maRangeY.expand(rRange.maRangeY);
+ }
+
/// calc set intersection
void intersect(const B2IRange& rRange)
{
@@ -201,6 +244,13 @@ namespace basegfx
maRangeY.intersect(rRange.maRangeY);
}
+ /// grow set by nValue on all sides
+ void grow(sal_Int32 nValue)
+ {
+ maRangeX.grow(nValue);
+ maRangeY.grow(nValue);
+ }
+
private:
typedef ::basegfx::BasicRange< ValueType, TraitsType > MyBasicRange;