summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-11-16 21:39:08 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-11-16 21:41:50 +0100
commit97972153d0e221cd38e663a041f6a08752c0463c (patch)
treec2e24958179e024b12a696aee46632d0bbc66776
parent8b34be0852d8c8ae350d192980d825211e37f7ee (diff)
slideshow: initial work on "honeycomb" transition (incomplete)
Change-Id: I4a46f7f1ec289f96f9fd1b849317b7548ac29383
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu13
-rw-r--r--sd/xml/transitions-ogl.xml3
-rw-r--r--slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx57
-rw-r--r--slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx5
-rw-r--r--slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx4
5 files changed, 80 insertions, 2 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Effects.xcu
index f0fe30ec1704..36fbadecb5c7 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 d149c21b9abb..b145f1079750 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 f696ecb2cf4c..72427ab35ad0 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 f7e26651d517..a14694fbb1f4 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 04c86b13260c..7be1acfc3507 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();