[SRUK] Initial copy from Tizen 2.2 version
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / shader-effects / water-effect-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_WATER_EFFECT_H__
2 #define __DALI_TOOLKIT_INTERNAL_WATER_EFFECT_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
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
10 //
11 //     http://floralicense.org/license/
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 // EXTERNAL INCLUDES
21 #include <sstream>
22 #include <cmath>
23
24 // INTERNAL INCLUDES
25 #include <dali/dali.h>
26 #include <dali-toolkit/public-api/shader-effects/water-effect.h>
27
28 namespace Dali
29 {
30
31 namespace Toolkit
32 {
33
34 namespace Internal
35 {
36
37 /**
38  * WaterEffect implementation class
39  */
40 class WaterEffect : public ShaderEffect::Extension
41 {
42 public:
43
44   /**
45    * @copydoc Dali::Toolkit::WaterEffect::WaterEffect
46    */
47   WaterEffect( unsigned int numberOfWaves );
48
49   /**
50    * @copydoc Dali::Toolkit::WaterEffect::~WaterEffect
51    */
52   virtual ~WaterEffect();
53
54   /**
55    * @copydoc Dali::Toolkit::WaterEffect::GetNumberOfWaves
56    */
57   unsigned int GetNumberOfWaves() const;
58
59   /**
60    * @copydoc Dali::Toolkit::WaterEffect::CreateShaderEffect
61    */
62   static Dali::Toolkit::WaterEffect CreateShaderEffect( unsigned int numberOfWaves );
63
64   /**
65    * @copydoc Dali::Toolkit::WaterEffect::SetAmplitude
66    */
67   void SetAmplitude( unsigned int index, float amplitude );
68
69   /**
70    * @copydoc Dali::Toolkit::WaterEffect::SetCenter
71    */
72   void SetCenter( unsigned int index, const Vector2& center );
73
74   /**
75    * @copydoc Dali::Toolkit::WaterEffect::SetPropagation
76    */
77   void SetPropagation( unsigned int index, float radius );
78
79   /**
80    * @copydoc Dali::Toolkit::WaterEffect::GetPropagation
81    */
82   float GetPropagation( unsigned int index ) const;
83
84   /**
85    * @copydoc Dali::Toolkit::WaterEffect::GetAmplitude
86    */
87   float GetAmplitude( unsigned int index ) const;
88
89   /**
90    * @copydoc Dali::Toolkit::WaterEffect::GetCenter
91    */
92   Vector2 GetCenter( unsigned int index ) const;
93
94   /**
95    * @copydoc Dali::Toolkit::WaterEffect::GetAmplitudePropertyName
96    */
97   std::string GetAmplitudePropertyName( unsigned int index ) const;
98
99   /**
100    * @copydoc Dali::Toolkit::WaterEffect::GetCenterPropertyName
101    */
102   std::string GetCenterPropertyName( unsigned int index ) const;
103
104   /**
105    * @copydoc Dali::Toolkit::WaterEffect::GetPropagationPropertyName
106    */
107   std::string GetPropagationPropertyName( unsigned int index ) const;
108
109 private:
110
111   void Initialize( ShaderEffect shaderEffect );
112
113 private:
114
115   ShaderEffect mShaderEffect;
116
117   unsigned int mNumberOfWaves;
118
119
120 private:
121
122   // Undefined copy constructor.
123   WaterEffect( const WaterEffect& );
124
125   // Undefined assignment operator.
126   WaterEffect& operator=( const WaterEffect& );
127
128 };
129
130 } // namespace Internal
131
132 inline Internal::WaterEffect& GetImpl( Toolkit::WaterEffect& waterEffect )
133 {
134   return static_cast<Internal::WaterEffect&>( waterEffect.GetExtension() );
135 }
136
137 inline const Internal::WaterEffect& GetImpl( const Toolkit::WaterEffect& waterEffect )
138 {
139   return static_cast<const Internal::WaterEffect&>( waterEffect.GetExtension() );
140 }
141
142 } // namespace Toolkit
143
144 } // namespace Dali
145
146 #endif // __DALI_TOOLKIT_INTERNAL_WATER_EFFECT_H__