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 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.
22 #include <dali/dali.h>
24 namespace Dali DALI_IMPORT_API
31 * CarouselEffect is a custom shader effect to achieve Carousel effects in actors
33 * A Carousel has a Radius property which can be +ve (appear as if viewing from the outside of
35 * or -ve (appear as if viewing from the inside of a cylinder/sphere).
37 * It can be a horizontal or vertical (cylindrical) or both (spherical). The AnglePerUnit
38 * property provides this functionality as a Vector2.
40 * Finally, the carousel's center position can be specified as a Screen coordinate (top-left being
43 class CarouselEffect : public ShaderEffect
48 * Create an uninitialized CarouselEffect; this can be initialized with CarouselEffect::New()
49 * Calling member functions with an uninitialized Dali::Object is not allowed.
56 virtual ~CarouselEffect();
59 * Create an initialized CarouselEffect.
60 * @return A handle to a newly allocated Dali resource.
62 static CarouselEffect New();
65 * Set the radius of the Carousel effect.
66 * A positive Radius will bend toward the camera,
67 * while a negative Radius will bend away from the camera.
68 * @param[in] radius The new radius.
70 void SetRadius( float radius);
73 * Sets the center point of the carousel (in screen coordinates)
74 * this is where the peek of the carousel should appear.
75 * this defaults to top-left corner (0.0f, 0.0f).
77 * @param[in] center The center point.
79 void SetCenter( const Vector2& center );
82 * Set the angle deviation of Carousel in degrees per
83 * geometric unit for each axis. For example if you
84 * wish for the horizontal angle deviation to vary from +/- 10
85 * degrees, then a Value of 20.0f / stageWidth for the X
86 * component should be specified.
88 * @param[in] angle the Angle Spread in X and Y axes.
90 void SetAnglePerUnit( const Vector2& angle );
93 * Get the name for the radius property
94 * @return A std::string containing the property name
96 const std::string& GetRadiusPropertyName() const;
99 * Get the name for the center property
100 * @return A std::string containing the property name
102 const std::string& GetCenterPropertyName() const;
105 * Get the name for the angle spread property
106 * @return A std::string containing the property name
108 const std::string& GetAnglePerUnitPropertyName() const;
111 private: // Not intended for application developers
112 CarouselEffect(ShaderEffect handle);
115 } // namespace Toolkit
119 #endif // __DALI_TOOLKIT_CAROUSEL_EFFECT_H__