diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-05-22 18:20:35 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-05-22 18:20:35 +0000 |
commit | 0bc23af7fc698e5c2b20f35f68dca2153e1f609b (patch) | |
tree | cb27db7b9c361c6bacf225d6f4bf093cb151b786 /chart2/source/view/inc/ShapeFactory.hxx | |
parent | 0794f264f3cfe31fa459842d1cc67a305cd804fc (diff) |
INTEGRATION: CWS chart2mst3 (1.10.4); FILE MERGED
2006/10/11 11:49:23 dr 1.10.4.19: #i67757# connect first/last point in radarcharts correctly
2006/10/06 19:02:19 iha 1.10.4.18: added helping method to remove all sub shapes in a group shape
2006/08/29 12:26:22 iha 1.10.4.17: correct overlap detection for rotated axis labels
2006/08/10 15:57:34 iha 1.10.4.16: Axis Label Layout - Font&Diagram Size
2006/06/30 23:31:58 iha 1.10.4.15: helping method to respect aspect ratio
2006/06/30 23:17:54 iha 1.10.4.14: correct scene dimensions also for pies with dummy objects
2006/04/03 12:11:05 iha 1.10.4.13: correct selection handles for data point labels and legend entries
2006/03/12 00:23:48 iha 1.10.4.12: added methods getOrCreateChartRootShape & getShapeName
2006/01/14 13:55:55 iha 1.10.4.11: respect PercentDiagonal Property as boolean for bars
2005/12/21 14:10:57 dr 1.10.4.10: border color for symbols
2005/12/05 18:04:23 iha 1.10.4.9: methods moved from AreaChart to here
2005/11/24 15:08:28 bm 1.10.4.8: symbol graphics support
2005/10/07 12:21:36 bm 1.10.4.7: RESYNC: (1.10-1.11); FILE MERGED
2005/07/04 17:12:33 iha 1.10.4.6: added method createMarkHandlesRectangle
2004/05/08 17:54:57 iha 1.10.4.5: polartransformation fixes and pie offset implementation
2004/04/29 09:28:06 iha 1.10.4.4: correct 3d bar object position and size
2004/04/28 20:16:53 iha 1.10.4.3: removed /cvs/graphics/chart2/source/inc/RegressionCurveHelper.hxx,v: needs patch
2004/03/24 10:39:13 iha 1.10.4.2: change signature of ShapeFactory::createLine2D
2004/03/23 20:22:28 iha 1.10.4.1: removed now superfluous method createErrorBar2D
Diffstat (limited to 'chart2/source/view/inc/ShapeFactory.hxx')
-rw-r--r-- | chart2/source/view/inc/ShapeFactory.hxx | 147 |
1 files changed, 95 insertions, 52 deletions
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index bf64f16338db..4237b2a36c7a 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -4,9 +4,9 @@ * * $RCSfile: ShapeFactory.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: rt $ $Date: 2005-09-08 01:44:33 $ + * last change: $Author: vg $ $Date: 2007-05-22 19:20:35 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -35,26 +35,40 @@ #ifndef _CHART2_VIEW_SHAPEFACTORY_HXX #define _CHART2_VIEW_SHAPEFACTORY_HXX -#include "DatapointGeometry.hxx" #include "PropertyMapper.hxx" #include "VLineProperties.hxx" - +#include "BaseGFXHelper.hxx" #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> #endif +#ifndef _COM_SUN_STAR_DRAWING_DIRECTION3D_HPP_ +#include <com/sun/star/drawing/Direction3D.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_HOMOGENMATRIX_HPP_ +#include <com/sun/star/drawing/HomogenMatrix.hpp> +#endif #ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCESEQUENCE_HPP_ #include <com/sun/star/drawing/PointSequenceSequence.hpp> #endif #ifndef _COM_SUN_STAR_DRAWING_POLYPOLYGONSHAPE3D_HPP_ #include <com/sun/star/drawing/PolyPolygonShape3D.hpp> #endif +#ifndef _COM_SUN_STAR_DRAWING_POSITION3D_HPP_ +#include <com/sun/star/drawing/Position3D.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_XDRAWPAGE_HPP_ +#include <com/sun/star/drawing/XDrawPage.hpp> +#endif #ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_ #include <com/sun/star/drawing/XShapes.hpp> #endif #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #endif +#ifndef _COM_SUN_STAR_GRAPHIC_XGRAPHIC_HPP_ +#include <com/sun/star/graphic/XGraphic.hpp> +#endif //............................................................................. namespace chart @@ -83,54 +97,50 @@ public: //------ - enum tErrorBarDirection - { - ERROR_BAR_UP, - ERROR_BAR_RIGHT, - ERROR_BAR_DOWN, - ERROR_BAR_LEFT - }; - - //------ - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createCube( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget - , const DataPointGeometry& rGeometry + , const ::com::sun::star::drawing::Position3D& rPosition + , const ::com::sun::star::drawing::Direction3D& rSize + , sal_Int32 nRotateZAngleHundredthDegree , const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSourceProp - , const tPropertyNameMap& rPropertyNameMap ); - - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > - createRoundedCube(const ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XShapes >& xTarget - , const DataPointGeometry& rGeometry ); + , const tPropertyNameMap& rPropertyNameMap + , bool bRounded = false); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createCylinder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget - , const DataPointGeometry& rGeometry ); + , const ::com::sun::star::drawing::Position3D& rPosition + , const ::com::sun::star::drawing::Direction3D& rSize + , sal_Int32 nRotateZAngleHundredthDegree ); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createPyramid( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget - , const DataPointGeometry& rGeometry ); + , const ::com::sun::star::drawing::Position3D& rPosition + , const ::com::sun::star::drawing::Direction3D& rSize + , double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree ); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createCone( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget - , const DataPointGeometry& rGeometry ); + , const ::com::sun::star::drawing::Position3D& rPosition + , const ::com::sun::star::drawing::Direction3D& rSize + , double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree ); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createPieSegment2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget - , double fStartAngleDegree, double fWidthAngleDegree - , double fInnerXRadius, double fOuterXRadius, double fOuterYRadius - , const ::com::sun::star::drawing::Position3D& rOrigin ); + , double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree + , double fUnitCircleInnerRadius, double fUnitCircleOuterRadius + , const ::com::sun::star::drawing::Direction3D& rOffset + , const ::com::sun::star::drawing::HomogenMatrix& rUnitCircleToScene ); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createPieSegment( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget - , double fStartAngleDegree, double fWidthAngleDegree - , double fInnerXRadius, double fOuterXRadius, double fOuterYRadius - , const ::com::sun::star::drawing::Position3D& rOrigin + , double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree + , double fUnitCircleInnerRadius, double fUnitCircleOuterRadius + , const ::com::sun::star::drawing::Direction3D& rOffset + , const ::com::sun::star::drawing::HomogenMatrix& rUnitCircleToScene , double fDepth ); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > @@ -156,43 +166,33 @@ public: , const ::com::sun::star::drawing::Position3D& rPos , const ::com::sun::star::drawing::Direction3D& rSize , sal_Int32 nStandardSymbol + , sal_Int32 nBorderColor=0 , sal_Int32 nFillColor=0 ); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createGraphic2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const ::com::sun::star::drawing::Position3D& rPos + , const ::com::sun::star::drawing::Direction3D& rSize + , const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& xGraphic ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createSymbol3D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget , const ::com::sun::star::drawing::Position3D& rPos , const ::com::sun::star::drawing::Direction3D& rSize , sal_Int32 nStandardSymbol + , sal_Int32 nBorderColor=0 , sal_Int32 nFillColor=0 ); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createLine2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget , const ::com::sun::star::drawing::PointSequenceSequence& rPoints - , const VLineProperties& rLineProperties ); + , const VLineProperties* pLineProperties = NULL ); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createLine3D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget , const ::com::sun::star::drawing::PolyPolygonShape3D& rPoints , const VLineProperties& rLineProperties ); - /** creates an error bar shape, that is a line with a small perpendicular - line on top like the letter 'T'. - - @param bClip - If true, the perpendicular line is omitted. - - @todo If bClip is true, the main line could end in dots. - */ - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > - createErrorBar2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget - , const ::com::sun::star::drawing::Position3D& rPos - , const ::com::sun::star::drawing::Direction3D& rSize - , tErrorBarDirection eDirection - , bool bClip - ); -// , const tNameSequence& rPropNames -// , const tAnySequence& rPropValues ); - //------------------- create 2D elements: ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > @@ -203,27 +203,70 @@ public: , const ::com::sun::star::uno::Any& rATransformation ); + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createInvisibleRectangle( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const ::com::sun::star::awt::Size& rSize ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > + getOrCreateChartRootShape( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XDrawPage>& xPage ); + + static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > + getChartRootShape( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XDrawPage>& xPage ); + //------ + static void makeShapeInvisible( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShape >& xShape ); static void setShapeName( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape , const rtl::OUString& rName ); + static rtl::OUString getShapeName( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShape >& xShape ); + static ::com::sun::star::uno::Any makeTransformation( const ::com::sun::star::awt::Point& rScreenPosition2D, double fRotationAnglePi=0.0 ); static rtl::OUString getStackedString( const rtl::OUString& rString, bool bStacked=true ); + static bool hasPolygonAnyLines( ::com::sun::star::drawing::PolyPolygonShape3D& rPoly ); + static bool isPolygonEmptyOrSinglePoint( ::com::sun::star::drawing::PolyPolygonShape3D& rPoly ); + static void closePolygon( ::com::sun::star::drawing::PolyPolygonShape3D& rPoly ); + + static ::com::sun::star::awt::Size calculateNewSizeRespectingAspectRatio( + const ::com::sun::star::awt::Size& rTargetSize + , const ::com::sun::star::awt::Size& rSourceSizeWithCorrectAspectRatio ); + + static ::com::sun::star::awt::Point calculateTopLeftPositionToCenterObject( + const ::com::sun::star::awt::Point& rTargetAreaPosition + , const ::com::sun::star::awt::Size& rTargetAreaSize + , const ::com::sun::star::awt::Size& rObjectSize ); + + static ::basegfx::B2IRectangle getRectangleOfShape( + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ); + + static ::com::sun::star::awt::Size getSizeAfterRotation( + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, double fRotationAngleDegree ); + + static void removeSubShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes ); + private: ShapeFactory(); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > impl_createCube( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget - , const DataPointGeometry& rGeometry - , sal_Bool bRounded ); + , const ::com::sun::star::drawing::Position3D& rPosition + , const ::com::sun::star::drawing::Direction3D& rSize, sal_Int32 nRotateZAngleHundredthDegree + , bool bRounded ); ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > impl_createConeOrCylinder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget - , const DataPointGeometry& rGeometry + , const ::com::sun::star::drawing::Position3D& rPosition + , const ::com::sun::star::drawing::Direction3D& rSize + , double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree , sal_Int32 nSegments , bool bCylinder = false); |