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 "IXMLReader.h"
\r
27 #include "IXMLWriter.h"
\r
28 #include "EAttributes.h"
\r
36 } // end namespace video
\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
45 //! Returns amount of attributes in this collection of attributes.
\r
46 virtual u32 getAttributeCount() const = 0;
\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
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
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
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
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
70 //! Returns if an attribute with a name exists
\r
71 virtual bool existsAttribute(const c8* attributeName) const = 0;
\r
73 //! Returns attribute index from name, -1 if not found
\r
74 virtual s32 findAttribute(const c8* attributeName) const = 0;
\r
76 //! Removes all attributes
\r
77 virtual void clear() = 0;
\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
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
100 //! Adds an attribute as integer
\r
101 virtual void addInt(const c8* attributeName, s32 value) = 0;
\r
103 //! Sets an attribute as integer value
\r
104 virtual void setAttribute(const c8* attributeName, s32 value) = 0;
\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
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
116 //! Sets an attribute as integer value
\r
117 virtual void setAttribute(s32 index, s32 value) = 0;
\r
125 //! Adds an attribute as float
\r
126 virtual void addFloat(const c8* attributeName, f32 value) = 0;
\r
128 //! Sets a attribute as float value
\r
129 virtual void setAttribute(const c8* attributeName, f32 value) = 0;
\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
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
141 //! Sets an attribute as float value
\r
142 virtual void setAttribute(s32 index, f32 value) = 0;
\r
150 //! Adds an attribute as string
\r
151 virtual void addString(const c8* attributeName, const c8* value) = 0;
\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
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
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
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
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
181 //! Adds an attribute as string
\r
182 virtual void addString(const c8* attributeName, const wchar_t* value) = 0;
\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
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
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
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
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
212 Binary Data Attribute
\r
216 //! Adds an attribute as binary data
\r
217 virtual void addBinary(const c8* attributeName, void* data, s32 dataSizeInBytes) = 0;
\r
219 //! Sets an attribute as binary data
\r
220 virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes ) = 0;
\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
227 virtual void getAttributeAsBinaryData(const c8* attributeName, void* outData, s32 maxSizeInBytes) const = 0;
\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
234 virtual void getAttributeAsBinaryData(s32 index, void* outData, s32 maxSizeInBytes) const = 0;
\r
236 //! Sets an attribute as binary data
\r
237 virtual void setAttribute(s32 index, void* data, s32 dataSizeInBytes ) = 0;
\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
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
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
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
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
273 //! Adds an attribute as bool
\r
274 virtual void addBool(const c8* attributeName, bool value) = 0;
\r
276 //! Sets an attribute as boolean value
\r
277 virtual void setAttribute(const c8* attributeName, bool value) = 0;
\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
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
289 //! Sets an attribute as boolean value
\r
290 virtual void setAttribute(s32 index, bool value) = 0;
\r
294 Enumeration Attribute
\r
298 //! Adds an attribute as enum
\r
299 virtual void addEnum(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
\r
301 //! Adds an attribute as enum
\r
302 virtual void addEnum(const c8* attributeName, s32 enumValue, const c8* const* enumerationLiterals) = 0;
\r
304 //! Sets an attribute as enumeration
\r
305 virtual void setAttribute(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
\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
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
321 virtual s32 getAttributeAsEnumeration(const c8* attributeName, const c8* const* enumerationLiteralsToUse, s32 defaultNotFound = -1) const = 0;
\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
332 virtual s32 getAttributeAsEnumeration(s32 index, const c8* const* enumerationLiteralsToUse, s32 defaultNotFound = -1) const = 0;
\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
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
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
348 //! Sets an attribute as enumeration
\r
349 virtual void setAttribute(s32 index, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
\r
358 //! Adds an attribute as color
\r
359 virtual void addColor(const c8* attributeName, video::SColor value) = 0;
\r
362 //! Sets a attribute as color
\r
363 virtual void setAttribute(const c8* attributeName, video::SColor color) = 0;
\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
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
375 //! Sets an attribute as color
\r
376 virtual void setAttribute(s32 index, video::SColor color) = 0;
\r
384 //! Adds an attribute as floating point color
\r
385 virtual void addColorf(const c8* attributeName, video::SColorf value) = 0;
\r
387 //! Sets a attribute as floating point color
\r
388 virtual void setAttribute(const c8* attributeName, video::SColorf color) = 0;
\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
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
400 //! Sets an attribute as floating point color
\r
401 virtual void setAttribute(s32 index, video::SColorf color) = 0;
\r
410 //! Adds an attribute as 3d vector
\r
411 virtual void addVector3d(const c8* attributeName, const core::vector3df& value) = 0;
\r
413 //! Sets a attribute as 3d vector
\r
414 virtual void setAttribute(const c8* attributeName, const core::vector3df& v) = 0;
\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
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
426 //! Sets an attribute as vector
\r
427 virtual void setAttribute(s32 index, const core::vector3df& v) = 0;
\r
435 //! Adds an attribute as 2d vector
\r
436 virtual void addVector2d(const c8* attributeName, const core::vector2df& value) = 0;
\r
438 //! Sets a attribute as 2d vector
\r
439 virtual void setAttribute(const c8* attributeName, const core::vector2df& v) = 0;
\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
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
451 //! Sets an attribute as 2d vector
\r
452 virtual void setAttribute(s32 index, const core::vector2df& v) = 0;
\r
456 Position2d Attribute
\r
460 //! Adds an attribute as 2d position
\r
461 virtual void addPosition2d(const c8* attributeName, const core::position2di& value) = 0;
\r
463 //! Sets a attribute as 2d position
\r
464 virtual void setAttribute(const c8* attributeName, const core::position2di& v) = 0;
\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
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
476 //! Sets an attribute as 2d position
\r
477 virtual void setAttribute(s32 index, const core::position2di& v) = 0;
\r
481 Rectangle Attribute
\r
485 //! Adds an attribute as rectangle
\r
486 virtual void addRect(const c8* attributeName, const core::rect<s32>& value) = 0;
\r
488 //! Sets an attribute as rectangle
\r
489 virtual void setAttribute(const c8* attributeName, const core::rect<s32>& v) = 0;
\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
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
501 //! Sets an attribute as rectangle
\r
502 virtual void setAttribute(s32 index, const core::rect<s32>& v) = 0;
\r
507 Dimension2d Attribute
\r
511 //! Adds an attribute as dimension2d
\r
512 virtual void addDimension2d(const c8* attributeName, const core::dimension2d<u32>& value) = 0;
\r
514 //! Sets an attribute as dimension2d
\r
515 virtual void setAttribute(const c8* attributeName, const core::dimension2d<u32>& v) = 0;
\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
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
527 //! Sets an attribute as dimension2d
\r
528 virtual void setAttribute(s32 index, const core::dimension2d<u32>& v) = 0;
\r
535 //! Adds an attribute as matrix
\r
536 virtual void addMatrix(const c8* attributeName, const core::matrix4& v) = 0;
\r
538 //! Sets an attribute as matrix
\r
539 virtual void setAttribute(const c8* attributeName, const core::matrix4& v) = 0;
\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
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
551 //! Sets an attribute as matrix
\r
552 virtual void setAttribute(s32 index, const core::matrix4& v) = 0;
\r
555 quaternion attribute
\r
559 //! Adds an attribute as quaternion
\r
560 virtual void addQuaternion(const c8* attributeName, const core::quaternion& v) = 0;
\r
562 //! Sets an attribute as quaternion
\r
563 virtual void setAttribute(const c8* attributeName, const core::quaternion& v) = 0;
\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
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
575 //! Sets an attribute as quaternion
\r
576 virtual void setAttribute(s32 index, const core::quaternion& v) = 0;
\r
584 //! Adds an attribute as axis aligned bounding box
\r
585 virtual void addBox3d(const c8* attributeName, const core::aabbox3df& v) = 0;
\r
587 //! Sets an attribute as axis aligned bounding box
\r
588 virtual void setAttribute(const c8* attributeName, const core::aabbox3df& v) = 0;
\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
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
600 //! Sets an attribute as axis aligned bounding box
\r
601 virtual void setAttribute(s32 index, const core::aabbox3df& v) = 0;
\r
609 //! Adds an attribute as 3d plane
\r
610 virtual void addPlane3d(const c8* attributeName, const core::plane3df& v) = 0;
\r
612 //! Sets an attribute as 3d plane
\r
613 virtual void setAttribute(const c8* attributeName, const core::plane3df& v) = 0;
\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
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
625 //! Sets an attribute as 3d plane
\r
626 virtual void setAttribute(s32 index, const core::plane3df& v) = 0;
\r
635 //! Adds an attribute as 3d triangle
\r
636 virtual void addTriangle3d(const c8* attributeName, const core::triangle3df& v) = 0;
\r
638 //! Sets an attribute as 3d trianle
\r
639 virtual void setAttribute(const c8* attributeName, const core::triangle3df& v) = 0;
\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
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
651 //! Sets an attribute as 3d triangle
\r
652 virtual void setAttribute(s32 index, const core::triangle3df& v) = 0;
\r
661 //! Adds an attribute as a 2d line
\r
662 virtual void addLine2d(const c8* attributeName, const core::line2df& v) = 0;
\r
664 //! Sets an attribute as a 2d line
\r
665 virtual void setAttribute(const c8* attributeName, const core::line2df& v) = 0;
\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
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
677 //! Sets an attribute as a 2d line
\r
678 virtual void setAttribute(s32 index, const core::line2df& v) = 0;
\r
687 //! Adds an attribute as a 3d line
\r
688 virtual void addLine3d(const c8* attributeName, const core::line3df& v) = 0;
\r
690 //! Sets an attribute as a 3d line
\r
691 virtual void setAttribute(const c8* attributeName, const core::line3df& v) = 0;
\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
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
703 //! Sets an attribute as a 3d line
\r
704 virtual void setAttribute(s32 index, const core::line3df& v) = 0;
\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
716 //! Sets an attribute as texture reference
\r
717 virtual void setAttribute(const c8* attributeName, video::ITexture* texture, const io::path& filename = "") = 0;
\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
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
728 //! Sets an attribute as texture reference
\r
729 virtual void setAttribute(s32 index, video::ITexture* texture, const io::path& filename = "") = 0;
\r
734 User Pointer Attribute
\r
738 //! Adds an attribute as user pointer
\r
739 virtual void addUserPointer(const c8* attributeName, void* userPointer) = 0;
\r
741 //! Sets an attribute as user pointer
\r
742 virtual void setAttribute(const c8* attributeName, void* userPointer) = 0;
\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
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
753 //! Sets an attribute as user pointer
\r
754 virtual void setAttribute(s32 index, void* userPointer) = 0;
\r
758 } // end namespace io
\r
759 } // end namespace irr
\r