/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ #pragma once
/** allows the transformation of numeric values from one coordinate-system into another. Values may be transformed using any mapping. This is a non-UNO variant of the css::chart2::XTransformation interface, but using more efficient calling and returning types.
*/ class XTransformation2
{ public: virtual ~XTransformation2(); /** transforms the given input data tuple, given in the source coordinate system, according to the internal transformation rules, into a tuple of transformed coordinates in the destination coordinate system.
<p>Note that both coordinate systems may have different dimensions, e.g., if a transformation does simply a projection into a lower-dimensional space.</p>
@param aValues a source tuple of data that is to be transformed. The length of this sequence must be equivalent to the dimension of the source coordinate system.
@return the transformed data tuple. The length of this sequence is equal to the dimension of the output coordinate system.
@throws ::com::sun::star::lang::IllegalArgumentException if the dimension of the input vector is not equal to the dimension given in getSourceDimension().
*/ virtual css::drawing::Position3D transform( const css::drawing::Position3D& rSourceValues ) const = 0; virtual css::drawing::Position3D transform( const css::uno::Sequence< double >& rSourceValues ) const = 0;
};
//the resulting values provided by the following 3 methods should be used //for input to the transformation received with //'getTransformationScaledLogicToScene'
/** Given a value in the radius axis scale range, it returns the normalized * value.
*/ double transformToRadius( double fLogicValueOnRadiusAxis, bool bDoScaling=true ) const;
/** Given a value in the angle axis scale range (e.g. [0,1] for pie charts) * this method returns the related angle in degree.
*/ double transformToAngleDegree( double fLogicValueOnAngleAxis, bool bDoScaling=true ) const;
/** Given 2 values in the angle axis scale range (e.g. [0,1] for pie charts) * this method returns the angle between the 2 values keeping into account * the correct axis orientation; (for instance, this method is used for * computing the angle width of a pie slice).
*/ double getWidthAngleDegree( double& fStartLogicValueOnAngleAxis, double& fEndLogicValueOnAngleAxis ) const;
/** Return the scene coordinates of the passed point: this point is * described through a normalized cylindrical coordinate system, with an * optional offset. * (For a standard pie chart the origin of the coordinate system is the * pie center; for an of-pie chart the components of the aOffset * parameter are not all zero).
*/
css::drawing::Position3D
transformUnitCircleToScene( double fUnitAngleDegree
, double fUnitRadius, double fLogicZ
, const ::basegfx::B3DVector& aOffset = ::basegfx::B3DVector()) const;
using PlottingPositionHelper::transformScaledLogicToScene;
double getOuterLogicRadius() const;
inlinebool isMathematicalOrientationAngle() const; inlinebool isMathematicalOrientationRadius() const; public: ///m_bSwapXAndY (inherited): by default the X axis (scale[0]) represents ///the angle axis and the Y axis (scale[1]) represents the radius axis; ///when this parameter is true, the opposite happens (this is the case for ///pie charts).
///Offset for radius axis in absolute logic scaled values (1.0 == 1 category) ///For a donut, it represents the non-normalized inner radius (see notes for ///transformToRadius) double m_fRadiusOffset; ///Offset for angle axis in real degree. ///For a pie it represents the angle offset at which the first slice have to ///start; double m_fAngleDegreeOffset;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.