summaryrefslogtreecommitdiff
path: root/slideshow
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 /slideshow
parent8b34be0852d8c8ae350d192980d825211e37f7ee (diff)
slideshow: initial work on "honeycomb" transition (incomplete)
Change-Id: I4a46f7f1ec289f96f9fd1b849317b7548ac29383
Diffstat (limited to 'slideshow')
-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
3 files changed, 64 insertions, 2 deletions
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();