convert ReverseMethod to scoped enum

and drop unused enumerators
   REVERSEMETHOD_INVERT_SWEEP
   REVERSEMETHOD_SUBTRACT_POLYGON

Change-Id: I11b52d4b32e5f766dfa3bcd69b9c636f4106b7b4
This commit is contained in:
Noel Grandin
2017-02-14 15:42:53 +02:00
parent b3204c541e
commit dd803c6e25
3 changed files with 183 additions and 201 deletions

View File

@@ -65,8 +65,8 @@ namespace slideshow
// perform general transformations _before_ the reverse // perform general transformations _before_ the reverse
// mode changes. This allows the Transition table to be // mode changes. This allows the Transition table to be
// filled more consistently (otherwise, when e.g. rotating // filled more consistently (otherwise, when e.g. rotating
// a clip 90 degrees, the REVERSEMETHOD_FLIP_X becomes // a clip 90 degrees, the ReverseMethod::FlipX becomes
// REVERSEMETHOD_FLIP_Y instead) // ReverseMethod::FlipY instead)
if (rTransitionInfo.mnRotationAngle != 0.0 || if (rTransitionInfo.mnRotationAngle != 0.0 ||
rTransitionInfo.mnScaleX != 1.0 || rTransitionInfo.mnScaleX != 1.0 ||
rTransitionInfo.mnScaleY != 1.0) rTransitionInfo.mnScaleY != 1.0)
@@ -101,34 +101,26 @@ namespace slideshow
"TransitionFactory::TransitionFactory(): Unexpected reverse method" ); "TransitionFactory::TransitionFactory(): Unexpected reverse method" );
break; break;
case TransitionInfo::REVERSEMETHOD_IGNORE: case TransitionInfo::ReverseMethod::Ignore:
break; break;
case TransitionInfo::REVERSEMETHOD_INVERT_SWEEP: case TransitionInfo::ReverseMethod::SubtractAndInvert:
mbForwardParameterSweep = !mbForwardParameterSweep;
break;
case TransitionInfo::REVERSEMETHOD_SUBTRACT_POLYGON:
mbSubtractPolygon = !mbSubtractPolygon;
break;
case TransitionInfo::REVERSEMETHOD_SUBTRACT_AND_INVERT:
mbForwardParameterSweep = !mbForwardParameterSweep; mbForwardParameterSweep = !mbForwardParameterSweep;
mbSubtractPolygon = !mbSubtractPolygon; mbSubtractPolygon = !mbSubtractPolygon;
break; break;
case TransitionInfo::REVERSEMETHOD_ROTATE_180: case TransitionInfo::ReverseMethod::Rotate180:
maStaticTransformation = basegfx::tools::createRotateAroundPoint(0.5, 0.5, M_PI) maStaticTransformation = basegfx::tools::createRotateAroundPoint(0.5, 0.5, M_PI)
* maStaticTransformation; * maStaticTransformation;
break; break;
case TransitionInfo::REVERSEMETHOD_FLIP_X: case TransitionInfo::ReverseMethod::FlipX:
maStaticTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(-1.0, 1.0, 1.0, 0.0) maStaticTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(-1.0, 1.0, 1.0, 0.0)
* maStaticTransformation; * maStaticTransformation;
mbFlip = true; mbFlip = true;
break; break;
case TransitionInfo::REVERSEMETHOD_FLIP_Y: case TransitionInfo::ReverseMethod::FlipY:
maStaticTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(1.0, -1.0, 0.0, 1.0) maStaticTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(1.0, -1.0, 0.0, 1.0)
* maStaticTransformation; * maStaticTransformation;
mbFlip = true; mbFlip = true;

File diff suppressed because it is too large Load Diff

View File

@@ -75,36 +75,26 @@ struct TransitionInfo
the target in the outer area (instead of in the inner the target in the outer area (instead of in the inner
area, as in normal mode). area, as in normal mode).
*/ */
enum ReverseMethod enum class ReverseMethod
{ {
/** Ignore direction attribute altogether /** Ignore direction attribute altogether
(if it has no sensible meaning for this transition) (if it has no sensible meaning for this transition)
*/ */
REVERSEMETHOD_IGNORE, Ignore,
/** Revert by changing the direction of the parameter sweep /** Combination of ReverseMethod::InvertSweep and
(from 1->0 instead of 0->1) ReverseMethod::SubtractPolygon.
*/ */
REVERSEMETHOD_INVERT_SWEEP, SubtractAndInvert,
/** Revert by subtracting the generated polygon from the
target bound rect
*/
REVERSEMETHOD_SUBTRACT_POLYGON,
/** Combination of REVERSEMETHOD_INVERT_SWEEP and
REVERSEMETHOD_SUBTRACT_POLYGON.
*/
REVERSEMETHOD_SUBTRACT_AND_INVERT,
/// Reverse by rotating polygon 180 degrees /// Reverse by rotating polygon 180 degrees
REVERSEMETHOD_ROTATE_180, Rotate180,
/// Reverse by flipping polygon at the y (!) axis /// Reverse by flipping polygon at the y (!) axis
REVERSEMETHOD_FLIP_X, FlipX,
/// Reverse by flipping polygon at the x (!) axis /// Reverse by flipping polygon at the x (!) axis
REVERSEMETHOD_FLIP_Y FlipY
}; };
/** Indicating the method to use when transition /** Indicating the method to use when transition