Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / chart2 / source / view / inc / VDiagram.hxx
blob1472b66e8a6a6af59130813947dc5991c96cd309
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_CHART2_SOURCE_VIEW_INC_VDIAGRAM_HXX
20 #define INCLUDED_CHART2_SOURCE_VIEW_INC_VDIAGRAM_HXX
22 #include <com/sun/star/drawing/XShapes.hpp>
23 #include <basegfx/range/b2irectangle.hxx>
24 #include <com/sun/star/drawing/Direction3D.hpp>
25 #include <com/sun/star/awt/Size.hpp>
26 #include <com/sun/star/awt/Point.hpp>
28 namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } }
29 namespace com { namespace sun { namespace star { namespace chart2 { class XDiagram; } } } }
30 namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } } } }
31 namespace com { namespace sun { namespace star { namespace drawing { class XShape; } } } }
34 namespace chart
37 class ShapeFactory;
39 /** The VDiagram is responsible to generate the visible parts of the Diagram
40 that is wall, floor, axes and data series.
41 The axes and data series are subobjects which are created and managed by the
42 diagram.
45 class VDiagram final
47 public: //methods
48 VDiagram( const css::uno::Reference<css::chart2::XDiagram>& xDiagram,
49 const css::drawing::Direction3D& rPreferredAspectRatio,
50 sal_Int32 nDimension );
51 ~VDiagram();
53 void init(
54 const css::uno::Reference<css::drawing::XShapes>& xTarget,
55 const css::uno::Reference<css::lang::XMultiServiceFactory>& xFactory );
57 void createShapes( const css::awt::Point& rPos
58 , const css::awt::Size& rSize );
60 css::uno::Reference< css::drawing::XShapes >
61 getCoordinateRegion() const { return css::uno::Reference<css::drawing::XShapes>( m_xCoordinateRegionShape, css::uno::UNO_QUERY );}
63 /**
64 * Get current bounding rectangle for the diagram without axes.
66 basegfx::B2IRectangle getCurrentRectangle() const;
68 void reduceToMimimumSize();
70 ::basegfx::B2IRectangle adjustPosAndSize( const css::awt::Point& rPos
71 , const css::awt::Size& rAvailableSize );
73 ::basegfx::B2IRectangle adjustInnerSize( const ::basegfx::B2IRectangle& rConsumedOuterRect );
75 private: //methods
76 void createShapes_2d();
77 void createShapes_3d();
79 ::basegfx::B2IRectangle adjustPosAndSize_2d( const css::awt::Point& rPos
80 , const css::awt::Size& rAvailableSize );
81 ::basegfx::B2IRectangle adjustPosAndSize_3d( const css::awt::Point& rPos
82 , const css::awt::Size& rAvailableSize );
84 void adjustAspectRatio3d( const css::awt::Size& rAvailableSize );
86 private: //members
87 VDiagram(const VDiagram& rD) = delete;
89 css::uno::Reference< css::drawing::XShapes > m_xTarget;
90 css::uno::Reference< css::lang::XMultiServiceFactory> m_xShapeFactory;
91 ShapeFactory* m_pShapeFactory;
93 // this is the surrounding shape which contains floor, wall and coordinate
94 css::uno::Reference< css::drawing::XShape > m_xOuterGroupShape;
95 // this is an additional inner shape that represents the coordinate region - that is - where to place data points
96 css::uno::Reference< css::drawing::XShape > m_xCoordinateRegionShape;
97 css::uno::Reference< css::drawing::XShape > m_xWall2D;
99 sal_Int32 m_nDimensionCount;
100 css::uno::Reference< css::chart2::XDiagram > m_xDiagram;
102 css::drawing::Direction3D m_aPreferredAspectRatio;
103 css::uno::Reference< css::beans::XPropertySet > m_xAspectRatio3D;
105 double m_fXAnglePi;
106 double m_fYAnglePi;
107 double m_fZAnglePi;
109 css::awt::Point m_aAvailablePosIncludingAxes;
110 css::awt::Size m_aAvailableSizeIncludingAxes;
112 css::awt::Point m_aCurrentPosWithoutAxes;
113 css::awt::Size m_aCurrentSizeWithoutAxes;
115 bool m_bRightAngledAxes;
118 } //namespace chart
119 #endif
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */