summaryrefslogtreecommitdiff
path: root/basegfx/inc/basegfx/range/b2drange.hxx
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2003-11-28 10:18:16 +0000
committerArmin Weiss <aw@openoffice.org>2003-11-28 10:18:16 +0000
commitd539c95155ccc7030411f7494704894a3ac610a8 (patch)
treedc3dbd283a5f501f6e48dd585d80bb158db920e3 /basegfx/inc/basegfx/range/b2drange.hxx
parentce0ce72d1fd37f7b8e7cb4ebc372d8cd6b4ab9c0 (diff)
Removed in-between namespaces (curve, matrix, numeric, point, polygon, range, tuple, vector). Names were too common and e.g. vector leaded to problems with some defines. This is now avoided. Also some bug fixes, addition of 3d polygon tooling etc.
Diffstat (limited to 'basegfx/inc/basegfx/range/b2drange.hxx')
-rw-r--r--basegfx/inc/basegfx/range/b2drange.hxx223
1 files changed, 110 insertions, 113 deletions
diff --git a/basegfx/inc/basegfx/range/b2drange.hxx b/basegfx/inc/basegfx/range/b2drange.hxx
index 10f14abe9fd7..c30d461f259a 100644
--- a/basegfx/inc/basegfx/range/b2drange.hxx
+++ b/basegfx/inc/basegfx/range/b2drange.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2drange.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: aw $ $Date: 2003-11-26 14:40:01 $
+ * last change: $Author: aw $ $Date: 2003-11-28 11:17:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,119 +72,116 @@
namespace basegfx
{
- namespace range
+ class B2DRange
{
- class B2DRange
+ ::basegfx::BasicRange maRangeX;
+ ::basegfx::BasicRange maRangeY;
+
+ public:
+ B2DRange()
+ {
+ }
+
+ B2DRange(const B2DTuple& rTuple)
+ : maRangeX(rTuple.getX()),
+ maRangeY(rTuple.getY())
+ {
+ }
+
+ B2DRange(const B2DRange& rRange)
+ : maRangeX(rRange.maRangeX),
+ maRangeY(rRange.maRangeY)
+ {
+ }
+
+ sal_Bool isEmpty() const
+ {
+ return (
+ maRangeX.isEmpty()
+ || maRangeY.isEmpty()
+ );
+ }
+
+ void reset()
+ {
+ maRangeX.reset();
+ maRangeY.reset();
+ }
+
+ void operator=(const B2DRange& rRange)
+ {
+ maRangeX = rRange.maRangeX;
+ maRangeY = rRange.maRangeY;
+ }
+
+ B2DTuple getMinimum() const
+ {
+ return B2DTuple(
+ maRangeX.getMinimum(),
+ maRangeY.getMinimum()
+ );
+ }
+
+ B2DTuple getMaximum() const
+ {
+ return B2DTuple(
+ maRangeX.getMaximum(),
+ maRangeY.getMaximum()
+ );
+ }
+
+ B2DTuple getRange() const
+ {
+ return B2DTuple(
+ maRangeX.getRange(),
+ maRangeY.getRange()
+ );
+ }
+
+ B2DTuple getCenter() const
+ {
+ return B2DTuple(
+ maRangeX.getCenter(),
+ maRangeY.getCenter()
+ );
+ }
+
+ sal_Bool isInside(const B2DTuple& rTuple) const
+ {
+ return (
+ maRangeX.isInside(rTuple.getX())
+ && maRangeY.isInside(rTuple.getY())
+ );
+ }
+
+ sal_Bool isInside(const B2DRange& rRange) const
+ {
+ return (
+ maRangeX.isInside(rRange.maRangeX)
+ && maRangeY.isInside(rRange.maRangeY)
+ );
+ }
+
+ sal_Bool overlaps(const B2DRange& rRange) const
+ {
+ return (
+ maRangeX.overlaps(rRange.maRangeX)
+ && maRangeY.overlaps(rRange.maRangeY)
+ );
+ }
+
+ void expand(const B2DTuple& rTuple)
+ {
+ maRangeX.expand(rTuple.getX());
+ maRangeY.expand(rTuple.getY());
+ }
+
+ void expand(const B2DRange& rRange)
{
- ::basegfx::range::BasicRange maRangeX;
- ::basegfx::range::BasicRange maRangeY;
-
- public:
- B2DRange()
- {
- }
-
- B2DRange(const tuple::B2DTuple& rTuple)
- : maRangeX(rTuple.getX()),
- maRangeY(rTuple.getY())
- {
- }
-
- B2DRange(const B2DRange& rRange)
- : maRangeX(rRange.maRangeX),
- maRangeY(rRange.maRangeY)
- {
- }
-
- sal_Bool isEmpty() const
- {
- return (
- maRangeX.isEmpty()
- || maRangeY.isEmpty()
- );
- }
-
- void reset()
- {
- maRangeX.reset();
- maRangeY.reset();
- }
-
- void operator=(const B2DRange& rRange)
- {
- maRangeX = rRange.maRangeX;
- maRangeY = rRange.maRangeY;
- }
-
- tuple::B2DTuple getMinimum() const
- {
- return tuple::B2DTuple(
- maRangeX.getMinimum(),
- maRangeY.getMinimum()
- );
- }
-
- tuple::B2DTuple getMaximum() const
- {
- return tuple::B2DTuple(
- maRangeX.getMaximum(),
- maRangeY.getMaximum()
- );
- }
-
- tuple::B2DTuple getRange() const
- {
- return tuple::B2DTuple(
- maRangeX.getRange(),
- maRangeY.getRange()
- );
- }
-
- tuple::B2DTuple getCenter() const
- {
- return tuple::B2DTuple(
- maRangeX.getCenter(),
- maRangeY.getCenter()
- );
- }
-
- sal_Bool isInside(const tuple::B2DTuple& rTuple) const
- {
- return (
- maRangeX.isInside(rTuple.getX())
- && maRangeY.isInside(rTuple.getY())
- );
- }
-
- sal_Bool isInside(const B2DRange& rRange) const
- {
- return (
- maRangeX.isInside(rRange.maRangeX)
- && maRangeY.isInside(rRange.maRangeY)
- );
- }
-
- sal_Bool overlaps(const B2DRange& rRange) const
- {
- return (
- maRangeX.overlaps(rRange.maRangeX)
- && maRangeY.overlaps(rRange.maRangeY)
- );
- }
-
- void expand(const tuple::B2DTuple& rTuple)
- {
- maRangeX.expand(rTuple.getX());
- maRangeY.expand(rTuple.getY());
- }
-
- void expand(const B2DRange& rRange)
- {
- maRangeX.expand(rRange.maRangeX);
- maRangeY.expand(rRange.maRangeY);
- }
- };
- } // end of namespace range
+ maRangeX.expand(rRange.maRangeX);
+ maRangeY.expand(rRange.maRangeY);
+ }
+ };
} // end of namespace basegfx
#endif // _BGFX_RANGE_B2DRANGE_HXX