diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 22:54:16 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-08-19 22:54:16 +0000 |
commit | 56fa7423bf032d6dfcc9afb38e86c88ea73f2386 (patch) | |
tree | f3d1db06855bc7d4a2f4e4daff59fd2e40bb8929 /basegfx | |
parent | 2aad9ba33bdd4231d7ab5c33b7f796d0cc9a9d75 (diff) |
INTEGRATION: CWS aw033 (1.6.2); FILE MERGED
2008/05/27 14:08:43 aw 1.6.2.6: #i39532# changes DEV300 m12 resync corrections
2008/05/14 14:42:20 aw 1.6.2.5: RESYNC: (1.7-1.9); FILE MERGED
2007/11/07 14:24:28 aw 1.6.2.4: #i39532# committing to have a base for HDU
2006/05/12 14:32:36 aw 1.6.2.3: RESYNC: (1.6-1.7); FILE MERGED
2006/05/12 11:38:01 aw 1.6.2.2: code changes for primitive support
2005/10/28 11:21:56 aw 1.6.2.1: #i39532#
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/inc/basegfx/polygon/b3dpolygontools.hxx | 74 |
1 files changed, 59 insertions, 15 deletions
diff --git a/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx index 92f0b5ae1cf9..d3dbb333a896 100644 --- a/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b3dpolygontools.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: b3dpolygontools.hxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.10 $ * * This file is part of OpenOffice.org. * @@ -34,7 +34,7 @@ #include <basegfx/point/b3dpoint.hxx> #include <basegfx/vector/b3dvector.hxx> #include <basegfx/polygon/b3dpolypolygon.hxx> - +#include <basegfx/vector/b2enums.hxx> #include <vector> ////////////////////////////////////////////////////////////////////////////// @@ -56,15 +56,30 @@ namespace basegfx method corrects this (removes double start/end points) and sets the Closed()-state of the polygon correctly. */ - void checkClosed(::basegfx::B3DPolygon& rCandidate); + void checkClosed(B3DPolygon& rCandidate); // Get successor and predecessor indices. Returning the same index means there // is none. Same for successor. - sal_uInt32 getIndexOfPredecessor(sal_uInt32 nIndex, const ::basegfx::B3DPolygon& rCandidate); - sal_uInt32 getIndexOfSuccessor(sal_uInt32 nIndex, const ::basegfx::B3DPolygon& rCandidate); + sal_uInt32 getIndexOfPredecessor(sal_uInt32 nIndex, const B3DPolygon& rCandidate); + sal_uInt32 getIndexOfSuccessor(sal_uInt32 nIndex, const B3DPolygon& rCandidate); + + // Get orientation of Polygon + B2VectorOrientation getOrientation(const B3DPolygon& rCandidate); // get size of polygon. Control vectors are included in that ranges. - ::basegfx::B3DRange getRange(const ::basegfx::B3DPolygon& rCandidate); + B3DRange getRange(const B3DPolygon& rCandidate); + + // get normal vector of polygon + B3DVector getNormal(const B3DPolygon& rCandidate); + + // get normal vector of positive oriented polygon + B3DVector getPositiveOrientedNormal(const B3DPolygon& rCandidate); + + // get signed area of polygon + double getSignedArea(const B3DPolygon& rCandidate); + + // get area of polygon + double getArea(const B3DPolygon& rCandidate); // get normal vector of polygon ::basegfx::B3DVector getNormal(const ::basegfx::B3DPolygon& rCandidate); @@ -76,26 +91,55 @@ namespace basegfx double getArea(const ::basegfx::B3DPolygon& rCandidate); // get length of polygon edge from point nIndex to nIndex + 1 - double getEdgeLength(const ::basegfx::B3DPolygon& rCandidate, sal_uInt32 nIndex); + double getEdgeLength(const B3DPolygon& rCandidate, sal_uInt32 nIndex); // get length of polygon - double getLength(const ::basegfx::B3DPolygon& rCandidate); + double getLength(const B3DPolygon& 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::B3DPoint getPositionAbsolute(const ::basegfx::B3DPolygon& rCandidate, double fDistance, double fLength = 0.0); + B3DPoint getPositionAbsolute(const B3DPolygon& 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::B3DPoint getPositionRelative(const ::basegfx::B3DPolygon& rCandidate, double fDistance, double fLength = 0.0); + B3DPoint getPositionRelative(const B3DPolygon& rCandidate, double fDistance, double fLength = 0.0); + + /** Apply given LineDashing to given polygon - // Apply Line Dashing. This cuts the Polygon into line pieces - // which are inserted as single polygons into the result. - // If fFullDashDotLen is not given it will be calculated from the given - // raDashDotArray. - ::basegfx::B3DPolyPolygon applyLineDashing(const ::basegfx::B3DPolygon& rCandidate, const ::std::vector<double>& raDashDotArray, double fFullDashDotLen = 0.0); + For a description see applyLineDashing in b2dpolygontoos.hxx + */ + void applyLineDashing( + const B3DPolygon& rCandidate, + const ::std::vector<double>& rDotDashArray, + B3DPolyPolygon* pLineTarget, + B3DPolyPolygon* pGapTarget = 0, + double fFullDashDotLen = 0.0); + + /** Create/replace normals for given 3d geometry with default normals from given center to outside. + rCandidate: the 3d geometry to change + rCenter: the center of the 3d geometry + */ + B3DPolygon applyDefaultNormalsSphere( const B3DPolygon& rCandidate, const B3DPoint& rCenter); + + /** invert normals for given 3d geometry. + */ + B3DPolygon invertNormals( const B3DPolygon& rCandidate); + + /** Create/replace texture coordinates for given 3d geometry with parallel projected one + rRange: the full range of the 3d geometry + If bChangeX, x texture coordinate will be recalculated. + If bChangeY, y texture coordinate will be recalculated. + */ + B3DPolygon applyDefaultTextureCoordinatesParallel( const B3DPolygon& rCandidate, const B3DRange& rRange, bool bChangeX = true, bool bChangeY = true); + + /** Create/replace texture coordinates for given 3d geometry with spherical one + rCenter: the centre of the used 3d geometry + If bChangeX, x texture coordinate will be recalculated. + If bChangeY, y texture coordinate will be recalculated. + */ + B3DPolygon applyDefaultTextureCoordinatesSphere( const B3DPolygon& rCandidate, const B3DPoint& rCenter, bool bChangeX = true, bool bChangeY = true); ////////////////////////////////////////////////////////////////////// // comparators with tolerance for 3D Polygons |