diff options
-rw-r--r-- | chart2/source/view/diagram/VDiagram.cxx | 47 | ||||
-rw-r--r-- | chart2/source/view/inc/ViewDefines.hxx | 1 |
2 files changed, 8 insertions, 40 deletions
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx index 5e0db2644cc5..655961c75e2a 100644 --- a/chart2/source/view/diagram/VDiagram.cxx +++ b/chart2/source/view/diagram/VDiagram.cxx @@ -646,44 +646,13 @@ void VDiagram::createShapes_3d() if( m_xDiagram.is() ) xFloorProp=uno::Reference< beans::XPropertySet >( m_xDiagram->getFloor()); - uno::Reference< drawing::XShape > xShape( - m_xShapeFactory->createInstance( C2U( - "com.sun.star.drawing.Shape3DExtrudeObject") ), uno::UNO_QUERY ); - xOuterGroup_Shapes->add(xShape); - uno::Reference< beans::XPropertySet > xShapeProp( xShape, uno::UNO_QUERY ); - if( xShapeProp.is()) - { - //depth - xShapeProp->setPropertyValue( C2U( UNO_NAME_3D_EXTRUDE_DEPTH ) - , uno::makeAny((sal_Int32)FLOOR_THICKNESS) ); - //PercentDiagonal - xShapeProp->setPropertyValue( C2U( UNO_NAME_3D_PERCENT_DIAGONAL ) - , uno::makeAny( sal_Int32(0) ) ); - - drawing::Direction3D aSize(FIXED_SIZE_FOR_3D_CHART_VOLUME,FIXED_SIZE_FOR_3D_CHART_VOLUME,FLOOR_THICKNESS); - - //Polygon - drawing::PolyPolygonShape3D aPoly; - AddPointToPoly( aPoly, drawing::Position3D(0,0,0) ); - AddPointToPoly( aPoly, drawing::Position3D(FIXED_SIZE_FOR_3D_CHART_VOLUME,0,0) ); - AddPointToPoly( aPoly, drawing::Position3D(FIXED_SIZE_FOR_3D_CHART_VOLUME,FIXED_SIZE_FOR_3D_CHART_VOLUME,0) ); - AddPointToPoly( aPoly, drawing::Position3D(0,FIXED_SIZE_FOR_3D_CHART_VOLUME,0) ); - AddPointToPoly( aPoly, drawing::Position3D(0,0,0) ); - xShapeProp->setPropertyValue( C2U( UNO_NAME_3D_POLYPOLYGON3D ), uno::makeAny( aPoly ) ); - - //Matrix for position - { - ::basegfx::B3DHomMatrix aM; - aM.rotate(F_PI/2.0,0.0,0.0); - aM.translate(0.0,FLOOR_THICKNESS, 0.0); - drawing::HomogenMatrix aHM = B3DHomMatrixToHomogenMatrix(aM); - E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene( m_xOuterGroupShape )); - xShapeProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) - , uno::makeAny(aHM) ); - } + Stripe aStripe( drawing::Position3D(0,0,0) + , drawing::Direction3D(FIXED_SIZE_FOR_3D_CHART_VOLUME,0,0) + , drawing::Direction3D(0,0,FIXED_SIZE_FOR_3D_CHART_VOLUME) ); - PropertyMapper::setMappedProperties( xShapeProp, xFloorProp, PropertyMapper::getPropertyNameMapForFillAndLineProperties() ); - } + uno::Reference< drawing::XShape > xShape = + m_pShapeFactory->createStripe(xOuterGroup_Shapes, aStripe + , xFloorProp, PropertyMapper::getPropertyNameMapForFillAndLineProperties(), true ); CuboidPlanePosition eBottomPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBottom( uno::Reference< beans::XPropertySet >( m_xDiagram, uno::UNO_QUERY ) ) ); if( !bAddFloorAndWall || (CuboidPlanePosition_Bottom!=eBottomPos) ) @@ -712,11 +681,11 @@ void VDiagram::createShapes_3d() try { double fXScale = (FIXED_SIZE_FOR_3D_CHART_VOLUME -GRID_TO_WALL_DISTANCE) /FIXED_SIZE_FOR_3D_CHART_VOLUME; - double fYScale = (FIXED_SIZE_FOR_3D_CHART_VOLUME -FLOOR_THICKNESS-GRID_TO_WALL_DISTANCE ) /FIXED_SIZE_FOR_3D_CHART_VOLUME; + double fYScale = (FIXED_SIZE_FOR_3D_CHART_VOLUME -GRID_TO_WALL_DISTANCE) /FIXED_SIZE_FOR_3D_CHART_VOLUME; double fZScale = (FIXED_SIZE_FOR_3D_CHART_VOLUME -GRID_TO_WALL_DISTANCE) /FIXED_SIZE_FOR_3D_CHART_VOLUME; ::basegfx::B3DHomMatrix aM; - aM.translate(GRID_TO_WALL_DISTANCE/fXScale, (FLOOR_THICKNESS+GRID_TO_WALL_DISTANCE)/fYScale, GRID_TO_WALL_DISTANCE/fZScale); + aM.translate(GRID_TO_WALL_DISTANCE/fXScale, GRID_TO_WALL_DISTANCE/fYScale, GRID_TO_WALL_DISTANCE/fZScale); aM.scale( fXScale, fYScale, fZScale ); E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene( m_xOuterGroupShape )); xShapeProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) diff --git a/chart2/source/view/inc/ViewDefines.hxx b/chart2/source/view/inc/ViewDefines.hxx index 7e94db29baef..0bebf86c8142 100644 --- a/chart2/source/view/inc/ViewDefines.hxx +++ b/chart2/source/view/inc/ViewDefines.hxx @@ -40,7 +40,6 @@ namespace chart #define FIXED_SIZE_FOR_3D_CHART_VOLUME (10000.0) //There needs to be a little distance betweengrid lines and walls in 3D, otherwise the lines are partly hidden by the walls #define GRID_TO_WALL_DISTANCE (1.0) -#define FLOOR_THICKNESS (100.0) const double ZDIRECTION = 1.0; const sal_Int32 AXIS2D_TICKLENGTH = 150;//value like in old chart |