1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: VDiagram.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _CHART2_VDIAGRAM_HXX
31 #define _CHART2_VDIAGRAM_HXX
33 #include <com/sun/star/drawing/HomogenMatrix.hpp>
34 #include <com/sun/star/drawing/XShapes.hpp>
35 #include <com/sun/star/chart2/XDiagram.hpp>
36 #include "ShapeFactory.hxx"
37 #include <basegfx/range/b2irectangle.hxx>
39 //.............................................................................
42 //.............................................................................
46 //-----------------------------------------------------------------------------
47 /** The VDiagram is responsible to generate the visible parts of the Diagram
48 that is wall, floor, axes and data series.
49 The axes and data series are subobjects which are created and managed by the
56 VDiagram( const ::com::sun::star::uno::Reference
<
57 ::com::sun::star::chart2::XDiagram
> & xDiagram
58 , const ::com::sun::star::drawing::Direction3D
& rPreferredAspectRatio
59 , sal_Int32 nDimension
=3, sal_Bool bPolar
=sal_False
);
62 void SAL_CALL
init( const ::com::sun::star::uno::Reference
<
63 ::com::sun::star::drawing::XShapes
>& xLogicTarget
64 , const ::com::sun::star::uno::Reference
<
65 ::com::sun::star::drawing::XShapes
>& xFinalTarget
66 , const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xFactory
);
68 void createShapes( const ::com::sun::star::awt::Point
& rPos
69 , const ::com::sun::star::awt::Size
& rSize
);
71 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
>
72 getCoordinateRegion();
74 ::basegfx::B2IRectangle
getCurrentRectangle();
76 void reduceToMimimumSize();
78 ::basegfx::B2IRectangle
adjustPosAndSize( const ::com::sun::star::awt::Point
& rPos
79 , const ::com::sun::star::awt::Size
& rAvailableSize
);
81 ::basegfx::B2IRectangle
adjustInnerSize( const ::basegfx::B2IRectangle
& rConsumedOuterRect
);
84 // const awt::Point& rPos, const awt::Size& rSize );
87 void createShapes_2d();
88 void createShapes_3d();
90 ::basegfx::B2IRectangle
adjustPosAndSize_2d( const ::com::sun::star::awt::Point
& rPos
91 , const ::com::sun::star::awt::Size
& rAvailableSize
);
92 ::basegfx::B2IRectangle
adjustPosAndSize_3d( const ::com::sun::star::awt::Point
& rPos
93 , const ::com::sun::star::awt::Size
& rAvailableSize
);
95 void adjustAspectRatio3d( const ::com::sun::star::awt::Size
& rAvailableSize
);
98 VDiagram(const VDiagram
& rD
);
100 ::com::sun::star::uno::Reference
<
101 ::com::sun::star::drawing::XShapes
> m_xLogicTarget
;
102 ::com::sun::star::uno::Reference
<
103 ::com::sun::star::drawing::XShapes
> m_xFinalTarget
;
104 ::com::sun::star::uno::Reference
<
105 ::com::sun::star::lang::XMultiServiceFactory
> m_xShapeFactory
;
106 ShapeFactory
* m_pShapeFactory
;
108 // this is the surrounding shape which contains floor, wall and coordinate
109 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> m_xOuterGroupShape
;
110 // this is an additional inner shape that represents the coordinate region - that is - where to place data points
111 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> m_xCoordinateRegionShape
;
112 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> m_xWall2D
;
114 sal_Int32 m_nDimensionCount
;
116 ::com::sun::star::uno::Reference
<
117 ::com::sun::star::chart2::XDiagram
> m_xDiagram
;
119 ::com::sun::star::drawing::Direction3D m_aPreferredAspectRatio
;
120 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> m_xAspectRatio3D
;
125 sal_Bool m_bRightAngledAxes
;
127 ::com::sun::star::awt::Point m_aAvailablePosIncludingAxes
;
128 ::com::sun::star::awt::Size m_aAvailableSizeIncludingAxes
;
130 ::com::sun::star::awt::Point m_aCurrentPosWithoutAxes
;
131 ::com::sun::star::awt::Size m_aCurrentSizeWithoutAxes
;
134 //.............................................................................
136 //.............................................................................