summaryrefslogtreecommitdiff
path: root/chart2/source/view/main/ChartView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/view/main/ChartView.cxx')
-rw-r--r--chart2/source/view/main/ChartView.cxx250
1 files changed, 0 insertions, 250 deletions
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 566f84244c72..a15d6d020afb 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -51,9 +51,6 @@
#include <ExplicitCategoriesProvider.hxx>
#include <defines.hxx>
#include <unonames.hxx>
-#if HAVE_FEATURE_OPENGL
-#include <GL3DBarChart.hxx>
-#endif
#include <editeng/frmdiritem.hxx>
#include <rtl/uuid.h>
#include <tools/globname.hxx>
@@ -70,10 +67,6 @@
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
#include <svx/unofill.hxx>
-#include <vcl/openglwin.hxx>
-#if HAVE_FEATURE_OPENGL
-#include <vcl/opengl/OpenGLContext.hxx>
-#endif
#include <drawinglayer/XShapeDumper.hxx>
#include <time.h>
@@ -1056,102 +1049,6 @@ struct CreateShapeParam2D
mbUseFixedInnerSize(false) {}
};
-class GL2DRenderer : public IRenderer
-{
-public:
- explicit GL2DRenderer(ChartView* pView);
- virtual ~GL2DRenderer() override;
-
- virtual void update() override;
- virtual void clickedAt(const Point& rPos, sal_uInt16 nButton) override;
- virtual void mouseDragMove(const Point& rBegin, const Point& rEnd, sal_uInt16 nButton) override;
- virtual void scroll(long nDelta) override;
- virtual void contextDestroyed() override;
-
-#if HAVE_FEATURE_OPENGL
- const OpenGLWindow* getOpenGLWindow() const;
- void updateOpenGLWindow();
-#endif
-private:
- ChartView* mpView;
- bool mbContextDestroyed;
-#if HAVE_FEATURE_OPENGL
- VclPtr<OpenGLWindow> mpWindow;
-#endif
-};
-
-GL2DRenderer::GL2DRenderer(ChartView* pView)
- : mpView(pView)
- , mbContextDestroyed(false)
-#if HAVE_FEATURE_OPENGL
- , mpWindow(mpView->mrChartModel.getOpenGLWindow())
-#endif
-{
-}
-
-GL2DRenderer::~GL2DRenderer()
-{
-#if HAVE_FEATURE_OPENGL
- SolarMutexGuard g;
- if(!mbContextDestroyed && mpWindow)
- mpWindow->setRenderer(nullptr);
- mpWindow.reset();
-#endif
-}
-
-void GL2DRenderer::update()
-{
- mpView->update();
- mpView->render();
-}
-
-void GL2DRenderer::clickedAt(const Point&, sal_uInt16 )
-{
-}
-
-void GL2DRenderer::mouseDragMove(const Point& , const Point& , sal_uInt16 )
-{
-}
-
-void GL2DRenderer::scroll(long )
-{
-}
-
-void GL2DRenderer::contextDestroyed()
-{
- mbContextDestroyed = true;
-}
-
-#if HAVE_FEATURE_OPENGL
-
-const OpenGLWindow* GL2DRenderer::getOpenGLWindow() const
-{
- return mpWindow;
-}
-
-void GL2DRenderer::updateOpenGLWindow()
-{
- if(mbContextDestroyed)
- return;
-
- OpenGLWindow* pWindow = mpView->mrChartModel.getOpenGLWindow();
- if(pWindow != mpWindow)
- {
- if(mpWindow)
- {
- mpWindow->setRenderer(nullptr);
- }
-
- if(pWindow)
- {
- pWindow->setRenderer(this);
- }
- }
- mpWindow = pWindow;
-}
-
-#endif
-
const uno::Sequence<sal_Int8>& ExplicitValueProvider::getUnoTunnelId()
{
return theExplicitValueProviderUnoTunnelId::get().getSeq();
@@ -1193,7 +1090,6 @@ ChartView::ChartView(
, m_nScaleYDenominator(1)
, m_bSdrViewIsInEditMode(false)
, m_aResultingDiagramRectangleExcludingAxes(0,0,0,0)
- , mp2DRenderer(new GL2DRenderer(this))
{
init();
}
@@ -2577,19 +2473,6 @@ void ChartView::impl_refreshAddIn()
}
}
-/**
- * Is it a real 3D chart with a true 3D scene or a 3D chart in a 2D scene.
- */
-bool ChartView::isReal3DChart()
-{
- uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() );
-#if HAVE_FEATURE_OPENGL
- return ChartHelper::isGL3DDiagram(xDiagram);
-#else
- return false;
-#endif
-}
-
static const char* envChartDummyFactory = getenv("CHART_DUMMY_FACTORY");
void ChartView::createShapes()
@@ -2630,24 +2513,6 @@ void ChartView::createShapes()
}
pShapeFactory->setPageSize(mxRootShape, aPageSize);
pShapeFactory->clearPage(mxRootShape);
-#if HAVE_FEATURE_OPENGL
-#if HAVE_FEATURE_DESKTOP
- if(isReal3DChart())
- {
- createShapes3D();
- return;
- }
- else
- {
- m_pGL3DPlotter.reset();
-
- // hide OpenGL window for now in normal charts
- OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
- if(pWindow && !envChartDummyFactory)
- pWindow->Show(false);
- }
-#endif
-#endif
createShapes2D(aPageSize);
@@ -2664,27 +2529,6 @@ void ChartView::createShapes()
}
}
-void ChartView::render()
-{
-#if HAVE_FEATURE_OPENGL
- if(!isReal3DChart())
- {
- AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory);
- OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
- if(pWindow)
- pWindow->setRenderer(mp2DRenderer.get());
- bool bRender = pShapeFactory->preRender(mxRootShape, pWindow);
- if(bRender)
- {
- pShapeFactory->render(mxRootShape, pWindow != mp2DRenderer->getOpenGLWindow());
- pShapeFactory->postRender(pWindow);
- }
- }
-#else
- (void) this;
-#endif
-}
-
// util::XEventListener (base of XCloseListener)
void SAL_CALL ChartView::disposing( const lang::EventObject& /* rSource */ )
{
@@ -2721,11 +2565,6 @@ void ChartView::impl_updateView( bool bCheckLockedCtrler )
//create chart view
{
-#if HAVE_FEATURE_OPENGL
- OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
- if (pWindow && ChartHelper::isGL3DDiagram(mrChartModel.getFirstDiagram()))
- pWindow->Initialize();
-#endif
m_bViewDirty = false;
m_bViewUpdatePending = false;
createShapes();
@@ -3234,8 +3073,6 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
//cleanup: remove all empty group shapes to avoid grey border lines:
lcl_removeEmptyGroupShapes( mxRootShape );
- render();
-
if(maTimeBased.bTimeBased && maTimeBased.nFrame % 60 == 0)
{
// create copy of the data for next frame
@@ -3309,93 +3146,6 @@ bool ChartView::createAxisTitleShapes2D( CreateShapeParam2D& rParam, const css::
return true;
}
-void ChartView::createShapes3D()
-{
-#if HAVE_FEATURE_OPENGL
- OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
- if(!pWindow)
- return;
-
- if( pWindow->GetSizePixel().Width() == 0 || pWindow->GetSizePixel().Height() == 0 )
- {
- awt::Size aPageSize = mrChartModel.getVisualAreaSize( embed::Aspects::MSOLE_CONTENT );
- Size aSize = pWindow->LogicToPixel(Size(aPageSize.Width, aPageSize.Height), MapMode(MapUnit::Map100thMM));
- pWindow->SetSizePixel(aSize);
- }
- pWindow->Show();
- uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() );
- uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY );
- if( !xCooSysContainer.is())
- return;
-
- uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
-
- if (aCooSysList.getLength() != 1)
- // Supporting multiple coordinates in a truly 3D chart (which implies
- // it's a Cartesian coordinate system) is a bit of a challenge, if not
- // impossible.
- return;
-
- uno::Reference<XCoordinateSystem> xCooSys( aCooSysList[0] );
-
- //iterate through all chart types in the current coordinate system
- uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
- OSL_ASSERT( xChartTypeContainer.is());
- if( !xChartTypeContainer.is() )
- return;
-
- uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- if (aChartTypeList.getLength() != 1)
- // Likewise, we can't really support multiple chart types here.
- return;
-
- uno::Reference< XChartType > xChartType( aChartTypeList[0] );
-
- if (!m_pGL3DPlotter)
- {
- m_pGL3DPlotter.reset(new GL3DBarChart(xChartType, pWindow));
- }
- else
- {
- GL3DBarChart* pChart = dynamic_cast<GL3DBarChart*>(m_pGL3DPlotter.get());
- if (pChart)
- pChart->setOpenGLWindow(pWindow);
- }
-
- uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
- OSL_ASSERT( xDataSeriesContainer.is());
- if( !xDataSeriesContainer.is() )
- return;
-
- std::vector<std::unique_ptr<VDataSeries> > aDataSeries;
- uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
- for( sal_Int32 nS = 0; nS < aSeriesList.getLength(); ++nS )
- {
- uno::Reference< XDataSeries > xDataSeries( aSeriesList[nS], uno::UNO_QUERY );
- if(!xDataSeries.is())
- continue;
-
- aDataSeries.push_back(o3tl::make_unique<VDataSeries>(xDataSeries));
- }
-
- std::unique_ptr<ExplicitCategoriesProvider> pCatProvider(new ExplicitCategoriesProvider(xCooSys, mrChartModel));
-
- m_pGL3DPlotter->create3DShapes(aDataSeries, *pCatProvider);
-
- m_pGL3DPlotter->render();
-#endif
-}
-
-#if HAVE_FEATURE_OPENGL
-
-void ChartView::updateOpenGLWindow()
-{
- if(!isReal3DChart())
- mp2DRenderer->updateOpenGLWindow();
-}
-
-#endif
-
} //namespace chart
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *