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
5 #ifndef __I_ATTRIBUTES_H_INCLUDED__
\r
6 #define __I_ATTRIBUTES_H_INCLUDED__
\r
8 #include "IReferenceCounted.h"
\r
10 #include "vector3d.h"
\r
11 #include "vector2d.h"
\r
14 #include "triangle3d.h"
\r
15 #include "position2d.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
24 #include "irrString.h"
\r
25 #include "irrArray.h"
\r
26 #include "EAttributes.h"
\r
34 } // end namespace video
\r
38 //! Provides a generic interface for attributes and their values and the possibility to serialize them
\r
39 class IAttributes : public virtual IReferenceCounted
\r
43 //! Returns amount of attributes in this collection of attributes.
\r
44 virtual u32 getAttributeCount() const = 0;
\r
46 //! Returns attribute name by index.
\r
47 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
48 virtual const c8* getAttributeName(s32 index) const = 0;
\r
50 //! Returns the type of an attribute
\r
51 //! \param attributeName: Name for the attribute
\r
52 virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) const = 0;
\r
54 //! Returns attribute type by index.
\r
55 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
56 virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) const = 0;
\r
58 //! Returns the type string of the attribute
\r
59 //! \param attributeName: String for the attribute type
\r
60 //! \param defaultNotFound Value returned when attributeName was not found
\r
61 virtual const wchar_t* getAttributeTypeString(const c8* attributeName, const wchar_t* defaultNotFound = L"unknown") const = 0;
\r
63 //! Returns the type string of the attribute by index.
\r
64 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
65 //! \param defaultNotFound Value returned for an invalid index
\r
66 virtual const wchar_t* getAttributeTypeString(s32 index, const wchar_t* defaultNotFound = L"unknown") const = 0;
\r
68 //! Returns if an attribute with a name exists
\r
69 virtual bool existsAttribute(const c8* attributeName) const = 0;
\r
71 //! Returns attribute index from name, -1 if not found
\r
72 virtual s32 findAttribute(const c8* attributeName) const = 0;
\r
74 //! Removes all attributes
\r
75 virtual void clear() = 0;
\r
84 //! Adds an attribute as integer
\r
85 virtual void addInt(const c8* attributeName, s32 value) = 0;
\r
87 //! Sets an attribute as integer value
\r
88 virtual void setAttribute(const c8* attributeName, s32 value) = 0;
\r
90 //! Gets an attribute as integer value
\r
91 //! \param attributeName: Name of the attribute to get.
\r
92 //! \param defaultNotFound Value returned when attributeName was not found
\r
93 //! \return Returns value of the attribute previously set by setAttribute()
\r
94 virtual s32 getAttributeAsInt(const c8* attributeName, irr::s32 defaultNotFound=0) const = 0;
\r
96 //! Gets an attribute as integer value
\r
97 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
98 virtual s32 getAttributeAsInt(s32 index) const = 0;
\r
100 //! Sets an attribute as integer value
\r
101 virtual void setAttribute(s32 index, s32 value) = 0;
\r
109 //! Adds an attribute as float
\r
110 virtual void addFloat(const c8* attributeName, f32 value) = 0;
\r
112 //! Sets a attribute as float value
\r
113 virtual void setAttribute(const c8* attributeName, f32 value) = 0;
\r
115 //! Gets an attribute as float value
\r
116 //! \param attributeName: Name of the attribute to get.
\r
117 //! \param defaultNotFound Value returned when attributeName was not found
\r
118 //! \return Returns value of the attribute previously set by setAttribute()
\r
119 virtual f32 getAttributeAsFloat(const c8* attributeName, irr::f32 defaultNotFound=0.f) const = 0;
\r
121 //! Gets an attribute as float value
\r
122 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
123 virtual f32 getAttributeAsFloat(s32 index) const = 0;
\r
125 //! Sets an attribute as float value
\r
126 virtual void setAttribute(s32 index, f32 value) = 0;
\r
134 //! Adds an attribute as string
\r
135 virtual void addString(const c8* attributeName, const c8* value) = 0;
\r
137 //! Sets an attribute value as string.
\r
138 //! \param attributeName: Name for the attribute
\r
139 //! \param value: Value for the attribute. Set this to 0 to delete the attribute
\r
140 virtual void setAttribute(const c8* attributeName, const c8* value) = 0;
\r
142 //! Gets an attribute as string.
\r
143 //! \param attributeName: Name of the attribute to get.
\r
144 //! \param defaultNotFound Value returned when attributeName was not found
\r
145 //! \return Returns value of the attribute previously set by setAttribute()
\r
146 //! or defaultNotFound if attribute is not set.
\r
147 virtual core::stringc getAttributeAsString(const c8* attributeName, const core::stringc& defaultNotFound=core::stringc()) const = 0;
\r
149 //! Gets an attribute as string.
\r
150 //! \param attributeName Name of the attribute to get.
\r
151 //! \param target Buffer where the string is copied to.
\r
152 virtual void getAttributeAsString(const c8* attributeName, c8* target) const = 0;
\r
154 //! Returns attribute value as string by index.
\r
155 //! \param index Index value, must be between 0 and getAttributeCount()-1.
\r
156 virtual core::stringc getAttributeAsString(s32 index) const = 0;
\r
158 //! Sets an attribute value as string.
\r
159 //! \param index Index value, must be between 0 and getAttributeCount()-1.
\r
160 //! \param value String to which the attribute is set.
\r
161 virtual void setAttribute(s32 index, const c8* value) = 0;
\r
165 //! Adds an attribute as string
\r
166 virtual void addString(const c8* attributeName, const wchar_t* value) = 0;
\r
168 //! Sets an attribute value as string.
\r
169 //! \param attributeName: Name for the attribute
\r
170 //! \param value: Value for the attribute. Set this to 0 to delete the attribute
\r
171 virtual void setAttribute(const c8* attributeName, const wchar_t* value) = 0;
\r
173 //! Gets an attribute as string.
\r
174 //! \param attributeName: Name of the attribute to get.
\r
175 //! \param defaultNotFound Value returned when attributeName was not found
\r
176 //! \return Returns value of the attribute previously set by setAttribute()
\r
177 //! or defaultNotFound if attribute is not set.
\r
178 virtual core::stringw getAttributeAsStringW(const c8* attributeName, const core::stringw& defaultNotFound = core::stringw()) const = 0;
\r
180 //! Gets an attribute as string.
\r
181 //! \param attributeName: Name of the attribute to get.
\r
182 //! \param target: Buffer where the string is copied to.
\r
183 virtual void getAttributeAsStringW(const c8* attributeName, wchar_t* target) const = 0;
\r
185 //! Returns attribute value as string by index.
\r
186 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
187 virtual core::stringw getAttributeAsStringW(s32 index) const = 0;
\r
189 //! Sets an attribute value as string.
\r
190 //! \param index Index value, must be between 0 and getAttributeCount()-1.
\r
191 //! \param value String to which the attribute is set.
\r
192 virtual void setAttribute(s32 index, const wchar_t* value) = 0;
\r
196 Binary Data Attribute
\r
200 //! Adds an attribute as binary data
\r
201 virtual void addBinary(const c8* attributeName, void* data, s32 dataSizeInBytes) = 0;
\r
203 //! Sets an attribute as binary data
\r
204 virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes ) = 0;
\r
206 //! Gets an attribute as binary data
\r
207 /** \param attributeName: Name of the attribute to get.
\r
208 \param outData Pointer to buffer where data shall be stored.
\r
209 \param maxSizeInBytes Maximum number of bytes to write into outData.
\r
211 virtual void getAttributeAsBinaryData(const c8* attributeName, void* outData, s32 maxSizeInBytes) const = 0;
\r
213 //! Gets an attribute as binary data
\r
214 /** \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
215 \param outData Pointer to buffer where data shall be stored.
\r
216 \param maxSizeInBytes Maximum number of bytes to write into outData.
\r
218 virtual void getAttributeAsBinaryData(s32 index, void* outData, s32 maxSizeInBytes) const = 0;
\r
220 //! Sets an attribute as binary data
\r
221 virtual void setAttribute(s32 index, void* data, s32 dataSizeInBytes ) = 0;
\r
228 //! Adds an attribute as wide string array
\r
229 virtual void addArray(const c8* attributeName, const core::array<core::stringw>& value) = 0;
\r
231 //! Sets an attribute value as a wide string array.
\r
232 //! \param attributeName: Name for the attribute
\r
233 //! \param value: Value for the attribute. Set this to 0 to delete the attribute
\r
234 virtual void setAttribute(const c8* attributeName, const core::array<core::stringw>& value) = 0;
\r
236 //! Gets an attribute as an array of wide strings.
\r
237 //! \param attributeName: Name of the attribute to get.
\r
238 //! \param defaultNotFound Value returned when attributeName was not found
\r
239 //! \return Returns value of the attribute previously set by setAttribute()
\r
240 //! or defaultNotFound if attribute is not set.
\r
241 virtual core::array<core::stringw> getAttributeAsArray(const c8* attributeName, const core::array<core::stringw>& defaultNotFound = core::array<core::stringw>()) const = 0;
\r
243 //! Returns attribute value as an array of wide strings by index.
\r
244 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
245 virtual core::array<core::stringw> getAttributeAsArray(s32 index) const = 0;
\r
247 //! Sets an attribute as an array of wide strings
\r
248 virtual void setAttribute(s32 index, const core::array<core::stringw>& value) = 0;
\r
257 //! Adds an attribute as bool
\r
258 virtual void addBool(const c8* attributeName, bool value) = 0;
\r
260 //! Sets an attribute as boolean value
\r
261 virtual void setAttribute(const c8* attributeName, bool value) = 0;
\r
263 //! Gets an attribute as boolean value
\r
264 //! \param attributeName: Name of the attribute to get.
\r
265 //! \param defaultNotFound Value returned when attributeName was not found
\r
266 //! \return Returns value of the attribute previously set by setAttribute()
\r
267 virtual bool getAttributeAsBool(const c8* attributeName, bool defaultNotFound=false) const = 0;
\r
269 //! Gets an attribute as boolean value
\r
270 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
271 virtual bool getAttributeAsBool(s32 index) const = 0;
\r
273 //! Sets an attribute as boolean value
\r
274 virtual void setAttribute(s32 index, bool value) = 0;
\r
278 Enumeration Attribute
\r
282 //! Adds an attribute as enum
\r
283 virtual void addEnum(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
\r
285 //! Adds an attribute as enum
\r
286 virtual void addEnum(const c8* attributeName, s32 enumValue, const c8* const* enumerationLiterals) = 0;
\r
288 //! Sets an attribute as enumeration
\r
289 virtual void setAttribute(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
\r
291 //! Gets an attribute as enumeration
\r
292 //! \param attributeName: Name of the attribute to get.
\r
293 //! \param defaultNotFound Value returned when attributeName was not found
\r
294 //! \return Returns value of the attribute previously set by setAttribute()
\r
295 virtual const c8* getAttributeAsEnumeration(const c8* attributeName, const c8* defaultNotFound = 0) const = 0;
\r
297 //! Gets an attribute as enumeration
\r
298 /** \param attributeName: Name of the attribute to get.
\r
299 \param enumerationLiteralsToUse: Use these enumeration literals to get
\r
300 the index value instead of the set ones. This is useful when the
\r
301 attribute list maybe was read from an xml file, and only contains the
\r
302 enumeration string, but no information about its index.
\r
303 \return Returns value of the attribute previously set by setAttribute()
\r
305 virtual s32 getAttributeAsEnumeration(const c8* attributeName, const c8* const* enumerationLiteralsToUse, s32 defaultNotFound = -1) const = 0;
\r
307 //! Gets an attribute as enumeration
\r
308 /** \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
309 \param enumerationLiteralsToUse: Use these enumeration literals to get
\r
310 the index value instead of the set ones. This is useful when the
\r
311 attribute list maybe was read from an xml file, and only contains the
\r
312 enumeration string, but no information about its index.
\r
313 \param defaultNotFound Value returned when the attribute referenced by the index was not found.
\r
314 \return Returns value of the attribute previously set by setAttribute()
\r
316 virtual s32 getAttributeAsEnumeration(s32 index, const c8* const* enumerationLiteralsToUse, s32 defaultNotFound = -1) const = 0;
\r
318 //! Gets an attribute as enumeration
\r
319 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
320 virtual const c8* getAttributeAsEnumeration(s32 index) const = 0;
\r
322 //! Gets the list of enumeration literals of an enumeration attribute
\r
323 //! \param attributeName Name of the attribute to get.
\r
324 //! \param outLiterals Set of strings to choose the enum name from.
\r
325 virtual void getAttributeEnumerationLiteralsOfEnumeration(const c8* attributeName, core::array<core::stringc>& outLiterals) const = 0;
\r
327 //! Gets the list of enumeration literals of an enumeration attribute
\r
328 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
329 //! \param outLiterals Set of strings to choose the enum name from.
\r
330 virtual void getAttributeEnumerationLiteralsOfEnumeration(s32 index, core::array<core::stringc>& outLiterals) const = 0;
\r
332 //! Sets an attribute as enumeration
\r
333 virtual void setAttribute(s32 index, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
\r
342 //! Adds an attribute as color
\r
343 virtual void addColor(const c8* attributeName, video::SColor value) = 0;
\r
346 //! Sets a attribute as color
\r
347 virtual void setAttribute(const c8* attributeName, video::SColor color) = 0;
\r
349 //! Gets an attribute as color
\r
350 //! \param attributeName: Name of the attribute to get.
\r
351 //! \param defaultNotFound Value returned when attributeName was not found
\r
352 //! \return Returns value of the attribute previously set by setAttribute()
\r
353 virtual video::SColor getAttributeAsColor(const c8* attributeName, const video::SColor& defaultNotFound = video::SColor(0)) const = 0;
\r
355 //! Gets an attribute as color
\r
356 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
357 virtual video::SColor getAttributeAsColor(s32 index) const = 0;
\r
359 //! Sets an attribute as color
\r
360 virtual void setAttribute(s32 index, video::SColor color) = 0;
\r
368 //! Adds an attribute as floating point color
\r
369 virtual void addColorf(const c8* attributeName, video::SColorf value) = 0;
\r
371 //! Sets a attribute as floating point color
\r
372 virtual void setAttribute(const c8* attributeName, video::SColorf color) = 0;
\r
374 //! Gets an attribute as floating point color
\r
375 //! \param attributeName: Name of the attribute to get.
\r
376 //! \param defaultNotFound Value returned when attributeName was not found
\r
377 //! \return Returns value of the attribute previously set by setAttribute()
\r
378 virtual video::SColorf getAttributeAsColorf(const c8* attributeName, const video::SColorf& defaultNotFound = video::SColorf(0)) const = 0;
\r
380 //! Gets an attribute as floating point color
\r
381 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
382 virtual video::SColorf getAttributeAsColorf(s32 index) const = 0;
\r
384 //! Sets an attribute as floating point color
\r
385 virtual void setAttribute(s32 index, video::SColorf color) = 0;
\r
394 //! Adds an attribute as 3d vector
\r
395 virtual void addVector3d(const c8* attributeName, const core::vector3df& value) = 0;
\r
397 //! Sets a attribute as 3d vector
\r
398 virtual void setAttribute(const c8* attributeName, const core::vector3df& v) = 0;
\r
400 //! Gets an attribute as 3d vector
\r
401 //! \param attributeName: Name of the attribute to get.
\r
402 //! \param defaultNotFound Value returned when attributeName was not found
\r
403 //! \return Returns value of the attribute previously set by setAttribute()
\r
404 virtual core::vector3df getAttributeAsVector3d(const c8* attributeName, const core::vector3df& defaultNotFound=core::vector3df(0,0,0)) const = 0;
\r
406 //! Gets an attribute as 3d vector
\r
407 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
408 virtual core::vector3df getAttributeAsVector3d(s32 index) const = 0;
\r
410 //! Sets an attribute as vector
\r
411 virtual void setAttribute(s32 index, const core::vector3df& v) = 0;
\r
419 //! Adds an attribute as 2d vector
\r
420 virtual void addVector2d(const c8* attributeName, const core::vector2df& value) = 0;
\r
422 //! Sets a attribute as 2d vector
\r
423 virtual void setAttribute(const c8* attributeName, const core::vector2df& v) = 0;
\r
425 //! Gets an attribute as vector
\r
426 //! \param attributeName: Name of the attribute to get.
\r
427 //! \param defaultNotFound Value returned when attributeName was not found
\r
428 //! \return Returns value of the attribute previously set by setAttribute()
\r
429 virtual core::vector2df getAttributeAsVector2d(const c8* attributeName, const core::vector2df& defaultNotFound=core::vector2df(0,0)) const = 0;
\r
431 //! Gets an attribute as position
\r
432 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
433 virtual core::vector2df getAttributeAsVector2d(s32 index) const = 0;
\r
435 //! Sets an attribute as 2d vector
\r
436 virtual void setAttribute(s32 index, const core::vector2df& v) = 0;
\r
440 Position2d Attribute
\r
444 //! Adds an attribute as 2d position
\r
445 virtual void addPosition2d(const c8* attributeName, const core::position2di& value) = 0;
\r
447 //! Sets a attribute as 2d position
\r
448 virtual void setAttribute(const c8* attributeName, const core::position2di& v) = 0;
\r
450 //! Gets an attribute as position
\r
451 //! \param attributeName: Name of the attribute to get.
\r
452 //! \param defaultNotFound Value returned when attributeName was not found
\r
453 //! \return Returns value of the attribute previously set by setAttribute()
\r
454 virtual core::position2di getAttributeAsPosition2d(const c8* attributeName, const core::position2di& defaultNotFound=core::position2di(0,0)) const = 0;
\r
456 //! Gets an attribute as position
\r
457 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
458 virtual core::position2di getAttributeAsPosition2d(s32 index) const = 0;
\r
460 //! Sets an attribute as 2d position
\r
461 virtual void setAttribute(s32 index, const core::position2di& v) = 0;
\r
465 Rectangle Attribute
\r
469 //! Adds an attribute as rectangle
\r
470 virtual void addRect(const c8* attributeName, const core::rect<s32>& value) = 0;
\r
472 //! Sets an attribute as rectangle
\r
473 virtual void setAttribute(const c8* attributeName, const core::rect<s32>& v) = 0;
\r
475 //! Gets an attribute as rectangle
\r
476 //! \param attributeName: Name of the attribute to get.
\r
477 //! \param defaultNotFound Value returned when attributeName was not found
\r
478 //! \return Returns value of the attribute previously set by setAttribute()
\r
479 virtual core::rect<s32> getAttributeAsRect(const c8* attributeName, const core::rect<s32>& defaultNotFound = core::rect<s32>()) const = 0;
\r
481 //! Gets an attribute as rectangle
\r
482 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
483 virtual core::rect<s32> getAttributeAsRect(s32 index) const = 0;
\r
485 //! Sets an attribute as rectangle
\r
486 virtual void setAttribute(s32 index, const core::rect<s32>& v) = 0;
\r
491 Dimension2d Attribute
\r
495 //! Adds an attribute as dimension2d
\r
496 virtual void addDimension2d(const c8* attributeName, const core::dimension2d<u32>& value) = 0;
\r
498 //! Sets an attribute as dimension2d
\r
499 virtual void setAttribute(const c8* attributeName, const core::dimension2d<u32>& v) = 0;
\r
501 //! Gets an attribute as dimension2d
\r
502 //! \param attributeName: Name of the attribute to get.
\r
503 //! \param defaultNotFound Value returned when attributeName was not found
\r
504 //! \return Returns value of the attribute previously set by setAttribute()
\r
505 virtual core::dimension2d<u32> getAttributeAsDimension2d(const c8* attributeName, const core::dimension2d<u32>& defaultNotFound = core::dimension2d<u32>()) const = 0;
\r
507 //! Gets an attribute as dimension2d
\r
508 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
509 virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) const = 0;
\r
511 //! Sets an attribute as dimension2d
\r
512 virtual void setAttribute(s32 index, const core::dimension2d<u32>& v) = 0;
\r
519 //! Adds an attribute as matrix
\r
520 virtual void addMatrix(const c8* attributeName, const core::matrix4& v) = 0;
\r
522 //! Sets an attribute as matrix
\r
523 virtual void setAttribute(const c8* attributeName, const core::matrix4& v) = 0;
\r
525 //! Gets an attribute as a matrix4
\r
526 //! \param attributeName: Name of the attribute to get.
\r
527 //! \param defaultNotFound Value returned when attributeName was not found
\r
528 //! \return Returns value of the attribute previously set by setAttribute()
\r
529 virtual core::matrix4 getAttributeAsMatrix(const c8* attributeName, const core::matrix4& defaultNotFound=core::matrix4()) const = 0;
\r
531 //! Gets an attribute as matrix
\r
532 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
533 virtual core::matrix4 getAttributeAsMatrix(s32 index) const = 0;
\r
535 //! Sets an attribute as matrix
\r
536 virtual void setAttribute(s32 index, const core::matrix4& v) = 0;
\r
539 quaternion attribute
\r
543 //! Adds an attribute as quaternion
\r
544 virtual void addQuaternion(const c8* attributeName, const core::quaternion& v) = 0;
\r
546 //! Sets an attribute as quaternion
\r
547 virtual void setAttribute(const c8* attributeName, const core::quaternion& v) = 0;
\r
549 //! Gets an attribute as a quaternion
\r
550 //! \param attributeName: Name of the attribute to get.
\r
551 //! \param defaultNotFound Value returned when attributeName was not found
\r
552 //! \return Returns value of the attribute previously set by setAttribute()
\r
553 virtual core::quaternion getAttributeAsQuaternion(const c8* attributeName, const core::quaternion& defaultNotFound=core::quaternion(0,1,0, 0)) const = 0;
\r
555 //! Gets an attribute as quaternion
\r
556 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
557 virtual core::quaternion getAttributeAsQuaternion(s32 index) const = 0;
\r
559 //! Sets an attribute as quaternion
\r
560 virtual void setAttribute(s32 index, const core::quaternion& v) = 0;
\r
568 //! Adds an attribute as axis aligned bounding box
\r
569 virtual void addBox3d(const c8* attributeName, const core::aabbox3df& v) = 0;
\r
571 //! Sets an attribute as axis aligned bounding box
\r
572 virtual void setAttribute(const c8* attributeName, const core::aabbox3df& v) = 0;
\r
574 //! Gets an attribute as a axis aligned bounding box
\r
575 //! \param attributeName: Name of the attribute to get.
\r
576 //! \param defaultNotFound Value returned when attributeName was not found
\r
577 //! \return Returns value of the attribute previously set by setAttribute()
\r
578 virtual core::aabbox3df getAttributeAsBox3d(const c8* attributeName, const core::aabbox3df& defaultNotFound=core::aabbox3df(0,0,0, 0,0,0)) const = 0;
\r
580 //! Gets an attribute as axis aligned bounding box
\r
581 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
582 virtual core::aabbox3df getAttributeAsBox3d(s32 index) const = 0;
\r
584 //! Sets an attribute as axis aligned bounding box
\r
585 virtual void setAttribute(s32 index, const core::aabbox3df& v) = 0;
\r
593 //! Adds an attribute as 3d plane
\r
594 virtual void addPlane3d(const c8* attributeName, const core::plane3df& v) = 0;
\r
596 //! Sets an attribute as 3d plane
\r
597 virtual void setAttribute(const c8* attributeName, const core::plane3df& v) = 0;
\r
599 //! Gets an attribute as a 3d plane
\r
600 //! \param attributeName: Name of the attribute to get.
\r
601 //! \param defaultNotFound Value returned when attributeName was not found
\r
602 //! \return Returns value of the attribute previously set by setAttribute()
\r
603 virtual core::plane3df getAttributeAsPlane3d(const c8* attributeName, const core::plane3df& defaultNotFound=core::plane3df(0,0,0, 0,1,0)) const = 0;
\r
605 //! Gets an attribute as 3d plane
\r
606 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
607 virtual core::plane3df getAttributeAsPlane3d(s32 index) const = 0;
\r
609 //! Sets an attribute as 3d plane
\r
610 virtual void setAttribute(s32 index, const core::plane3df& v) = 0;
\r
619 //! Adds an attribute as 3d triangle
\r
620 virtual void addTriangle3d(const c8* attributeName, const core::triangle3df& v) = 0;
\r
622 //! Sets an attribute as 3d trianle
\r
623 virtual void setAttribute(const c8* attributeName, const core::triangle3df& v) = 0;
\r
625 //! Gets an attribute as a 3d triangle
\r
626 //! \param attributeName: Name of the attribute to get.
\r
627 //! \param defaultNotFound Value returned when attributeName was not found
\r
628 //! \return Returns value of the attribute previously set by setAttribute()
\r
629 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
631 //! Gets an attribute as 3d triangle
\r
632 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
633 virtual core::triangle3df getAttributeAsTriangle3d(s32 index) const = 0;
\r
635 //! Sets an attribute as 3d triangle
\r
636 virtual void setAttribute(s32 index, const core::triangle3df& v) = 0;
\r
645 //! Adds an attribute as a 2d line
\r
646 virtual void addLine2d(const c8* attributeName, const core::line2df& v) = 0;
\r
648 //! Sets an attribute as a 2d line
\r
649 virtual void setAttribute(const c8* attributeName, const core::line2df& v) = 0;
\r
651 //! Gets an attribute as a 2d line
\r
652 //! \param attributeName: Name of the attribute to get.
\r
653 //! \param defaultNotFound Value returned when attributeName was not found
\r
654 //! \return Returns value of the attribute previously set by setAttribute()
\r
655 virtual core::line2df getAttributeAsLine2d(const c8* attributeName, const core::line2df& defaultNotFound = core::line2df(0,0, 0,0)) const = 0;
\r
657 //! Gets an attribute as a 2d line
\r
658 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
659 virtual core::line2df getAttributeAsLine2d(s32 index) const = 0;
\r
661 //! Sets an attribute as a 2d line
\r
662 virtual void setAttribute(s32 index, const core::line2df& v) = 0;
\r
671 //! Adds an attribute as a 3d line
\r
672 virtual void addLine3d(const c8* attributeName, const core::line3df& v) = 0;
\r
674 //! Sets an attribute as a 3d line
\r
675 virtual void setAttribute(const c8* attributeName, const core::line3df& v) = 0;
\r
677 //! Gets an attribute as a 3d line
\r
678 //! \param attributeName: Name of the attribute to get.
\r
679 //! \param defaultNotFound Value returned when attributeName was not found
\r
680 //! \return Returns value of the attribute previously set by setAttribute()
\r
681 virtual core::line3df getAttributeAsLine3d(const c8* attributeName, const core::line3df& defaultNotFound=core::line3df(0,0,0, 0,0,0)) const = 0;
\r
683 //! Gets an attribute as a 3d line
\r
684 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
685 virtual core::line3df getAttributeAsLine3d(s32 index) const = 0;
\r
687 //! Sets an attribute as a 3d line
\r
688 virtual void setAttribute(s32 index, const core::line3df& v) = 0;
\r
697 //! Adds an attribute as texture reference
\r
698 virtual void addTexture(const c8* attributeName, video::ITexture* texture, const io::path& filename = "") = 0;
\r
700 //! Sets an attribute as texture reference
\r
701 virtual void setAttribute(const c8* attributeName, video::ITexture* texture, const io::path& filename = "") = 0;
\r
703 //! Gets an attribute as texture reference
\r
704 //! \param attributeName: Name of the attribute to get.
\r
705 //! \param defaultNotFound Value returned when attributeName was not found
\r
706 virtual video::ITexture* getAttributeAsTexture(const c8* attributeName, video::ITexture* defaultNotFound=0) const = 0;
\r
708 //! Gets an attribute as texture reference
\r
709 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
710 virtual video::ITexture* getAttributeAsTexture(s32 index) const = 0;
\r
712 //! Sets an attribute as texture reference
\r
713 virtual void setAttribute(s32 index, video::ITexture* texture, const io::path& filename = "") = 0;
\r
718 User Pointer Attribute
\r
722 //! Adds an attribute as user pointer
\r
723 virtual void addUserPointer(const c8* attributeName, void* userPointer) = 0;
\r
725 //! Sets an attribute as user pointer
\r
726 virtual void setAttribute(const c8* attributeName, void* userPointer) = 0;
\r
728 //! Gets an attribute as user pointer
\r
729 //! \param attributeName: Name of the attribute to get.
\r
730 //! \param defaultNotFound Value returned when attributeName was not found
\r
731 virtual void* getAttributeAsUserPointer(const c8* attributeName, void* defaultNotFound = 0) const = 0;
\r
733 //! Gets an attribute as user pointer
\r
734 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
\r
735 virtual void* getAttributeAsUserPointer(s32 index) const = 0;
\r
737 //! Sets an attribute as user pointer
\r
738 virtual void setAttribute(s32 index, void* userPointer) = 0;
\r
742 } // end namespace io
\r
743 } // end namespace irr
\r