diff options
Diffstat (limited to 'chart2/source/view/diagram/VDiagram.cxx')
-rw-r--r-- | chart2/source/view/diagram/VDiagram.cxx | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx index 8deea35e2d48..ff660a485d04 100644 --- a/chart2/source/view/diagram/VDiagram.cxx +++ b/chart2/source/view/diagram/VDiagram.cxx @@ -19,11 +19,13 @@ #include <ShapeFactory.hxx> #include <VDiagram.hxx> +#include <Diagram.hxx> #include <PropertyMapper.hxx> #include <ViewDefines.hxx> #include <Stripe.hxx> #include <ObjectIdentifier.hxx> #include <DiagramHelper.hxx> +#include <ChartType.hxx> #include <BaseGFXHelper.hxx> #include <ChartTypeHelper.hxx> #include <ThreeDHelper.hxx> @@ -31,7 +33,7 @@ #include <editeng/unoprnms.hxx> #include <svx/scene3d.hxx> #include <svx/e3dsceneupdater.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace chart { @@ -39,7 +41,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; VDiagram::VDiagram( - const uno::Reference<XDiagram> & xDiagram, const drawing::Direction3D& rPreferredAspectRatio, + const rtl::Reference<Diagram> & xDiagram, const drawing::Direction3D& rPreferredAspectRatio, sal_Int32 nDimension ) : m_nDimensionCount(nDimension) , m_xDiagram(xDiagram) @@ -52,13 +54,12 @@ VDiagram::VDiagram( if( m_nDimensionCount != 3) return; - uno::Reference< beans::XPropertySet > xSourceProp( m_xDiagram, uno::UNO_QUERY ); - ThreeDHelper::getRotationAngleFromDiagram( xSourceProp, m_fXAnglePi, m_fYAnglePi, m_fZAnglePi ); + xDiagram->getRotationAngle( m_fXAnglePi, m_fYAnglePi, m_fZAnglePi ); if( ChartTypeHelper::isSupportingRightAngledAxes( - DiagramHelper::getChartTypeByIndex( m_xDiagram, 0 ) ) ) + m_xDiagram->getChartTypeByIndex( 0 ) ) ) { - if(xSourceProp.is()) - xSourceProp->getPropertyValue("RightAngledAxes") >>= m_bRightAngledAxes; + if(xDiagram.is()) + xDiagram->getPropertyValue("RightAngledAxes") >>= m_bRightAngledAxes; if( m_bRightAngledAxes ) { ThreeDHelper::adaptRadAnglesForRightAngledAxes( m_fXAnglePi, m_fYAnglePi ); @@ -142,7 +143,7 @@ void VDiagram::createShapes_2d() //create independent group shape as container for datapoints and such things m_xCoordinateRegionShape = ShapeFactory::createGroup2D(xOuterGroup_Shapes,"testonly;CooContainer=XXX_CID"); - bool bAddFloorAndWall = DiagramHelper::isSupportingFloorAndWall( m_xDiagram ); + bool bAddFloorAndWall = m_xDiagram->isSupportingFloorAndWall(); //add back wall { @@ -182,7 +183,7 @@ void VDiagram::createShapes_2d() static E3dScene* lcl_getE3dScene( const rtl::Reference<SvxShapeGroupAnyD>& xShape ) { - return dynamic_cast< E3dScene* >(xShape->GetSdrObject()); + return DynCastE3dScene(xShape->GetSdrObject()); } static void lcl_setLightSources( @@ -441,7 +442,7 @@ void VDiagram::createShapes_3d() m_xAspectRatio3D = xOuterGroup_Shapes; - bool bAddFloorAndWall = DiagramHelper::isSupportingFloorAndWall( m_xDiagram ); + bool bAddFloorAndWall = m_xDiagram->isSupportingFloorAndWall(); const bool bDoubleSided = false; @@ -456,8 +457,8 @@ void VDiagram::createShapes_3d() aWallCID.clear(); rtl::Reference<Svx3DSceneObject> xWallGroup_Shapes = ShapeFactory::createGroup3D( xOuterGroup_Shapes, aWallCID ); - CuboidPlanePosition eLeftWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeftWall( uno::Reference< beans::XPropertySet >( m_xDiagram, uno::UNO_QUERY ) ) ); - CuboidPlanePosition eBackWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBackWall( uno::Reference< beans::XPropertySet >( m_xDiagram, uno::UNO_QUERY ) ) ); + CuboidPlanePosition eLeftWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeftWall( m_xDiagram ) ); + CuboidPlanePosition eBackWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBackWall( m_xDiagram ) ); //add left wall { @@ -519,27 +520,25 @@ void VDiagram::createShapes_3d() try { - uno::Reference< beans::XPropertySet > xSourceProp( m_xDiagram, uno::UNO_QUERY_THROW ); - //perspective { //ignore distance and focal length from file format and model completely //use vrp only to indicate the distance of the camera and thus influence the perspective m_xOuterGroupShape->setPropertyValue( UNO_NAME_3D_SCENE_DISTANCE, uno::Any( - static_cast<sal_Int32>(ThreeDHelper::getCameraDistance( xSourceProp )))); + static_cast<sal_Int32>(m_xDiagram->getCameraDistance()))); m_xOuterGroupShape->setPropertyValue( UNO_NAME_3D_SCENE_PERSPECTIVE, - xSourceProp->getPropertyValue( UNO_NAME_3D_SCENE_PERSPECTIVE)); + m_xDiagram->getPropertyValue( UNO_NAME_3D_SCENE_PERSPECTIVE)); } //light { m_xOuterGroupShape->setPropertyValue( UNO_NAME_3D_SCENE_SHADE_MODE, - xSourceProp->getPropertyValue( UNO_NAME_3D_SCENE_SHADE_MODE)); + m_xDiagram->getPropertyValue( UNO_NAME_3D_SCENE_SHADE_MODE)); m_xOuterGroupShape->setPropertyValue( UNO_NAME_3D_SCENE_AMBIENTCOLOR, - xSourceProp->getPropertyValue( UNO_NAME_3D_SCENE_AMBIENTCOLOR)); + m_xDiagram->getPropertyValue( UNO_NAME_3D_SCENE_AMBIENTCOLOR)); m_xOuterGroupShape->setPropertyValue( UNO_NAME_3D_SCENE_TWO_SIDED_LIGHTING, - xSourceProp->getPropertyValue( UNO_NAME_3D_SCENE_TWO_SIDED_LIGHTING)); - lcl_setLightSources( xSourceProp, m_xOuterGroupShape ); + m_xDiagram->getPropertyValue( UNO_NAME_3D_SCENE_TWO_SIDED_LIGHTING)); + lcl_setLightSources( m_xDiagram, m_xOuterGroupShape ); } //rotation @@ -583,7 +582,7 @@ void VDiagram::createShapes_3d() ShapeFactory::createStripe(xOuterGroup_Shapes, aStripe , xFloorProp, PropertyMapper::getPropertyNameMapForFillAndLineProperties(), bDoubleSided ); - CuboidPlanePosition eBottomPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBottom( uno::Reference< beans::XPropertySet >( m_xDiagram, uno::UNO_QUERY ) ) ); + CuboidPlanePosition eBottomPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBottom( m_xDiagram ) ); if( !bAddFloorAndWall || (eBottomPos!=CuboidPlanePosition_Bottom) ) { //we always need this object as dummy object for correct scene dimensions |