diff options
author | Ingrid Halama <iha@openoffice.org> | 2003-12-15 18:30:38 +0000 |
---|---|---|
committer | Ingrid Halama <iha@openoffice.org> | 2003-12-15 18:30:38 +0000 |
commit | 44c476d42406ddf5b96212d225002b83b8145f04 (patch) | |
tree | 3d034069b5fdd841307759cf740d18b202862a71 /chart2 | |
parent | fe3dc8b4d1670d6242d4d018b2390c294f25c8e2 (diff) |
moved method getTransformedClip(Double)Rect from AreaChart AreaPositionHelper
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/inc/PlottingPositionHelper.hxx | 9 | ||||
-rw-r--r-- | chart2/source/view/main/PlottingPositionHelper.cxx | 44 |
2 files changed, 49 insertions, 4 deletions
diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx b/chart2/source/view/inc/PlottingPositionHelper.hxx index ea4aac8074a1..5f7f90107b9d 100644 --- a/chart2/source/view/inc/PlottingPositionHelper.hxx +++ b/chart2/source/view/inc/PlottingPositionHelper.hxx @@ -2,9 +2,9 @@ * * $RCSfile: PlottingPositionHelper.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: iha $ $Date: 2003-11-19 13:13:28 $ + * last change: $Author: iha $ $Date: 2003-12-15 19:30:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,6 +61,8 @@ #ifndef _CHART2_PLOTTINGPOSITIONHELPER_HXX #define _CHART2_PLOTTINGPOSITIONHELPER_HXX +#include "Clipping.hxx" + #ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITSCALEDATA_HPP_ #include <drafts/com/sun/star/chart2/ExplicitScaleData.hpp> #endif @@ -120,6 +122,9 @@ public: void getScreenValuesForMinimum( ::com::sun::star::uno::Sequence< double >& rSeq ) const; void getScreenValuesForMaximum( ::com::sun::star::uno::Sequence< double >& rSeq ) const; + Rectangle getTransformedClipRect() const; + DoubleRectangle getTransformedClipDoubleRect() const; + protected: //member ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::chart2::ExplicitScaleData > m_aScales; diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx index 5ce69c7f4968..b41f1d8127d3 100644 --- a/chart2/source/view/main/PlottingPositionHelper.cxx +++ b/chart2/source/view/main/PlottingPositionHelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: PlottingPositionHelper.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: iha $ $Date: 2003-12-04 15:56:46 $ + * last change: $Author: iha $ $Date: 2003-12-15 19:30:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -196,6 +196,46 @@ void PlottingPositionHelper::getLogicMaximum( ::com::sun::star::uno::Sequence< d rSeq[2] = this->getLogicMaxZ(); } +Rectangle PlottingPositionHelper::getTransformedClipRect() const +{ + DoubleRectangle aDoubleRect( this->getTransformedClipDoubleRect() ); + + Rectangle aRet( static_cast<long>(aDoubleRect.Left) + , static_cast<long>(aDoubleRect.Top) + , static_cast<long>(aDoubleRect.Right) + , static_cast<long>(aDoubleRect.Bottom) ); + return aRet; +} +DoubleRectangle PlottingPositionHelper::getTransformedClipDoubleRect() const +{ + //get logic clip values: + double MinX = getLogicMinX(); + double MinY = getLogicMinY(); + double MinZ = getLogicMinZ(); + double MaxX = getLogicMaxX(); + double MaxY = getLogicMaxY(); + double MaxZ = getLogicMaxZ(); + + //apply scaling + doLogicScaling( &MinX, &MinY, &MinZ ); + doLogicScaling( &MaxX, &MaxY, &MaxZ); + + drawing::Position3D aMimimum( MinX, MinY, MinZ); + drawing::Position3D aMaximum( MaxX, MaxY, MaxZ); + + //transform to screen coordinates + aMimimum = SequenceToPosition3D( getTransformationLogicToScene() + ->transform( Position3DToSequence(aMimimum) ) ); + aMaximum = SequenceToPosition3D( getTransformationLogicToScene() + ->transform( Position3DToSequence(aMaximum) ) ); + + DoubleRectangle aRet( aMimimum.PositionX + , aMaximum.PositionY + , aMaximum.PositionX + , aMimimum.PositionY ); + return aRet; +} + //............................................................................. } //namespace chart //............................................................................. |