LibreOffice Module chart2 (master) 1
WrappedSceneProperty.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
22#include <DiagramHelper.hxx>
23#include <BaseGFXHelper.hxx>
24#include <utility>
25
26using namespace ::com::sun::star;
27using ::com::sun::star::uno::Any;
28using ::com::sun::star::uno::Reference;
29
30namespace chart::wrapper
31{
32
33void WrappedSceneProperty::addWrappedProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList
34 , const std::shared_ptr< Chart2ModelContact >& spChart2ModelContact )
35{
36 rList.emplace_back( new WrappedD3DTransformMatrixProperty( spChart2ModelContact ) );
37}
38
40 std::shared_ptr<Chart2ModelContact> spChart2ModelContact )
41 : WrappedProperty("D3DTransformMatrix","D3DTransformMatrix")
42 , m_spChart2ModelContact(std::move( spChart2ModelContact ))
43{
44}
45
47{
48}
49
50void WrappedD3DTransformMatrixProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
51{
52 if( m_spChart2ModelContact->getDiagram()->isPieOrDonutChart() )
53 {
54 drawing::HomogenMatrix aHM;
55 if( rOuterValue >>= aHM )
56 {
59
61 aMatrix.rotate( aRotation.getX(), aRotation.getY(), aRotation.getZ() );
62 ::basegfx::B3DHomMatrix aObjectMatrix;
63 ::basegfx::B3DHomMatrix aNewMatrix = aMatrix*aObjectMatrix;
64
66
67 WrappedProperty::setPropertyValue( uno::Any(aHM), xInnerPropertySet );
68 return;
69 }
70 }
71
72 WrappedProperty::setPropertyValue( rOuterValue, xInnerPropertySet );
73}
74
76{
77 if( m_spChart2ModelContact->getDiagram()->isPieOrDonutChart() )
78 {
79 uno::Any aAMatrix( WrappedProperty::getPropertyValue( xInnerPropertySet ) );
80 drawing::HomogenMatrix aHM;
81 if( aAMatrix >>= aHM )
82 {
85
87 aMatrix.rotate( aRotation.getX(), aRotation.getY(), aRotation.getZ() );
88 ::basegfx::B3DHomMatrix aObjectMatrix;
89 ::basegfx::B3DHomMatrix aNewMatrix = aMatrix*aObjectMatrix;
90
92
93 return uno::Any(aHM);
94 }
95 }
96
97 return WrappedProperty::getPropertyValue( xInnerPropertySet );
98}
99
100} //namespace chart::wrapper
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact
void rotate(double fAngleX, double fAngleY, double fAngleZ)
TYPE getX() const
TYPE getZ() const
TYPE getY() const
virtual css::uno::Any getPropertyValue(const css::uno::Reference< css::beans::XPropertySet > &xInnerPropertySet) const
virtual void setPropertyValue(const css::uno::Any &rOuterValue, const css::uno::Reference< css::beans::XPropertySet > &xInnerPropertySet) const
virtual void setPropertyValue(const css::uno::Any &rOuterValue, const css::uno::Reference< css::beans::XPropertySet > &xInnerPropertySet) const override
WrappedD3DTransformMatrixProperty(std::shared_ptr< Chart2ModelContact > spChart2ModelContact)
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact
virtual css::uno::Any getPropertyValue(const css::uno::Reference< css::beans::XPropertySet > &xInnerPropertySet) const override
static void addWrappedProperties(std::vector< std::unique_ptr< WrappedProperty > > &rList, const std::shared_ptr< Chart2ModelContact > &spChart2ModelContact)
OOO_DLLPUBLIC_CHARTTOOLS::basegfx::B3DTuple GetRotationFromMatrix(const ::basegfx::B3DHomMatrix &rB3DMatrix)
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::HomogenMatrix B3DHomMatrixToHomogenMatrix(const ::basegfx::B3DHomMatrix &rB3DMatrix)
OOO_DLLPUBLIC_CHARTTOOLS::basegfx::B3DHomMatrix HomogenMatrixToB3DHomMatrix(const css::drawing::HomogenMatrix &rHomogenMatrix)