summaryrefslogtreecommitdiff
path: root/basegfx/inc
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2003-11-05 11:25:58 +0000
committerArmin Weiss <aw@openoffice.org>2003-11-05 11:25:58 +0000
commitc3663a687ccc9365b2b4eb4a3950b8d94c2d6ea7 (patch)
treec47ce5e59d718d5f772121000a356ef523662b17 /basegfx/inc
parent571971699571e0baf9710ddf076ebf27aebb548d (diff)
Added PolyPolygonTools, Added PolygonTool functionality, changed bool to sal_Bool
Diffstat (limited to 'basegfx/inc')
-rw-r--r--basegfx/inc/basegfx/curve/b2dcubicbezier.hxx10
-rw-r--r--basegfx/inc/basegfx/curve/b2dquadraticbezier.hxx10
-rw-r--r--basegfx/inc/basegfx/matrix/b2dhommatrix.hxx18
-rw-r--r--basegfx/inc/basegfx/matrix/b3dhommatrix.hxx18
-rw-r--r--basegfx/inc/basegfx/numeric/ftools.hxx28
-rw-r--r--basegfx/inc/basegfx/point/b2dhompoint.hxx12
-rw-r--r--basegfx/inc/basegfx/point/b3dhompoint.hxx12
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolygon.hxx21
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolygontools.hxx67
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx29
-rw-r--r--basegfx/inc/basegfx/range/b1drange.hxx10
-rw-r--r--basegfx/inc/basegfx/range/b2drange.hxx10
-rw-r--r--basegfx/inc/basegfx/range/b3drange.hxx10
-rw-r--r--basegfx/inc/basegfx/tuple/b2dtuple.hxx16
-rw-r--r--basegfx/inc/basegfx/tuple/b3dtuple.hxx16
-rw-r--r--basegfx/inc/basegfx/vector/b2dvector.hxx44
-rw-r--r--basegfx/inc/basegfx/vector/b3dvector.hxx10
17 files changed, 200 insertions, 141 deletions
diff --git a/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx b/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx
index 4d5617eff4a8..66f70223a14f 100644
--- a/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx
+++ b/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dcubicbezier.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:12:08 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -91,11 +91,11 @@ namespace basegfx
B2DCubicBezier& operator=(const B2DCubicBezier& rBezier);
// compare operators
- bool operator==(const B2DCubicBezier& rBezier) const;
- bool operator!=(const B2DCubicBezier& rBezier) const;
+ sal_Bool operator==(const B2DCubicBezier& rBezier) const;
+ sal_Bool operator!=(const B2DCubicBezier& rBezier) const;
// test if vectors are used
- bool isBezier() const;
+ sal_Bool isBezier() const;
// test if contained bezier is trivial and reset vectors accordingly
void testAndSolveTrivialBezier();
diff --git a/basegfx/inc/basegfx/curve/b2dquadraticbezier.hxx b/basegfx/inc/basegfx/curve/b2dquadraticbezier.hxx
index 6b7640bdd8b3..72c4df358c74 100644
--- a/basegfx/inc/basegfx/curve/b2dquadraticbezier.hxx
+++ b/basegfx/inc/basegfx/curve/b2dquadraticbezier.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dquadraticbezier.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:12:08 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -90,11 +90,11 @@ namespace basegfx
B2DQuadraticBezier& operator=(const B2DQuadraticBezier& rBezier);
// compare operators
- bool operator==(const B2DQuadraticBezier& rBezier) const;
- bool operator!=(const B2DQuadraticBezier& rBezier) const;
+ sal_Bool operator==(const B2DQuadraticBezier& rBezier) const;
+ sal_Bool operator!=(const B2DQuadraticBezier& rBezier) const;
// test if control point is placed on the edge
- bool isBezier() const;
+ sal_Bool isBezier() const;
// data interface
point::B2DPoint getStartPoint() const { return maStartPoint; }
diff --git a/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx b/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx
index b0e2d25cbd7f..641aa22deecb 100644
--- a/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx
+++ b/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dhommatrix.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:12:30 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,15 +95,15 @@ namespace basegfx
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue);
// Auf Einheitsmatrix zuruecksetzen
- bool isIdentity() const;
+ sal_Bool isIdentity() const;
void identity();
// Invertierung
- bool isInvertible() const;
- bool invert();
+ sal_Bool isInvertible() const;
+ sal_Bool invert();
// Normalisierung
- bool isNormalized() const;
+ sal_Bool isNormalized() const;
void normalize();
// Determinante
@@ -133,8 +133,8 @@ namespace basegfx
B2DHomMatrix& operator-=(const B2DHomMatrix& rMat);
// Vergleichsoperatoren
- bool operator==(const B2DHomMatrix& rMat) const;
- bool operator!=(const B2DHomMatrix& rMat) const;
+ sal_Bool operator==(const B2DHomMatrix& rMat) const;
+ sal_Bool operator!=(const B2DHomMatrix& rMat) const;
// Multiplikation, Division mit Konstante
B2DHomMatrix& operator*=(double fValue);
@@ -149,7 +149,7 @@ namespace basegfx
// Help routine to decompose given homogen 3x3 matrix to components. A correction of
// the components is done to avoid inaccuracies.
// Zerlegung
- bool decompose(tuple::B2DTuple& rScale, tuple::B2DTuple& rTranslate, double& rRotate, double& rShearX) const;
+ sal_Bool decompose(tuple::B2DTuple& rScale, tuple::B2DTuple& rTranslate, double& rRotate, double& rShearX) const;
};
// Addition, Subtraktion
diff --git a/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx b/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx
index db024b816c40..5de879853f45 100644
--- a/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx
+++ b/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b3dhommatrix.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:12:30 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,15 +94,15 @@ namespace basegfx
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const;
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue);
- bool isIdentity() const;
+ sal_Bool isIdentity() const;
/// Reset to the identity matrix
void identity();
- bool isInvertible() const;
+ sal_Bool isInvertible() const;
/// Invert the matrix (if possible)
- bool invert();
+ sal_Bool invert();
- bool isNormalized() const;
+ sal_Bool isNormalized() const;
/// Normalize (i.e. force w=1) the matrix
void normalize();
@@ -144,8 +144,8 @@ namespace basegfx
B3DHomMatrix& operator-=(const B3DHomMatrix& rMat);
// comparison
- bool operator==(const B3DHomMatrix& rMat) const;
- bool operator!=(const B3DHomMatrix& rMat) const;
+ sal_Bool operator==(const B3DHomMatrix& rMat) const;
+ sal_Bool operator!=(const B3DHomMatrix& rMat) const;
// multiplication, division by constant value
B3DHomMatrix& operator*=(double fValue);
@@ -158,7 +158,7 @@ namespace basegfx
B3DHomMatrix& operator=(const B3DHomMatrix& rMat);
// decomposition
- bool decompose(tuple::B3DTuple& rScale, tuple::B3DTuple& rTranslate, tuple::B3DTuple& rRotate, tuple::B3DTuple& rShear) const;
+ sal_Bool decompose(tuple::B3DTuple& rScale, tuple::B3DTuple& rTranslate, tuple::B3DTuple& rRotate, tuple::B3DTuple& rShear) const;
};
// addition, subtraction
diff --git a/basegfx/inc/basegfx/numeric/ftools.hxx b/basegfx/inc/basegfx/numeric/ftools.hxx
index 7c8cecd6fd25..9e657b91179f 100644
--- a/basegfx/inc/basegfx/numeric/ftools.hxx
+++ b/basegfx/inc/basegfx/numeric/ftools.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ftools.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:05:31 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -83,64 +83,64 @@ namespace basegfx
static void setSmallValue(const double& rfNew) { mfSmallValue = rfNew; }
- static bool equalZero(const double& rfVal)
+ static sal_Bool equalZero(const double& rfVal)
{
return (fabs(rfVal) <= getSmallValue());
}
- static bool equalZero(const double& rfVal, const double& rfSmallValue)
+ static sal_Bool equalZero(const double& rfVal, const double& rfSmallValue)
{
return (fabs(rfVal) <= rfSmallValue);
}
- static bool equal(const double& rfValA, const double& rfValB)
+ static sal_Bool equal(const double& rfValA, const double& rfValB)
{
return (fabs(rfValB - rfValA) <= getSmallValue());
}
- static bool less(const double& rfValA, const double& rfValB)
+ static sal_Bool less(const double& rfValA, const double& rfValB)
{
return (rfValA < rfValB && !equal(rfValA, rfValB));
}
- static bool lessOrEqual(const double& rfValA, const double& rfValB)
+ static sal_Bool lessOrEqual(const double& rfValA, const double& rfValB)
{
return (rfValA < rfValB || equal(rfValA, rfValB));
}
- static bool more(const double& rfValA, const double& rfValB)
+ static sal_Bool more(const double& rfValA, const double& rfValB)
{
return (rfValA > rfValB && !equal(rfValA, rfValB));
}
- static bool moreOrEqual(const double& rfValA, const double& rfValB)
+ static sal_Bool moreOrEqual(const double& rfValA, const double& rfValB)
{
return (rfValA > rfValB || equal(rfValA, rfValB));
}
- static bool equal(const double& rfValA, const double& rfValB, const double& rfSmallValue)
+ static sal_Bool equal(const double& rfValA, const double& rfValB, const double& rfSmallValue)
{
return (fabs(rfValB - rfValA) <= rfSmallValue);
}
- static bool less(const double& rfValA, const double& rfValB, const double& rfSmallValue)
+ static sal_Bool less(const double& rfValA, const double& rfValB, const double& rfSmallValue)
{
return (rfValA < rfValB && !equal(rfValA, rfValB, rfSmallValue));
}
- static bool lessOrEqual(const double& rfValA, const double& rfValB, const double& rfSmallValue)
+ static sal_Bool lessOrEqual(const double& rfValA, const double& rfValB, const double& rfSmallValue)
{
return (rfValA < rfValB || equal(rfValA, rfValB, rfSmallValue));
}
- static bool more(const double& rfValA, const double& rfValB, const double& rfSmallValue)
+ static sal_Bool more(const double& rfValA, const double& rfValB, const double& rfSmallValue)
{
return (rfValA > rfValB && !equal(rfValA, rfValB, rfSmallValue));
}
- static bool moreOrEqual(const double& rfValA, const double& rfValB, const double& rfSmallValue)
+ static sal_Bool moreOrEqual(const double& rfValA, const double& rfValB, const double& rfSmallValue)
{
return (rfValA > rfValB || equal(rfValA, rfValB, rfSmallValue));
}
diff --git a/basegfx/inc/basegfx/point/b2dhompoint.hxx b/basegfx/inc/basegfx/point/b2dhompoint.hxx
index 723fff6e4aab..5407b2653029 100644
--- a/basegfx/inc/basegfx/point/b2dhompoint.hxx
+++ b/basegfx/inc/basegfx/point/b2dhompoint.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b2dhompoint.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:12:48 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,9 +94,9 @@ namespace basegfx
/** Test if this homogen point does have a homogenous part
- @return Returns true if this point has no homogenous part
+ @return Returns sal_True if this point has no homogenous part
*/
- bool implIsHomogenized() const;
+ sal_Bool implIsHomogenized() const;
/** Remove homogenous part of this Point
@@ -235,9 +235,9 @@ namespace basegfx
B2DHomPoint& operator-(void);
- bool operator==( const B2DHomPoint& rPnt ) const;
+ sal_Bool operator==( const B2DHomPoint& rPnt ) const;
- bool operator!=( const B2DHomPoint& rPnt ) const;
+ sal_Bool operator!=( const B2DHomPoint& rPnt ) const;
B2DHomPoint& operator=( const B2DHomPoint& rPnt );
};
diff --git a/basegfx/inc/basegfx/point/b3dhompoint.hxx b/basegfx/inc/basegfx/point/b3dhompoint.hxx
index 881a9de2f0fb..dc470d1c7ebd 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.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:12:49 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,9 +94,9 @@ namespace basegfx
/** Test if this homogen point does have a homogenous part
- @return Returns true if this point has no homogenous part
+ @return Returns sal_True if this point has no homogenous part
*/
- bool implIsHomogenized() const
+ sal_Bool implIsHomogenized() const
{
const double fOne(1.0);
return ::basegfx::numeric::fTools::equal(mfW, fOne);
@@ -322,13 +322,13 @@ namespace basegfx
return *this;
}
- bool operator==( const B3DHomPoint& rPnt ) const
+ sal_Bool operator==( const B3DHomPoint& rPnt ) const
{
implTestAndHomogenize();
return (maTuple == rPnt.maTuple);
}
- bool operator!=( const B3DHomPoint& rPnt ) const
+ sal_Bool operator!=( const B3DHomPoint& rPnt ) const
{
implTestAndHomogenize();
return (maTuple != rPnt.maTuple);
diff --git a/basegfx/inc/basegfx/polygon/b2dpolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolygon.hxx
index ec13b1b3b69b..60d1219d431a 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.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:05:58 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -81,11 +81,6 @@ namespace basegfx
{
class B2DPoint;
} // end of namespace point
-
- namespace vector
- {
- class B2DVector;
- } // end of namespace vector
} // end of namespace basegfx
//////////////////////////////////////////////////////////////////////////////
@@ -149,8 +144,18 @@ namespace basegfx
sal_Bool isClosed() const;
void setClosed(sal_Bool bNew);
- // flip polygon
+ // flip polygon direction
void flip();
+
+ // test if Polygon has double points
+ sal_Bool hasDoublePoints() const;
+
+ // 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 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 ac9e2b1f90d8..f3a7601f0f78 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.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:05:59 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -84,6 +84,11 @@ namespace basegfx
class B2DPolygon;
} // end of namespace polygon
+ namespace range
+ {
+ class B2DRange;
+ } // end of namespace range
+
namespace polygon
{
namespace tools
@@ -99,29 +104,57 @@ namespace basegfx
*/
void checkClosed(polygon::B2DPolygon& rCandidate);
- // Checks if one of the control vectors is used
- bool isEdgeBezier(const polygon::B2DPolygon& rPolygon, sal_uInt32 nEdgeIndex);
+ // Get index of outmost point (e.g. biggest X and biggest Y)
+ sal_uInt32 getIndexOfOutmostPoint(const polygon::B2DPolygon& rCandidate);
+
+ // Get successor and predecessor indices. Returning the same index means there
+ // is none. Same for successor.
+ sal_uInt32 getIndexOfPredecessor(sal_uInt32 nIndex, const polygon::B2DPolygon& rCandidate);
+ sal_uInt32 getIndexOfSuccessor(sal_uInt32 nIndex, const polygon::B2DPolygon& rCandidate);
+
+ // Get index of first different predecessor. Returning the same index means there
+ // is none. Same for successor.
+ sal_uInt32 getIndexOfDifferentPredecessor(sal_uInt32 nIndex, const polygon::B2DPolygon& rCandidate);
+ sal_uInt32 getIndexOfDifferentSuccessor(sal_uInt32 nIndex, const polygon::B2DPolygon& rCandidate);
+
+ // 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);
+
+ // get size of polygon
+ ::basegfx::range::B2DRange getRange(const ::basegfx::polygon::B2DPolygon& rCandidate);
- // Checks if usage of the control vectors is only for trivial cubic bezier.
- bool isEdgeTrivialBezier(const polygon::B2DPolygon& rPolygon, sal_uInt32 nEdgeIndex);
+ // get area of polygon
+ double getArea(const ::basegfx::polygon::B2DPolygon& rCandidate);
+
+ // get length of polygon edge from point nIndex to nIndex + 1
+ double getEdgeLength(const ::basegfx::polygon::B2DPolygon& rCandidate, sal_uInt32 nIndex);
+
+ // get length of polygon
+ double getLength(const ::basegfx::polygon::B2DPolygon& rCandidate);
+
+ // get position on polygon for absolute given distance. If
+ // length is given, it is assumed the correct polygon length, if 0.0 it is calculated
+ // using getLength(...)
+ ::basegfx::point::B2DPoint getPositionAbsolute(const ::basegfx::polygon::B2DPolygon& rCandidate, double fDistance, double fLength = 0.0);
+
+ // get position on polygon for relative given distance in range [0.0 .. 1.0]. If
+ // length is given, it is assumed the correct polygon length, if 0.0 it is calculated
+ // using getLength(...)
+ ::basegfx::point::B2DPoint getPositionRelative(const ::basegfx::polygon::B2DPolygon& rCandidate, double fDistance, double fLength = 0.0);
+
+ // get orientation at given polygon point
+ ::basegfx::vector::B2DVectorOrientation getPointOrientation(const ::basegfx::polygon::B2DPolygon& rCandidate, sal_uInt32 nIndex);
/* Still missing:
- BOOL isClockwise(const Vector3D &rNormal) const;
- void removeDoublePoints();
void transform(const Matrix4D& rTfMatrix);
- BOOL isInside(const Vector3D& rPnt, BOOL bWithBorder=FALSE) const;
- BOOL isInside(const Polygon3D& rPoly, BOOL bWithBorder=TRUE) const;
- Volume3D getPolySize() const;
- double getPolyArea() const;
- double getLength() const;
- BOOL getPointOrientation(UINT16 nIndex) const;
- Vector3D getPosition(double fPos) const;
Polygon3D getExpandedPolygon(sal_uInt32 nNum);
*/
-
-
} // end of namespace tools
} // end of namespace polygon
} // end of namespace basegfx
diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx
index 565e024cf1c3..b54d067ec78c 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.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:06:00 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,6 +75,11 @@ namespace basegfx
{
class B2DPolygon;
} // end of namespace polygon
+
+ namespace vector
+ {
+ enum B2DVectorOrientation;
+ } // end of namespace vector
} // end of namespace basegfx
//////////////////////////////////////////////////////////////////////////////
@@ -101,8 +106,8 @@ namespace basegfx
B2DPolyPolygon& operator=(const B2DPolyPolygon& rPolyPolygon);
// compare operators
- bool operator==(const B2DPolyPolygon& rPolyPolygon) const;
- bool operator!=(const B2DPolyPolygon& rPolyPolygon) const;
+ sal_Bool operator==(const B2DPolyPolygon& rPolyPolygon) const;
+ sal_Bool operator!=(const B2DPolyPolygon& rPolyPolygon) const;
// polygon interface
sal_uInt32 count() const;
@@ -123,6 +128,22 @@ namespace basegfx
// reset to empty state
void clear();
+
+ // closed state
+ sal_Bool isClosed() const;
+ void setClosed(sal_Bool bNew);
+
+ // Check and evtl. correct orientations of contained Polygons
+ ::basegfx::vector::B2DVectorOrientation checkOrientations();
+
+ // flip polygon direction
+ void flip();
+
+ // test if PolyPolygon has double points
+ sal_Bool hasDoublePoints() const;
+
+ // remove double points, at the begin/end and follow-ups, too
+ void removeDoublePoints();
};
} // end of namespace polygon
} // end of namespace basegfx
diff --git a/basegfx/inc/basegfx/range/b1drange.hxx b/basegfx/inc/basegfx/range/b1drange.hxx
index 3e9094585a37..eedb4bc5911b 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.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:13:08 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,7 +89,7 @@ namespace basegfx
{
}
- bool isEmpty() const
+ sal_Bool isEmpty() const
{
return maRange.isEmpty();
}
@@ -119,12 +119,12 @@ namespace basegfx
return maRange.getRange();
}
- bool isInside(double fValue) const
+ sal_Bool isInside(double fValue) const
{
return maRange.isInside(fValue);
}
- bool isInside(const B1DRange& rRange) const
+ sal_Bool isInside(const B1DRange& rRange) const
{
return maRange.isInside(rRange.maRange);
}
diff --git a/basegfx/inc/basegfx/range/b2drange.hxx b/basegfx/inc/basegfx/range/b2drange.hxx
index 0a166a3a87ec..f3a8ac8bbba2 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.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:13:08 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,7 +96,7 @@ namespace basegfx
{
}
- bool isEmpty() const
+ sal_Bool isEmpty() const
{
return (
maRangeX.isEmpty()
@@ -140,7 +140,7 @@ namespace basegfx
);
}
- bool isInside(const tuple::B2DTuple& rTuple) const
+ sal_Bool isInside(const tuple::B2DTuple& rTuple) const
{
return (
maRangeX.isInside(rTuple.getX())
@@ -148,7 +148,7 @@ namespace basegfx
);
}
- bool isInside(const B2DRange& rRange) const
+ sal_Bool isInside(const B2DRange& rRange) const
{
return (
maRangeX.isInside(rRange.maRangeX)
diff --git a/basegfx/inc/basegfx/range/b3drange.hxx b/basegfx/inc/basegfx/range/b3drange.hxx
index 0f9f114e8ec6..a62f61208b5d 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.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:13:09 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,7 +99,7 @@ namespace basegfx
{
}
- bool isEmpty() const
+ sal_Bool isEmpty() const
{
return (
maRangeX.isEmpty()
@@ -149,7 +149,7 @@ namespace basegfx
);
}
- bool isInside(const tuple::B3DTuple& rTuple) const
+ sal_Bool isInside(const tuple::B3DTuple& rTuple) const
{
return (
maRangeX.isInside(rTuple.getX())
@@ -158,7 +158,7 @@ namespace basegfx
);
}
- bool isInside(const B3DRange& rRange) const
+ sal_Bool isInside(const B3DRange& rRange) const
{
return (
maRangeX.isInside(rRange.maRangeX)
diff --git a/basegfx/inc/basegfx/tuple/b2dtuple.hxx b/basegfx/inc/basegfx/tuple/b2dtuple.hxx
index 69a9a438abde..71300b00b6a1 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.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:06:24 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -176,13 +176,13 @@ namespace basegfx
// comparators with tolerance
//////////////////////////////////////////////////////////////////////
- bool equalZero() const;
+ sal_Bool equalZero() const;
- bool equalZero(const double& rfSmallValue) const;
+ sal_Bool equalZero(const double& rfSmallValue) const;
- bool equal(const B2DTuple& rTup) const;
+ sal_Bool equal(const B2DTuple& rTup) const;
- bool equal(const B2DTuple& rTup, const double& rfSmallValue) const;
+ sal_Bool equal(const B2DTuple& rTup, const double& rfSmallValue) const;
// operators
//////////////////////////////////////////////////////////////////////
@@ -235,12 +235,12 @@ namespace basegfx
return B2DTuple(-mfX, -mfY);
}
- bool operator==( const B2DTuple& rTup ) const
+ sal_Bool operator==( const B2DTuple& rTup ) const
{
return equal(rTup);
}
- bool operator!=( const B2DTuple& rTup ) const
+ sal_Bool operator!=( const B2DTuple& rTup ) const
{
return !equal(rTup);
}
diff --git a/basegfx/inc/basegfx/tuple/b3dtuple.hxx b/basegfx/inc/basegfx/tuple/b3dtuple.hxx
index 2bce77f9d03c..2098433a2af3 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.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:06:25 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -192,13 +192,13 @@ namespace basegfx
// comparators with tolerance
//////////////////////////////////////////////////////////////////////
- bool EqualZero() const
+ sal_Bool EqualZero() const
{
return (this == &maEmptyTuple ||
(::basegfx::numeric::fTools::equalZero(mfX) && ::basegfx::numeric::fTools::equalZero(mfY) && ::basegfx::numeric::fTools::equalZero(mfZ)));
}
- bool EqualZero(const double& rfSmallValue) const
+ sal_Bool EqualZero(const double& rfSmallValue) const
{
return (this == &maEmptyTuple ||
(::basegfx::numeric::fTools::equalZero(mfX, rfSmallValue)
@@ -206,7 +206,7 @@ namespace basegfx
&& ::basegfx::numeric::fTools::equalZero(mfZ, rfSmallValue)));
}
- bool Equal(const B3DTuple& rTup) const
+ sal_Bool Equal(const B3DTuple& rTup) const
{
return (
::basegfx::numeric::fTools::equal(mfX, rTup.mfX) &&
@@ -214,7 +214,7 @@ namespace basegfx
::basegfx::numeric::fTools::equal(mfZ, rTup.mfZ));
}
- bool Equal(const B3DTuple& rTup, const double& rfSmallValue) const
+ sal_Bool Equal(const B3DTuple& rTup, const double& rfSmallValue) const
{
return (
::basegfx::numeric::fTools::equal(mfX, rTup.mfX, rfSmallValue) &&
@@ -279,12 +279,12 @@ namespace basegfx
return B3DTuple(-mfX, -mfY, -mfZ);
}
- bool operator==( const B3DTuple& rTup ) const
+ sal_Bool operator==( const B3DTuple& rTup ) const
{
return Equal(rTup);
}
- bool operator!=( const B3DTuple& rTup ) const
+ sal_Bool operator!=( const B3DTuple& rTup ) const
{
return !Equal(rTup);
}
diff --git a/basegfx/inc/basegfx/vector/b2dvector.hxx b/basegfx/inc/basegfx/vector/b2dvector.hxx
index cd7a2e2f5309..1766a3d4ca0e 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.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:13:25 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -76,6 +76,20 @@ namespace basegfx
namespace vector
{
+ /** Descriptor for the mathematical orientations of two 2D Vectors
+ */
+ enum B2DVectorOrientation
+ {
+ /// mathematically positive oriented
+ ORIENTATION_POSITIVE = 0,
+
+ /// mathematically negative oriented
+ ORIENTATION_NEGATIVE,
+
+ /// mathematically neutral, thus parallel
+ ORIENTATION_NEUTRAL
+ };
+
/** Base Point class with two double values
This class derives all operators and common handling for
@@ -87,20 +101,6 @@ namespace basegfx
class B2DVector : public tuple::B2DTuple
{
public:
- /** Descriptor for the mathematical orientations of two 2D Vectors
- */
- enum B2DVectorOrientation
- {
- /// mathematically positive oriented
- POSITIVE = 0,
-
- /// mathematically negative oriented
- NEGATIVE,
-
- /// mathematically neutral, thus parallel
- NEUTRAL
- };
-
/** Create a 2D Vector
@param fVal
@@ -171,10 +171,10 @@ namespace basegfx
/** Test if this 2D Vector is normalized
@return
- true if lenth of vector is equal to 1.0
- false else
+ sal_True if lenth of vector is equal to 1.0
+ sal_False else
*/
- bool isNormalized() const;
+ sal_Bool isNormalized() const;
/** Calculate the Scalar with another 2D Vector
@@ -210,7 +210,7 @@ namespace basegfx
@return
The mathematical Orientation of the two involved 2D Vectors
*/
- B2DVector::B2DVectorOrientation getOrientation( const B2DVector& rVecA, const B2DVector& rVecB );
+ B2DVectorOrientation getOrientation( const B2DVector& rVecA, const B2DVector& rVecB );
/** Calculate a perpendicular 2D Vector to the given one
@@ -233,10 +233,10 @@ namespace basegfx
The second 2D Vector
@return
- bool if the two values are parallel. Also true if
+ sal_Bool if the two values are parallel. Also sal_True if
one of the vectors is empty.
*/
- bool areParallel( const B2DVector& rVecA, const B2DVector& rVecB );
+ sal_Bool areParallel( const B2DVector& rVecA, const B2DVector& rVecB );
/** Transform vector by given transformation matrix.
diff --git a/basegfx/inc/basegfx/vector/b3dvector.hxx b/basegfx/inc/basegfx/vector/b3dvector.hxx
index 9e8629f1bbfc..ec153104981e 100644
--- a/basegfx/inc/basegfx/vector/b3dvector.hxx
+++ b/basegfx/inc/basegfx/vector/b3dvector.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: b3dvector.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: aw $ $Date: 2003-10-31 10:13:26 $
+ * last change: $Author: aw $ $Date: 2003-11-05 12:25:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -222,10 +222,10 @@ namespace basegfx
/** Test if this 3D Vector is normalized
@return
- true if lenth of vector is equal to 1.0
- false else
+ sal_True if lenth of vector is equal to 1.0
+ sal_False else
*/
- bool isNormalized() const
+ sal_Bool isNormalized() const
{
const double fOne(1.0);
const double fScalar(scalar(*this));