summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorIngrid Halama <iha@openoffice.org>2004-01-06 18:41:01 +0000
committerIngrid Halama <iha@openoffice.org>2004-01-06 18:41:01 +0000
commit40f0e9899459c3eed07f4c2f7a6c58b5ba4867f3 (patch)
tree631996d8f46a30897a4ad458958482da138e02e4 /chart2
parent62bec995a23dc50e94b59728291422519a6f1ecd (diff)
added method transformSceneToScreenPosition
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/inc/PlotterBase.hxx8
-rw-r--r--chart2/source/view/main/PlotterBase.cxx24
2 files changed, 28 insertions, 4 deletions
diff --git a/chart2/source/view/inc/PlotterBase.hxx b/chart2/source/view/inc/PlotterBase.hxx
index 09aa4ff6f822..00e0d844e111 100644
--- a/chart2/source/view/inc/PlotterBase.hxx
+++ b/chart2/source/view/inc/PlotterBase.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: PlotterBase.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: bm $ $Date: 2003-12-15 10:15:33 $
+ * last change: $Author: iha $ $Date: 2004-01-06 19:40:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -161,6 +161,10 @@ protected: //methods
::com::sun::star::drawing::XShapes >& xTarget
, ::rtl::OUString rName=::rtl::OUString() );
+ ::com::sun::star::awt::Point transformSceneToScreenPosition(
+ const ::com::sun::star::drawing::Position3D& rScenePosition3D ) const;
+
+
protected: //member
::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes > m_xLogicTarget;
diff --git a/chart2/source/view/main/PlotterBase.cxx b/chart2/source/view/main/PlotterBase.cxx
index 3ff172dfb5d6..126e1efdb93c 100644
--- a/chart2/source/view/main/PlotterBase.cxx
+++ b/chart2/source/view/main/PlotterBase.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: PlotterBase.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: iha $ $Date: 2004-01-05 15:31:51 $
+ * last change: $Author: iha $ $Date: 2004-01-06 19:41:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -149,6 +149,26 @@ uno::Reference< drawing::XShapes > PlotterBase::createGroupShape(
}
}
+awt::Point PlotterBase::transformSceneToScreenPosition( const drawing::Position3D& rScenePosition3D ) const
+{
+ //@todo would like to have a cheaper method to do this transformation
+ awt::Point aScreenPoint( rScenePosition3D.PositionX, rScenePosition3D.PositionY );
+
+ //transformation from scene to screen (only neccessary for 3D):
+ if(3==m_nDimension)
+ {
+ //create 3D anchor shape
+ tPropertyNameMap aDummyPropertyNameMap;
+ uno::Reference< drawing::XShape > xShape3DAnchor = m_pShapeFactory->createCube( m_xLogicTarget
+ , DataPointGeometry( rScenePosition3D,drawing::Direction3D(1,1,1) )
+ , 0, aDummyPropertyNameMap);
+ //get 2D position from xShape3DAnchor
+ aScreenPoint = xShape3DAnchor->getPosition();
+ m_xLogicTarget->remove(xShape3DAnchor);
+ }
+ return aScreenPoint;
+}
+
/*
//-----------------------------------------------------------------
// chart2::XPlotter