Merge "Purge underscored header file barriers" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / transition-effects / cube-transition-cross-effect-impl.h
1 #ifndef DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H
2 #define DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
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>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 class CubeTransitionCrossEffect;
34
35 namespace Internal
36 {
37
38 class CubeTransitionEffect;
39
40 class CubeTransitionCrossEffect : public CubeTransitionEffect
41 {
42
43 public:
44
45   /**
46    * @copydoc Toolkit::CubeTransitionCrossEffect::New
47    */
48   static Toolkit::CubeTransitionCrossEffect New( unsigned int numRows, unsigned int numColumns );
49
50 protected:
51
52    /**
53     * @copydoc Toolkit::Internal::CubeTransitionEffect::OnInitialize
54     */
55    virtual void OnInitialize();
56
57    /**
58     * @copydoc Toolkit::Internal::CubeTransitionEffect::OnStartTransition
59     */
60    virtual void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement );
61
62 private:
63
64    /**
65     * @brief Construct a new CubeTransitionCrossEffect object
66     *
67     * @param[in] numRows How many rows of cubes
68     * @param[in] numColumns How many columns of cubes
69     */
70    CubeTransitionCrossEffect( unsigned int numRows, unsigned int numColumns );
71
72    /**
73     * @brief Set up animation to an Actor
74     * This will also displace the cubes in the z direction by mCubeDisplacement and spread them apart on the xy plane
75     * given by the closeness of displacementCentre to the XY plane at 0.
76     *
77     * @param[in] actorIndex The index of the cube in the cube array
78     * @param[in] angle The angle of the rotation animation
79     * @param[in] the centre to "explode" the tiles outwards from
80     */
81    void SetupAnimation( unsigned int actorIndex, unsigned int x, unsigned int y, float angle, const Vector3 axis, const Vector3& displacementCentre );
82
83 private:
84
85    /**
86     * The factor that determines how spread apart from each other the cubes will go
87     * when they are displaced during the transition animation.
88     * The larger the value the more the spread apart the cubes will be.
89     * it should be in the range (0.0, +infinity)
90     */
91    float  mDisplacementSpreadFactor;
92
93 }; //class CubeTransitionCrossEffect
94
95 } // namespace Internal
96
97 // Helpers for public-api forwarding methods
98
99 inline Internal::CubeTransitionCrossEffect& GetImpl( Dali::Toolkit::CubeTransitionCrossEffect& obj )
100 {
101   DALI_ASSERT_ALWAYS( obj );
102
103   Dali::RefObject& handle = obj.GetImplementation();
104
105   return static_cast< Internal::CubeTransitionCrossEffect& >( handle );
106 }
107
108 inline const Internal::CubeTransitionCrossEffect& GetImpl( const Dali::Toolkit::CubeTransitionCrossEffect& obj )
109 {
110   DALI_ASSERT_ALWAYS( obj );
111
112   const Dali::RefObject& handle = obj.GetImplementation();
113
114   return static_cast< const Internal::CubeTransitionCrossEffect& >( handle );
115 }
116
117 } // namespace Toolkit
118
119 } // namespace Dali
120
121 #endif // DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_CROSS_EFFECT_H