Crazy Eddies GUI System  0.7.2
CEGUIBasicInterpolators.h
1 /***********************************************************************
2  filename: CEGUIBasicInterpolators.h
3  created: 7/8/2010
4  author: Martin Preisler
5 
6  purpose: Defines basic integrated interpolators
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to deal in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUIBasicInterpolators_h_
31 #define _CEGUIBasicInterpolators_h_
32 
33 #include "CEGUIInterpolator.h"
34 
35 // Start of CEGUI namespace section
36 namespace CEGUI
37 {
38 
39 // this does no interpolation! it just chooses left or right value based on
40 // position!
41 class CEGUIEXPORT StringInterpolator : public Interpolator
42 {
43 public:
44  virtual ~StringInterpolator(void) {};
45 
46  virtual const String& getType() const;
47 
48  virtual String interpolateAbsolute(const String& value1,
49  const String& value2,
50  float position);
51  virtual String interpolateRelative(const String& base,
52  const String& value1,
53  const String& value2,
54  float position);
55  virtual String interpolateRelativeMultiply(const String& base,
56  const String& value1,
57  const String& value2,
58  float position);
59 };
60 
61 class CEGUIEXPORT FloatInterpolator : public Interpolator
62 {
63 public:
64  virtual ~FloatInterpolator(void) {};
65 
66  virtual const String& getType() const;
67 
68  virtual String interpolateAbsolute(const String& value1,
69  const String& value2,
70  float position);
71  virtual String interpolateRelative(const String& base,
72  const String& value1,
73  const String& value2,
74  float position);
75  virtual String interpolateRelativeMultiply(const String& base,
76  const String& value1,
77  const String& value2,
78  float position);
79 };
80 
81 class CEGUIEXPORT UintInterpolator : public Interpolator
82 {
83 public:
84  virtual ~UintInterpolator(void) {};
85 
86  virtual const String& getType() const;
87 
88  virtual String interpolateAbsolute(const String& value1,
89  const String& value2,
90  float position);
91  virtual String interpolateRelative(const String& base,
92  const String& value1,
93  const String& value2,
94  float position);
95  virtual String interpolateRelativeMultiply(const String& base,
96  const String& value1,
97  const String& value2,
98  float position);
99 };
100 
101 class CEGUIEXPORT IntInterpolator : public Interpolator
102 {
103 public:
104  virtual ~IntInterpolator(void) {};
105 
106  virtual const String& getType() const;
107 
108  virtual String interpolateAbsolute(const String& value1,
109  const String& value2,
110  float position);
111  virtual String interpolateRelative(const String& base,
112  const String& value1,
113  const String& value2,
114  float position);
115  virtual String interpolateRelativeMultiply(const String& base,
116  const String& value1,
117  const String& value2,
118  float position);
119 };
120 
121 // this does no interpolation! it just chooses left or right value based on
122 // position!
123 class CEGUIEXPORT BoolInterpolator : public Interpolator
124 {
125 public:
126  virtual ~BoolInterpolator(void) {};
127 
128  virtual const String& getType() const;
129 
130  virtual String interpolateAbsolute(const String& value1,
131  const String& value2,
132  float position);
133  virtual String interpolateRelative(const String& base,
134  const String& value1,
135  const String& value2,
136  float position);
137  virtual String interpolateRelativeMultiply(const String& base,
138  const String& value1,
139  const String& value2,
140  float position);
141 };
142 
143 class CEGUIEXPORT SizeInterpolator : public Interpolator
144 {
145 public:
146  virtual ~SizeInterpolator(void) {};
147 
148  virtual const String& getType() const;
149 
150  virtual String interpolateAbsolute(const String& value1,
151  const String& value2,
152  float position);
153  virtual String interpolateRelative(const String& base,
154  const String& value1,
155  const String& value2,
156  float position);
157  virtual String interpolateRelativeMultiply(const String& base,
158  const String& value1,
159  const String& value2,
160  float position);
161 };
162 
163 class CEGUIEXPORT PointInterpolator : public Interpolator
164 {
165 public:
166  virtual ~PointInterpolator(void) {};
167 
168  virtual const String& getType() const;
169 
170  virtual String interpolateAbsolute(const String& value1,
171  const String& value2,
172  float position);
173  virtual String interpolateRelative(const String& base,
174  const String& value1,
175  const String& value2,
176  float position);
177  virtual String interpolateRelativeMultiply(const String& base,
178  const String& value1,
179  const String& value2,
180  float position);
181 };
182 
183 class CEGUIEXPORT Vector3Interpolator : public Interpolator
184 {
185 public:
186  virtual ~Vector3Interpolator(void) {};
187 
188  virtual const String& getType() const;
189 
190  virtual String interpolateAbsolute(const String& value1,
191  const String& value2,
192  float position);
193  virtual String interpolateRelative(const String& base,
194  const String& value1,
195  const String& value2,
196  float position);
197  virtual String interpolateRelativeMultiply(const String& base,
198  const String& value1,
199  const String& value2,
200  float position);
201 };
202 
203 class CEGUIEXPORT RectInterpolator : public Interpolator
204 {
205 public:
206  virtual ~RectInterpolator(void) {};
207 
208  virtual const String& getType() const;
209 
210  virtual String interpolateAbsolute(const String& value1,
211  const String& value2,
212  float position);
213  virtual String interpolateRelative(const String& base,
214  const String& value1,
215  const String& value2,
216  float position);
217  virtual String interpolateRelativeMultiply(const String& base,
218  const String& value1,
219  const String& value2,
220  float position);
221 };
222 
223 class CEGUIEXPORT ColourInterpolator : public Interpolator
224 {
225 public:
226  virtual ~ColourInterpolator(void) {};
227 
228  virtual const String& getType() const;
229 
230  virtual String interpolateAbsolute(const String& value1,
231  const String& value2,
232  float position);
233  virtual String interpolateRelative(const String& base,
234  const String& value1,
235  const String& value2,
236  float position);
237  virtual String interpolateRelativeMultiply(const String& base,
238  const String& value1,
239  const String& value2,
240  float position);
241 };
242 
243 class CEGUIEXPORT ColourRectInterpolator : public Interpolator
244 {
245 public:
246  virtual ~ColourRectInterpolator(void) {};
247 
248  virtual const String& getType() const;
249 
250  virtual String interpolateAbsolute(const String& value1,
251  const String& value2,
252  float position);
253  virtual String interpolateRelative(const String& base,
254  const String& value1,
255  const String& value2,
256  float position);
257  virtual String interpolateRelativeMultiply(const String& base,
258  const String& value1,
259  const String& value2,
260  float position);
261 };
262 
263 class CEGUIEXPORT UDimInterpolator : public Interpolator
264 {
265 public:
266  virtual ~UDimInterpolator(void) {};
267 
268  virtual const String& getType() const;
269 
270  virtual String interpolateAbsolute(const String& value1,
271  const String& value2,
272  float position);
273  virtual String interpolateRelative(const String& base,
274  const String& value1,
275  const String& value2,
276  float position);
277  virtual String interpolateRelativeMultiply(const String& base,
278  const String& value1,
279  const String& value2,
280  float position);
281 };
282 
283 class CEGUIEXPORT UVector2Interpolator : public Interpolator
284 {
285 public:
286  virtual ~UVector2Interpolator(void) {};
287 
288  virtual const String& getType() const;
289 
290  virtual String interpolateAbsolute(const String& value1,
291  const String& value2,
292  float position);
293  virtual String interpolateRelative(const String& base,
294  const String& value1,
295  const String& value2,
296  float position);
297  virtual String interpolateRelativeMultiply(const String& base,
298  const String& value1,
299  const String& value2,
300  float position);
301 };
302 
303 class CEGUIEXPORT URectInterpolator : public Interpolator
304 {
305 public:
306  virtual ~URectInterpolator(void) {};
307 
308  virtual const String& getType() const;
309 
310  virtual String interpolateAbsolute(const String& value1,
311  const String& value2,
312  float position);
313  virtual String interpolateRelative(const String& base,
314  const String& value1,
315  const String& value2,
316  float position);
317  virtual String interpolateRelativeMultiply(const String& base,
318  const String& value1,
319  const String& value2,
320  float position);
321 };
322 
323 class CEGUIEXPORT UBoxInterpolator : public Interpolator
324 {
325 public:
326  virtual ~UBoxInterpolator(void) {};
327 
328  virtual const String& getType() const;
329 
330  virtual String interpolateAbsolute(const String& value1,
331  const String& value2,
332  float position);
333  virtual String interpolateRelative(const String& base,
334  const String& value1,
335  const String& value2,
336  float position);
337  virtual String interpolateRelativeMultiply(const String& base,
338  const String& value1,
339  const String& value2,
340  float position);
341 };
342 
343 } // End of CEGUI namespace section
344 
345 #endif // end of guard _CEGUIBasicInterpolators_h_
346