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