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