CAttributes.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef __C_ATTRIBUTES_H_INCLUDED__
  5. #define __C_ATTRIBUTES_H_INCLUDED__
  6. #include "IAttributes.h"
  7. #include "IAttribute.h"
  8. namespace irr
  9. {
  10. namespace video
  11. {
  12. class ITexture;
  13. class IVideoDriver;
  14. }
  15. namespace io
  16. {
  17. //! Implementation of the IAttributes interface
  18. class CAttributes : public IAttributes
  19. {
  20. public:
  21. CAttributes(video::IVideoDriver* driver=0);
  22. ~CAttributes();
  23. //! Returns amount of attributes in this collection of attributes.
  24. virtual u32 getAttributeCount() const;
  25. //! Returns attribute name by index.
  26. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  27. virtual const c8* getAttributeName(s32 index);
  28. //! Returns the type of an attribute
  29. //! \param attributeName: Name for the attribute
  30. virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName);
  31. //! Returns attribute type by index.
  32. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  33. virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index);
  34. //! Returns the type string of the attribute
  35. //! \param attributeName: String for the attribute type
  36. virtual const wchar_t* getAttributeTypeString(const c8* attributeName);
  37. //! Returns the type string of the attribute by index.
  38. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  39. virtual const wchar_t* getAttributeTypeString(s32 index);
  40. //! Returns if an attribute with a name exists
  41. virtual bool existsAttribute(const c8* attributeName);
  42. //! Returns attribute index from name, -1 if not found
  43. virtual s32 findAttribute(const c8* attributeName) const;
  44. //! Removes all attributes
  45. virtual void clear();
  46. //! Reads attributes from a xml file.
  47. //! \param readCurrentElementOnly: If set to true, reading only works if current element has the name 'attributes'.
  48. //! IF set to false, the first appearing list attributes are read.
  49. virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false,
  50. const wchar_t* nonDefaultElementName = 0);
  51. //! Write these attributes into a xml file
  52. virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false, const wchar_t* nonDefaultElementName=0);
  53. /*
  54. Integer Attribute
  55. */
  56. //! Adds an attribute as integer
  57. virtual void addInt(const c8* attributeName, s32 value);
  58. //! Sets an attribute as integer value
  59. virtual void setAttribute(const c8* attributeName, s32 value);
  60. //! Gets an attribute as integer value
  61. //! \param attributeName: Name of the attribute to get.
  62. //! \return Returns value of the attribute previously set by setAttribute()
  63. virtual s32 getAttributeAsInt(const c8* attributeName) const;
  64. //! Gets an attribute as integer value
  65. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  66. virtual s32 getAttributeAsInt(s32 index) const;
  67. //! Sets an attribute as integer value
  68. virtual void setAttribute(s32 index, s32 value);
  69. /*
  70. Float Attribute
  71. */
  72. //! Adds an attribute as float
  73. virtual void addFloat(const c8* attributeName, f32 value);
  74. //! Sets a attribute as float value
  75. virtual void setAttribute(const c8* attributeName, f32 value);
  76. //! Gets an attribute as float value
  77. //! \param attributeName: Name of the attribute to get.
  78. //! \return Returns value of the attribute previously set by setAttribute()
  79. virtual f32 getAttributeAsFloat(const c8* attributeName);
  80. //! Gets an attribute as float value
  81. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  82. virtual f32 getAttributeAsFloat(s32 index);
  83. //! Sets an attribute as float value
  84. virtual void setAttribute(s32 index, f32 value);
  85. /*
  86. String Attribute
  87. */
  88. //! Adds an attribute as string
  89. virtual void addString(const c8* attributeName, const c8* value);
  90. //! Sets an attribute value as string.
  91. //! \param attributeName: Name for the attribute
  92. //! \param value: Value for the attribute. Set this to 0 to delete the attribute
  93. virtual void setAttribute(const c8* attributeName, const c8* value);
  94. //! Gets an attribute as string.
  95. //! \param attributeName: Name of the attribute to get.
  96. //! \return Returns value of the attribute previously set by setAttribute()
  97. //! or 0 if attribute is not set.
  98. virtual core::stringc getAttributeAsString(const c8* attributeName);
  99. //! Gets an attribute as string.
  100. //! \param attributeName: Name of the attribute to get.
  101. //! \param target: Buffer where the string is copied to.
  102. virtual void getAttributeAsString(const c8* attributeName, c8* target);
  103. //! Returns attribute value as string by index.
  104. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  105. virtual core::stringc getAttributeAsString(s32 index);
  106. //! Sets an attribute value as string.
  107. //! \param attributeName: Name for the attribute
  108. virtual void setAttribute(s32 index, const c8* value);
  109. // wide strings
  110. //! Adds an attribute as string
  111. virtual void addString(const c8* attributeName, const wchar_t* value);
  112. //! Sets an attribute value as string.
  113. //! \param attributeName: Name for the attribute
  114. //! \param value: Value for the attribute. Set this to 0 to delete the attribute
  115. virtual void setAttribute(const c8* attributeName, const wchar_t* value);
  116. //! Gets an attribute as string.
  117. //! \param attributeName: Name of the attribute to get.
  118. //! \return Returns value of the attribute previously set by setAttribute()
  119. //! or 0 if attribute is not set.
  120. virtual core::stringw getAttributeAsStringW(const c8* attributeName);
  121. //! Gets an attribute as string.
  122. //! \param attributeName: Name of the attribute to get.
  123. //! \param target: Buffer where the string is copied to.
  124. virtual void getAttributeAsStringW(const c8* attributeName, wchar_t* target);
  125. //! Returns attribute value as string by index.
  126. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  127. virtual core::stringw getAttributeAsStringW(s32 index);
  128. //! Sets an attribute value as string.
  129. //! \param attributeName: Name for the attribute
  130. virtual void setAttribute(s32 index, const wchar_t* value);
  131. /*
  132. Binary Data Attribute
  133. */
  134. //! Adds an attribute as binary data
  135. virtual void addBinary(const c8* attributeName, void* data, s32 dataSizeInBytes);
  136. //! Sets an attribute as binary data
  137. virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes);
  138. //! Gets an attribute as binary data
  139. //! \param attributeName: Name of the attribute to get.
  140. virtual void getAttributeAsBinaryData(const c8* attributeName, void* outData, s32 maxSizeInBytes);
  141. //! Gets an attribute as binary data
  142. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  143. virtual void getAttributeAsBinaryData(s32 index, void* outData, s32 maxSizeInBytes);
  144. //! Sets an attribute as binary data
  145. virtual void setAttribute(s32 index, void* data, s32 dataSizeInBytes);
  146. /*
  147. Array Attribute
  148. */
  149. //! Adds an attribute as wide string array
  150. virtual void addArray(const c8* attributeName, const core::array<core::stringw>& value);
  151. //! Sets an attribute value as a wide string array.
  152. //! \param attributeName: Name for the attribute
  153. //! \param value: Value for the attribute. Set this to 0 to delete the attribute
  154. virtual void setAttribute(const c8* attributeName, const core::array<core::stringw>& value);
  155. //! Gets an attribute as an array of wide strings.
  156. //! \param attributeName: Name of the attribute to get.
  157. //! \return Returns value of the attribute previously set by setAttribute()
  158. //! or 0 if attribute is not set.
  159. virtual core::array<core::stringw> getAttributeAsArray(const c8* attributeName);
  160. //! Returns attribute value as an array of wide strings by index.
  161. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  162. virtual core::array<core::stringw> getAttributeAsArray(s32 index);
  163. //! Sets an attribute as an array of wide strings
  164. virtual void setAttribute(s32 index, const core::array<core::stringw>& value);
  165. /*
  166. Bool Attribute
  167. */
  168. //! Adds an attribute as bool
  169. virtual void addBool(const c8* attributeName, bool value);
  170. //! Sets an attribute as boolean value
  171. virtual void setAttribute(const c8* attributeName, bool value);
  172. //! Gets an attribute as boolean value
  173. //! \param attributeName: Name of the attribute to get.
  174. //! \return Returns value of the attribute previously set by setAttribute()
  175. virtual bool getAttributeAsBool(const c8* attributeName);
  176. //! Gets an attribute as boolean value
  177. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  178. virtual bool getAttributeAsBool(s32 index);
  179. //! Sets an attribute as boolean value
  180. virtual void setAttribute(s32 index, bool value);
  181. /*
  182. Enumeration Attribute
  183. */
  184. //! Adds an attribute as enum
  185. virtual void addEnum(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals);
  186. //! Adds an attribute as enum
  187. virtual void addEnum(const c8* attributeName, s32 enumValue, const c8* const* enumerationLiterals);
  188. //! Sets an attribute as enumeration
  189. virtual void setAttribute(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals);
  190. //! Gets an attribute as enumeration
  191. //! \param attributeName: Name of the attribute to get.
  192. //! \return Returns value of the attribute previously set by setAttribute()
  193. virtual const c8* getAttributeAsEnumeration(const c8* attributeName);
  194. //! Gets an attribute as enumeration
  195. //! \param attributeName: Name of the attribute to get.
  196. //! \param enumerationLiteralsToUse: Use these enumeration literals to get the index value instead of the set ones.
  197. //! This is useful when the attribute list maybe was read from an xml file, and only contains the enumeration string, but
  198. //! no information about its index.
  199. //! \return Returns value of the attribute previously set by setAttribute()
  200. virtual s32 getAttributeAsEnumeration(const c8* attributeName, const c8* const* enumerationLiteralsToUse);
  201. //! Gets an attribute as enumeration
  202. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  203. virtual s32 getAttributeAsEnumeration(s32 index, const c8* const* enumerationLiteralsToUse);
  204. //! Gets an attribute as enumeration
  205. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  206. virtual const c8* getAttributeAsEnumeration(s32 index);
  207. //! Gets the list of enumeration literals of an enumeration attribute
  208. //! \param attributeName: Name of the attribute to get.
  209. virtual void getAttributeEnumerationLiteralsOfEnumeration(const c8* attributeName, core::array<core::stringc>& outLiterals);
  210. //! Gets the list of enumeration literals of an enumeration attribute
  211. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  212. virtual void getAttributeEnumerationLiteralsOfEnumeration(s32 index, core::array<core::stringc>& outLiterals);
  213. //! Sets an attribute as enumeration
  214. virtual void setAttribute(s32 index, const c8* enumValue, const c8* const* enumerationLiterals);
  215. /*
  216. SColor Attribute
  217. */
  218. //! Adds an attribute as color
  219. virtual void addColor(const c8* attributeName, video::SColor value);
  220. //! Sets a attribute as color
  221. virtual void setAttribute(const c8* attributeName, video::SColor color);
  222. //! Gets an attribute as color
  223. //! \param attributeName: Name of the attribute to get.
  224. //! \return Returns value of the attribute previously set by setAttribute()
  225. virtual video::SColor getAttributeAsColor(const c8* attributeName);
  226. //! Gets an attribute as color
  227. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  228. virtual video::SColor getAttributeAsColor(s32 index);
  229. //! Sets an attribute as color
  230. virtual void setAttribute(s32 index, video::SColor color);
  231. /*
  232. SColorf Attribute
  233. */
  234. //! Adds an attribute as floating point color
  235. virtual void addColorf(const c8* attributeName, video::SColorf value);
  236. //! Sets a attribute as floating point color
  237. virtual void setAttribute(const c8* attributeName, video::SColorf color);
  238. //! Gets an attribute as floating point color
  239. //! \param attributeName: Name of the attribute to get.
  240. //! \return Returns value of the attribute previously set by setAttribute()
  241. virtual video::SColorf getAttributeAsColorf(const c8* attributeName);
  242. //! Gets an attribute as floating point color
  243. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  244. virtual video::SColorf getAttributeAsColorf(s32 index);
  245. //! Sets an attribute as floating point color
  246. virtual void setAttribute(s32 index, video::SColorf color);
  247. /*
  248. Vector3d Attribute
  249. */
  250. //! Adds an attribute as 3d vector
  251. virtual void addVector3d(const c8* attributeName, core::vector3df value);
  252. //! Sets a attribute as 3d vector
  253. virtual void setAttribute(const c8* attributeName, core::vector3df v);
  254. //! Gets an attribute as 3d vector
  255. //! \param attributeName: Name of the attribute to get.
  256. //! \return Returns value of the attribute previously set by setAttribute()
  257. virtual core::vector3df getAttributeAsVector3d(const c8* attributeName);
  258. //! Gets an attribute as 3d vector
  259. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  260. virtual core::vector3df getAttributeAsVector3d(s32 index);
  261. //! Sets an attribute as vector
  262. virtual void setAttribute(s32 index, core::vector3df v);
  263. /*
  264. Vector2d Attribute
  265. */
  266. //! Adds an attribute as 2d vector
  267. virtual void addVector2d(const c8* attributeName, core::vector2df value);
  268. //! Sets a attribute as 2d vector
  269. virtual void setAttribute(const c8* attributeName, core::vector2df v);
  270. //! Gets an attribute as 2d vector
  271. //! \param attributeName: Name of the attribute to get.
  272. //! \return Returns value of the attribute previously set by setAttribute()
  273. virtual core::vector2df getAttributeAsVector2d(const c8* attributeName);
  274. //! Gets an attribute as 3d vector
  275. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  276. virtual core::vector2df getAttributeAsVector2d(s32 index);
  277. //! Sets an attribute as vector
  278. virtual void setAttribute(s32 index, core::vector2df v);
  279. /*
  280. Position2d Attribute
  281. */
  282. //! Adds an attribute as 2d position
  283. virtual void addPosition2d(const c8* attributeName, core::position2di value);
  284. //! Sets a attribute as 2d position
  285. virtual void setAttribute(const c8* attributeName, core::position2di v);
  286. //! Gets an attribute as position
  287. //! \param attributeName: Name of the attribute to get.
  288. //! \return Returns value of the attribute previously set by setAttribute()
  289. virtual core::position2di getAttributeAsPosition2d(const c8* attributeName);
  290. //! Gets an attribute as position
  291. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  292. virtual core::position2di getAttributeAsPosition2d(s32 index);
  293. //! Sets an attribute as 2d position
  294. virtual void setAttribute(s32 index, core::position2di v);
  295. /*
  296. Rectangle Attribute
  297. */
  298. //! Adds an attribute as rectangle
  299. virtual void addRect(const c8* attributeName, core::rect<s32> value);
  300. //! Sets an attribute as rectangle
  301. virtual void setAttribute(const c8* attributeName, core::rect<s32> v);
  302. //! Gets an attribute as rectangle
  303. //! \param attributeName: Name of the attribute to get.
  304. //! \return Returns value of the attribute previously set by setAttribute()
  305. virtual core::rect<s32> getAttributeAsRect(const c8* attributeName);
  306. //! Gets an attribute as rectangle
  307. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  308. virtual core::rect<s32> getAttributeAsRect(s32 index);
  309. //! Sets an attribute as rectangle
  310. virtual void setAttribute(s32 index, core::rect<s32> v);
  311. /*
  312. Dimension2d Attribute
  313. */
  314. //! Adds an attribute as dimension2d
  315. virtual void addDimension2d(const c8* attributeName, core::dimension2d<u32> value);
  316. //! Sets an attribute as dimension2d
  317. virtual void setAttribute(const c8* attributeName, core::dimension2d<u32> v);
  318. //! Gets an attribute as dimension2d
  319. //! \param attributeName: Name of the attribute to get.
  320. //! \return Returns value of the attribute previously set by setAttribute()
  321. virtual core::dimension2d<u32> getAttributeAsDimension2d(const c8* attributeName) const;
  322. //! Gets an attribute as dimension2d
  323. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  324. virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) const;
  325. //! Sets an attribute as dimension2d
  326. virtual void setAttribute(s32 index, core::dimension2d<u32> v);
  327. /*
  328. matrix attribute
  329. */
  330. //! Adds an attribute as matrix
  331. virtual void addMatrix(const c8* attributeName, const core::matrix4& v);
  332. //! Sets an attribute as matrix
  333. virtual void setAttribute(const c8* attributeName, const core::matrix4& v);
  334. //! Gets an attribute as a matrix4
  335. //! \param attributeName: Name of the attribute to get.
  336. //! \return Returns value of the attribute previously set by setAttribute()
  337. virtual core::matrix4 getAttributeAsMatrix(const c8* attributeName);
  338. //! Gets an attribute as matrix
  339. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  340. virtual core::matrix4 getAttributeAsMatrix(s32 index);
  341. //! Sets an attribute as matrix
  342. virtual void setAttribute(s32 index, const core::matrix4& v);
  343. /*
  344. quaternion attribute
  345. */
  346. //! Adds an attribute as quaternion
  347. virtual void addQuaternion(const c8* attributeName, core::quaternion v);
  348. //! Sets an attribute as quaternion
  349. virtual void setAttribute(const c8* attributeName, core::quaternion v);
  350. //! Gets an attribute as a quaternion
  351. //! \param attributeName: Name of the attribute to get.
  352. //! \return Returns value of the attribute previously set by setAttribute()
  353. virtual core::quaternion getAttributeAsQuaternion(const c8* attributeName);
  354. //! Gets an attribute as quaternion
  355. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  356. virtual core::quaternion getAttributeAsQuaternion(s32 index);
  357. //! Sets an attribute as quaternion
  358. virtual void setAttribute(s32 index, core::quaternion v);
  359. /*
  360. 3d bounding box
  361. */
  362. //! Adds an attribute as axis aligned bounding box
  363. virtual void addBox3d(const c8* attributeName, core::aabbox3df v);
  364. //! Sets an attribute as axis aligned bounding box
  365. virtual void setAttribute(const c8* attributeName, core::aabbox3df v);
  366. //! Gets an attribute as a axis aligned bounding box
  367. //! \param attributeName: Name of the attribute to get.
  368. //! \return Returns value of the attribute previously set by setAttribute()
  369. virtual core::aabbox3df getAttributeAsBox3d(const c8* attributeName);
  370. //! Gets an attribute as axis aligned bounding box
  371. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  372. virtual core::aabbox3df getAttributeAsBox3d(s32 index);
  373. //! Sets an attribute as axis aligned bounding box
  374. virtual void setAttribute(s32 index, core::aabbox3df v);
  375. /*
  376. plane
  377. */
  378. //! Adds an attribute as 3d plane
  379. virtual void addPlane3d(const c8* attributeName, core::plane3df v);
  380. //! Sets an attribute as 3d plane
  381. virtual void setAttribute(const c8* attributeName, core::plane3df v);
  382. //! Gets an attribute as a 3d plane
  383. //! \param attributeName: Name of the attribute to get.
  384. //! \return Returns value of the attribute previously set by setAttribute()
  385. virtual core::plane3df getAttributeAsPlane3d(const c8* attributeName);
  386. //! Gets an attribute as 3d plane
  387. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  388. virtual core::plane3df getAttributeAsPlane3d(s32 index);
  389. //! Sets an attribute as 3d plane
  390. virtual void setAttribute(s32 index, core::plane3df v);
  391. /*
  392. 3d triangle
  393. */
  394. //! Adds an attribute as 3d triangle
  395. virtual void addTriangle3d(const c8* attributeName, core::triangle3df v);
  396. //! Sets an attribute as 3d trianle
  397. virtual void setAttribute(const c8* attributeName, core::triangle3df v);
  398. //! Gets an attribute as a 3d triangle
  399. //! \param attributeName: Name of the attribute to get.
  400. //! \return Returns value of the attribute previously set by setAttribute()
  401. virtual core::triangle3df getAttributeAsTriangle3d(const c8* attributeName);
  402. //! Gets an attribute as 3d triangle
  403. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  404. virtual core::triangle3df getAttributeAsTriangle3d(s32 index);
  405. //! Sets an attribute as 3d triangle
  406. virtual void setAttribute(s32 index, core::triangle3df v);
  407. /*
  408. line 2d
  409. */
  410. //! Adds an attribute as a 2d line
  411. virtual void addLine2d(const c8* attributeName, core::line2df v);
  412. //! Sets an attribute as a 2d line
  413. virtual void setAttribute(const c8* attributeName, core::line2df v);
  414. //! Gets an attribute as a 2d line
  415. //! \param attributeName: Name of the attribute to get.
  416. //! \return Returns value of the attribute previously set by setAttribute()
  417. virtual core::line2df getAttributeAsLine2d(const c8* attributeName);
  418. //! Gets an attribute as a 2d line
  419. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  420. virtual core::line2df getAttributeAsLine2d(s32 index);
  421. //! Sets an attribute as a 2d line
  422. virtual void setAttribute(s32 index, core::line2df v);
  423. /*
  424. line 3d
  425. */
  426. //! Adds an attribute as a 3d line
  427. virtual void addLine3d(const c8* attributeName, core::line3df v);
  428. //! Sets an attribute as a 3d line
  429. virtual void setAttribute(const c8* attributeName, core::line3df v);
  430. //! Gets an attribute as a 3d line
  431. //! \param attributeName: Name of the attribute to get.
  432. //! \return Returns value of the attribute previously set by setAttribute()
  433. virtual core::line3df getAttributeAsLine3d(const c8* attributeName);
  434. //! Gets an attribute as a 3d line
  435. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  436. virtual core::line3df getAttributeAsLine3d(s32 index);
  437. //! Sets an attribute as a 3d line
  438. virtual void setAttribute(s32 index, core::line3df v);
  439. /*
  440. Texture Attribute
  441. */
  442. //! Adds an attribute as texture reference
  443. virtual void addTexture(const c8* attributeName, video::ITexture* texture, const io::path& filename = "");
  444. //! Sets an attribute as texture reference
  445. virtual void setAttribute(const c8* attributeName, video::ITexture* texture, const io::path& filename = "");
  446. //! Gets an attribute as texture reference
  447. //! \param attributeName: Name of the attribute to get.
  448. virtual video::ITexture* getAttributeAsTexture(const c8* attributeName);
  449. //! Gets an attribute as texture reference
  450. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  451. virtual video::ITexture* getAttributeAsTexture(s32 index);
  452. //! Sets an attribute as texture reference
  453. virtual void setAttribute(s32 index, video::ITexture* texture, const io::path& filename = "");
  454. /*
  455. User Pointer Attribute
  456. */
  457. //! Adds an attribute as user pointner
  458. virtual void addUserPointer(const c8* attributeName, void* userPointer);
  459. //! Sets an attribute as user pointer
  460. virtual void setAttribute(const c8* attributeName, void* userPointer);
  461. //! Gets an attribute as user pointer
  462. //! \param attributeName: Name of the attribute to get.
  463. virtual void* getAttributeAsUserPointer(const c8* attributeName);
  464. //! Gets an attribute as user pointer
  465. //! \param index: Index value, must be between 0 and getAttributeCount()-1.
  466. virtual void* getAttributeAsUserPointer(s32 index);
  467. //! Sets an attribute as user pointer
  468. virtual void setAttribute(s32 index, void* userPointer);
  469. protected:
  470. void readAttributeFromXML(io::IXMLReader* reader);
  471. core::array<IAttribute*> Attributes;
  472. IAttribute* getAttributeP(const c8* attributeName) const;
  473. video::IVideoDriver* Driver;
  474. };
  475. } // end namespace io
  476. } // end namespace irr
  477. #endif