]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CAttributes.h
Merging r5975 through r6036 from trunk to ogl-es branch.
[irrlicht.git] / source / Irrlicht / CAttributes.h
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __C_ATTRIBUTES_H_INCLUDED__\r
6 #define __C_ATTRIBUTES_H_INCLUDED__\r
7 \r
8 #include "IrrCompileConfig.h"\r
9 \r
10 #include "IAttributes.h"\r
11 #include "IAttribute.h"\r
12 \r
13 namespace irr\r
14 {\r
15 namespace video\r
16 {\r
17         class ITexture;\r
18         class IVideoDriver;\r
19 }\r
20 namespace io\r
21 {\r
22 \r
23 \r
24 //! Implementation of the IAttributes interface\r
25 class CAttributes : public IAttributes\r
26 {\r
27 public:\r
28 \r
29         CAttributes(video::IVideoDriver* driver=0);\r
30         ~CAttributes();\r
31 \r
32         //! Returns amount of attributes in this collection of attributes.\r
33         virtual u32 getAttributeCount() const _IRR_OVERRIDE_;\r
34 \r
35         //! Returns attribute name by index.\r
36         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
37         virtual const c8* getAttributeName(s32 index) const _IRR_OVERRIDE_;\r
38 \r
39         //! Returns the type of an attribute\r
40         //! \param attributeName: Name for the attribute\r
41         virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) const _IRR_OVERRIDE_;\r
42 \r
43         //! Returns attribute type by index.\r
44         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
45         virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) const _IRR_OVERRIDE_;\r
46 \r
47         //! Returns the type string of the attribute\r
48         //! \param attributeName: String for the attribute type\r
49         //! \param defaultNotFound Value returned when attributeName was not found\r
50         virtual const wchar_t* getAttributeTypeString(const c8* attributeName, const wchar_t* defaultNotFound = L"unknown") const _IRR_OVERRIDE_;\r
51 \r
52         //! Returns the type string of the attribute by index.\r
53         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
54         virtual const wchar_t* getAttributeTypeString(s32 index, const wchar_t* defaultNotFound = L"unknown") const _IRR_OVERRIDE_;\r
55 \r
56         //! Returns if an attribute with a name exists\r
57         virtual bool existsAttribute(const c8* attributeName) const _IRR_OVERRIDE_;\r
58 \r
59         //! Returns attribute index from name, -1 if not found\r
60         virtual s32 findAttribute(const c8* attributeName) const _IRR_OVERRIDE_;\r
61 \r
62         //! Removes all attributes\r
63         virtual void clear() _IRR_OVERRIDE_;\r
64 \r
65         //! Reads attributes from a xml file.\r
66         //! \param readCurrentElementOnly: If set to true, reading only works if current element has the name 'attributes'.\r
67         //! IF set to false, the first appearing list attributes are read.\r
68         virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false,\r
69                                         const wchar_t* nonDefaultElementName = 0) _IRR_OVERRIDE_;\r
70 \r
71         //! Write these attributes into a xml file\r
72         virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false, const wchar_t* nonDefaultElementName=0) _IRR_OVERRIDE_;\r
73 \r
74 \r
75         /*\r
76 \r
77                 Integer Attribute\r
78 \r
79         */\r
80 \r
81         //! Adds an attribute as integer\r
82         virtual void addInt(const c8* attributeName, s32 value) _IRR_OVERRIDE_;\r
83 \r
84         //! Sets an attribute as integer value\r
85         virtual void setAttribute(const c8* attributeName, s32 value) _IRR_OVERRIDE_;\r
86 \r
87         //! Gets an attribute as integer value\r
88         //! \param attributeName: Name of the attribute to get.\r
89         //! \param defaultNotFound Value returned when attributeName was not found\r
90         //! \return Returns value of the attribute previously set by setAttribute()\r
91         virtual s32 getAttributeAsInt(const c8* attributeName, irr::s32 defaultNotFound=0) const _IRR_OVERRIDE_;\r
92 \r
93         //! Gets an attribute as integer value\r
94         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
95         virtual s32 getAttributeAsInt(s32 index) const _IRR_OVERRIDE_;\r
96 \r
97         //! Sets an attribute as integer value\r
98         virtual void setAttribute(s32 index, s32 value) _IRR_OVERRIDE_;\r
99 \r
100         /*\r
101 \r
102                 Float Attribute\r
103 \r
104         */\r
105 \r
106         //! Adds an attribute as float\r
107         virtual void addFloat(const c8* attributeName, f32 value) _IRR_OVERRIDE_;\r
108 \r
109         //! Sets a attribute as float value\r
110         virtual void setAttribute(const c8* attributeName, f32 value) _IRR_OVERRIDE_;\r
111 \r
112         //! Gets an attribute as float value\r
113         //! \param attributeName: Name of the attribute to get.\r
114         //! \param defaultNotFound Value returned when attributeName was not found\r
115         //! \return Returns value of the attribute previously set by setAttribute()\r
116         virtual f32 getAttributeAsFloat(const c8* attributeName, irr::f32 defaultNotFound=0.f) const _IRR_OVERRIDE_;\r
117 \r
118         //! Gets an attribute as float value\r
119         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
120         virtual f32 getAttributeAsFloat(s32 index) const _IRR_OVERRIDE_;\r
121 \r
122         //! Sets an attribute as float value\r
123         virtual void setAttribute(s32 index, f32 value) _IRR_OVERRIDE_;\r
124 \r
125         /*\r
126 \r
127                 String Attribute\r
128 \r
129         */\r
130 \r
131         //! Adds an attribute as string\r
132         virtual void addString(const c8* attributeName, const c8* value) _IRR_OVERRIDE_;\r
133 \r
134         //! Sets an attribute value as string.\r
135         //! \param attributeName: Name for the attribute\r
136         //! \param value: Value for the attribute. Set this to 0 to delete the attribute\r
137         virtual void setAttribute(const c8* attributeName, const c8* value) _IRR_OVERRIDE_;\r
138 \r
139         //! Gets an attribute as string.\r
140         //! \param attributeName: Name of the attribute to get.\r
141         //! \param defaultNotFound Value returned when attributeName was not found\r
142         //! \return Returns value of the attribute previously set by setAttribute()\r
143         //! or defaultNotFound if attribute is not set.\r
144         virtual core::stringc getAttributeAsString(const c8* attributeName, const core::stringc& defaultNotFound=core::stringc()) const _IRR_OVERRIDE_;\r
145 \r
146         //! Gets an attribute as string.\r
147         //! \param attributeName: Name of the attribute to get.\r
148         //! \param target: Buffer where the string is copied to.\r
149         virtual void getAttributeAsString(const c8* attributeName, c8* target) const _IRR_OVERRIDE_;\r
150 \r
151         //! Returns attribute value as string by index.\r
152         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
153         virtual core::stringc getAttributeAsString(s32 index) const _IRR_OVERRIDE_;\r
154 \r
155         //! Sets an attribute value as string.\r
156         //! \param attributeName: Name for the attribute\r
157         virtual void setAttribute(s32 index, const c8* value) _IRR_OVERRIDE_;\r
158 \r
159         // wide strings\r
160 \r
161         //! Adds an attribute as string\r
162         virtual void addString(const c8* attributeName, const wchar_t* value) _IRR_OVERRIDE_;\r
163 \r
164         //! Sets an attribute value as string.\r
165         //! \param attributeName: Name for the attribute\r
166         //! \param value: Value for the attribute. Set this to 0 to delete the attribute\r
167         virtual void setAttribute(const c8* attributeName, const wchar_t* value) _IRR_OVERRIDE_;\r
168 \r
169         //! Gets an attribute as string.\r
170         //! \param attributeName: Name of the attribute to get.\r
171         //! \param defaultNotFound Value returned when attributeName was not found\r
172         //! \return Returns value of the attribute previously set by setAttribute()\r
173         //! or defaultNotFound if attribute is not set.\r
174         virtual core::stringw getAttributeAsStringW(const c8* attributeName, const core::stringw& defaultNotFound = core::stringw()) const _IRR_OVERRIDE_;\r
175 \r
176         //! Gets an attribute as string.\r
177         //! \param attributeName: Name of the attribute to get.\r
178         //! \param target: Buffer where the string is copied to.\r
179         virtual void getAttributeAsStringW(const c8* attributeName, wchar_t* target) const _IRR_OVERRIDE_;\r
180 \r
181         //! Returns attribute value as string by index.\r
182         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
183         virtual core::stringw getAttributeAsStringW(s32 index) const _IRR_OVERRIDE_;\r
184 \r
185         //! Sets an attribute value as string.\r
186         //! \param attributeName: Name for the attribute\r
187         virtual void setAttribute(s32 index, const wchar_t* value) _IRR_OVERRIDE_;\r
188 \r
189         /*\r
190 \r
191                 Binary Data Attribute\r
192 \r
193         */\r
194 \r
195         //! Adds an attribute as binary data\r
196         virtual void addBinary(const c8* attributeName, void* data, s32 dataSizeInBytes) _IRR_OVERRIDE_;\r
197 \r
198         //! Sets an attribute as binary data\r
199         virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes) _IRR_OVERRIDE_;\r
200 \r
201         //! Gets an attribute as binary data\r
202         //! \param attributeName: Name of the attribute to get.\r
203         virtual void getAttributeAsBinaryData(const c8* attributeName, void* outData, s32 maxSizeInBytes) const _IRR_OVERRIDE_;\r
204 \r
205         //! Gets an attribute as binary data\r
206         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
207         virtual void getAttributeAsBinaryData(s32 index, void* outData, s32 maxSizeInBytes) const _IRR_OVERRIDE_;\r
208 \r
209         //! Sets an attribute as binary data\r
210         virtual void setAttribute(s32 index, void* data, s32 dataSizeInBytes) _IRR_OVERRIDE_;\r
211 \r
212 \r
213         /*\r
214 \r
215                 Array Attribute\r
216 \r
217         */\r
218 \r
219         //! Adds an attribute as wide string array\r
220         virtual void addArray(const c8* attributeName, const core::array<core::stringw>& value) _IRR_OVERRIDE_;\r
221 \r
222         //! Sets an attribute value as a wide string array.\r
223         //! \param attributeName: Name for the attribute\r
224         //! \param value: Value for the attribute. Set this to 0 to delete the attribute\r
225         virtual void setAttribute(const c8* attributeName, const core::array<core::stringw>& value) _IRR_OVERRIDE_;\r
226 \r
227         //! Gets an attribute as an array of wide strings.\r
228         //! \param attributeName: Name of the attribute to get.\r
229         //! \param defaultNotFound Value returned when attributeName was not found\r
230         //! \return Returns value of the attribute previously set by setAttribute()\r
231         //! or defaultNotFound if attribute is not set.\r
232         virtual core::array<core::stringw> getAttributeAsArray(const c8* attributeName, const core::array<core::stringw>& defaultNotFound = core::array<core::stringw>()) const _IRR_OVERRIDE_;\r
233 \r
234         //! Returns attribute value as an array of wide strings by index.\r
235         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
236         virtual core::array<core::stringw> getAttributeAsArray(s32 index) const _IRR_OVERRIDE_;\r
237 \r
238         //! Sets an attribute as an array of wide strings\r
239         virtual void setAttribute(s32 index, const core::array<core::stringw>& value) _IRR_OVERRIDE_;\r
240 \r
241         /*\r
242 \r
243                 Bool Attribute\r
244 \r
245         */\r
246 \r
247         //! Adds an attribute as bool\r
248         virtual void addBool(const c8* attributeName, bool value) _IRR_OVERRIDE_;\r
249 \r
250         //! Sets an attribute as boolean value\r
251         virtual void setAttribute(const c8* attributeName, bool value) _IRR_OVERRIDE_;\r
252 \r
253         //! Gets an attribute as boolean value\r
254         //! \param attributeName: Name of the attribute to get.\r
255         //! \param defaultNotFound Value returned when attributeName was not found\r
256         //! \return Returns value of the attribute previously set by setAttribute()\r
257         virtual bool getAttributeAsBool(const c8* attributeName, bool defaultNotFound=false) const _IRR_OVERRIDE_;\r
258 \r
259         //! Gets an attribute as boolean value\r
260         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
261         virtual bool getAttributeAsBool(s32 index) const _IRR_OVERRIDE_;\r
262 \r
263         //! Sets an attribute as boolean value\r
264         virtual void setAttribute(s32 index, bool value) _IRR_OVERRIDE_;\r
265 \r
266         /*\r
267 \r
268                 Enumeration Attribute\r
269 \r
270         */\r
271 \r
272         //! Adds an attribute as enum\r
273         virtual void addEnum(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) _IRR_OVERRIDE_;\r
274 \r
275         //! Adds an attribute as enum\r
276         virtual void addEnum(const c8* attributeName, s32 enumValue, const c8* const* enumerationLiterals) _IRR_OVERRIDE_;\r
277 \r
278         //! Sets an attribute as enumeration\r
279         virtual void setAttribute(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) _IRR_OVERRIDE_;\r
280 \r
281         //! Gets an attribute as enumeration\r
282         //! \param attributeName: Name of the attribute to get.\r
283         //! \param defaultNotFound Value returned when attributeName was not found\r
284         //! \return Returns value of the attribute previously set by setAttribute()\r
285         virtual const c8* getAttributeAsEnumeration(const c8* attributeName, const c8* defaultNotFound = 0) const _IRR_OVERRIDE_;\r
286 \r
287         //! Gets an attribute as enumeration\r
288         //! \param attributeName: Name of the attribute to get.\r
289         //! \param enumerationLiteralsToUse: Use these enumeration literals to get the index value instead of the set ones.\r
290         //! This is useful when the attribute list maybe was read from an xml file, and only contains the enumeration string, but\r
291         //! no information about its index.\r
292         //! \return Returns value of the attribute previously set by setAttribute()\r
293         virtual s32 getAttributeAsEnumeration(const c8* attributeName, const c8* const* enumerationLiteralsToUse, s32 defaultNotFound ) const _IRR_OVERRIDE_;\r
294 \r
295         //! Gets an attribute as enumeration\r
296         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
297         virtual s32 getAttributeAsEnumeration(s32 index, const c8* const* enumerationLiteralsToUse, s32 defaultNotFound) const _IRR_OVERRIDE_;\r
298 \r
299         //! Gets an attribute as enumeration\r
300         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
301         virtual const c8* getAttributeAsEnumeration(s32 index) const _IRR_OVERRIDE_;\r
302 \r
303         //! Gets the list of enumeration literals of an enumeration attribute\r
304         //! \param attributeName: Name of the attribute to get.\r
305         virtual void getAttributeEnumerationLiteralsOfEnumeration(const c8* attributeName, core::array<core::stringc>& outLiterals) const _IRR_OVERRIDE_;\r
306 \r
307         //! Gets the list of enumeration literals of an enumeration attribute\r
308         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
309         virtual void getAttributeEnumerationLiteralsOfEnumeration(s32 index, core::array<core::stringc>& outLiterals) const _IRR_OVERRIDE_;\r
310 \r
311         //! Sets an attribute as enumeration\r
312         virtual void setAttribute(s32 index, const c8* enumValue, const c8* const* enumerationLiterals) _IRR_OVERRIDE_;\r
313 \r
314 \r
315         /*\r
316 \r
317                 SColor Attribute\r
318 \r
319         */\r
320 \r
321         //! Adds an attribute as color\r
322         virtual void addColor(const c8* attributeName, video::SColor value) _IRR_OVERRIDE_;\r
323 \r
324         //! Sets a attribute as color\r
325         virtual void setAttribute(const c8* attributeName, video::SColor color) _IRR_OVERRIDE_;\r
326 \r
327         //! Gets an attribute as color\r
328         //! \param attributeName: Name of the attribute to get.\r
329         //! \param defaultNotFound Value returned when attributeName was not found\r
330         //! \return Returns value of the attribute previously set by setAttribute()\r
331         virtual video::SColor getAttributeAsColor(const c8* attributeName, const video::SColor& defaultNotFound = video::SColor(0)) const _IRR_OVERRIDE_;\r
332 \r
333         //! Gets an attribute as color\r
334         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
335         virtual video::SColor getAttributeAsColor(s32 index) const _IRR_OVERRIDE_;\r
336 \r
337         //! Sets an attribute as color\r
338         virtual void setAttribute(s32 index, video::SColor color) _IRR_OVERRIDE_;\r
339 \r
340         /*\r
341 \r
342                 SColorf Attribute\r
343 \r
344         */\r
345 \r
346         //! Adds an attribute as floating point color\r
347         virtual void addColorf(const c8* attributeName, video::SColorf value) _IRR_OVERRIDE_;\r
348 \r
349         //! Sets a attribute as floating point color\r
350         virtual void setAttribute(const c8* attributeName, video::SColorf color) _IRR_OVERRIDE_;\r
351 \r
352         //! Gets an attribute as floating point color\r
353         //! \param attributeName: Name of the attribute to get.\r
354         //! \param defaultNotFound Value returned when attributeName was not found\r
355         //! \return Returns value of the attribute previously set by setAttribute()\r
356         virtual video::SColorf getAttributeAsColorf(const c8* attributeName, const video::SColorf& defaultNotFound = video::SColorf(0)) const _IRR_OVERRIDE_;\r
357 \r
358         //! Gets an attribute as floating point color\r
359         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
360         virtual video::SColorf getAttributeAsColorf(s32 index) const _IRR_OVERRIDE_;\r
361 \r
362         //! Sets an attribute as floating point color\r
363         virtual void setAttribute(s32 index, video::SColorf color) _IRR_OVERRIDE_;\r
364 \r
365 \r
366         /*\r
367 \r
368                 Vector3d Attribute\r
369 \r
370         */\r
371 \r
372         //! Adds an attribute as 3d vector\r
373         virtual void addVector3d(const c8* attributeName, const core::vector3df& value) _IRR_OVERRIDE_;\r
374 \r
375         //! Sets a attribute as 3d vector\r
376         virtual void setAttribute(const c8* attributeName, const core::vector3df& v) _IRR_OVERRIDE_;\r
377 \r
378         //! Gets an attribute as 3d vector\r
379         //! \param attributeName: Name of the attribute to get.\r
380         //! \param defaultNotFound Value returned when attributeName was not found\r
381         //! \return Returns value of the attribute previously set by setAttribute()\r
382         virtual core::vector3df getAttributeAsVector3d(const c8* attributeName, const core::vector3df& defaultNotFound=core::vector3df(0,0,0)) const _IRR_OVERRIDE_;\r
383 \r
384         //! Gets an attribute as 3d vector\r
385         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
386         virtual core::vector3df getAttributeAsVector3d(s32 index) const _IRR_OVERRIDE_;\r
387 \r
388         //! Sets an attribute as vector\r
389         virtual void setAttribute(s32 index, const core::vector3df& v) _IRR_OVERRIDE_;\r
390 \r
391 \r
392         /*\r
393 \r
394                 Vector2d Attribute\r
395 \r
396         */\r
397 \r
398         //! Adds an attribute as 2d vector\r
399         virtual void addVector2d(const c8* attributeName, const core::vector2df& value) _IRR_OVERRIDE_;\r
400 \r
401         //! Sets a attribute as 2d vector\r
402         virtual void setAttribute(const c8* attributeName, const core::vector2df& v) _IRR_OVERRIDE_;\r
403 \r
404         //! Gets an attribute as 2d vector\r
405         //! \param attributeName: Name of the attribute to get.\r
406         //! \param defaultNotFound Value returned when attributeName was not found\r
407         //! \return Returns value of the attribute previously set by setAttribute()\r
408         virtual core::vector2df getAttributeAsVector2d(const c8* attributeName, const core::vector2df& defaultNotFound=core::vector2df(0,0)) const _IRR_OVERRIDE_;\r
409 \r
410         //! Gets an attribute as 3d vector\r
411         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
412         virtual core::vector2df getAttributeAsVector2d(s32 index) const _IRR_OVERRIDE_;\r
413 \r
414         //! Sets an attribute as vector\r
415         virtual void setAttribute(s32 index, const core::vector2df& v) _IRR_OVERRIDE_;\r
416 \r
417 \r
418         /*\r
419 \r
420                 Position2d Attribute\r
421 \r
422         */\r
423 \r
424         //! Adds an attribute as 2d position\r
425         virtual void addPosition2d(const c8* attributeName, const core::position2di& value) _IRR_OVERRIDE_;\r
426 \r
427         //! Sets a attribute as 2d position\r
428         virtual void setAttribute(const c8* attributeName, const core::position2di& v) _IRR_OVERRIDE_;\r
429 \r
430         //! Gets an attribute as position\r
431         //! \param attributeName: Name of the attribute to get.\r
432         //! \param defaultNotFound Value returned when attributeName was not found\r
433         //! \return Returns value of the attribute previously set by setAttribute()\r
434         virtual core::position2di getAttributeAsPosition2d(const c8* attributeName, const core::position2di& defaultNotFound=core::position2di(0,0)) const _IRR_OVERRIDE_;\r
435 \r
436         //! Gets an attribute as position\r
437         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
438         virtual core::position2di getAttributeAsPosition2d(s32 index) const _IRR_OVERRIDE_;\r
439 \r
440         //! Sets an attribute as 2d position\r
441         virtual void setAttribute(s32 index, const core::position2di& v) _IRR_OVERRIDE_;\r
442 \r
443         /*\r
444 \r
445                 Rectangle Attribute\r
446 \r
447         */\r
448 \r
449         //! Adds an attribute as rectangle\r
450         virtual void addRect(const c8* attributeName, const core::rect<s32>& value) _IRR_OVERRIDE_;\r
451 \r
452         //! Sets an attribute as rectangle\r
453         virtual void setAttribute(const c8* attributeName, const core::rect<s32>& v) _IRR_OVERRIDE_;\r
454 \r
455         //! Gets an attribute as rectangle\r
456         //! \param attributeName: Name of the attribute to get.\r
457         //! \param defaultNotFound Value returned when attributeName was not found\r
458         //! \return Returns value of the attribute previously set by setAttribute()\r
459         virtual core::rect<s32> getAttributeAsRect(const c8* attributeName, const core::rect<s32>& defaultNotFound = core::rect<s32>()) const _IRR_OVERRIDE_;\r
460 \r
461         //! Gets an attribute as rectangle\r
462         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
463         virtual core::rect<s32> getAttributeAsRect(s32 index) const _IRR_OVERRIDE_;\r
464 \r
465         //! Sets an attribute as rectangle\r
466         virtual void setAttribute(s32 index, const core::rect<s32>& v) _IRR_OVERRIDE_;\r
467 \r
468 \r
469         /*\r
470 \r
471                 Dimension2d Attribute\r
472 \r
473         */\r
474 \r
475         //! Adds an attribute as dimension2d\r
476         virtual void addDimension2d(const c8* attributeName, const core::dimension2d<u32>& value) _IRR_OVERRIDE_;\r
477 \r
478         //! Sets an attribute as dimension2d\r
479         virtual void setAttribute(const c8* attributeName, const core::dimension2d<u32>& v) _IRR_OVERRIDE_;\r
480 \r
481         //! Gets an attribute as dimension2d\r
482         //! \param attributeName: Name of the attribute to get.\r
483         //! \param defaultNotFound Value returned when attributeName was not found\r
484         //! \return Returns value of the attribute previously set by setAttribute()\r
485         virtual core::dimension2d<u32> getAttributeAsDimension2d(const c8* attributeName, const core::dimension2d<u32>& defaultNotFound = core::dimension2d<u32>()) const _IRR_OVERRIDE_;\r
486 \r
487         //! Gets an attribute as dimension2d\r
488         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
489         virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) const _IRR_OVERRIDE_;\r
490 \r
491         //! Sets an attribute as dimension2d\r
492         virtual void setAttribute(s32 index, const core::dimension2d<u32>& v) _IRR_OVERRIDE_;\r
493 \r
494 \r
495         /*\r
496 \r
497                 matrix attribute\r
498 \r
499         */\r
500 \r
501         //! Adds an attribute as matrix\r
502         virtual void addMatrix(const c8* attributeName, const core::matrix4& v) _IRR_OVERRIDE_;\r
503 \r
504         //! Sets an attribute as matrix\r
505         virtual void setAttribute(const c8* attributeName, const core::matrix4& v) _IRR_OVERRIDE_;\r
506 \r
507         //! Gets an attribute as a matrix4\r
508         //! \param attributeName: Name of the attribute to get.\r
509         //! \param defaultNotFound Value returned when attributeName was not found\r
510         //! \return Returns value of the attribute previously set by setAttribute()\r
511         virtual core::matrix4 getAttributeAsMatrix(const c8* attributeName, const core::matrix4& defaultNotFound=core::matrix4()) const _IRR_OVERRIDE_;\r
512 \r
513         //! Gets an attribute as matrix\r
514         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
515         virtual core::matrix4 getAttributeAsMatrix(s32 index) const _IRR_OVERRIDE_;\r
516 \r
517         //! Sets an attribute as matrix\r
518         virtual void setAttribute(s32 index, const core::matrix4& v) _IRR_OVERRIDE_;\r
519 \r
520         /*\r
521                 quaternion attribute\r
522 \r
523         */\r
524 \r
525         //! Adds an attribute as quaternion\r
526         virtual void addQuaternion(const c8* attributeName, const core::quaternion& v) _IRR_OVERRIDE_;\r
527 \r
528         //! Sets an attribute as quaternion\r
529         virtual void setAttribute(const c8* attributeName, const core::quaternion& v) _IRR_OVERRIDE_;\r
530 \r
531         //! Gets an attribute as a quaternion\r
532         //! \param attributeName: Name of the attribute to get.\r
533         //! \param defaultNotFound Value returned when attributeName was not found\r
534         //! \return Returns value of the attribute previously set by setAttribute()\r
535         virtual core::quaternion getAttributeAsQuaternion(const c8* attributeName, const core::quaternion& defaultNotFound=core::quaternion(0,1,0, 0)) const _IRR_OVERRIDE_;\r
536 \r
537         //! Gets an attribute as quaternion\r
538         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
539         virtual core::quaternion getAttributeAsQuaternion(s32 index) const _IRR_OVERRIDE_;\r
540 \r
541         //! Sets an attribute as quaternion\r
542         virtual void setAttribute(s32 index, const core::quaternion& v) _IRR_OVERRIDE_;\r
543 \r
544         /*\r
545 \r
546                 3d bounding box\r
547 \r
548         */\r
549 \r
550         //! Adds an attribute as axis aligned bounding box\r
551         virtual void addBox3d(const c8* attributeName, const core::aabbox3df& v) _IRR_OVERRIDE_;\r
552 \r
553         //! Sets an attribute as axis aligned bounding box\r
554         virtual void setAttribute(const c8* attributeName, const core::aabbox3df& v) _IRR_OVERRIDE_;\r
555 \r
556         //! Gets an attribute as a axis aligned bounding box\r
557         //! \param attributeName: Name of the attribute to get.\r
558         //! \param defaultNotFound Value returned when attributeName was not found\r
559         //! \return Returns value of the attribute previously set by setAttribute()\r
560         virtual core::aabbox3df getAttributeAsBox3d(const c8* attributeName, const core::aabbox3df& defaultNotFound=core::aabbox3df(0,0,0, 0,0,0)) const _IRR_OVERRIDE_;\r
561 \r
562         //! Gets an attribute as axis aligned bounding box\r
563         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
564         virtual core::aabbox3df getAttributeAsBox3d(s32 index) const _IRR_OVERRIDE_;\r
565 \r
566         //! Sets an attribute as axis aligned bounding box\r
567         virtual void setAttribute(s32 index, const core::aabbox3df& v) _IRR_OVERRIDE_;\r
568 \r
569         /*\r
570 \r
571                 plane\r
572 \r
573         */\r
574 \r
575         //! Adds an attribute as 3d plane\r
576         virtual void addPlane3d(const c8* attributeName, const core::plane3df& v) _IRR_OVERRIDE_;\r
577 \r
578         //! Sets an attribute as 3d plane\r
579         virtual void setAttribute(const c8* attributeName, const core::plane3df& v) _IRR_OVERRIDE_;\r
580 \r
581         //! Gets an attribute as a 3d plane\r
582         //! \param attributeName: Name of the attribute to get.\r
583         //! \param defaultNotFound Value returned when attributeName was not found\r
584         //! \return Returns value of the attribute previously set by setAttribute()\r
585         virtual core::plane3df getAttributeAsPlane3d(const c8* attributeName, const core::plane3df& defaultNotFound=core::plane3df(0,0,0, 0,1,0)) const _IRR_OVERRIDE_;\r
586 \r
587         //! Gets an attribute as 3d plane\r
588         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
589         virtual core::plane3df getAttributeAsPlane3d(s32 index) const _IRR_OVERRIDE_;\r
590 \r
591         //! Sets an attribute as 3d plane\r
592         virtual void setAttribute(s32 index, const core::plane3df& v) _IRR_OVERRIDE_;\r
593 \r
594 \r
595         /*\r
596 \r
597                 3d triangle\r
598 \r
599         */\r
600 \r
601         //! Adds an attribute as 3d triangle\r
602         virtual void addTriangle3d(const c8* attributeName, const core::triangle3df& v) _IRR_OVERRIDE_;\r
603 \r
604         //! Sets an attribute as 3d triangle\r
605         virtual void setAttribute(const c8* attributeName, const core::triangle3df& v) _IRR_OVERRIDE_;\r
606 \r
607         //! Gets an attribute as a 3d triangle\r
608         //! \param attributeName: Name of the attribute to get.\r
609         //! \param defaultNotFound Value returned when attributeName was not found\r
610         //! \return Returns value of the attribute previously set by setAttribute()\r
611         virtual core::triangle3df getAttributeAsTriangle3d(const c8* attributeName, const core::triangle3df& defaultNotFound = core::triangle3df(core::vector3df(0,0,0), core::vector3df(0,0,0), core::vector3df(0,0,0))) const _IRR_OVERRIDE_;\r
612 \r
613         //! Gets an attribute as 3d triangle\r
614         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
615         virtual core::triangle3df getAttributeAsTriangle3d(s32 index) const _IRR_OVERRIDE_;\r
616 \r
617         //! Sets an attribute as 3d triangle\r
618         virtual void setAttribute(s32 index, const core::triangle3df& v) _IRR_OVERRIDE_;\r
619 \r
620 \r
621         /*\r
622 \r
623                 line 2d\r
624 \r
625         */\r
626 \r
627         //! Adds an attribute as a 2d line\r
628         virtual void addLine2d(const c8* attributeName, const core::line2df& v) _IRR_OVERRIDE_;\r
629 \r
630         //! Sets an attribute as a 2d line\r
631         virtual void setAttribute(const c8* attributeName, const core::line2df& v) _IRR_OVERRIDE_;\r
632 \r
633         //! Gets an attribute as a 2d line\r
634         //! \param attributeName: Name of the attribute to get.\r
635         //! \param defaultNotFound Value returned when attributeName was not found\r
636         //! \return Returns value of the attribute previously set by setAttribute()\r
637         virtual core::line2df getAttributeAsLine2d(const c8* attributeName, const core::line2df& defaultNotFound = core::line2df(0,0, 0,0)) const _IRR_OVERRIDE_;\r
638 \r
639         //! Gets an attribute as a 2d line\r
640         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
641         virtual core::line2df getAttributeAsLine2d(s32 index) const _IRR_OVERRIDE_;\r
642 \r
643         //! Sets an attribute as a 2d line\r
644         virtual void setAttribute(s32 index, const core::line2df& v) _IRR_OVERRIDE_;\r
645 \r
646 \r
647         /*\r
648 \r
649                 line 3d\r
650 \r
651         */\r
652 \r
653         //! Adds an attribute as a 3d line\r
654         virtual void addLine3d(const c8* attributeName, const core::line3df& v) _IRR_OVERRIDE_;\r
655 \r
656         //! Sets an attribute as a 3d line\r
657         virtual void setAttribute(const c8* attributeName, const core::line3df& v) _IRR_OVERRIDE_;\r
658 \r
659         //! Gets an attribute as a 3d line\r
660         //! \param attributeName: Name of the attribute to get.\r
661         //! \param defaultNotFound Value returned when attributeName was not found\r
662         //! \return Returns value of the attribute previously set by setAttribute()\r
663         virtual core::line3df getAttributeAsLine3d(const c8* attributeName, const core::line3df& defaultNotFound=core::line3df(0,0,0, 0,0,0)) const _IRR_OVERRIDE_;\r
664 \r
665         //! Gets an attribute as a 3d line\r
666         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
667         virtual core::line3df getAttributeAsLine3d(s32 index) const _IRR_OVERRIDE_;\r
668 \r
669         //! Sets an attribute as a 3d line\r
670         virtual void setAttribute(s32 index, const core::line3df& v) _IRR_OVERRIDE_;\r
671 \r
672 \r
673         /*\r
674 \r
675                 Texture Attribute\r
676 \r
677         */\r
678 \r
679         //! Adds an attribute as texture reference\r
680         virtual void addTexture(const c8* attributeName, video::ITexture* texture, const io::path& filename = "") _IRR_OVERRIDE_;\r
681 \r
682         //! Sets an attribute as texture reference\r
683         virtual void setAttribute(const c8* attributeName, video::ITexture* texture, const io::path& filename = "") _IRR_OVERRIDE_;\r
684 \r
685         //! Gets an attribute as texture reference\r
686         //! \param attributeName: Name of the attribute to get.\r
687         //! \param defaultNotFound Value returned when attributeName was not found\r
688         virtual video::ITexture* getAttributeAsTexture(const c8* attributeName, video::ITexture* defaultNotFound=0) const _IRR_OVERRIDE_;\r
689 \r
690         //! Gets an attribute as texture reference\r
691         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
692         virtual video::ITexture* getAttributeAsTexture(s32 index) const _IRR_OVERRIDE_;\r
693 \r
694         //! Sets an attribute as texture reference\r
695         virtual void setAttribute(s32 index, video::ITexture* texture, const io::path& filename = "") _IRR_OVERRIDE_;\r
696 \r
697 \r
698 \r
699         /*\r
700 \r
701                 User Pointer Attribute\r
702 \r
703         */\r
704 \r
705         //! Adds an attribute as user pointer\r
706         virtual void addUserPointer(const c8* attributeName, void* userPointer) _IRR_OVERRIDE_;\r
707 \r
708         //! Sets an attribute as user pointer\r
709         virtual void setAttribute(const c8* attributeName, void* userPointer) _IRR_OVERRIDE_;\r
710 \r
711         //! Gets an attribute as user pointer\r
712         //! \param attributeName: Name of the attribute to get.\r
713         //! \param defaultNotFound Value returned when attributeName was not found\r
714         virtual void* getAttributeAsUserPointer(const c8* attributeName, void* defaultNotFound = 0) const _IRR_OVERRIDE_;\r
715 \r
716         //! Gets an attribute as user pointer\r
717         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
718         virtual void* getAttributeAsUserPointer(s32 index) const _IRR_OVERRIDE_;\r
719 \r
720         //! Sets an attribute as user pointer\r
721         virtual void setAttribute(s32 index, void* userPointer) _IRR_OVERRIDE_;\r
722 \r
723 protected:\r
724 \r
725         void readAttributeFromXML(const io::IXMLReader* reader);\r
726 \r
727         core::array<IAttribute*> Attributes;\r
728 \r
729         IAttribute* getAttributeP(const c8* attributeName) const;\r
730 \r
731         video::IVideoDriver* Driver;\r
732 };\r
733 \r
734 } // end namespace io\r
735 } // end namespace irr\r
736 \r
737 #endif\r
738 \r