1 #ifndef DALI_DEMO_RADIAL_SWEEP_VIEW_IMPL_H
2 #define DALI_DEMO_RADIAL_SWEEP_VIEW_IMPL_H
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
20 #include <dali-toolkit/dali-toolkit.h>
21 #include "radial-sweep-view.h"
24 /********************************************************************************
25 * Class to implement a layer with a radial sweep stencil mask and an actor tree
27 class RadialSweepViewImpl : public Dali::Toolkit::Internal::Control
30 static RadialSweepView New();
32 static RadialSweepView New( float duration,
34 Dali::Degree initialAngle,
35 Dali::Degree finalAngle,
36 Dali::Degree initialSector,
37 Dali::Degree finalSector );
39 RadialSweepViewImpl( float duration,
41 Dali::Degree initialAngle,
42 Dali::Degree finalAngle,
43 Dali::Degree initialSector,
44 Dali::Degree finalSector );
46 void SetDuration(float duration);
47 void SetEasingFunction( Dali::AlphaFunction easingFunction );
49 void SetDiameter(float diameter);
50 void SetInitialAngle( Dali::Degree initialAngle);
51 void SetFinalAngle( Dali::Degree finalAngle);
52 void SetInitialSector( Dali::Degree initialSector);
53 void SetFinalSector( Dali::Degree finalSector);
54 void SetInitialActorAngle( Dali::Degree initialAngle );
55 void SetFinalActorAngle( Dali::Degree finalAngle );
59 Dali::Degree GetInitialAngle( );
60 Dali::Degree GetFinalAngle( );
61 Dali::Degree GetInitialSector( );
62 Dali::Degree GetFinalSector( );
63 Dali::Degree GetInitialActorAngle( );
64 Dali::Degree GetFinalActorAngle( );
66 void RotateActorsWithStencil(bool rotate);
68 void Add( Dali::Actor actor );
70 void Activate( Dali::Animation anim = Dali::Animation(), float offsetTime=0, float duration=2.0f );
77 * Create the stencil mask
79 void CreateStencil(Dali::Degree initialSector );
83 Dali::Animation mAnim;
86 Dali::Degree mInitialAngle;
87 Dali::Degree mFinalAngle;
88 Dali::Degree mInitialSector;
89 Dali::Degree mFinalSector;
90 Dali::Degree mInitialActorAngle;
91 Dali::Degree mFinalActorAngle;
92 Dali::AlphaFunction mEasingFunction;
93 Dali::MeshActor mStencilActor; ///< Stencil actor which generates mask
94 Dali::Material mMaterial; ///< Material for drawing mesh actor
95 Dali::AnimatableMesh mMesh; ///< Animatable mesh
96 Dali::Property::Index mStartAngleIndex; ///< Index of start-angle property
97 Dali::Property::Index mRotationAngleIndex; ///< Index of rotation-angle property
98 bool mRotateActorsWithStencil:1;
103 inline RadialSweepViewImpl& GetImpl( RadialSweepView& obj )
105 DALI_ASSERT_ALWAYS(obj);
106 Dali::RefObject& handle = obj.GetImplementation();
107 return static_cast<RadialSweepViewImpl&>(handle);
110 inline const RadialSweepViewImpl& GetImpl( const RadialSweepView& obj )
112 DALI_ASSERT_ALWAYS(obj);
113 const Dali::RefObject& handle = obj.GetImplementation();
114 return static_cast<const RadialSweepViewImpl&>(handle);
119 #endif // DALI_DEMO_RADIAL_SWEEP_VIEW_IMPL_H