office-gobmx/chart2/source/tools/CommonConverters.cxx

553 lines
18 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2003-10-06 03:58:36 -05:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2003-10-06 03:58:36 -05:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2003-10-06 03:58:36 -05:00
*
* OpenOffice.org - a multi-platform office productivity suite
2003-10-06 03:58:36 -05:00
*
* This file is part of OpenOffice.org.
2003-10-06 03:58:36 -05:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2003-10-06 03:58:36 -05:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2003-10-06 03:58:36 -05:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2003-10-06 03:58:36 -05:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
2003-10-06 03:58:36 -05:00
#include "CommonConverters.hxx"
#include <com/sun/star/drawing/DoubleSequence.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
2003-12-17 07:30:48 -06:00
#include <rtl/math.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
2003-10-06 03:58:36 -05:00
#include <cstdarg>
//.............................................................................
namespace chart
{
//.............................................................................
using namespace ::com::sun::star;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// diverse methods for class conversions; e.g. ::basegfx::B3DHomMatrix to HomogenMatrix
2003-10-06 03:58:36 -05:00
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
drawing::HomogenMatrix B3DHomMatrixToHomogenMatrix( const ::basegfx::B3DHomMatrix& rM )
2003-10-06 03:58:36 -05:00
{
drawing::HomogenMatrix aHM;
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
aHM.Line1.Column1 = rM.get(0, 0);
aHM.Line1.Column2 = rM.get(0, 1);
aHM.Line1.Column3 = rM.get(0, 2);
aHM.Line1.Column4 = rM.get(0, 3);
aHM.Line2.Column1 = rM.get(1, 0);
aHM.Line2.Column2 = rM.get(1, 1);
aHM.Line2.Column3 = rM.get(1, 2);
aHM.Line2.Column4 = rM.get(1, 3);
aHM.Line3.Column1 = rM.get(2, 0);
aHM.Line3.Column2 = rM.get(2, 1);
aHM.Line3.Column3 = rM.get(2, 2);
aHM.Line3.Column4 = rM.get(2, 3);
aHM.Line4.Column1 = rM.get(3, 0);
aHM.Line4.Column2 = rM.get(3, 1);
aHM.Line4.Column3 = rM.get(3, 2);
aHM.Line4.Column4 = rM.get(3, 3);
2003-10-06 03:58:36 -05:00
return aHM;
}
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
::basegfx::B3DHomMatrix HomogenMatrixToB3DHomMatrix( const drawing::HomogenMatrix& rHM )
{
::basegfx::B3DHomMatrix aM;
aM.set(0, 0, rHM.Line1.Column1);
aM.set(0, 1, rHM.Line1.Column2);
aM.set(0, 2, rHM.Line1.Column3);
aM.set(0, 3, rHM.Line1.Column4);
aM.set(1, 0, rHM.Line2.Column1);
aM.set(1, 1, rHM.Line2.Column2);
aM.set(1, 2, rHM.Line2.Column3);
aM.set(1, 3, rHM.Line2.Column4);
aM.set(2, 0, rHM.Line3.Column1);
aM.set(2, 1, rHM.Line3.Column2);
aM.set(2, 2, rHM.Line3.Column3);
aM.set(2, 3, rHM.Line3.Column4);
aM.set(3, 0, rHM.Line4.Column1);
aM.set(3, 1, rHM.Line4.Column2);
aM.set(3, 2, rHM.Line4.Column3);
aM.set(3, 3, rHM.Line4.Column4);
return aM;
2003-10-06 03:58:36 -05:00
}
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
::basegfx::B2DHomMatrix IgnoreZ( const ::basegfx::B3DHomMatrix& rM )
{
::basegfx::B2DHomMatrix aM;
aM.set(0, 0, rM.get(0, 0));
aM.set(0, 1, rM.get(0, 1));
aM.set(0, 2, rM.get(0, 3));
aM.set(1, 0, rM.get(1, 0));
aM.set(1, 1, rM.get(1, 1));
aM.set(1, 2, rM.get(1, 3));
aM.set(2, 0, rM.get(3, 0));
aM.set(2, 1, rM.get(3, 1));
aM.set(2, 2, rM.get(3, 3));
return aM;
2003-10-06 03:58:36 -05:00
}
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
drawing::HomogenMatrix3 B2DHomMatrixToHomogenMatrix3( const ::basegfx::B2DHomMatrix& rM )
2003-10-06 03:58:36 -05:00
{
drawing::HomogenMatrix3 aHM;
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
aHM.Line1.Column1 = rM.get(0, 0);
aHM.Line1.Column2 = rM.get(0, 1);
aHM.Line1.Column3 = rM.get(0, 2);
aHM.Line2.Column1 = rM.get(1, 0);
aHM.Line2.Column2 = rM.get(1, 1);
aHM.Line2.Column3 = rM.get(1, 2);
aHM.Line3.Column1 = rM.get(2, 0);
aHM.Line3.Column2 = rM.get(2, 1);
aHM.Line3.Column3 = rM.get(2, 2);
2003-10-06 03:58:36 -05:00
return aHM;
}
::basegfx::B3DPoint Position3DToB3DPoint( const drawing::Position3D& rPosition )
2003-10-06 03:58:36 -05:00
{
return ::basegfx::B3DPoint(
rPosition.PositionX ,
rPosition.PositionY ,
rPosition.PositionZ );
2003-10-06 03:58:36 -05:00
}
drawing::Direction3D B3DVectorToDirection3D( const ::basegfx::B3DVector& rVector)
2003-10-06 03:58:36 -05:00
{
return drawing::Direction3D(
rVector.getX()
, rVector.getY()
, rVector.getZ()
2003-10-06 03:58:36 -05:00
);
}
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
drawing::Position3D B3DPointToPosition3D( const ::basegfx::B3DPoint& rPoint)
{
return drawing::Position3D(
rPoint.getX()
, rPoint.getY()
, rPoint.getZ()
);
}
2008-10-17 03:40:10 -05:00
::basegfx::B3DVector Direction3DToB3DVector( const drawing::Direction3D& rDirection)
{
return ::basegfx::B3DVector(
rDirection.DirectionX
, rDirection.DirectionY
, rDirection.DirectionZ
);
}
2003-10-06 03:58:36 -05:00
void AddPointToPoly( drawing::PolyPolygonShape3D& rPoly, const drawing::Position3D& rPos, sal_Int32 nPolygonIndex )
{
if(nPolygonIndex<0)
{
OSL_ENSURE( false, "The polygon index needs to be > 0");
nPolygonIndex=0;
}
//make sure that we have enough polygons
if(nPolygonIndex >= rPoly.SequenceX.getLength() )
{
rPoly.SequenceX.realloc(nPolygonIndex+1);
rPoly.SequenceY.realloc(nPolygonIndex+1);
rPoly.SequenceZ.realloc(nPolygonIndex+1);
}
drawing::DoubleSequence* pOuterSequenceX = &rPoly.SequenceX.getArray()[nPolygonIndex];
drawing::DoubleSequence* pOuterSequenceY = &rPoly.SequenceY.getArray()[nPolygonIndex];
drawing::DoubleSequence* pOuterSequenceZ = &rPoly.SequenceZ.getArray()[nPolygonIndex];
sal_Int32 nOldPointCount = pOuterSequenceX->getLength();
pOuterSequenceX->realloc(nOldPointCount+1);
pOuterSequenceY->realloc(nOldPointCount+1);
pOuterSequenceZ->realloc(nOldPointCount+1);
double* pInnerSequenceX = pOuterSequenceX->getArray();
double* pInnerSequenceY = pOuterSequenceY->getArray();
double* pInnerSequenceZ = pOuterSequenceZ->getArray();
pInnerSequenceX[nOldPointCount] = rPos.PositionX;
pInnerSequenceY[nOldPointCount] = rPos.PositionY;
pInnerSequenceZ[nOldPointCount] = rPos.PositionZ;
}
2003-11-04 06:14:20 -06:00
drawing::Position3D getPointFromPoly( const drawing::PolyPolygonShape3D& rPolygon, sal_Int32 nPointIndex, sal_Int32 nPolyIndex )
{
drawing::Position3D aRet(0.0,0.0,0.0);
if( nPolyIndex>=0 && nPolyIndex<rPolygon.SequenceX.getLength())
{
if(nPointIndex<rPolygon.SequenceX[nPolyIndex].getLength())
{
aRet.PositionX = rPolygon.SequenceX[nPolyIndex][nPointIndex];
aRet.PositionY = rPolygon.SequenceY[nPolyIndex][nPointIndex];
aRet.PositionZ = rPolygon.SequenceZ[nPolyIndex][nPointIndex];
}
else
{
;DBG_ERROR("polygon was accessed with a wrong index");
}
}
else
{
;DBG_ERROR("polygon was accessed with a wrong index");
}
return aRet;
}
void addPolygon( drawing::PolyPolygonShape3D& rRet, const drawing::PolyPolygonShape3D& rAdd )
{
sal_Int32 nAddOuterCount = rAdd.SequenceX.getLength();
sal_Int32 nOuterCount = rRet.SequenceX.getLength() + nAddOuterCount;
rRet.SequenceX.realloc( nOuterCount );
rRet.SequenceY.realloc( nOuterCount );
rRet.SequenceZ.realloc( nOuterCount );
sal_Int32 nIndex = 0;
sal_Int32 nOuter = nOuterCount - nAddOuterCount;
for( ; nOuter < nOuterCount; nOuter++ )
{
if( nIndex >= nAddOuterCount )
break;
rRet.SequenceX[nOuter] = rAdd.SequenceX[nIndex];
rRet.SequenceY[nOuter] = rAdd.SequenceY[nIndex];
rRet.SequenceZ[nOuter] = rAdd.SequenceZ[nIndex];
nIndex++;
}
}
2003-10-06 03:58:36 -05:00
void appendPoly( drawing::PolyPolygonShape3D& rRet, const drawing::PolyPolygonShape3D& rAdd )
{
sal_Int32 nOuterCount = Max( rRet.SequenceX.getLength(), rAdd.SequenceX.getLength() );
rRet.SequenceX.realloc(nOuterCount);
rRet.SequenceY.realloc(nOuterCount);
rRet.SequenceZ.realloc(nOuterCount);
for( sal_Int32 nOuter=0;nOuter<nOuterCount;nOuter++ )
{
sal_Int32 nOldPointCount = rRet.SequenceX[nOuter].getLength();
sal_Int32 nAddPointCount = 0;
if(nOuter<rAdd.SequenceX.getLength())
nAddPointCount = rAdd.SequenceX[nOuter].getLength();
if(!nAddPointCount)
continue;
sal_Int32 nNewPointCount = nOldPointCount + nAddPointCount;
rRet.SequenceX[nOuter].realloc(nNewPointCount);
rRet.SequenceY[nOuter].realloc(nNewPointCount);
rRet.SequenceZ[nOuter].realloc(nNewPointCount);
sal_Int32 nPointTarget=nOldPointCount;
sal_Int32 nPointSource=nAddPointCount;
for( ; nPointSource-- ; nPointTarget++ )
{
rRet.SequenceX[nOuter][nPointTarget] = rAdd.SequenceX[nOuter][nPointSource];
rRet.SequenceY[nOuter][nPointTarget] = rAdd.SequenceY[nOuter][nPointSource];
rRet.SequenceZ[nOuter][nPointTarget] = rAdd.SequenceZ[nOuter][nPointSource];
}
}
}
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
drawing::PolyPolygonShape3D BezierToPoly(
const drawing::PolyPolygonBezierCoords& rBezier )
{
const drawing::PointSequenceSequence& rPointSequence = rBezier.Coordinates;
// const drawing::FlagSequenceSequence& rFlags = rBezier.Flags;
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
drawing::PolyPolygonShape3D aRet;
aRet.SequenceX.realloc( rPointSequence.getLength() );
aRet.SequenceY.realloc( rPointSequence.getLength() );
aRet.SequenceZ.realloc( rPointSequence.getLength() );
sal_Int32 nRealOuter = 0;
for(sal_Int32 nN = 0; nN < rPointSequence.getLength(); nN++)
{
sal_Int32 nInnerLength = rPointSequence[nN].getLength();
aRet.SequenceX[nN].realloc( nInnerLength );
aRet.SequenceY[nN].realloc( nInnerLength );
aRet.SequenceZ[nN].realloc( nInnerLength );
bool bHasOuterFlags = nN < rBezier.Flags.getLength();
sal_Int32 nRealInner = 0;
for( sal_Int32 nM = 0; nM < nInnerLength; nM++)
{
bool bHasInnerFlags = bHasOuterFlags && (nM < rBezier.Flags[nN].getLength());
if( !bHasInnerFlags || (rBezier.Flags[nN][nM] == drawing::PolygonFlags_NORMAL) )
{
aRet.SequenceX[nRealOuter][nRealInner] = rPointSequence[nN][nM].X;
aRet.SequenceY[nRealOuter][nRealInner] = rPointSequence[nN][nM].Y;
aRet.SequenceZ[nRealOuter][nRealInner] = 0.0;
nRealInner++;
}
}
aRet.SequenceX[nRealOuter].realloc( nRealInner );
aRet.SequenceY[nRealOuter].realloc( nRealInner );
aRet.SequenceZ[nRealOuter].realloc( nRealInner );
if( nRealInner>0 )
nRealOuter++;
}
aRet.SequenceX.realloc( nRealOuter );
aRet.SequenceY.realloc( nRealOuter );
aRet.SequenceZ.realloc( nRealOuter );
return aRet;
}
2003-10-06 03:58:36 -05:00
drawing::PointSequenceSequence PolyToPointSequence(
const drawing::PolyPolygonShape3D& rPolyPolygon )
{
drawing::PointSequenceSequence aRet;
aRet.realloc( rPolyPolygon.SequenceX.getLength() );
for(sal_Int32 nN = 0; nN < rPolyPolygon.SequenceX.getLength(); nN++)
{
sal_Int32 nInnerLength = rPolyPolygon.SequenceX[nN].getLength();
aRet[nN].realloc( nInnerLength );
for( sal_Int32 nM = 0; nM < nInnerLength; nM++)
{
aRet[nN][nM].X = static_cast<sal_Int32>(rPolyPolygon.SequenceX[nN][nM]);
aRet[nN][nM].Y = static_cast<sal_Int32>(rPolyPolygon.SequenceY[nN][nM]);
}
}
return aRet;
}
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
void appendPointSequence( drawing::PointSequenceSequence& rTarget
, drawing::PointSequenceSequence& rAdd )
{
sal_Int32 nAddCount = rAdd.getLength();
if(!nAddCount)
return;
sal_Int32 nOldCount = rTarget.getLength();
rTarget.realloc(nOldCount+nAddCount);
for(sal_Int32 nS=0; nS<nAddCount; nS++ )
rTarget[nOldCount+nS]=rAdd[nS];
}
2003-10-06 03:58:36 -05:00
drawing::Position3D operator+( const drawing::Position3D& rPos
, const drawing::Direction3D& rDirection)
{
return drawing::Position3D(
rPos.PositionX + rDirection.DirectionX
, rPos.PositionY + rDirection.DirectionY
, rPos.PositionZ + rDirection.DirectionZ
);
}
drawing::Direction3D operator-( const drawing::Position3D& rPos1
, const drawing::Position3D& rPos2)
{
return drawing::Direction3D(
rPos1.PositionX - rPos2.PositionX
, rPos1.PositionY - rPos2.PositionY
, rPos1.PositionZ - rPos2.PositionZ
);
}
2003-11-04 03:23:04 -06:00
bool operator==( const drawing::Position3D& rPos1
, const drawing::Position3D& rPos2)
{
return rPos1.PositionX == rPos2.PositionX
&& rPos1.PositionY == rPos2.PositionY
&& rPos1.PositionZ == rPos2.PositionZ;
}
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
awt::Point Position3DToAWTPoint( const drawing::Position3D& rPos )
{
awt::Point aRet;
aRet.X = static_cast<sal_Int32>(rPos.PositionX);
aRet.Y = static_cast<sal_Int32>(rPos.PositionY);
return aRet;
}
awt::Point ToPoint( const awt::Rectangle& rRectangle )
{
return awt::Point( rRectangle.X, rRectangle.Y );
}
awt::Size ToSize( const awt::Rectangle& rRectangle )
{
return awt::Size( rRectangle.Width, rRectangle.Height );
}
awt::Size Direction3DToAWTSize( const drawing::Direction3D& rDirection )
{
awt::Size aRet;
aRet.Width = static_cast<sal_Int32>(rDirection.DirectionX);
aRet.Height = static_cast<sal_Int32>(rDirection.DirectionY);
return aRet;
}
uno::Sequence< double > B3DPointToSequence( const ::basegfx::B3DPoint& rPoint )
2003-10-06 03:58:36 -05:00
{
uno::Sequence< double > aRet(3);
aRet[0] = rPoint.getX();
aRet[1] = rPoint.getY();
aRet[2] = rPoint.getZ();
2003-10-06 03:58:36 -05:00
return aRet;
}
drawing::Position3D SequenceToPosition3D( const uno::Sequence< double >& rSeq )
{
OSL_ENSURE(rSeq.getLength()==3,"The sequence needs to have length 3 for conversion into vector");
drawing::Position3D aRet;
aRet.PositionX = rSeq.getLength()>0?rSeq[0]:0.0;
aRet.PositionY = rSeq.getLength()>1?rSeq[1]:0.0;
aRet.PositionZ = rSeq.getLength()>2?rSeq[2]:0.0;
return aRet;
}
uno::Sequence< double > Position3DToSequence( const drawing::Position3D& rPosition )
{
uno::Sequence< double > aRet(3);
aRet[0] = rPosition.PositionX;
aRet[1] = rPosition.PositionY;
aRet[2] = rPosition.PositionZ;
return aRet;
}
using namespace ::com::sun::star::chart2;
2003-12-17 07:30:48 -06:00
uno::Sequence< double > DataSequenceToDoubleSequence(
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
const uno::Reference< data::XDataSequence >& xDataSequence )
2003-12-17 07:30:48 -06:00
{
uno::Sequence< double > aResult;
OSL_ASSERT( xDataSequence.is());
if(!xDataSequence.is())
return aResult;
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
uno::Reference< data::XNumericalDataSequence > xNumericalDataSequence( xDataSequence, uno::UNO_QUERY );
2003-12-17 07:30:48 -06:00
if( xNumericalDataSequence.is() )
{
aResult = xNumericalDataSequence->getNumericalData();
}
else
{
uno::Sequence< uno::Any > aValues = xDataSequence->getData();
aResult.realloc(aValues.getLength());
for(sal_Int32 nN=aValues.getLength();nN--;)
{
if( !(aValues[nN] >>= aResult[nN]) )
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
::rtl::math::setNan( &aResult[nN] );
2003-12-17 07:30:48 -06:00
}
}
return aResult;
}
INTEGRATION: CWS chart2mst3 (1.6.4); FILE MERGED 2006/11/26 13:22:33 iha 1.6.4.18: method Direction3DToB3DPoint and B3DPointToPosition3D 2006/11/22 17:25:14 iha 1.6.4.17: RESYNC: (1.8-1.9); FILE MERGED 2006/11/01 15:35:04 iha 1.6.4.16: cleanup resources + changed variable names according to style guide 2006/10/20 20:32:55 iha 1.6.4.15: implement gradient step count 2006/10/18 17:15:42 bm 1.6.4.14: RESYNC: (1.7-1.8); FILE MERGED 2006/09/29 14:59:47 iha 1.6.4.13: corrected creation of 3D pies and donuts (extrude instead of lathe objects- for corect texture, get rid of problem with extended scene due to rotating bounding box, fixed #i67743# and no 90degree rotation difference between old and new API anymore) 2006/09/24 09:12:55 iha 1.6.4.12: #i61970# correct implementation of axis at 2005/10/07 12:07:15 bm 1.6.4.11: RESYNC: (1.6-1.7); FILE MERGED 2005/07/23 00:01:20 iha 1.6.4.10: include axis title sizes in diagram position to support old api and fileformat 2005/05/09 09:51:32 bm 1.6.4.9: moved parts of API to data namespace 2004/06/07 17:51:14 iha 1.6.4.8: added Direction3DToVector3D 2004/05/05 16:00:22 iha 1.6.4.7: added Vector3DToPosition3D 2004/04/27 13:32:42 iha 1.6.4.6: warnings removed 2004/03/11 09:38:33 iha 1.6.4.5: added operator+ for Direction3D 2004/02/29 10:20:42 iha 1.6.4.4: added Position3DToAWTPoint + Direction3DToAWTSize 2004/02/23 19:07:48 iha 1.6.4.3: do not convert something wrong to number - functionality not needed anymore 2004/02/20 17:34:29 iha 1.6.4.2: added method DataSequenceToStringSequence for categories at axes 2004/02/13 16:51:50 bm 1.6.4.1: join from changes on branch bm_post_chart01
2007-05-22 12:56:47 -05:00
uno::Sequence< rtl::OUString > DataSequenceToStringSequence(
const uno::Reference< data::XDataSequence >& xDataSequence )
{
uno::Sequence< rtl::OUString > aResult;
OSL_ASSERT( xDataSequence.is());
if(!xDataSequence.is())
return aResult;
uno::Reference< data::XTextualDataSequence > xTextualDataSequence( xDataSequence, uno::UNO_QUERY );
if( xTextualDataSequence.is() )
{
aResult = xTextualDataSequence->getTextualData();
}
else
{
uno::Sequence< uno::Any > aValues = xDataSequence->getData();
aResult.realloc(aValues.getLength());
for(sal_Int32 nN=aValues.getLength();nN--;)
aValues[nN] >>= aResult[nN];
}
return aResult;
}
sal_Bool hasDoubleValue( const uno::Any& rAny )
{
sal_Bool bRet = sal_False;
double fValue = 0.0;
if( rAny >>= fValue )
bRet = sal_True;
return bRet;
}
sal_Bool hasLongOrShortValue( const uno::Any& rAny )
{
sal_Bool bRet = sal_False;
sal_Int32 n32 = 0;
if( rAny >>= n32 )
bRet = sal_True;
else
{
sal_Int16 n16 = 0;
if( rAny >>= n16 )
bRet = sal_True;
}
return bRet;
}
sal_Int16 getShortForLongAlso( const uno::Any& rAny )
{
sal_Int16 nRet = 0;
if( !(rAny >>= nRet) )
{
sal_Int32 n32 = 0;
if( rAny >>= n32 )
nRet = static_cast<sal_Int16>(n32);
}
return nRet;
}
bool replaceParamterInString( rtl::OUString & rInOutResourceString,
const rtl::OUString & rParamToReplace,
const rtl::OUString & rReplaceWith )
{
sal_Int32 nPos = rInOutResourceString.indexOf( rParamToReplace );
if( nPos == -1 )
return false;
rInOutResourceString = rInOutResourceString.replaceAt( nPos
, rParamToReplace.getLength(), rReplaceWith );
return true;
}
2003-10-06 03:58:36 -05:00
//.............................................................................
} //namespace chart
//.............................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */