From 0b6b4ef6d88586317bd065b07f250b49b889b6ff Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 14 Nov 2006 14:36:22 +0000 Subject: [PATCH] INTEGRATION: CWS aw024 (1.18.72); FILE MERGED 2006/09/22 04:25:43 aw 1.18.72.5: RESYNC: (1.19-1.20); FILE MERGED 2005/09/19 15:37:05 aw 1.18.72.4: RESYNC: (1.18-1.19); FILE MERGED 2005/05/12 16:41:39 aw 1.18.72.3: #i39529# 2005/04/26 14:50:18 aw 1.18.72.2: #i39528# 2005/01/12 20:02:41 aw 1.18.72.1: #i39528 --- chart2/source/view/main/ShapeFactory.cxx | 103 ++++++++++++----------- 1 file changed, 53 insertions(+), 50 deletions(-) diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 95397a2908fc..4f975a960f39 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -4,9 +4,9 @@ * * $RCSfile: ShapeFactory.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: obo $ $Date: 2006-09-17 13:38:06 $ + * last change: $Author: ihi $ $Date: 2006-11-14 15:36:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -102,9 +102,6 @@ #include #endif -#ifndef _XPOLY_HXX -#include -#endif #ifndef _SVDOCIRC_HXX #include #endif @@ -112,6 +109,14 @@ #include #endif +#ifndef _BGFX_VECTOR_B2DVECTOR_HXX +#include +#endif + +#ifndef _BGFX_MATRIX_B3DHOMMATRIX_HXX +#include +#endif + #include using namespace ::com::sun::star; @@ -554,8 +559,8 @@ uno::Reference //Matrix for position { - Matrix4D aM4; - aM4.Translate(rGeometry.m_aPosition.PositionX + ::basegfx::B3DHomMatrix aM4; + aM4.translate(rGeometry.m_aPosition.PositionX , rGeometry.m_aPosition.PositionY , rGeometry.m_aPosition.PositionZ - (fDepth/2.0)); drawing::HomogenMatrix aHM = Matrix4DToHomogenMatrix(aM4); @@ -659,14 +664,14 @@ uno::Reference //Matrix for position { - Matrix4D aM4; + ::basegfx::B3DHomMatrix aM4; //if(ntest%2) //llllllllllllllllllll //aM4.RotateY( fYRotateAnglePi ); // Note: Uncomment the following to let the objects grow in z // direction to fill the diagram // aM4.ScaleZ(rGeometry.m_aSize.DirectionZ/rGeometry.m_aSize.DirectionX); - aM4.Translate(rGeometry.m_aPosition.PositionX, rGeometry.m_aPosition.PositionY, rGeometry.m_aPosition.PositionZ); + aM4.translate(rGeometry.m_aPosition.PositionX, rGeometry.m_aPosition.PositionY, rGeometry.m_aPosition.PositionZ); drawing::HomogenMatrix aHM = Matrix4DToHomogenMatrix(aM4); xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) , uno::makeAny(aHM) ); @@ -713,7 +718,7 @@ void appendBezierCoords( drawing::PolyPolygonBezierCoords& rReturn, const drawin drawing::PolyPolygonBezierCoords getCircularArcBezierCoords( double fAngleRadian - , const Matrix3D& rTransformationFromUnitCircle ) + , const ::basegfx::B2DHomMatrix& rTransformationFromUnitCircle ) { //at least one polygon is created using two normal and two control points //if the angle is larger it is separated into multiple sub angles @@ -735,8 +740,8 @@ drawing::PolyPolygonBezierCoords getCircularArcBezierCoords( // - Vector2D P0,P1,P2,P3; - Vector2D POrigin = rTransformationFromUnitCircle*Vector2D(0,0); + ::basegfx::B2DVector P0,P1,P2,P3; + ::basegfx::B2DVector POrigin = rTransformationFromUnitCircle * ::basegfx::B2DVector(0.0, 0.0); sal_Int32 nPoint=0; for(sal_Int32 nSegment=0; nSegment( P0.X()); - aPoints[nPoint].Y = static_cast< sal_Int32 >( P0.Y()); + aPoints[nPoint].X = static_cast< sal_Int32 >( P0.getX()); + aPoints[nPoint].Y = static_cast< sal_Int32 >( P0.getY()); aFlags [nPoint++] = drawing::PolygonFlags_NORMAL; - aPoints[nPoint].X = static_cast< sal_Int32 >( P1.X()); - aPoints[nPoint].Y = static_cast< sal_Int32 >( P1.Y()); + aPoints[nPoint].X = static_cast< sal_Int32 >( P1.getX()); + aPoints[nPoint].Y = static_cast< sal_Int32 >( P1.getY()); aFlags[nPoint++] = drawing::PolygonFlags_CONTROL; - aPoints[nPoint].X = static_cast< sal_Int32 >( P2.X()); - aPoints[nPoint].Y = static_cast< sal_Int32 >( P2.Y()); + aPoints[nPoint].X = static_cast< sal_Int32 >( P2.getX()); + aPoints[nPoint].Y = static_cast< sal_Int32 >( P2.getY()); aFlags [nPoint++] = drawing::PolygonFlags_CONTROL; if(nSegment==(nSegmentCount-1)) { - aPoints[nPoint].X = static_cast< sal_Int32 >( P3.X()); - aPoints[nPoint].Y = static_cast< sal_Int32 >( P3.Y()); + aPoints[nPoint].X = static_cast< sal_Int32 >( P3.getX()); + aPoints[nPoint].Y = static_cast< sal_Int32 >( P3.getY()); aFlags [nPoint++] = drawing::PolygonFlags_NORMAL; } } @@ -805,23 +812,19 @@ drawing::PolyPolygonBezierCoords getRingBezierCoords( aReturn.Coordinates = drawing::PointSequenceSequence(1); aReturn.Flags = drawing::FlagSequenceSequence(1); - Matrix3D aTransformationFromUnitCircle_Outer; - aTransformationFromUnitCircle_Outer.Rotate(fStartAngleRadian); - aTransformationFromUnitCircle_Outer.ScaleX(fOuterXRadius); - aTransformationFromUnitCircle_Outer.ScaleY(fOuterYRadius); - aTransformationFromUnitCircle_Outer.TranslateX(fPosX); - aTransformationFromUnitCircle_Outer.TranslateY(fPosY); + ::basegfx::B2DHomMatrix aTransformationFromUnitCircle_Outer; + aTransformationFromUnitCircle_Outer.rotate(fStartAngleRadian); + aTransformationFromUnitCircle_Outer.scale(fOuterXRadius, fOuterYRadius); + aTransformationFromUnitCircle_Outer.translate(fPosX, fPosY); drawing::PolyPolygonBezierCoords aOuterArc = getCircularArcBezierCoords( fWidthAngleRadian, aTransformationFromUnitCircle_Outer ); aReturn.Coordinates[0] = aOuterArc.Coordinates[0]; aReturn.Flags[0] = aOuterArc.Flags[0]; - Matrix3D aTransformationFromUnitCircle_Inner; - aTransformationFromUnitCircle_Inner.Rotate(fStartAngleRadian); - aTransformationFromUnitCircle_Inner.ScaleX(fInnerXRadius); - aTransformationFromUnitCircle_Inner.ScaleY(fInnerXRadius*fOuterYRadius/fOuterXRadius); - aTransformationFromUnitCircle_Inner.TranslateX(fPosX); - aTransformationFromUnitCircle_Inner.TranslateY(fPosY); + ::basegfx::B2DHomMatrix aTransformationFromUnitCircle_Inner; + aTransformationFromUnitCircle_Inner.rotate(fStartAngleRadian); + aTransformationFromUnitCircle_Inner.scale(fInnerXRadius, fInnerXRadius*fOuterYRadius/fOuterXRadius); + aTransformationFromUnitCircle_Inner.translate(fPosX, fPosY); drawing::PolyPolygonBezierCoords aInnerArc = getCircularArcBezierCoords( fWidthAngleRadian, aTransformationFromUnitCircle_Inner ); appendBezierCoords( aReturn, aInnerArc, sal_True ); @@ -915,10 +918,10 @@ uno::Reference< drawing::XShape > //Matrix for position { - Matrix4D aM4; - aM4.ScaleZ(fOuterYRadius/fOuterXRadius); - aM4.RotateY( ZDIRECTION*fStartAngleDegree*F_PI/180.0 ); - aM4.Translate(rOrigin.PositionX, rOrigin.PositionZ, rOrigin.PositionY); + ::basegfx::B3DHomMatrix aM4; + aM4.scale(1.0, 1.0, fOuterYRadius/fOuterXRadius); + aM4.rotate( 0.0, ZDIRECTION*fStartAngleDegree*F_PI/180.0, 0.0 ); + aM4.translate(rOrigin.PositionX, rOrigin.PositionZ, rOrigin.PositionY); drawing::HomogenMatrix aHM = Matrix4DToHomogenMatrix(aM4); xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) , uno::makeAny(aHM) ); @@ -1429,7 +1432,7 @@ uno::Reference< drawing::XShapes > { try { - Matrix4D aM4; + ::basegfx::B3DHomMatrix aM4; xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) , uno::makeAny(Matrix4DToHomogenMatrix(aM4)) ); } @@ -1700,13 +1703,13 @@ uno::Reference< drawing::XShape > ShapeFactory::createErrorBar2D( uno::Any ShapeFactory::makeTransformation( const awt::Point& rScreenPosition2D, double fRotationAnglePi ) { - Matrix3D aM3; + ::basegfx::B2DHomMatrix aM3; //As autogrow is active the rectangle is automatically expanded to that side //to which the text is not adjusted. - aM3.Scale( 1, 1 ); - aM3.Rotate( fRotationAnglePi ); - aM3.Translate( rScreenPosition2D.X, rScreenPosition2D.Y ); - uno::Any aATransformation = uno::makeAny( Matrix3DToHomogenMatrix3(aM3) ); + // aM3.scale( 1, 1 ); Oops? A scale with this parameters is neutral, line commented out + aM3.rotate( fRotationAnglePi ); + aM3.translate( rScreenPosition2D.X, rScreenPosition2D.Y ); + uno::Any aATransformation = uno::makeAny( B2DHomMatrixToHomogenMatrix3(aM3) ); return aATransformation; }