1 #ifndef __DALI_TOOLKIT_CAROUSEL_EFFECT_H__
2 #define __DALI_TOOLKIT_CAROUSEL_EFFECT_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.
21 #include <dali/dali.h>
23 namespace Dali DALI_IMPORT_API
30 * CarouselEffect is a custom shader effect to achieve Carousel effects in actors
32 * A Carousel has a Radius property which can be +ve (appear as if viewing from the outside of
34 * or -ve (appear as if viewing from the inside of a cylinder/sphere).
36 * It can be a horizontal or vertical (cylindrical) or both (spherical). The AnglePerUnit
37 * property provides this functionality as a Vector2.
39 * Finally, the carousel's center position can be specified as a Screen coordinate (top-left being
42 class CarouselEffect : public ShaderEffect
47 * Create an uninitialized CarouselEffect; this can be initialized with CarouselEffect::New()
48 * Calling member functions with an uninitialized Dali::Object is not allowed.
55 virtual ~CarouselEffect();
58 * Create an initialized CarouselEffect.
59 * @return A handle to a newly allocated Dali resource.
61 static CarouselEffect New();
64 * Set the radius of the Carousel effect.
65 * A positive Radius will bend toward the camera,
66 * while a negative Radius will bend away from the camera.
67 * @param[in] radius The new radius.
69 void SetRadius( float radius);
72 * Sets the center point of the carousel (in screen coordinates)
73 * this is where the peek of the carousel should appear.
74 * this defaults to top-left corner (0.0f, 0.0f).
76 * @param[in] center The center point.
78 void SetCenter( const Vector2& center );
81 * Set the angle deviation of Carousel in degrees per
82 * geometric unit for each axis. For example if you
83 * wish for the horizontal angle deviation to vary from +/- 10
84 * degrees, then a Value of 20.0f / stageWidth for the X
85 * component should be specified.
87 * @param[in] angle the Angle Spread in X and Y axes.
89 void SetAnglePerUnit( const Vector2& angle );
92 * Get the name for the radius property
93 * @return A std::string containing the property name
95 const std::string& GetRadiusPropertyName() const;
98 * Get the name for the center property
99 * @return A std::string containing the property name
101 const std::string& GetCenterPropertyName() const;
104 * Get the name for the angle spread property
105 * @return A std::string containing the property name
107 const std::string& GetAnglePerUnitPropertyName() const;
110 private: // Not intended for application developers
111 CarouselEffect(ShaderEffect handle);
114 } // namespace Toolkit
118 #endif // __DALI_TOOLKIT_CAROUSEL_EFFECT_H__