[Libreoffice-commits] core.git: officecfg/registry sd/xml slideshow/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Mon Nov 16 12:42:30 PST 2015


 officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu           |   13 ++
 sd/xml/transitions-ogl.xml                                             |    3 
 slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx   |   57 ++++++++++
 slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx   |    5 
 slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx |    4 
 5 files changed, 80 insertions(+), 2 deletions(-)

New commits:
commit 97972153d0e221cd38e663a041f6a08752c0463c
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Mon Nov 16 21:39:08 2015 +0100

    slideshow: initial work on "honeycomb" transition (incomplete)
    
    Change-Id: I4a46f7f1ec289f96f9fd1b849317b7548ac29383

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu
index f0fe30e..36fbade 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu
@@ -1613,6 +1613,14 @@
           <value xml:lang="en-US">Glitter</value>
         </prop>
       </node>
+      <node oor:name="honeycomb" oor:op="replace">
+        <prop oor:name="Group" oor:type="xs:string">
+          <value>exciting</value>
+        </prop>
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Honeycomb</value>
+        </prop>
+      </node>
     </node>
     <node oor:name="TransitionVariants">
       <node oor:name="plain" oor:op="replace">
@@ -2361,6 +2369,11 @@
           <value>glitter</value>
         </prop>
       </node>
+      <node oor:name="honeycomb" oor:op="replace">
+        <prop oor:name="Set" oor:type="xs:string">
+          <value>honeycomb</value>
+        </prop>
+      </node>
     </node>
   </node>
   <node oor:name="Presets">
diff --git a/sd/xml/transitions-ogl.xml b/sd/xml/transitions-ogl.xml
index d149c21..b145f10 100644
--- a/sd/xml/transitions-ogl.xml
+++ b/sd/xml/transitions-ogl.xml
@@ -68,6 +68,9 @@
   <anim:par pres:preset-id="glitter">
   <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="diamond"/>
  </anim:par>
+ <anim:par pres:preset-id="honeycomb">
+  <anim:transitionFilter smil:type="miscShapeWipe" smil:subtype="heart"/>
+ </anim:par>
  <anim:par pres:preset-id="zoom-rotate-in">
   <anim:transitionFilter smil:type="zoom" smil:subtype="rotateIn"/>
  </anim:par>
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
index f696ecb..72427ab 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
@@ -1918,6 +1918,63 @@ std::shared_ptr<OGLTransitionImpl> makeGlitter()
     return makeSimpleTransition(aLeavingSlide, aEnteringSlide);
 }
 
+std::shared_ptr<OGLTransitionImpl> makeHoneycomb()
+{
+    TransitionSettings aSettings;
+
+    const int NX = 15;
+    const int NY = NX * 4 / 3;
+
+    Primitives_t aLeavingSlide;
+    Primitives_t aEnteringSlide;
+
+    for (int y = 0; y < NY+2; y+=2)
+    {
+        for (int x = 0; x < NX+2; x+=2)
+        {
+            Primitive aHexagon;
+
+            if (y % 4 == 0)
+            {
+                aHexagon.pushTriangle(vec(x-1, y-1, NX, NY), vec(x,   y-2, NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.pushTriangle(vec(x,   y-2, NX, NY), vec(x+1, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.pushTriangle(vec(x+1, y-1, NX, NY), vec(x+1, y,   NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.pushTriangle(vec(x+1, y,   NX, NY), vec(x,   y+1, NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.pushTriangle(vec(x,   y+1, NX, NY), vec(x-1, y,   NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.pushTriangle(vec(x-1, y,   NX, NY), vec(x-1, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+            }
+            else
+            {
+                aHexagon.pushTriangle(vec(x-2, y-1, NX, NY), vec(x-1, y-2, NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.pushTriangle(vec(x-1, y-2, NX, NY), vec(x,   y-1, NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.pushTriangle(vec(x,   y-1, NX, NY), vec(x,   y,   NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.pushTriangle(vec(x,   y,   NX, NY), vec(x-1, y+1, NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.pushTriangle(vec(x-1, y+1, NX, NY), vec(x-2, y,   NX, NY), vec(x, y+0.5, NX, NY));
+                aHexagon.pushTriangle(vec(x-2, y,   NX, NY), vec(x-2, y-1, NX, NY), vec(x, y+0.5, NX, NY));
+            }
+
+            float fRandom = comphelper::rng::uniform_real_distribution(0.0, std::nextafter(1.0, DBL_MAX));
+
+            aHexagon.Operations.push_back(makeSRotate(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), 90 , true, 0.0, 1.0));
+            aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 7), true, 0.0, fRandom));
+            aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 100), false, fRandom, 1.0));
+
+            aLeavingSlide.push_back(aHexagon);
+
+            aHexagon.Operations.clear();
+            aHexagon.Operations.push_back(makeSRotate(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), -90 , false, -1, 0.0));
+            aHexagon.Operations.push_back(makeSRotate(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), 90 , true, 0.0, 1.0));
+            aHexagon.Operations.push_back(makeSTranslate(glm::vec3(-100, 0, 0),false, -1, 0));
+            aHexagon.Operations.push_back(makeSTranslate(glm::vec3(100, 0, -7),false, 0.0, 1));
+            aHexagon.Operations.push_back(makeSTranslate(glm::vec3 (0, 0, 7), true, 0.0, 1));
+
+            aEnteringSlide.push_back(aHexagon);
+        }
+    }
+
+    return makeSimpleTransition(aLeavingSlide, aEnteringSlide, aSettings);
+}
+
 std::shared_ptr<OGLTransitionImpl> makeNewsflash()
 {
     Primitive Slide;
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
index f7e2665..a14694f 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
@@ -237,10 +237,11 @@ std::shared_ptr<OGLTransitionImpl> makeDissolve();
 std::shared_ptr<OGLTransitionImpl> makeVortex();
 std::shared_ptr<OGLTransitionImpl> makeRipple();
 std::shared_ptr<OGLTransitionImpl> makeGlitter();
+std::shared_ptr<OGLTransitionImpl> makeHoneycomb();
 std::shared_ptr<OGLTransitionImpl> makeNewsflash();
 
-/** 2D replacements
-    */
+/** 2D replacements */
+
 std::shared_ptr<OGLTransitionImpl> makeDiamond();
 std::shared_ptr<OGLTransitionImpl> makeFadeSmoothly();
 std::shared_ptr<OGLTransitionImpl> makeFadeThroughBlack();
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index 04c86b1..7be1acf 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -1434,6 +1434,7 @@ public:
                 case animations::TransitionSubType::HORIZONTAL:         //  14
                 case animations::TransitionSubType::DIAMOND:            //  26
                 case animations::TransitionSubType::CIRCLE:             //  27
+                case animations::TransitionSubType::HEART:              //  31
                 case animations::TransitionSubType::FANOUTHORIZONTAL:   //  55
                 case animations::TransitionSubType::ACROSS:             // 108
                     return sal_True;
@@ -1524,6 +1525,9 @@ public:
                 case animations::TransitionSubType::DIAMOND:
                     pTransition = makeGlitter();
                     break;
+                case animations::TransitionSubType::HEART:
+                    pTransition = makeHoneycomb();
+                    break;
                 }
         } else if( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::CROSSFADE ) {
             pTransition = makeFadeSmoothly();


More information about the Libreoffice-commits mailing list