X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftransition-effects%2Fcube-transition-cross-effect-impl.h;h=ded10ea6a395ba9eae9ae8034fa0158b0a97eae3;hb=refs%2Fchanges%2F46%2F265846%2F1;hp=d1416e4e22b36ab0fb1bccba172bfcf724c8e97b;hpb=820c66e71516e7a25600b8b5de2e84b5d44d8ff3;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.h b/dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.h index d1416e4..ded10ea 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.h +++ b/dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H__ -#define __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H__ +#ifndef DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H +#define DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,67 +26,61 @@ namespace Dali { - namespace Toolkit { - class CubeTransitionCrossEffect; namespace Internal { - class CubeTransitionEffect; class CubeTransitionCrossEffect : public CubeTransitionEffect { - public: - /** * @copydoc Toolkit::CubeTransitionCrossEffect::New */ - static Toolkit::CubeTransitionCrossEffect New(unsigned int numRows, unsigned int numColumns, Size viewAreaSize); + static Toolkit::CubeTransitionCrossEffect New(unsigned int numRows, unsigned int numColumns); protected: - - /** + /** * @copydoc Toolkit::Internal::CubeTransitionEffect::OnInitialize */ - virtual void OnInitialize(); + void OnInitialize() override; - /** + /** * @copydoc Toolkit::Internal::CubeTransitionEffect::OnStartTransition */ - virtual void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement ); - - /** - * @copydoc Toolkit::Internal::CubeTransitionEffect::OnStopTransition - */ - virtual void OnStopTransition(); + void OnStartTransition(Vector2 panPosition, Vector2 panDisplacement) override; private: - - /** - * Construct a new CubeTransitionCrossEffect object + /** + * @brief Construct a new CubeTransitionCrossEffect object + * * @param[in] numRows How many rows of cubes * @param[in] numColumns How many columns of cubes - * @param[in] viewAreaSize The size of view area for this transition effect */ - CubeTransitionCrossEffect( unsigned int numRows, unsigned int numColumns, Size viewAreaSize ); + CubeTransitionCrossEffect(unsigned int numRows, unsigned int numColumns); - /** - * Set up animation to an Actor + /** + * @brief Set up animation to an Actor + * This will also displace the cubes in the z direction by mCubeDisplacement and spread them apart on the xy plane + * given by the closeness of displacementCentre to the XY plane at 0. + * * @param[in] actorIndex The index of the cube in the cube array * @param[in] angle The angle of the rotation animation - * @param[in] axis The axis of the rotation animation - * @param[in] resetTranslation The translation used to reset the actor position before animation + * @param[in] the centre to "explode" the tiles outwards from */ - - void SetupAnimation( unsigned int actorIndex, float angle, const Vector3 axis, Vector3 resetTranslation ); + void SetupAnimation(unsigned int actorIndex, unsigned int x, unsigned int y, float angle, const Vector3 axis, const Vector3& displacementCentre); private: - - float mDisplacementRatio; + /** + * The factor that determines how spread apart from each other the cubes will go + * when they are displaced during the transition animation. + * The larger the value the more the spread apart the cubes will be. + * it should be in the range (0.0, +infinity) + */ + float mDisplacementSpreadFactor; }; //class CubeTransitionCrossEffect @@ -98,7 +92,7 @@ inline Internal::CubeTransitionCrossEffect& GetImpl(Dali::Toolkit::CubeTransitio { DALI_ASSERT_ALWAYS(obj); - Dali::BaseObject& handle = obj.GetBaseObject(); + Dali::RefObject& handle = obj.GetImplementation(); return static_cast(handle); } @@ -107,7 +101,7 @@ inline const Internal::CubeTransitionCrossEffect& GetImpl(const Dali::Toolkit::C { DALI_ASSERT_ALWAYS(obj); - const Dali::BaseObject& handle = obj.GetBaseObject(); + const Dali::RefObject& handle = obj.GetImplementation(); return static_cast(handle); } @@ -116,4 +110,4 @@ inline const Internal::CubeTransitionCrossEffect& GetImpl(const Dali::Toolkit::C } // namespace Dali -#endif /* __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H_ */ +#endif // DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H