1 #ifndef DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H
2 #define DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
24 #include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
25 #include <dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h>
31 class CubeTransitionCrossEffect;
35 class CubeTransitionEffect;
37 class CubeTransitionCrossEffect : public CubeTransitionEffect
41 * @copydoc Toolkit::CubeTransitionCrossEffect::New
43 static Toolkit::CubeTransitionCrossEffect New(unsigned int numRows, unsigned int numColumns);
47 * @copydoc Toolkit::Internal::CubeTransitionEffect::OnInitialize
49 void OnInitialize() override;
52 * @copydoc Toolkit::Internal::CubeTransitionEffect::OnStartTransition
54 void OnStartTransition(Vector2 panPosition, Vector2 panDisplacement) override;
58 * @brief Construct a new CubeTransitionCrossEffect object
60 * @param[in] numRows How many rows of cubes
61 * @param[in] numColumns How many columns of cubes
63 CubeTransitionCrossEffect(unsigned int numRows, unsigned int numColumns);
66 * @brief Set up animation to an Actor
67 * This will also displace the cubes in the z direction by mCubeDisplacement and spread them apart on the xy plane
68 * given by the closeness of displacementCentre to the XY plane at 0.
70 * @param[in] actorIndex The index of the cube in the cube array
71 * @param[in] angle The angle of the rotation animation
72 * @param[in] the centre to "explode" the tiles outwards from
74 void SetupAnimation(unsigned int actorIndex, unsigned int x, unsigned int y, float angle, const Vector3 axis, const Vector3& displacementCentre);
78 * The factor that determines how spread apart from each other the cubes will go
79 * when they are displaced during the transition animation.
80 * The larger the value the more the spread apart the cubes will be.
81 * it should be in the range (0.0, +infinity)
83 float mDisplacementSpreadFactor;
85 }; //class CubeTransitionCrossEffect
87 } // namespace Internal
89 // Helpers for public-api forwarding methods
91 inline Internal::CubeTransitionCrossEffect& GetImpl(Dali::Toolkit::CubeTransitionCrossEffect& obj)
93 DALI_ASSERT_ALWAYS(obj);
95 Dali::RefObject& handle = obj.GetImplementation();
97 return static_cast<Internal::CubeTransitionCrossEffect&>(handle);
100 inline const Internal::CubeTransitionCrossEffect& GetImpl(const Dali::Toolkit::CubeTransitionCrossEffect& obj)
102 DALI_ASSERT_ALWAYS(obj);
104 const Dali::RefObject& handle = obj.GetImplementation();
106 return static_cast<const Internal::CubeTransitionCrossEffect&>(handle);
109 } // namespace Toolkit
113 #endif // DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H