slideshow: initial work on "honeycomb" transition (incomplete)

Change-Id: I4a46f7f1ec289f96f9fd1b849317b7548ac29383
This commit is contained in:
Tomaž Vajngerl
2015-11-16 21:39:08 +01:00
parent 8b34be0852
commit 97972153d0
5 changed files with 80 additions and 2 deletions

View File

@@ -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">

View File

@@ -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>

View File

@@ -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;

View File

@@ -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();

View File

@@ -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();