summaryrefslogtreecommitdiff
path: root/basegfx/inc
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2003-11-10 10:45:52 +0000
committerArmin Weiss <aw@openoffice.org>2003-11-10 10:45:52 +0000
commitff3c6dbe35436fa508356a45b7367d4055cd6387 (patch)
tree5325d2cd5ce67961f59260d70784e083c67bdad7 /basegfx/inc
parente7fb8a71b60f4c6e94b4cafbe9d0badf427316e3 (diff)
Some error corrections, some additions to polygon stuff, making PolyPolygonCutter work
Diffstat (limited to 'basegfx/inc')
-rw-r--r--basegfx/inc/basegfx/point/b3dhompoint.hxx10
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolygon.hxx8
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolygontools.hxx14
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx7
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolypolygoncutter.hxx10
-rw-r--r--basegfx/inc/basegfx/tuple/b2dtuple.hxx8
-rw-r--r--basegfx/inc/basegfx/tuple/b3dtuple.hxx10
-rw-r--r--basegfx/inc/basegfx/vector/b2dvector.hxx26
8 files changed, 60 insertions, 33 deletions
diff --git a/basegfx/inc/basegfx/point/b3dhompoint.hxx b/basegfx/inc/basegfx/point/b3dhompoint.hxx
index d661d2f500dc..7cd82c364a7f 100644
--- a/basegfx/inc/basegfx/point/b3dhompoint.hxx
+++ b/basegfx/inc/basegfx/point/b3dhompoint.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b3dhompoint.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2003-11-06 16:30:24 $
+ * last change: $Author: aw $ $Date: 2003-11-10 11:45:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -375,9 +375,9 @@ namespace basegfx
inline B3DHomPoint interpolate(B3DHomPoint& rOld1, B3DHomPoint& rOld2, double t)
{
B3DHomPoint aInt(
- ((rOld2.getX() - rOld1.getX()) + t) + rOld1.getX(),
- ((rOld2.getY() - rOld1.getY()) + t) + rOld1.getY(),
- ((rOld2.getZ() - rOld1.getZ()) + t) + rOld1.getZ());
+ ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(),
+ ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY(),
+ ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ());
return aInt;
}
diff --git a/basegfx/inc/basegfx/polygon/b2dpolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolygon.hxx
index 40a45c800a4f..3ce8fff7bf8c 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolygon.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolygon.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dpolygon.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2003-11-06 16:30:24 $
+ * last change: $Author: aw $ $Date: 2003-11-10 11:45:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -157,10 +157,6 @@ namespace basegfx
// remove double points, at the begin/end and follow-ups, too
void removeDoublePoints();
-
- // isInside tests for B2dPoint and other B2dPolygon. On border is not inside.
- sal_Bool isInside(const ::basegfx::point::B2DPoint& rPoint);
- sal_Bool isInside(const B2DPolygon& rPolygon);
};
} // end of namespace polygon
} // end of namespace basegfx
diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
index 740d82060283..ae69b4078280 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dpolygontools.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2003-11-06 16:30:24 $
+ * last change: $Author: aw $ $Date: 2003-11-10 11:45:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -120,9 +120,10 @@ namespace basegfx
// Get orientation of Polygon
::basegfx::vector::B2DVectorOrientation getOrientation(const ::basegfx::polygon::B2DPolygon& rCandidate);
- // isInside tests for B2dPoint and other B2dPolygon. On border is not inside.
- sal_Bool isInside(const ::basegfx::polygon::B2DPolygon& rCandidate, const ::basegfx::point::B2DPoint& rPoint);
- sal_Bool isInside(const ::basegfx::polygon::B2DPolygon& rCandidate, const ::basegfx::polygon::B2DPolygon& rPolygon);
+ // isInside tests for B2dPoint and other B2dPolygon. On border is not inside as long as
+ // not sal_True is given in bWithBorder flag.
+ sal_Bool isInside(const ::basegfx::polygon::B2DPolygon& rCandidate, const ::basegfx::point::B2DPoint& rPoint, sal_Bool bWithBorder = sal_False);
+ sal_Bool isInside(const ::basegfx::polygon::B2DPolygon& rCandidate, const ::basegfx::polygon::B2DPolygon& rPolygon, sal_Bool bWithBorder = sal_False);
// get size of polygon
::basegfx::range::B2DRange getRange(const ::basegfx::polygon::B2DPolygon& rCandidate);
@@ -149,6 +150,9 @@ namespace basegfx
// get orientation at given polygon point
::basegfx::vector::B2DVectorOrientation getPointOrientation(const ::basegfx::polygon::B2DPolygon& rCandidate, sal_uInt32 nIndex);
+ // Continuity check for point with given index
+ ::basegfx::vector::B2DVectorContinuity getContinuityInPoint(const ::basegfx::polygon::B2DPolygon& rCandidate, sal_uInt32 nIndex);
+
// Definitions for the cut flags used from the findCut methods
typedef sal_uInt16 CutFlagValue;
diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx
index 658f9b33d6b3..acd385099ebe 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dpolypolygon.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2003-11-06 16:30:25 $
+ * last change: $Author: aw $ $Date: 2003-11-10 11:45:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -110,6 +110,9 @@ namespace basegfx
B2DPolygon getPolygon(sal_uInt32 nIndex) const;
void setPolygon(sal_uInt32 nIndex, const B2DPolygon& rPolygon);
+ // test for curve
+ sal_Bool areControlPointsUsed() const;
+
// insert/append single polygon
void insert(sal_uInt32 nIndex, const B2DPolygon& rPolygon, sal_uInt32 nCount = 1);
void append(const B2DPolygon& rPolygon, sal_uInt32 nCount = 1);
diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygoncutter.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygoncutter.hxx
index 578df5a36965..c118076d82fe 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolypolygoncutter.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolypolygoncutter.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dpolypolygoncutter.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-11-06 16:28:48 $
+ * last change: $Author: aw $ $Date: 2003-11-10 11:45:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -125,8 +125,10 @@ namespace basegfx
void swapOrientation();
::basegfx::range::B2DRange getRange() const;
- sal_Bool isInside(const ::basegfx::point::B2DPoint& rPnt) const;
- sal_Bool isPolygonInside(B2DPolygonNode* pPoly) const;
+ // isInside tests for B2dPoint and other B2DPolygonNode Polygon. On border is not inside as long as
+ // not sal_True is given in bWithBorder flag.
+ sal_Bool isInside(const ::basegfx::point::B2DPoint& rPnt, sal_Bool bWithBorder = sal_False) const;
+ sal_Bool isPolygonInside(B2DPolygonNode* pPoly, sal_Bool bWithBorder = sal_False) const;
};
// a type definition to have a vector of pointers to B2DPolygonNodes
diff --git a/basegfx/inc/basegfx/tuple/b2dtuple.hxx b/basegfx/inc/basegfx/tuple/b2dtuple.hxx
index 71300b00b6a1..dd775d8c399e 100644
--- a/basegfx/inc/basegfx/tuple/b2dtuple.hxx
+++ b/basegfx/inc/basegfx/tuple/b2dtuple.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dtuple.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: aw $ $Date: 2003-11-05 12:25:45 $
+ * last change: $Author: aw $ $Date: 2003-11-10 11:45:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -290,8 +290,8 @@ namespace basegfx
inline B2DTuple interpolate(const B2DTuple& rOld1, const B2DTuple& rOld2, double t)
{
B2DTuple aInt(
- ((rOld2.getX() - rOld1.getX()) + t) + rOld1.getX(),
- ((rOld2.getY() - rOld1.getY()) + t) + rOld1.getY());
+ ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(),
+ ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY());
return aInt;
}
diff --git a/basegfx/inc/basegfx/tuple/b3dtuple.hxx b/basegfx/inc/basegfx/tuple/b3dtuple.hxx
index 2098433a2af3..24ab97aad569 100644
--- a/basegfx/inc/basegfx/tuple/b3dtuple.hxx
+++ b/basegfx/inc/basegfx/tuple/b3dtuple.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b3dtuple.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: aw $ $Date: 2003-11-05 12:25:46 $
+ * last change: $Author: aw $ $Date: 2003-11-10 11:45:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -374,9 +374,9 @@ namespace basegfx
inline B3DTuple interpolate(const B3DTuple& rOld1, const B3DTuple& rOld2, double t)
{
B3DTuple aInt(
- ((rOld2.getX() - rOld1.getX()) + t) + rOld1.getX(),
- ((rOld2.getY() - rOld1.getY()) + t) + rOld1.getY(),
- ((rOld2.getZ() - rOld1.getZ()) + t) + rOld1.getZ());
+ ((rOld2.getX() - rOld1.getX()) * t) + rOld1.getX(),
+ ((rOld2.getY() - rOld1.getY()) * t) + rOld1.getY(),
+ ((rOld2.getZ() - rOld1.getZ()) * t) + rOld1.getZ());
return aInt;
}
diff --git a/basegfx/inc/basegfx/vector/b2dvector.hxx b/basegfx/inc/basegfx/vector/b2dvector.hxx
index 8a7127d42ab3..91f25e436b65 100644
--- a/basegfx/inc/basegfx/vector/b2dvector.hxx
+++ b/basegfx/inc/basegfx/vector/b2dvector.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dvector.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2003-11-06 16:30:26 $
+ * last change: $Author: aw $ $Date: 2003-11-10 11:45:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -90,6 +90,20 @@ namespace basegfx
ORIENTATION_NEUTRAL
};
+ /** Descriptor for the mathematical continuity of two 2D Vectors
+ */
+ enum B2DVectorContinuity
+ {
+ /// none
+ CONTINUITY_NONE = 0,
+
+ /// mathematically negative oriented
+ CONTINUITY_C1,
+
+ /// mathematically neutral, thus parallel
+ CONTINUITY_C2
+ };
+
/** Base Point class with two double values
This class derives all operators and common handling for
@@ -244,6 +258,14 @@ namespace basegfx
matrix are disregarded.
*/
B2DVector operator*( const matrix::B2DHomMatrix& rMat, const B2DVector& rVec );
+
+ /** Test continuity between given vectors.
+
+ The two given vectors are assumed to describe control points on a
+ common point. Calculate if there is a continuity between them.
+ */
+ ::basegfx::vector::B2DVectorContinuity getContinuity( const B2DVector& rBackVector, const B2DVector& rForwardVector );
+
} // end of namespace vector
} // end of namespace basegfx