LibreOffice Module chart2 (master) 1
CommonConverters.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
20#include <CommonConverters.hxx>
21#include <com/sun/star/awt/Rectangle.hpp>
22#include <com/sun/star/drawing/DoubleSequence.hpp>
23#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
24#include <com/sun/star/chart2/data/XDataSequence.hpp>
25#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
26#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
27#include <o3tl/safeint.hxx>
28#include <osl/diagnose.h>
31
32#include <cstddef>
33#include <limits>
34
35namespace chart
36{
37
38using namespace ::com::sun::star;
39
40// diverse methods for class conversions; e.g. ::basegfx::B3DHomMatrix to HomogenMatrix
41
42drawing::HomogenMatrix B3DHomMatrixToHomogenMatrix( const ::basegfx::B3DHomMatrix& rM )
43{
44 drawing::HomogenMatrix aHM;
45 aHM.Line1.Column1 = rM.get(0, 0);
46 aHM.Line1.Column2 = rM.get(0, 1);
47 aHM.Line1.Column3 = rM.get(0, 2);
48 aHM.Line1.Column4 = rM.get(0, 3);
49 aHM.Line2.Column1 = rM.get(1, 0);
50 aHM.Line2.Column2 = rM.get(1, 1);
51 aHM.Line2.Column3 = rM.get(1, 2);
52 aHM.Line2.Column4 = rM.get(1, 3);
53 aHM.Line3.Column1 = rM.get(2, 0);
54 aHM.Line3.Column2 = rM.get(2, 1);
55 aHM.Line3.Column3 = rM.get(2, 2);
56 aHM.Line3.Column4 = rM.get(2, 3);
57 aHM.Line4.Column1 = rM.get(3, 0);
58 aHM.Line4.Column2 = rM.get(3, 1);
59 aHM.Line4.Column3 = rM.get(3, 2);
60 aHM.Line4.Column4 = rM.get(3, 3);
61 return aHM;
62}
63
64::basegfx::B3DHomMatrix HomogenMatrixToB3DHomMatrix( const drawing::HomogenMatrix& rHM )
65{
67 aM.set(0, 0, rHM.Line1.Column1);
68 aM.set(0, 1, rHM.Line1.Column2);
69 aM.set(0, 2, rHM.Line1.Column3);
70 aM.set(0, 3, rHM.Line1.Column4);
71 aM.set(1, 0, rHM.Line2.Column1);
72 aM.set(1, 1, rHM.Line2.Column2);
73 aM.set(1, 2, rHM.Line2.Column3);
74 aM.set(1, 3, rHM.Line2.Column4);
75 aM.set(2, 0, rHM.Line3.Column1);
76 aM.set(2, 1, rHM.Line3.Column2);
77 aM.set(2, 2, rHM.Line3.Column3);
78 aM.set(2, 3, rHM.Line3.Column4);
79 aM.set(3, 0, rHM.Line4.Column1);
80 aM.set(3, 1, rHM.Line4.Column2);
81 aM.set(3, 2, rHM.Line4.Column3);
82 aM.set(3, 3, rHM.Line4.Column4);
83 return aM;
84}
85
86::basegfx::B2DHomMatrix IgnoreZ( const ::basegfx::B3DHomMatrix& rM )
87{
89 aM.set(0, 0, rM.get(0, 0));
90 aM.set(0, 1, rM.get(0, 1));
91 aM.set(0, 2, rM.get(0, 3));
92 aM.set(1, 0, rM.get(1, 0));
93 aM.set(1, 1, rM.get(1, 1));
94 aM.set(1, 2, rM.get(1, 3));
95 // For this to be a valid 2D transform matrix, the last row must be [0,0,1]
96 assert( rM.get(3, 0) == 0 );
97 assert( rM.get(3, 1) == 0 );
98 assert( rM.get(3, 3) == 1 );
99 return aM;
100}
101
102drawing::HomogenMatrix3 B2DHomMatrixToHomogenMatrix3( const ::basegfx::B2DHomMatrix& rM )
103{
104 drawing::HomogenMatrix3 aHM;
105 aHM.Line1.Column1 = rM.get(0, 0);
106 aHM.Line1.Column2 = rM.get(0, 1);
107 aHM.Line1.Column3 = rM.get(0, 2);
108 aHM.Line2.Column1 = rM.get(1, 0);
109 aHM.Line2.Column2 = rM.get(1, 1);
110 aHM.Line2.Column3 = rM.get(1, 2);
111 aHM.Line3.Column1 = 0;
112 aHM.Line3.Column2 = 0;
113 aHM.Line3.Column3 = 1;
114 return aHM;
115}
116
117::basegfx::B3DPoint Position3DToB3DPoint( const drawing::Position3D& rPosition )
118{
119 return ::basegfx::B3DPoint(
120 rPosition.PositionX ,
121 rPosition.PositionY ,
122 rPosition.PositionZ );
123}
124
125drawing::Direction3D B3DVectorToDirection3D( const ::basegfx::B3DVector& rVector)
126{
127 return drawing::Direction3D(
128 rVector.getX()
129 , rVector.getY()
130 , rVector.getZ()
131 );
132}
133
134drawing::Position3D B3DPointToPosition3D( const ::basegfx::B3DPoint& rPoint)
135{
136 return drawing::Position3D(
137 rPoint.getX()
138 , rPoint.getY()
139 , rPoint.getZ()
140 );
141}
142
143::basegfx::B3DVector Direction3DToB3DVector( const drawing::Direction3D& rDirection)
144{
145 return ::basegfx::B3DVector(
146 rDirection.DirectionX
147 , rDirection.DirectionY
148 , rDirection.DirectionZ
149 );
150}
151
152void AddPointToPoly( drawing::PolyPolygonShape3D& rPoly, const drawing::Position3D& rPos, sal_Int32 nPolygonIndex )
153{
154 if(nPolygonIndex<0)
155 {
156 OSL_FAIL( "The polygon index needs to be > 0");
157 nPolygonIndex=0;
158 }
159
160 //make sure that we have enough polygons
161 if(nPolygonIndex >= rPoly.SequenceX.getLength() )
162 {
163 rPoly.SequenceX.realloc(nPolygonIndex+1);
164 rPoly.SequenceY.realloc(nPolygonIndex+1);
165 rPoly.SequenceZ.realloc(nPolygonIndex+1);
166 }
167
168 drawing::DoubleSequence* pOuterSequenceX = &rPoly.SequenceX.getArray()[nPolygonIndex];
169 drawing::DoubleSequence* pOuterSequenceY = &rPoly.SequenceY.getArray()[nPolygonIndex];
170 drawing::DoubleSequence* pOuterSequenceZ = &rPoly.SequenceZ.getArray()[nPolygonIndex];
171
172 sal_Int32 nOldPointCount = pOuterSequenceX->getLength();
173
174 pOuterSequenceX->realloc(nOldPointCount+1);
175 pOuterSequenceY->realloc(nOldPointCount+1);
176 pOuterSequenceZ->realloc(nOldPointCount+1);
177
178 double* pInnerSequenceX = pOuterSequenceX->getArray();
179 double* pInnerSequenceY = pOuterSequenceY->getArray();
180 double* pInnerSequenceZ = pOuterSequenceZ->getArray();
181
182 pInnerSequenceX[nOldPointCount] = rPos.PositionX;
183 pInnerSequenceY[nOldPointCount] = rPos.PositionY;
184 pInnerSequenceZ[nOldPointCount] = rPos.PositionZ;
185}
186
187void AddPointToPoly( std::vector<std::vector<css::drawing::Position3D>>& rPoly, const drawing::Position3D& rPos, sal_Int32 nPolygonIndex )
188{
189 if(nPolygonIndex<0)
190 {
191 OSL_FAIL( "The polygon index needs to be > 0");
192 nPolygonIndex=0;
193 }
194
195 //make sure that we have enough polygons
196 if(o3tl::make_unsigned(nPolygonIndex) >= rPoly.size() )
197 {
198 rPoly.resize(nPolygonIndex+1);
199 }
200
201 std::vector<css::drawing::Position3D>* pOuterSequence = &rPoly[nPolygonIndex];
202 pOuterSequence->push_back(rPos);
203}
204
205drawing::Position3D getPointFromPoly( const drawing::PolyPolygonShape3D& rPolygon, sal_Int32 nPointIndex, sal_Int32 nPolyIndex )
206{
207 drawing::Position3D aRet(0.0,0.0,0.0);
208
209 if( nPolyIndex>=0 && nPolyIndex<rPolygon.SequenceX.getLength())
210 {
211 if(nPointIndex<rPolygon.SequenceX[nPolyIndex].getLength())
212 {
213 aRet.PositionX = rPolygon.SequenceX[nPolyIndex][nPointIndex];
214 aRet.PositionY = rPolygon.SequenceY[nPolyIndex][nPointIndex];
215 aRet.PositionZ = rPolygon.SequenceZ[nPolyIndex][nPointIndex];
216 }
217 else
218 {
219 OSL_FAIL("polygon was accessed with a wrong index");
220 }
221 }
222 else
223 {
224 OSL_FAIL("polygon was accessed with a wrong index");
225 }
226 return aRet;
227}
228
229drawing::Position3D getPointFromPoly( const std::vector<std::vector<css::drawing::Position3D>>& rPolygon, sal_Int32 nPointIndex, sal_Int32 nPolyIndex )
230{
231 drawing::Position3D aRet(0.0,0.0,0.0);
232
233 if( nPolyIndex>=0 && o3tl::make_unsigned(nPolyIndex)<rPolygon.size())
234 {
235 if(nPointIndex<static_cast<sal_Int32>(rPolygon[nPolyIndex].size()))
236 {
237 aRet = rPolygon[nPolyIndex][nPointIndex];
238 }
239 else
240 {
241 OSL_FAIL("polygon was accessed with a wrong index");
242 }
243 }
244 else
245 {
246 OSL_FAIL("polygon was accessed with a wrong index");
247 }
248 return aRet;
249}
250
251void addPolygon( std::vector<std::vector<css::drawing::Position3D>>& rRet, const std::vector<std::vector<css::drawing::Position3D>>& rAdd )
252{
253 sal_Int32 nAddOuterCount = rAdd.size();
254 sal_Int32 nOuterCount = rRet.size() + nAddOuterCount;
255 rRet.resize( nOuterCount );
256 auto pSequence = rRet.data();
257
258 sal_Int32 nIndex = 0;
259 sal_Int32 nOuter = nOuterCount - nAddOuterCount;
260 for( ; nOuter < nOuterCount; nOuter++ )
261 {
262 if( nIndex >= nAddOuterCount )
263 break;
264
265 pSequence[nOuter] = rAdd[nIndex];
266
267 nIndex++;
268 }
269}
270
271void appendPoly( std::vector<std::vector<css::drawing::Position3D>>& rRet, const std::vector<std::vector<css::drawing::Position3D>>& rAdd )
272{
273 std::size_t nOuterCount = std::max( rRet.size(), rAdd.size() );
274 rRet.resize(nOuterCount);
275 auto pSequence = rRet.data();
276
277 for( std::size_t nOuter=0;nOuter<nOuterCount;nOuter++ )
278 {
279 sal_Int32 nOldPointCount = rRet[nOuter].size();
280 sal_Int32 nAddPointCount = 0;
281 if(nOuter<rAdd.size())
282 nAddPointCount = rAdd[nOuter].size();
283 if(!nAddPointCount)
284 continue;
285
286 sal_Int32 nNewPointCount = nOldPointCount + nAddPointCount;
287
288 pSequence[nOuter].resize(nNewPointCount);
289 auto pSequence_nOuter = pSequence[nOuter].data();
290
291 sal_Int32 nPointTarget=nOldPointCount;
292 sal_Int32 nPointSource=nAddPointCount;
293 for( ; nPointSource-- ; nPointTarget++ )
294 {
295 pSequence_nOuter[nPointTarget] = rAdd[nOuter][nPointSource];
296 }
297 }
298}
299
300drawing::PolyPolygonShape3D BezierToPoly(
301 const drawing::PolyPolygonBezierCoords& rBezier )
302{
303 const drawing::PointSequenceSequence& rPointSequence = rBezier.Coordinates;
304
305 drawing::PolyPolygonShape3D aRet;
306 aRet.SequenceX.realloc( rPointSequence.getLength() );
307 auto pSequenceX = aRet.SequenceX.getArray();
308 aRet.SequenceY.realloc( rPointSequence.getLength() );
309 auto pSequenceY = aRet.SequenceY.getArray();
310 aRet.SequenceZ.realloc( rPointSequence.getLength() );
311 auto pSequenceZ = aRet.SequenceZ.getArray();
312
313 sal_Int32 nRealOuter = 0;
314 for(sal_Int32 nN = 0; nN < rPointSequence.getLength(); nN++)
315 {
316 sal_Int32 nInnerLength = rPointSequence[nN].getLength();
317 pSequenceX[nRealOuter].realloc( nInnerLength );
318 auto pSequenceX_nRealOuter = pSequenceX[nRealOuter].getArray();
319 pSequenceY[nRealOuter].realloc( nInnerLength );
320 auto pSequenceY_nRealOuter = pSequenceY[nRealOuter].getArray();
321 pSequenceZ[nRealOuter].realloc( nInnerLength );
322 auto pSequenceZ_nRealOuter = pSequenceZ[nRealOuter].getArray();
323
324 bool bHasOuterFlags = nN < rBezier.Flags.getLength();
325
326 sal_Int32 nRealInner = 0;
327 for( sal_Int32 nM = 0; nM < nInnerLength; nM++)
328 {
329 bool bHasInnerFlags = bHasOuterFlags && (nM < rBezier.Flags[nN].getLength());
330
331 if( !bHasInnerFlags || (rBezier.Flags[nN][nM] == drawing::PolygonFlags_NORMAL) )
332 {
333 pSequenceX_nRealOuter[nRealInner] = rPointSequence[nN][nM].X;
334 pSequenceY_nRealOuter[nRealInner] = rPointSequence[nN][nM].Y;
335 pSequenceZ_nRealOuter[nRealInner] = 0.0;
336 nRealInner++;
337 }
338 }
339
340 pSequenceX[nRealOuter].realloc( nRealInner );
341 pSequenceY[nRealOuter].realloc( nRealInner );
342 pSequenceZ[nRealOuter].realloc( nRealInner );
343
344 if( nRealInner>0 )
345 nRealOuter++;
346 }
347
348 aRet.SequenceX.realloc( nRealOuter );
349 aRet.SequenceY.realloc( nRealOuter );
350 aRet.SequenceZ.realloc( nRealOuter );
351
352 return aRet;
353}
354
355drawing::PointSequenceSequence PolyToPointSequence(
356 const drawing::PolyPolygonShape3D& rPolyPolygon )
357{
358 drawing::PointSequenceSequence aRet;
359 aRet.realloc( rPolyPolygon.SequenceX.getLength() );
360 auto pRet = aRet.getArray();
361
362 for(sal_Int32 nN = 0; nN < rPolyPolygon.SequenceX.getLength(); nN++)
363 {
364 sal_Int32 nInnerLength = rPolyPolygon.SequenceX[nN].getLength();
365 pRet[nN].realloc( nInnerLength );
366 auto pRet_nN = pRet[nN].getArray();
367 for( sal_Int32 nM = 0; nM < nInnerLength; nM++)
368 {
369 pRet_nN[nM].X = static_cast<sal_Int32>(rPolyPolygon.SequenceX[nN][nM]);
370 pRet_nN[nM].Y = static_cast<sal_Int32>(rPolyPolygon.SequenceY[nN][nM]);
371 }
372 }
373 return aRet;
374}
375
376drawing::PointSequenceSequence PolyToPointSequence(
377 const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon )
378{
379 drawing::PointSequenceSequence aRet;
380 aRet.realloc( rPolyPolygon.size() );
381 auto pRet = aRet.getArray();
382
383 for(std::size_t nN = 0; nN < rPolyPolygon.size(); nN++)
384 {
385 sal_Int32 nInnerLength = rPolyPolygon[nN].size();
386 pRet[nN].realloc( nInnerLength );
387 auto pRet_nN = pRet[nN].getArray();
388 for( sal_Int32 nM = 0; nM < nInnerLength; nM++)
389 {
390 pRet_nN[nM].X = static_cast<sal_Int32>(rPolyPolygon[nN][nM].PositionX);
391 pRet_nN[nM].Y = static_cast<sal_Int32>(rPolyPolygon[nN][nM].PositionY);
392 }
393 }
394 return aRet;
395}
396
398 const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon )
399{
401
402 for(auto const & nN: rPolyPolygon)
403 {
404 basegfx::B2DPolygon aNewPolygon;
405 sal_Int32 nInnerLength = nN.size();
406 if(nInnerLength)
407 {
408 aNewPolygon.reserve(nInnerLength);
409 for( sal_Int32 nM = 0; nM < nInnerLength; nM++)
410 {
411 auto X = static_cast<sal_Int32>(nN[nM].PositionX);
412 auto Y = static_cast<sal_Int32>(nN[nM].PositionY);
413 aNewPolygon.append(basegfx::B2DPoint(X, Y));
414 }
415 // check for closed state flag
416 basegfx::utils::checkClosed(aNewPolygon);
417 }
418 aRetval.append(std::move(aNewPolygon));
419 }
420
421 return aRetval;
422}
423
424void appendPointSequence( drawing::PointSequenceSequence& rTarget
425 , const drawing::PointSequenceSequence& rAdd )
426{
427 sal_Int32 nAddCount = rAdd.getLength();
428 if(!nAddCount)
429 return;
430 sal_Int32 nOldCount = rTarget.getLength();
431
432 rTarget.realloc(nOldCount+nAddCount);
433 auto pTarget = rTarget.getArray();
434 for(sal_Int32 nS=0; nS<nAddCount; nS++ )
435 pTarget[nOldCount+nS]=rAdd[nS];
436}
437
438drawing::Position3D operator+( const drawing::Position3D& rPos
439 , const drawing::Direction3D& rDirection)
440{
441 return drawing::Position3D(
442 rPos.PositionX + rDirection.DirectionX
443 , rPos.PositionY + rDirection.DirectionY
444 , rPos.PositionZ + rDirection.DirectionZ
445 );
446}
447
448drawing::Direction3D operator-( const drawing::Position3D& rPos1
449 , const drawing::Position3D& rPos2)
450{
451 return drawing::Direction3D(
452 rPos1.PositionX - rPos2.PositionX
453 , rPos1.PositionY - rPos2.PositionY
454 , rPos1.PositionZ - rPos2.PositionZ
455 );
456}
457
458awt::Point Position3DToAWTPoint( const drawing::Position3D& rPos )
459{
460 awt::Point aRet;
461 aRet.X = static_cast<sal_Int32>(rPos.PositionX);
462 aRet.Y = static_cast<sal_Int32>(rPos.PositionY);
463 return aRet;
464}
465
466awt::Point ToPoint( const awt::Rectangle& rRectangle )
467{
468 return awt::Point( rRectangle.X, rRectangle.Y );
469}
470
471awt::Size ToSize( const awt::Rectangle& rRectangle )
472{
473 return awt::Size( rRectangle.Width, rRectangle.Height );
474}
475
476awt::Size Direction3DToAWTSize( const drawing::Direction3D& rDirection )
477{
478 awt::Size aRet;
479 aRet.Width = static_cast<sal_Int32>(rDirection.DirectionX);
480 aRet.Height = static_cast<sal_Int32>(rDirection.DirectionY);
481 return aRet;
482}
483
484drawing::Position3D SequenceToPosition3D( const uno::Sequence< double >& rSeq )
485{
486 OSL_ENSURE(rSeq.getLength()==3,"The sequence needs to have length 3 for conversion into vector");
487
488 drawing::Position3D aRet;
489 aRet.PositionX = rSeq.getLength()>0?rSeq[0]:0.0;
490 aRet.PositionY = rSeq.getLength()>1?rSeq[1]:0.0;
491 aRet.PositionZ = rSeq.getLength()>2?rSeq[2]:0.0;
492 return aRet;
493}
494
495using namespace ::com::sun::star::chart2;
496
498 const uno::Reference< data::XDataSequence >& xDataSequence )
499{
501 OSL_ASSERT( xDataSequence.is());
502 if(!xDataSequence.is())
503 return aResult;
504
505 uno::Reference< data::XNumericalDataSequence > xNumericalDataSequence( xDataSequence, uno::UNO_QUERY );
506 if( xNumericalDataSequence.is() )
507 {
508 aResult = xNumericalDataSequence->getNumericalData();
509 }
510 else
511 {
512 uno::Sequence< uno::Any > aValues = xDataSequence->getData();
513 aResult.realloc(aValues.getLength());
514 auto pResult = aResult.getArray();
515 for(sal_Int32 nN=aValues.getLength();nN--;)
516 {
517 if( !(aValues[nN] >>= pResult[nN]) )
518 pResult[nN] = std::numeric_limits<double>::quiet_NaN();
519 }
520 }
521
522 return aResult;
523}
524
526 const uno::Reference< data::XDataSequence >& xDataSequence )
527{
529 if(!xDataSequence.is())
530 return aResult;
531
532 uno::Reference< data::XTextualDataSequence > xTextualDataSequence( xDataSequence, uno::UNO_QUERY );
533 if( xTextualDataSequence.is() )
534 {
535 aResult = xTextualDataSequence->getTextualData();
536 }
537 else
538 {
539 uno::Sequence< uno::Any > aValues = xDataSequence->getData();
540 aResult.realloc(aValues.getLength());
541 auto pResult = aResult.getArray();
542
543 for(sal_Int32 nN=aValues.getLength();nN--;)
544 aValues[nN] >>= pResult[nN];
545 }
546
547 return aResult;
548}
549
550bool hasDoubleValue( const uno::Any& rAny )
551{
552 bool bRet = false;
553 double fValue = 0.0;
554 if( rAny >>= fValue )
555 bRet = true;
556 return bRet;
557}
558
559bool hasLongOrShortValue( const uno::Any& rAny )
560{
561 bool bRet = false;
562 sal_Int32 n32 = 0;
563 if( rAny >>= n32 )
564 bRet = true;
565 else
566 {
567 sal_Int16 n16 = 0;
568 if( rAny >>= n16 )
569 bRet = true;
570 }
571 return bRet;
572}
573sal_Int16 getShortForLongAlso( const uno::Any& rAny )
574{
575 sal_Int16 nRet = 0;
576
577 if( !(rAny >>= nRet) )
578 {
579 sal_Int32 n32 = 0;
580 if( rAny >>= n32 )
581 nRet = static_cast<sal_Int16>(n32);
582 }
583 return nRet;
584}
585
586bool replaceParamterInString( OUString & rInOutResourceString,
587 std::u16string_view rParamToReplace,
588 std::u16string_view rReplaceWith )
589{
590 sal_Int32 nPos = rInOutResourceString.indexOf( rParamToReplace );
591 if( nPos == -1 )
592 return false;
593
594 rInOutResourceString = rInOutResourceString.replaceAt( nPos
595 , rParamToReplace.size(), rReplaceWith );
596 return true;
597}
598
599} //namespace chart
600
601/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 nPos
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void reserve(sal_uInt32 nCount)
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
FilterGroup & rTarget
sal_Int32 nIndex
void checkClosed(B2DPolygon &rCandidate)
size
OOO_DLLPUBLIC_CHARTTOOLS::basegfx::B3DVector Direction3DToB3DVector(const css::drawing::Direction3D &rDirection)
Direction3D -> B3DVector.
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D getPointFromPoly(const std::vector< std::vector< css::drawing::Position3D > > &rPolygon, sal_Int32 nPointIndex, sal_Int32 nPolyIndex)
get a single Point from a Polygon
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D B3DPointToPosition3D(const ::basegfx::B3DPoint &rPoint)
B3DPoint -> Position3D.
OOO_DLLPUBLIC_CHARTTOOLS css::awt::Point Position3DToAWTPoint(const css::drawing::Position3D &rPos)
Position3D --> awt::Point (2D)
OOO_DLLPUBLIC_CHARTTOOLS bool hasLongOrShortValue(const css::uno::Any &rAny)
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::HomogenMatrix3 B2DHomMatrixToHomogenMatrix3(const ::basegfx::B2DHomMatrix &rM)
B2DHomMatrix <-> HomogenMatrix3.
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Direction3D operator-(const css::drawing::Position3D &rPos1, const css::drawing::Position3D &rPos2)
Position3D - Position3D == Direction3D.
OOO_DLLPUBLIC_CHARTTOOLS bool replaceParamterInString(OUString &rInOutResourceString, std::u16string_view rParamToReplace, std::u16string_view rReplaceWith)
OOO_DLLPUBLIC_CHARTTOOLS void AddPointToPoly(css::drawing::PolyPolygonShape3D &rPoly, const css::drawing::Position3D &rPos, sal_Int32 nSequenceIndex=0)
PolyPolygonShape3D + drawing::Position3D -> PolyPolygonShape3D.
OOO_DLLPUBLIC_CHARTTOOLS css::awt::Size ToSize(const css::awt::Rectangle &rRectangle)
awt::Rect --> awt::Size (2D)
OOO_DLLPUBLIC_CHARTTOOLS basegfx::B2DPolyPolygon PolyToB2DPolyPolygon(const std::vector< std::vector< css::drawing::Position3D > > &rPolyPolygon)
PolyPolygonShape3D -> basegfx::B2DPolyPolygon (2D)
OOO_DLLPUBLIC_CHARTTOOLS void addPolygon(std::vector< std::vector< css::drawing::Position3D > > &rRet, const std::vector< std::vector< css::drawing::Position3D > > &rAdd)
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::PolyPolygonShape3D BezierToPoly(const css::drawing::PolyPolygonBezierCoords &rBezier)
PolyPolygonBezierCoords -> PolyPolygonShape3D.
OOO_DLLPUBLIC_CHARTTOOLS void appendPointSequence(css::drawing::PointSequenceSequence &rTarget, const css::drawing::PointSequenceSequence &rAdd)
drawing::PointSequenceSequence + drawing::PointSequenceSequence
OOO_DLLPUBLIC_CHARTTOOLS void appendPoly(std::vector< std::vector< css::drawing::Position3D > > &rRet, const std::vector< std::vector< css::drawing::Position3D > > &rAdd)
PolyPolygonShape3D + PolyPolygonShape3D -> PolyPolygonShape3D.
OOO_DLLPUBLIC_CHARTTOOLS::basegfx::B3DPoint Position3DToB3DPoint(const css::drawing::Position3D &rPosition)
Position3D -> B3DPoint.
OOO_DLLPUBLIC_CHARTTOOLS sal_Int16 getShortForLongAlso(const css::uno::Any &rAny)
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Direction3D B3DVectorToDirection3D(const ::basegfx::B3DVector &rVector)
B3DVector -> Direction3D.
OOO_DLLPUBLIC_CHARTTOOLS css::awt::Point ToPoint(const css::awt::Rectangle &rRectangle)
awt::Rect --> awt::Point (2D)
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::HomogenMatrix B3DHomMatrixToHomogenMatrix(const ::basegfx::B3DHomMatrix &rM)
diverse methods for class conversions; e.g.
OOO_DLLPUBLIC_CHARTTOOLS css::uno::Sequence< double > DataSequenceToDoubleSequence(const css::uno::Reference< css::chart2::data::XDataSequence > &xDataSequence)
chart2::XDataSequence -> uno::Sequence< double >
OOO_DLLPUBLIC_CHARTTOOLS css::awt::Size Direction3DToAWTSize(const css::drawing::Direction3D &rDirection)
Direction3D --> awt::Size (2D)
OOO_DLLPUBLIC_CHARTTOOLS::basegfx::B2DHomMatrix IgnoreZ(const ::basegfx::B3DHomMatrix &rM)
basegfx::B3DHomMatrix -> B2DHomMatrix
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::PointSequenceSequence PolyToPointSequence(const css::drawing::PolyPolygonShape3D &rPolyPolygon)
PolyPolygonShape3D -> drawing::PointSequenceSequence (2D)
OOO_DLLPUBLIC_CHARTTOOLS css::uno::Sequence< OUString > DataSequenceToStringSequence(const css::uno::Reference< css::chart2::data::XDataSequence > &xDataSequence)
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D operator+(const css::drawing::Position3D &rPos, const css::drawing::Direction3D &rDirection)
Position3D + Direction3D == Position3D.
OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D SequenceToPosition3D(const css::uno::Sequence< double > &rSeq)
Sequence<double> -> drawing::Position3D.
OOO_DLLPUBLIC_CHARTTOOLS::basegfx::B3DHomMatrix HomogenMatrixToB3DHomMatrix(const css::drawing::HomogenMatrix &rHM)
HomogenMatrix -> basegfx::B3DHomMatrix.
OOO_DLLPUBLIC_CHARTTOOLS bool hasDoubleValue(const css::uno::Any &rAny)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
#define Y