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 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.
21 #include <dali-toolkit/dali-toolkit.h>
22 #include <dali/devel-api/actors/mesh-actor.h>
23 #include <dali/devel-api/modeling/material.h>
24 #include <dali/devel-api/geometry/animatable-mesh.h>
26 #include "radial-sweep-view.h"
29 /********************************************************************************
30 * Class to implement a layer with a radial sweep stencil mask and an actor tree
32 class RadialSweepViewImpl : public Dali::Toolkit::Internal::Control
35 static RadialSweepView New();
37 static RadialSweepView New( float duration,
39 Dali::Degree initialAngle,
40 Dali::Degree finalAngle,
41 Dali::Degree initialSector,
42 Dali::Degree finalSector );
44 RadialSweepViewImpl( float duration,
46 Dali::Degree initialAngle,
47 Dali::Degree finalAngle,
48 Dali::Degree initialSector,
49 Dali::Degree finalSector );
51 void SetDuration(float duration);
52 void SetEasingFunction( Dali::AlphaFunction easingFunction );
54 void SetDiameter(float diameter);
55 void SetInitialAngle( Dali::Degree initialAngle);
56 void SetFinalAngle( Dali::Degree finalAngle);
57 void SetInitialSector( Dali::Degree initialSector);
58 void SetFinalSector( Dali::Degree finalSector);
59 void SetInitialActorAngle( Dali::Degree initialAngle );
60 void SetFinalActorAngle( Dali::Degree finalAngle );
64 Dali::Degree GetInitialAngle( );
65 Dali::Degree GetFinalAngle( );
66 Dali::Degree GetInitialSector( );
67 Dali::Degree GetFinalSector( );
68 Dali::Degree GetInitialActorAngle( );
69 Dali::Degree GetFinalActorAngle( );
71 void RotateActorsWithStencil(bool rotate);
73 void Add( Dali::Actor actor );
75 void Activate( Dali::Animation anim = Dali::Animation(), float offsetTime=0, float duration=2.0f );
82 * Create the stencil mask
84 void CreateStencil(Dali::Degree initialSector );
88 Dali::Animation mAnim;
91 Dali::Degree mInitialAngle;
92 Dali::Degree mFinalAngle;
93 Dali::Degree mInitialSector;
94 Dali::Degree mFinalSector;
95 Dali::Degree mInitialActorAngle;
96 Dali::Degree mFinalActorAngle;
97 Dali::AlphaFunction mEasingFunction;
98 Dali::MeshActor mStencilActor; ///< Stencil actor which generates mask
99 Dali::Material mMaterial; ///< Material for drawing mesh actor
100 Dali::AnimatableMesh mMesh; ///< Animatable mesh
101 Dali::Property::Index mStartAngleIndex; ///< Index of start-angle property
102 Dali::Property::Index mRotationAngleIndex; ///< Index of rotation-angle property
103 bool mRotateActorsWithStencil:1;
108 inline RadialSweepViewImpl& GetImpl( RadialSweepView& obj )
110 DALI_ASSERT_ALWAYS(obj);
111 Dali::RefObject& handle = obj.GetImplementation();
112 return static_cast<RadialSweepViewImpl&>(handle);
115 inline const RadialSweepViewImpl& GetImpl( const RadialSweepView& obj )
117 DALI_ASSERT_ALWAYS(obj);
118 const Dali::RefObject& handle = obj.GetImplementation();
119 return static_cast<const RadialSweepViewImpl&>(handle);
124 #endif // DALI_DEMO_RADIAL_SWEEP_VIEW_IMPL_H