diff options
Diffstat (limited to 'chart2/source/view/inc/ShapeFactory.hxx')
-rw-r--r-- | chart2/source/view/inc/ShapeFactory.hxx | 207 |
1 files changed, 87 insertions, 120 deletions
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index 7a698e4b9d87..271b44b733bd 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CHART2_SOURCE_VIEW_INC_SHAPEFACTORY_HXX -#define INCLUDED_CHART2_SOURCE_VIEW_INC_SHAPEFACTORY_HXX +#pragma once #include "PropertyMapper.hxx" #include <basegfx/range/b2irectangle.hxx> @@ -25,22 +24,22 @@ #include <com/sun/star/awt/Point.hpp> #include <com/sun/star/drawing/PointSequenceSequence.hpp> +#include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <svx/unoshape.hxx> +#include <svx/unodraw/SvxTableShape.hxx> +#include <svx/unopage.hxx> namespace chart { struct VLineProperties; } namespace com::sun::star::beans { class XPropertySet; } namespace com::sun::star::chart2 { class XFormattedString; } -namespace com::sun::star::drawing { class XDrawPage; } namespace com::sun::star::drawing { class XShape; } -namespace com::sun::star::drawing { class XShapes; } namespace com::sun::star::drawing { struct HomogenMatrix; } namespace com::sun::star::drawing { struct PolyPolygonShape3D; } namespace com::sun::star::drawing { struct Position3D; } namespace com::sun::star::graphic { class XGraphic; } -namespace com::sun::star::lang { class XMultiServiceFactory; } namespace com::sun::star::drawing { struct Direction3D; } - namespace chart { class Stripe; @@ -68,29 +67,28 @@ enum SymbolEnum { Symbol_Square=0 class ShapeFactory { - css::uno::Reference< css::lang::XMultiServiceFactory> m_xShapeFactory; - - ShapeFactory(css::uno::Reference< css::lang::XMultiServiceFactory> const & xFactory) - {m_xShapeFactory = xFactory;} - public: enum class StackPosition { Top, Bottom }; - static ShapeFactory* getOrCreateShapeFactory(const css::uno::Reference< css::lang::XMultiServiceFactory>& xFactory); - ShapeFactory() = delete; - css::uno::Reference< css::drawing::XShapes > + + static rtl::Reference< SvxShapeGroup > createGroup2D( - const css::uno::Reference< css::drawing::XShapes >& xTarget + const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const OUString& aName = OUString() ); - css::uno::Reference< css::drawing::XShapes > + static rtl::Reference< SvxShapeGroup > + createGroup2D( + const rtl::Reference<SvxDrawPage>& xTarget + , const OUString& aName = OUString() ); + + static rtl::Reference<Svx3DSceneObject> createGroup3D( - const css::uno::Reference< css::drawing::XShapes >& xTarget + const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const OUString& aName = OUString() ); - css::uno::Reference< css::drawing::XShape > - createCube( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<Svx3DExtrudeObject> + createCube( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::drawing::Position3D& rPosition , const css::drawing::Direction3D& rSize , sal_Int32 nRotateZAngleHundredthDegree @@ -98,14 +96,14 @@ public: , const tPropertyNameMap& rPropertyNameMap , bool bRounded = false); - css::uno::Reference< css::drawing::XShape > - createCylinder( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<Svx3DLatheObject> + createCylinder( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::drawing::Position3D& rPosition , const css::drawing::Direction3D& rSize , sal_Int32 nRotateZAngleHundredthDegree ); - css::uno::Reference< css::drawing::XShape > - createPyramid( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<Svx3DSceneObject> + createPyramid( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::drawing::Position3D& rPosition , const css::drawing::Direction3D& rSize , double fTopHeight @@ -113,29 +111,29 @@ public: , const css::uno::Reference< css::beans::XPropertySet >& xSourceProp , const tPropertyNameMap& rPropertyNameMap); - css::uno::Reference< css::drawing::XShape > - createCone( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<Svx3DLatheObject> + createCone( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::drawing::Position3D& rPosition , const css::drawing::Direction3D& rSize , double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree ); - css::uno::Reference< css::drawing::XShape > - createPieSegment2D( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<SvxShapePolyPolygon> + createPieSegment2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree , double fUnitCircleInnerRadius, double fUnitCircleOuterRadius , const css::drawing::Direction3D& rOffset , const css::drawing::HomogenMatrix& rUnitCircleToScene ); - css::uno::Reference< css::drawing::XShape > - createPieSegment( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<Svx3DExtrudeObject> + createPieSegment( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree , double fUnitCircleInnerRadius, double fUnitCircleOuterRadius , const css::drawing::Direction3D& rOffset , const css::drawing::HomogenMatrix& rUnitCircleToScene , double fDepth ); - css::uno::Reference< css::drawing::XShape > - createStripe( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<Svx3DPolygonObject> + createStripe( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const Stripe& rStripe , const css::uno::Reference< css::beans::XPropertySet >& xSourceProp , const tPropertyNameMap& rPropertyNameMap @@ -143,143 +141,112 @@ public: , short nRotatedTexture = 0 //0 to 7 are the different possibilities , bool bFlatNormals=true ); - css::uno::Reference< css::drawing::XShape > - createArea3D( const css::uno::Reference< css::drawing::XShapes >& xTarget - , const css::drawing::PolyPolygonShape3D& rPolyPolygon + static rtl::Reference<Svx3DExtrudeObject> + createArea3D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget + , const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon , double fDepth); - css::uno::Reference< css::drawing::XShape > - createArea2D( const css::uno::Reference< css::drawing::XShapes >& xTarget - , const css::drawing::PolyPolygonShape3D& rPolyPolygon); + static rtl::Reference<SvxShapePolyPolygon> + createArea2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget + , const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon); - css::uno::Reference< css::drawing::XShape > - createSymbol2D( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<SvxShapePolyPolygon> + createSymbol2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::drawing::Position3D& rPos , const css::drawing::Direction3D& rSize , sal_Int32 nStandardSymbol , sal_Int32 nBorderColor , sal_Int32 nFillColor ); - css::uno::Reference< css::drawing::XShape > - createGraphic2D( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<SvxGraphicObject> + createGraphic2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::drawing::Position3D& rPos , const css::drawing::Direction3D& rSize , const css::uno::Reference< css::graphic::XGraphic >& xGraphic ); - css::uno::Reference< css::drawing::XShape > - createLine2D( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<SvxShapePolyPolygon> + createLine2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::drawing::PointSequenceSequence& rPoints , const VLineProperties* pLineProperties = nullptr ); + static rtl::Reference<SvxShapePolyPolygon> + createLine2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget + , const std::vector<std::vector<css::drawing::Position3D>>& rPoints + , const VLineProperties* pLineProperties = nullptr ); - css::uno::Reference< css::drawing::XShape > - createLine ( const css::uno::Reference< css::drawing::XShapes >& xTarget, + static rtl::Reference<SvxShapePolyPolygon> + createLine ( const rtl::Reference<SvxShapeGroupAnyD>& xTarget, const css::awt::Size& rSize, const css::awt::Point& rPosition ); - css::uno::Reference< css::drawing::XShape > - createLine3D( const css::uno::Reference< css::drawing::XShapes >& xTarget - , const css::drawing::PolyPolygonShape3D& rPoints + static rtl::Reference<Svx3DPolygonObject> + createLine3D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget + , const std::vector<std::vector<css::drawing::Position3D>>& rPoints , const VLineProperties& rLineProperties ); - css::uno::Reference< css::drawing::XShape > - createCircle2D( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<SvxShapeCircle> + createCircle2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::drawing::Position3D& rPos , const css::drawing::Direction3D& rSize ); - css::uno::Reference< css::drawing::XShape > - createCircle( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<SvxShapeCircle> + createCircle( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::awt::Size& rSize , const css::awt::Point& rPosition ); - css::uno::Reference< css::drawing::XShape > - createText( const css::uno::Reference< css::drawing::XShapes >& xTarget2D + static rtl::Reference<SvxShapeText> + createText( const rtl::Reference<SvxShapeGroupAnyD>& xTarget2D , const OUString& rText , const tNameSequence& rPropNames , const tAnySequence& rPropValues , const css::uno::Any& rATransformation ); - /** This method creates a text shape made up by a set of paragraphs. - * For each paragraph the related text style is passed to the method. - * - * @param xTarget - * where to append the new created text shape. - * - * @param rTextParagraphs - * the set of paragraphs which made up the text shape. - * - * @param rParaPropNames - * a collection of lists of text property names: - * there must be a list of text property names for each paragraph. - * - * @param rParaPropValues - * a collection of lists of text property values: - * there must be a list of text property values for each paragraph. - * - * @param rPropNames - * a list of text property names to be applied to the whole text shape. - * - * @param rPropValues - * a list of text property values to be applied to the whole text shape. - * - * @param rATransformation - * a transformation to be applied to the text shape as final step. - * - */ - css::uno::Reference< css::drawing::XShape > - createText( const css::uno::Reference< css::drawing::XShapes >& xTarget - , const css::uno::Sequence< OUString >& rTextParagraphs - , const css::uno::Sequence< tNameSequence >& rParaPropNames - , const css::uno::Sequence< tAnySequence >& rParaPropValues - , const tNameSequence& rPropNames - , const tAnySequence& rPropValues - , const css::uno::Any& rATransformation ); - - css::uno::Reference< css::drawing::XShape > - createText(const css::uno::Reference< css::drawing::XShapes >& xTarget - , css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& xFormattedString + static rtl::Reference<SvxShapeText> + createText(const rtl::Reference<SvxShapeGroupAnyD>& xTarget + , const css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& xFormattedString , const tNameSequence& rPropNames , const tAnySequence& rPropValues , const css::uno::Any& rATransformation); - css::uno::Reference< css::drawing::XShape > - createText( const css::uno::Reference< css::drawing::XShapes >& xTarget2D, + static rtl::Reference<SvxShapeText> + createText( const rtl::Reference<SvxShapeGroupAnyD>& xTarget2D, const css::awt::Size& rSize, const css::awt::Point& rPosition, css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& xFormattedString, const css::uno::Reference< css::beans::XPropertySet > & xTextProperties, double nRotation, const OUString& aName, sal_Int32 nTextMaxWidth ); - css::uno::Reference< css::drawing::XShape > + static rtl::Reference<SvxTableShape> createTable(rtl::Reference<SvxShapeGroupAnyD> const& xTarget, OUString const& rName = OUString()); + + static rtl::Reference<SvxShapeRect> createInvisibleRectangle( - const css::uno::Reference< css::drawing::XShapes >& xTarget + const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::awt::Size& rSize ); - css::uno::Reference< css::drawing::XShape > + static rtl::Reference<SvxShapeRect> createRectangle( - const css::uno::Reference< css::drawing::XShapes >& xTarget, + const rtl::Reference<SvxShapeGroupAnyD>& xTarget, const css::awt::Size& rSize, const css::awt::Point& rPosition, const tNameSequence& rPropNames, const tAnySequence& rPropValues, StackPosition ePos = StackPosition::Top ); - css::uno::Reference< css::drawing::XShape > + static rtl::Reference<SvxShapeRect> createRectangle( - const css::uno::Reference< css::drawing::XShapes >& xTarget ); + const rtl::Reference<SvxShapeGroupAnyD>& xTarget ); - css::uno::Reference< css::drawing::XShapes > - getOrCreateChartRootShape( const css::uno::Reference< - css::drawing::XDrawPage>& xPage ); + static rtl::Reference<SvxShapeGroupAnyD> + getOrCreateChartRootShape( const rtl::Reference<SvxDrawPage>& xPage ); - static void setPageSize(const css::uno::Reference<css::drawing::XShapes>& xChartShapes, + static void setPageSize(const rtl::Reference<SvxShapeGroupAnyD>& xChartShapes, const css::awt::Size& rSize); - static css::uno::Reference< css::drawing::XShapes > - getChartRootShape( const css::uno::Reference< css::drawing::XDrawPage>& xPage ); + static rtl::Reference<SvxShapeGroupAnyD> + getChartRootShape( const rtl::Reference<SvxDrawPage>& xPage ); - static void makeShapeInvisible( const css::uno::Reference< css::drawing::XShape >& xShape ); + static void makeShapeInvisible( const rtl::Reference< SvxShape >& rShape ); - static void setShapeName( const css::uno::Reference< css::drawing::XShape >& xShape + static void setShapeName( const rtl::Reference< SvxShape >& xShape , const OUString& rName ); static OUString getShapeName( const css::uno::Reference< css::drawing::XShape >& xShape ); @@ -288,9 +255,11 @@ public: static OUString getStackedString( const OUString& rString, bool bStacked ); - static bool hasPolygonAnyLines( css::drawing::PolyPolygonShape3D& rPoly ); - static bool isPolygonEmptyOrSinglePoint( css::drawing::PolyPolygonShape3D& rPoly ); + static bool hasPolygonAnyLines( const std::vector<std::vector<css::drawing::Position3D>>& rPoly ); + static bool isPolygonEmptyOrSinglePoint( const css::drawing::PolyPolygonShape3D& rPoly ); + static bool isPolygonEmptyOrSinglePoint( const std::vector<std::vector<css::drawing::Position3D>>& rPoly ); static void closePolygon( css::drawing::PolyPolygonShape3D& rPoly ); + static void closePolygon( std::vector<std::vector<css::drawing::Position3D>>& rPoly ); static css::awt::Size calculateNewSizeRespectingAspectRatio( const css::awt::Size& rTargetSize @@ -301,25 +270,24 @@ public: , const css::awt::Size& rTargetAreaSize , const css::awt::Size& rObjectSize ); - static ::basegfx::B2IRectangle getRectangleOfShape( - const css::uno::Reference< css::drawing::XShape >& xShape ); + static ::basegfx::B2IRectangle getRectangleOfShape( SvxShape& rShape ); static css::awt::Size getSizeAfterRotation( - const css::uno::Reference< css::drawing::XShape >& xShape, double fRotationAngleDegree ); + SvxShape& rShape, double fRotationAngleDegree ); - static void removeSubShapes( const css::uno::Reference< css::drawing::XShapes >& xShapes ); + static void removeSubShapes( const rtl::Reference<SvxShapeGroupAnyD>& xShapes ); static sal_Int32 getSymbolCount() { return Symbol_COUNT; } private: - css::uno::Reference< css::drawing::XShape > - impl_createCube( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<Svx3DExtrudeObject> + impl_createCube( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::drawing::Position3D& rPosition , const css::drawing::Direction3D& rSize, sal_Int32 nRotateZAngleHundredthDegree , bool bRounded ); - css::uno::Reference< css::drawing::XShape > - impl_createConeOrCylinder( const css::uno::Reference< css::drawing::XShapes >& xTarget + static rtl::Reference<Svx3DLatheObject> + impl_createConeOrCylinder( const rtl::Reference<SvxShapeGroupAnyD>& xTarget , const css::drawing::Position3D& rPosition , const css::drawing::Direction3D& rSize , double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree @@ -327,6 +295,5 @@ private: }; } //namespace chart -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |