xref: /aoo42x/main/chart2/source/view/inc/VDiagram.hxx (revision de7b3f82)
1*de7b3f82SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*de7b3f82SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*de7b3f82SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*de7b3f82SAndrew Rist  * distributed with this work for additional information
6*de7b3f82SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*de7b3f82SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*de7b3f82SAndrew Rist  * "License"); you may not use this file except in compliance
9*de7b3f82SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*de7b3f82SAndrew Rist  *
11*de7b3f82SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*de7b3f82SAndrew Rist  *
13*de7b3f82SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*de7b3f82SAndrew Rist  * software distributed under the License is distributed on an
15*de7b3f82SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*de7b3f82SAndrew Rist  * KIND, either express or implied.  See the License for the
17*de7b3f82SAndrew Rist  * specific language governing permissions and limitations
18*de7b3f82SAndrew Rist  * under the License.
19*de7b3f82SAndrew Rist  *
20*de7b3f82SAndrew Rist  *************************************************************/
21*de7b3f82SAndrew Rist 
22*de7b3f82SAndrew Rist 
23cdf0e10cSrcweir #ifndef _CHART2_VDIAGRAM_HXX
24cdf0e10cSrcweir #define _CHART2_VDIAGRAM_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/drawing/HomogenMatrix.hpp>
27cdf0e10cSrcweir #include <com/sun/star/drawing/XShapes.hpp>
28cdf0e10cSrcweir #include <com/sun/star/chart2/XDiagram.hpp>
29cdf0e10cSrcweir #include "ShapeFactory.hxx"
30cdf0e10cSrcweir #include <basegfx/range/b2irectangle.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir //.............................................................................
33cdf0e10cSrcweir namespace chart
34cdf0e10cSrcweir {
35cdf0e10cSrcweir //.............................................................................
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class ShapeFactory;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir //-----------------------------------------------------------------------------
40cdf0e10cSrcweir /** The VDiagram is responsible to generate the visible parts of the Diagram
41cdf0e10cSrcweir that is wall, floor, axes and data series.
42cdf0e10cSrcweir The axes and data series are subobjects which are created and managed by the
43cdf0e10cSrcweir diagram.
44cdf0e10cSrcweir */
45cdf0e10cSrcweir 
46cdf0e10cSrcweir class VDiagram
47cdf0e10cSrcweir {
48cdf0e10cSrcweir public: //methods
49cdf0e10cSrcweir     VDiagram( const ::com::sun::star::uno::Reference<
50cdf0e10cSrcweir                   ::com::sun::star::chart2::XDiagram > & xDiagram
51cdf0e10cSrcweir                 , const ::com::sun::star::drawing::Direction3D& rPreferredAspectRatio
52cdf0e10cSrcweir                 , sal_Int32 nDimension=3, sal_Bool bPolar=sal_False );
53cdf0e10cSrcweir     virtual ~VDiagram();
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     void init( const ::com::sun::star::uno::Reference<
56cdf0e10cSrcweir                      ::com::sun::star::drawing::XShapes >& xLogicTarget
57cdf0e10cSrcweir 			 , const ::com::sun::star::uno::Reference<
58cdf0e10cSrcweir                      ::com::sun::star::drawing::XShapes >& xFinalTarget
59cdf0e10cSrcweir              , const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory);
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     void    createShapes( const ::com::sun::star::awt::Point& rPos
62cdf0e10cSrcweir                         , const ::com::sun::star::awt::Size& rSize );
63cdf0e10cSrcweir 
64cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
65cdf0e10cSrcweir             getCoordinateRegion();
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     ::basegfx::B2IRectangle    getCurrentRectangle();
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     void    reduceToMimimumSize();
70cdf0e10cSrcweir 
71cdf0e10cSrcweir     ::basegfx::B2IRectangle    adjustPosAndSize( const ::com::sun::star::awt::Point& rPos
72cdf0e10cSrcweir                                     , const ::com::sun::star::awt::Size& rAvailableSize );
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     ::basegfx::B2IRectangle    adjustInnerSize( const ::basegfx::B2IRectangle& rConsumedOuterRect );
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     //    updateShapes(..);
77cdf0e10cSrcweir     // const awt::Point& rPos, const awt::Size& rSize );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir private: //methods
80cdf0e10cSrcweir     void    createShapes_2d();
81cdf0e10cSrcweir     void    createShapes_3d();
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     ::basegfx::B2IRectangle    adjustPosAndSize_2d( const ::com::sun::star::awt::Point& rPos
84cdf0e10cSrcweir                         , const ::com::sun::star::awt::Size& rAvailableSize );
85cdf0e10cSrcweir     ::basegfx::B2IRectangle    adjustPosAndSize_3d( const ::com::sun::star::awt::Point& rPos
86cdf0e10cSrcweir                         , const ::com::sun::star::awt::Size& rAvailableSize );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     void    adjustAspectRatio3d( const ::com::sun::star::awt::Size& rAvailableSize );
89cdf0e10cSrcweir 
90cdf0e10cSrcweir private: //members
91cdf0e10cSrcweir     VDiagram(const VDiagram& rD);
92cdf0e10cSrcweir 
93cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
94cdf0e10cSrcweir                     ::com::sun::star::drawing::XShapes >                    m_xLogicTarget;
95cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
96cdf0e10cSrcweir                     ::com::sun::star::drawing::XShapes >                    m_xFinalTarget;
97cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
98cdf0e10cSrcweir                     ::com::sun::star::lang::XMultiServiceFactory>	        m_xShapeFactory;
99cdf0e10cSrcweir     ShapeFactory*                                                           m_pShapeFactory;
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     // this is the surrounding shape which contains floor, wall and coordinate
102cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >   m_xOuterGroupShape;
103cdf0e10cSrcweir     // this is an additional inner shape that represents the coordinate region -  that is - where to place data points
104cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >   m_xCoordinateRegionShape;
105cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >   m_xWall2D;
106cdf0e10cSrcweir 
107cdf0e10cSrcweir     sal_Int32                                                               m_nDimensionCount;
108cdf0e10cSrcweir     sal_Bool                                                                m_bPolar;
109cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
110cdf0e10cSrcweir         ::com::sun::star::chart2::XDiagram >                                m_xDiagram;
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     ::com::sun::star::drawing::Direction3D                                  m_aPreferredAspectRatio;
113cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xAspectRatio3D;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     double m_fXAnglePi;
116cdf0e10cSrcweir     double m_fYAnglePi;
117cdf0e10cSrcweir     double m_fZAnglePi;
118cdf0e10cSrcweir     sal_Bool m_bRightAngledAxes;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir     ::com::sun::star::awt::Point    m_aAvailablePosIncludingAxes;
121cdf0e10cSrcweir     ::com::sun::star::awt::Size     m_aAvailableSizeIncludingAxes;
122cdf0e10cSrcweir 
123cdf0e10cSrcweir     ::com::sun::star::awt::Point    m_aCurrentPosWithoutAxes;
124cdf0e10cSrcweir     ::com::sun::star::awt::Size     m_aCurrentSizeWithoutAxes;
125cdf0e10cSrcweir };
126cdf0e10cSrcweir 
127cdf0e10cSrcweir //.............................................................................
128cdf0e10cSrcweir } //namespace chart
129cdf0e10cSrcweir //.............................................................................
130cdf0e10cSrcweir #endif
131cdf0e10cSrcweir 
132cdf0e10cSrcweir 
133