summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorThorsten Behrens <thb@openoffice.org>2004-01-16 12:40:26 +0000
committerThorsten Behrens <thb@openoffice.org>2004-01-16 12:40:26 +0000
commitc794c5ce7ea7b11f7275a471821310dcd3dd552e (patch)
tree35c44204390533a50fe9a26bddcc9b84f5b26ed8 /basegfx
parente1ee37accf3973cae1c373a6be84273d96401c39 (diff)
#110496# Some more adaptions to integer classes
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/inc/basegfx/range/b1drange.hxx10
-rw-r--r--basegfx/inc/basegfx/range/b2drange.hxx53
-rw-r--r--basegfx/inc/basegfx/range/b2irange.hxx57
-rw-r--r--basegfx/inc/basegfx/range/b3drange.hxx81
-rw-r--r--basegfx/inc/basegfx/range/b3irange.hxx85
5 files changed, 272 insertions, 14 deletions
diff --git a/basegfx/inc/basegfx/range/b1drange.hxx b/basegfx/inc/basegfx/range/b1drange.hxx
index d31e6c65ee73..202c8aa45115 100644
--- a/basegfx/inc/basegfx/range/b1drange.hxx
+++ b/basegfx/inc/basegfx/range/b1drange.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b1drange.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: thb $ $Date: 2004-01-16 10:34:07 $
+ * last change: $Author: thb $ $Date: 2004-01-16 13:40:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -83,6 +83,12 @@ namespace basegfx
{
}
+ B1DRange(double fStartValue1, double fStartValue2)
+ : maRange(fStartValue1)
+ {
+ expand(fStartValue2);
+ }
+
B1DRange(const B1DRange& rRange)
: maRange(rRange.maRange)
{
diff --git a/basegfx/inc/basegfx/range/b2drange.hxx b/basegfx/inc/basegfx/range/b2drange.hxx
index 6c0e90fbff56..b2c9454b9974 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.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: thb $ $Date: 2004-01-16 10:34:07 $
+ * last change: $Author: thb $ $Date: 2004-01-16 13:40:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -90,6 +90,25 @@ namespace basegfx
{
}
+ B2DRange(double x1,
+ double y1,
+ double x2,
+ double y2)
+ : maRangeX(x1),
+ maRangeY(y1)
+ {
+ maRangeX.expand(x2);
+ maRangeY.expand(y2);
+ }
+
+ B2DRange(const B2DTuple& rTuple1,
+ const B2DTuple& rTuple2)
+ : maRangeX(rTuple1.getX()),
+ maRangeY(rTuple1.getY())
+ {
+ expand( rTuple2 );
+ }
+
B2DRange(const B2DRange& rRange)
: maRangeX(rRange.maRangeX),
maRangeY(rRange.maRangeY)
@@ -116,6 +135,36 @@ namespace basegfx
maRangeY = rRange.maRangeY;
}
+ double getMinX() const
+ {
+ return maRangeX.getMinimum();
+ }
+
+ double getMinY() const
+ {
+ return maRangeY.getMinimum();
+ }
+
+ double getMaxX() const
+ {
+ return maRangeX.getMaximum();
+ }
+
+ double getMaxY() const
+ {
+ return maRangeY.getMaximum();
+ }
+
+ double getWidth() const
+ {
+ return maRangeX.getRange();
+ }
+
+ double getHeight() const
+ {
+ return maRangeY.getRange();
+ }
+
B2DTuple getMinimum() const
{
return B2DTuple(
diff --git a/basegfx/inc/basegfx/range/b2irange.hxx b/basegfx/inc/basegfx/range/b2irange.hxx
index 0ccd1a3301f7..50227a215831 100644
--- a/basegfx/inc/basegfx/range/b2irange.hxx
+++ b/basegfx/inc/basegfx/range/b2irange.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2irange.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: thb $ $Date: 2004-01-15 19:57:15 $
+ * last change: $Author: thb $ $Date: 2004-01-16 13:40:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,12 +87,31 @@ namespace basegfx
{
}
- explicit B2IRange(const B2DTuple& rTuple)
+ explicit B2IRange(const B2ITuple& rTuple)
: maRangeX(rTuple.getX()),
maRangeY(rTuple.getY())
{
}
+ B2IRange(sal_Int32 x1,
+ sal_Int32 y1,
+ sal_Int32 x2,
+ sal_Int32 y2)
+ : maRangeX(x1),
+ maRangeY(y1)
+ {
+ maRangeX.expand(x2);
+ maRangeY.expand(y2);
+ }
+
+ B2IRange(const B2ITuple& rTuple1,
+ const B2ITuple& rTuple2)
+ : maRangeX(rTuple1.getX()),
+ maRangeY(rTuple1.getY())
+ {
+ expand( rTuple2 );
+ }
+
B2IRange(const B2IRange& rRange)
: maRangeX(rRange.maRangeX),
maRangeY(rRange.maRangeY)
@@ -116,6 +135,36 @@ namespace basegfx
maRangeY = rRange.maRangeY;
}
+ sal_Int32 getMinX() const
+ {
+ return maRangeX.getMinimum();
+ }
+
+ sal_Int32 getMinY() const
+ {
+ return maRangeY.getMinimum();
+ }
+
+ sal_Int32 getMaxX() const
+ {
+ return maRangeX.getMaximum();
+ }
+
+ sal_Int32 getMaxY() const
+ {
+ return maRangeY.getMaximum();
+ }
+
+ sal_Int64 getWidth() const
+ {
+ return maRangeX.getRange();
+ }
+
+ sal_Int64 getHeight() const
+ {
+ return maRangeY.getRange();
+ }
+
B2ITuple getMinimum() const
{
return B2ITuple(
@@ -126,7 +175,7 @@ namespace basegfx
B2ITuple getMaximum() const
{
- return B2DTuple(
+ return B2ITuple(
maRangeX.getMaximum(),
maRangeY.getMaximum()
);
diff --git a/basegfx/inc/basegfx/range/b3drange.hxx b/basegfx/inc/basegfx/range/b3drange.hxx
index d5128934e309..a778fdd87f32 100644
--- a/basegfx/inc/basegfx/range/b3drange.hxx
+++ b/basegfx/inc/basegfx/range/b3drange.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b3drange.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: thb $ $Date: 2004-01-16 10:34:09 $
+ * last change: $Author: thb $ $Date: 2004-01-16 13:40:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,6 +92,38 @@ namespace basegfx
{
}
+ B3DRange(double x1,
+ double y1,
+ double z1,
+ double x2,
+ double y2,
+ double z2,
+ double x3,
+ double y3,
+ double z3)
+ : maRangeX(x1),
+ maRangeY(y1),
+ maRangeZ(z1)
+ {
+ maRangeX.expand(x2);
+ maRangeY.expand(y2);
+ maRangeZ.expand(z2);
+ maRangeX.expand(x3);
+ maRangeY.expand(y3);
+ maRangeZ.expand(z3);
+ }
+
+ B3DRange(const B3DTuple& rTuple1,
+ const B3DTuple& rTuple2,
+ const B3DTuple& rTuple3)
+ : maRangeX(rTuple1.getX()),
+ maRangeY(rTuple1.getY()),
+ maRangeZ(rTuple1.getZ())
+ {
+ expand(rTuple2);
+ expand(rTuple3);
+ }
+
B3DRange(const B3DRange& rRange)
: maRangeX(rRange.maRangeX),
maRangeY(rRange.maRangeY),
@@ -122,6 +154,51 @@ namespace basegfx
maRangeZ = rRange.maRangeZ;
}
+ double getMinX() const
+ {
+ return maRangeX.getMinimum();
+ }
+
+ double getMinY() const
+ {
+ return maRangeY.getMinimum();
+ }
+
+ double getMinZ() const
+ {
+ return maRangeZ.getMinimum();
+ }
+
+ double getMaxX() const
+ {
+ return maRangeX.getMaximum();
+ }
+
+ double getMaxY() const
+ {
+ return maRangeY.getMaximum();
+ }
+
+ double getMaxZ() const
+ {
+ return maRangeZ.getMaximum();
+ }
+
+ double getWidth() const
+ {
+ return maRangeX.getRange();
+ }
+
+ double getHeight() const
+ {
+ return maRangeY.getRange();
+ }
+
+ double getDepth() const
+ {
+ return maRangeZ.getRange();
+ }
+
B3DTuple getMinimum() const
{
return B3DTuple(
diff --git a/basegfx/inc/basegfx/range/b3irange.hxx b/basegfx/inc/basegfx/range/b3irange.hxx
index f3924c35b9fc..5165e9f4903b 100644
--- a/basegfx/inc/basegfx/range/b3irange.hxx
+++ b/basegfx/inc/basegfx/range/b3irange.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b3irange.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: thb $ $Date: 2004-01-15 19:57:30 $
+ * last change: $Author: thb $ $Date: 2004-01-16 13:40:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,6 +95,38 @@ namespace basegfx
{
}
+ B3IRange(sal_Int32 x1,
+ sal_Int32 y1,
+ sal_Int32 z1,
+ sal_Int32 x2,
+ sal_Int32 y2,
+ sal_Int32 z2,
+ sal_Int32 x3,
+ sal_Int32 y3,
+ sal_Int32 z3)
+ : maRangeX(x1),
+ maRangeY(y1),
+ maRangeZ(z1)
+ {
+ maRangeX.expand(x2);
+ maRangeY.expand(y2);
+ maRangeZ.expand(z2);
+ maRangeX.expand(x3);
+ maRangeY.expand(y3);
+ maRangeZ.expand(z3);
+ }
+
+ B3IRange(const B3ITuple& rTuple1,
+ const B3ITuple& rTuple2,
+ const B3ITuple& rTuple3)
+ : maRangeX(rTuple1.getX()),
+ maRangeY(rTuple1.getY()),
+ maRangeZ(rTuple1.getZ())
+ {
+ expand(rTuple2);
+ expand(rTuple3);
+ }
+
B3IRange(const B3IRange& rRange)
: maRangeX(rRange.maRangeX),
maRangeY(rRange.maRangeY),
@@ -121,9 +153,54 @@ namespace basegfx
maRangeZ = rRange.maRangeZ;
}
+ sal_Int32 getMinX() const
+ {
+ return maRangeX.getMinimum();
+ }
+
+ sal_Int32 getMinY() const
+ {
+ return maRangeY.getMinimum();
+ }
+
+ sal_Int32 getMinZ() const
+ {
+ return maRangeZ.getMinimum();
+ }
+
+ sal_Int32 getMaxX() const
+ {
+ return maRangeX.getMaximum();
+ }
+
+ sal_Int32 getMaxY() const
+ {
+ return maRangeY.getMaximum();
+ }
+
+ sal_Int32 getMaxZ() const
+ {
+ return maRangeZ.getMaximum();
+ }
+
+ sal_Int64 getWidth() const
+ {
+ return maRangeX.getRange();
+ }
+
+ sal_Int64 getHeight() const
+ {
+ return maRangeY.getRange();
+ }
+
+ sal_Int64 getDepth() const
+ {
+ return maRangeZ.getRange();
+ }
+
B3ITuple getMinimum() const
{
- return B3DTuple(
+ return B3ITuple(
maRangeX.getMinimum(),
maRangeY.getMinimum(),
maRangeZ.getMinimum()
@@ -132,7 +209,7 @@ namespace basegfx
B3ITuple getMaximum() const
{
- return B3DTuple(
+ return B3ITuple(
maRangeX.getMaximum(),
maRangeY.getMaximum(),
maRangeZ.getMaximum()