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 __C_ATTRIBUTES_H_INCLUDED__
\r
6 #define __C_ATTRIBUTES_H_INCLUDED__
\r
8 #include "IrrCompileConfig.h"
\r
10 #include "IAttributes.h"
\r
11 #include "IAttribute.h"
\r
24 //! Implementation of the IAttributes interface
\r
25 class CAttributes : public IAttributes
\r
29 CAttributes(video::IVideoDriver* driver=0);
\r
32 //! Returns amount of attributes in this collection of attributes.
\r
33 virtual u32 getAttributeCount() const _IRR_OVERRIDE_;
\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
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
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
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
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
56 //! Returns if an attribute with a name exists
\r
57 virtual bool existsAttribute(const c8* attributeName) const _IRR_OVERRIDE_;
\r
59 //! Returns attribute index from name, -1 if not found
\r
60 virtual s32 findAttribute(const c8* attributeName) const _IRR_OVERRIDE_;
\r
62 //! Removes all attributes
\r
63 virtual void clear() _IRR_OVERRIDE_;
\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
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
81 //! Adds an attribute as integer
\r
82 virtual void addInt(const c8* attributeName, s32 value) _IRR_OVERRIDE_;
\r
84 //! Sets an attribute as integer value
\r
85 virtual void setAttribute(const c8* attributeName, s32 value) _IRR_OVERRIDE_;
\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
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
97 //! Sets an attribute as integer value
\r
98 virtual void setAttribute(s32 index, s32 value) _IRR_OVERRIDE_;
\r
106 //! Adds an attribute as float
\r
107 virtual void addFloat(const c8* attributeName, f32 value) _IRR_OVERRIDE_;
\r
109 //! Sets a attribute as float value
\r
110 virtual void setAttribute(const c8* attributeName, f32 value) _IRR_OVERRIDE_;
\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
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
122 //! Sets an attribute as float value
\r
123 virtual void setAttribute(s32 index, f32 value) _IRR_OVERRIDE_;
\r
131 //! Adds an attribute as string
\r
132 virtual void addString(const c8* attributeName, const c8* value) _IRR_OVERRIDE_;
\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
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
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
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
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
161 //! Adds an attribute as string
\r
162 virtual void addString(const c8* attributeName, const wchar_t* value) _IRR_OVERRIDE_;
\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
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
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
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
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
191 Binary Data Attribute
\r
195 //! Adds an attribute as binary data
\r
196 virtual void addBinary(const c8* attributeName, void* data, s32 dataSizeInBytes) _IRR_OVERRIDE_;
\r
198 //! Sets an attribute as binary data
\r
199 virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes) _IRR_OVERRIDE_;
\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
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
209 //! Sets an attribute as binary data
\r
210 virtual void setAttribute(s32 index, void* data, s32 dataSizeInBytes) _IRR_OVERRIDE_;
\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
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
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
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
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
247 //! Adds an attribute as bool
\r
248 virtual void addBool(const c8* attributeName, bool value) _IRR_OVERRIDE_;
\r
250 //! Sets an attribute as boolean value
\r
251 virtual void setAttribute(const c8* attributeName, bool value) _IRR_OVERRIDE_;
\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
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
263 //! Sets an attribute as boolean value
\r
264 virtual void setAttribute(s32 index, bool value) _IRR_OVERRIDE_;
\r
268 Enumeration Attribute
\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
275 //! Adds an attribute as enum
\r
276 virtual void addEnum(const c8* attributeName, s32 enumValue, const c8* const* enumerationLiterals) _IRR_OVERRIDE_;
\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
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
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
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
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
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
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
311 //! Sets an attribute as enumeration
\r
312 virtual void setAttribute(s32 index, const c8* enumValue, const c8* const* enumerationLiterals) _IRR_OVERRIDE_;
\r
321 //! Adds an attribute as color
\r
322 virtual void addColor(const c8* attributeName, video::SColor value) _IRR_OVERRIDE_;
\r
324 //! Sets a attribute as color
\r
325 virtual void setAttribute(const c8* attributeName, video::SColor color) _IRR_OVERRIDE_;
\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
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
337 //! Sets an attribute as color
\r
338 virtual void setAttribute(s32 index, video::SColor color) _IRR_OVERRIDE_;
\r
346 //! Adds an attribute as floating point color
\r
347 virtual void addColorf(const c8* attributeName, video::SColorf value) _IRR_OVERRIDE_;
\r
349 //! Sets a attribute as floating point color
\r
350 virtual void setAttribute(const c8* attributeName, video::SColorf color) _IRR_OVERRIDE_;
\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
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
362 //! Sets an attribute as floating point color
\r
363 virtual void setAttribute(s32 index, video::SColorf color) _IRR_OVERRIDE_;
\r
372 //! Adds an attribute as 3d vector
\r
373 virtual void addVector3d(const c8* attributeName, const core::vector3df& value) _IRR_OVERRIDE_;
\r
375 //! Sets a attribute as 3d vector
\r
376 virtual void setAttribute(const c8* attributeName, const core::vector3df& v) _IRR_OVERRIDE_;
\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
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
388 //! Sets an attribute as vector
\r
389 virtual void setAttribute(s32 index, const core::vector3df& v) _IRR_OVERRIDE_;
\r
398 //! Adds an attribute as 2d vector
\r
399 virtual void addVector2d(const c8* attributeName, const core::vector2df& value) _IRR_OVERRIDE_;
\r
401 //! Sets a attribute as 2d vector
\r
402 virtual void setAttribute(const c8* attributeName, const core::vector2df& v) _IRR_OVERRIDE_;
\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
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
414 //! Sets an attribute as vector
\r
415 virtual void setAttribute(s32 index, const core::vector2df& v) _IRR_OVERRIDE_;
\r
420 Position2d Attribute
\r
424 //! Adds an attribute as 2d position
\r
425 virtual void addPosition2d(const c8* attributeName, const core::position2di& value) _IRR_OVERRIDE_;
\r
427 //! Sets a attribute as 2d position
\r
428 virtual void setAttribute(const c8* attributeName, const core::position2di& v) _IRR_OVERRIDE_;
\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
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
440 //! Sets an attribute as 2d position
\r
441 virtual void setAttribute(s32 index, const core::position2di& v) _IRR_OVERRIDE_;
\r
445 Rectangle Attribute
\r
449 //! Adds an attribute as rectangle
\r
450 virtual void addRect(const c8* attributeName, const core::rect<s32>& value) _IRR_OVERRIDE_;
\r
452 //! Sets an attribute as rectangle
\r
453 virtual void setAttribute(const c8* attributeName, const core::rect<s32>& v) _IRR_OVERRIDE_;
\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
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
465 //! Sets an attribute as rectangle
\r
466 virtual void setAttribute(s32 index, const core::rect<s32>& v) _IRR_OVERRIDE_;
\r
471 Dimension2d Attribute
\r
475 //! Adds an attribute as dimension2d
\r
476 virtual void addDimension2d(const c8* attributeName, const core::dimension2d<u32>& value) _IRR_OVERRIDE_;
\r
478 //! Sets an attribute as dimension2d
\r
479 virtual void setAttribute(const c8* attributeName, const core::dimension2d<u32>& v) _IRR_OVERRIDE_;
\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
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
491 //! Sets an attribute as dimension2d
\r
492 virtual void setAttribute(s32 index, const core::dimension2d<u32>& v) _IRR_OVERRIDE_;
\r
501 //! Adds an attribute as matrix
\r
502 virtual void addMatrix(const c8* attributeName, const core::matrix4& v) _IRR_OVERRIDE_;
\r
504 //! Sets an attribute as matrix
\r
505 virtual void setAttribute(const c8* attributeName, const core::matrix4& v) _IRR_OVERRIDE_;
\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
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
517 //! Sets an attribute as matrix
\r
518 virtual void setAttribute(s32 index, const core::matrix4& v) _IRR_OVERRIDE_;
\r
521 quaternion attribute
\r
525 //! Adds an attribute as quaternion
\r
526 virtual void addQuaternion(const c8* attributeName, const core::quaternion& v) _IRR_OVERRIDE_;
\r
528 //! Sets an attribute as quaternion
\r
529 virtual void setAttribute(const c8* attributeName, const core::quaternion& v) _IRR_OVERRIDE_;
\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
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
541 //! Sets an attribute as quaternion
\r
542 virtual void setAttribute(s32 index, const core::quaternion& v) _IRR_OVERRIDE_;
\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
553 //! Sets an attribute as axis aligned bounding box
\r
554 virtual void setAttribute(const c8* attributeName, const core::aabbox3df& v) _IRR_OVERRIDE_;
\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
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
566 //! Sets an attribute as axis aligned bounding box
\r
567 virtual void setAttribute(s32 index, const core::aabbox3df& v) _IRR_OVERRIDE_;
\r
575 //! Adds an attribute as 3d plane
\r
576 virtual void addPlane3d(const c8* attributeName, const core::plane3df& v) _IRR_OVERRIDE_;
\r
578 //! Sets an attribute as 3d plane
\r
579 virtual void setAttribute(const c8* attributeName, const core::plane3df& v) _IRR_OVERRIDE_;
\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
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
591 //! Sets an attribute as 3d plane
\r
592 virtual void setAttribute(s32 index, const core::plane3df& v) _IRR_OVERRIDE_;
\r
601 //! Adds an attribute as 3d triangle
\r
602 virtual void addTriangle3d(const c8* attributeName, const core::triangle3df& v) _IRR_OVERRIDE_;
\r
604 //! Sets an attribute as 3d triangle
\r
605 virtual void setAttribute(const c8* attributeName, const core::triangle3df& v) _IRR_OVERRIDE_;
\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
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
617 //! Sets an attribute as 3d triangle
\r
618 virtual void setAttribute(s32 index, const core::triangle3df& v) _IRR_OVERRIDE_;
\r
627 //! Adds an attribute as a 2d line
\r
628 virtual void addLine2d(const c8* attributeName, const core::line2df& v) _IRR_OVERRIDE_;
\r
630 //! Sets an attribute as a 2d line
\r
631 virtual void setAttribute(const c8* attributeName, const core::line2df& v) _IRR_OVERRIDE_;
\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
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
643 //! Sets an attribute as a 2d line
\r
644 virtual void setAttribute(s32 index, const core::line2df& v) _IRR_OVERRIDE_;
\r
653 //! Adds an attribute as a 3d line
\r
654 virtual void addLine3d(const c8* attributeName, const core::line3df& v) _IRR_OVERRIDE_;
\r
656 //! Sets an attribute as a 3d line
\r
657 virtual void setAttribute(const c8* attributeName, const core::line3df& v) _IRR_OVERRIDE_;
\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
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
669 //! Sets an attribute as a 3d line
\r
670 virtual void setAttribute(s32 index, const core::line3df& v) _IRR_OVERRIDE_;
\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
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
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
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
694 //! Sets an attribute as texture reference
\r
695 virtual void setAttribute(s32 index, video::ITexture* texture, const io::path& filename = "") _IRR_OVERRIDE_;
\r
701 User Pointer Attribute
\r
705 //! Adds an attribute as user pointer
\r
706 virtual void addUserPointer(const c8* attributeName, void* userPointer) _IRR_OVERRIDE_;
\r
708 //! Sets an attribute as user pointer
\r
709 virtual void setAttribute(const c8* attributeName, void* userPointer) _IRR_OVERRIDE_;
\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
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
720 //! Sets an attribute as user pointer
\r
721 virtual void setAttribute(s32 index, void* userPointer) _IRR_OVERRIDE_;
\r
725 void readAttributeFromXML(const io::IXMLReader* reader);
\r
727 core::array<IAttribute*> Attributes;
\r
729 IAttribute* getAttributeP(const c8* attributeName) const;
\r
731 video::IVideoDriver* Driver;
\r
734 } // end namespace io
\r
735 } // end namespace irr
\r