[Libreoffice-commits] core.git: Branch 'feature/chart-opengl2' - chart2/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Jan 1 22:52:36 PST 2014


 chart2/source/view/inc/DummyXShape.hxx   |    2 
 chart2/source/view/main/DummyXShape.cxx  |   17 +++++++
 chart2/source/view/main/OpenGLRender.cxx |   68 -------------------------------
 chart2/source/view/main/OpenGLRender.hxx |    2 
 4 files changed, 18 insertions(+), 71 deletions(-)

New commits:
commit e84b56ab535548016eb1e78ea4fe5ea14dbc67f7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Jan 2 09:50:49 2014 +0100

    integrate the rectangle shapes into the rendering
    
     # Changes to be committed:
    
    Change-Id: I76f2597d3d92e65a3c9116a24f941896baeb5fb9

diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index a2faf60..01cfe28 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -367,6 +367,8 @@ public:
     DummyRectangle(const awt::Size& rSize);
     DummyRectangle(const awt::Size& rSize, const awt::Point& rPoint, const tNameSequence& rNames,
             const tAnySequence& rValues );
+
+    virtual void render() SAL_OVERRIDE;
 };
 
 class DummyText : public DummyXShape
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 8743327..de11333 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -462,7 +462,7 @@ void DummyLine2D::render()
         sal_uInt8 B = (nColorValue & 0x000000FF);
         pChart->m_GLRender.SetLine2DColor(R, G, B);
 
-        SAL_WARN("chart2.opengl", "*colorvalue = " << nColorValue << ", R = " << R << ", G = " << G << ", B = " << B);
+        SAL_WARN("chart2.opengl", "*colorvalue = " << nColorValue << ", R = " << (int)R << ", G = " << (int)G << ", B = " << (int)B);
     }
     else
         SAL_WARN("chart2.opengl", "no line color set");
@@ -513,6 +513,21 @@ DummyRectangle::DummyRectangle(const awt::Size& rSize, const awt::Point& rPoint,
     setProperties(rNames, rValues, maProperties);
 }
 
+void DummyRectangle::render()
+{
+    debugProperties(maProperties);
+    DummyChart* pChart = getRootShape();
+    std::map< OUString, uno::Any >::const_iterator itr = maProperties.find("FillColor");
+    if(itr != maProperties.end())
+    {
+        uno::Any co =  itr->second;
+        sal_Int32 nColorValue = co.get<sal_Int32>();
+        pChart->m_GLRender.SetColor(nColorValue);
+    }
+    pChart->m_GLRender.RectangleShapePoint(maPosition.X, maPosition.Y, maSize.Width, maSize.Height);
+    pChart->m_GLRender.RenderRectangleShape();
+}
+
 DummyText::DummyText(const OUString& rText, const tNameSequence& rNames,
         const tAnySequence& rValues, const uno::Any& rTrans ):
     maText(rText),
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index d48146d..a366360 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -1247,74 +1247,6 @@ void OpenGLRender::SetTransparency(sal_uInt32 transparency)
     m_2DColor = glm::vec4(m_2DColor.r, m_2DColor.g, m_2DColor.b, m_fAlpha);
 }
 
-int OpenGLRender::ProcessRectangle(uno::Reference< drawing::XShape > &xShape)
-{
-    //Get position
-    awt::Point aPos( xShape->getPosition() );
-    awt::Size aSize( xShape->getSize() );
-    //Set Rectangle Pos
-    uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY );
-    //Get the back ground color
-    uno::Any co =  xProp->getPropertyValue(UNO_NAME_FILLCOLOR);
-    long *colorvalue = (long*)co.getValue();
-    SetColor(*colorvalue);
-
-    uno::Any trans =  xProp->getPropertyValue(UNO_NAME_FILL_TRANSPARENCE);
-    long *transparency = (long*)trans.getValue();
-    SetTransparency((*transparency) & 0xFF);
-    SetTransparency(0xFF);
-    RectangleShapePoint(aPos.X, aPos.Y, aSize.Width, aSize.Height);
-#if 0
-    com::sun::star::uno::Sequence<com::sun::star::beans::Property> Sequenceproperty = xProp->getPropertySetInfo()->getProperties();
-    com::sun::star::beans::Property* Propertyarr = Sequenceproperty.getArray();
-    int count = Sequenceproperty.getLength();
-    printf("Property length:%d\n",count);
-    for(int i=0;i<count;i++)
-    {
-
-        wprintf(L"item %d,name:%s", i,Propertyarr[i].Name.getStr());
-        com::sun::star::uno::Type t = Propertyarr[i].Type;
-        ::rtl::OUString strtypename = t.getTypeName();
-        sal_Unicode * typeName = (sal_Unicode *)strtypename.getStr();
-        wprintf(L",Type:%s ", typeName);
-        com::sun::star::uno::TypeClass typeclass = t.getTypeClass();
-        com::sun::star::uno::Any value = xProp->getPropertyValue(Propertyarr[i].Name);
-        if(strtypename.equals(OUString(L"string")))
-        {
-            ::rtl::OUString * strvalue = (::rtl::OUString *)value.getValue();
-           wprintf(L",Value:%s \n", strvalue->getStr());
-        }
-        else if(strtypename.equals(OUString(L"short")))
-        {
-            short * shortvalue = (short*)value.getValue();
-            printf(",Value:%d \n",*shortvalue);
-        }
-        else if(strtypename.equals(OUString(L"long")))
-        {
-            long * longvalue = (long*)value.getValue();
-            printf(",Value:%d \n",*longvalue);
-        }
-        else if(strtypename.equals(OUString(L"boolean")))
-        {
-            short * bvalue = (short*)value.getValue();
-            if(*bvalue==0)
-                printf(",Value:false \n");
-            else
-                printf(",Value:true \n");
-        }
-        else
-        {
-            printf(",Value:object \n");
-        }
-    }
-    printf("\n");
-#endif
-    //render rectangle
-    RenderRectangleShape();
-    m_fZStep += 0.01f;
-    return 0;
-}
-
 int OpenGLRender::RectangleShapePoint(float x, float y, float directionX, float directionY)
 {
     //check whether to create the circle data
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index a5e8537..f0fcb4a 100644
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -161,8 +161,6 @@ public:
 
 
     void SetTransparency(sal_uInt32 transparency);
-    int ProcessRectangle(com::sun::star::uno::Reference<
-            com::sun::star::drawing::XShape > &xShape);
     int RenderRectangleShape();
     int RectangleShapePoint(float x, float y, float directionX, float directionY);
 


More information about the Libreoffice-commits mailing list