5#ifndef NIRT_I_ATTRIBUTES_HPP_INCLUDED
6#define NIRT_I_ATTRIBUTES_HPP_INCLUDED
8#include <nirtcpp/core/engine/IReferenceCounted.hpp>
9#include <nirtcpp/core/engine/SColor.hpp>
10#include <nirtcpp/core/engine/vector3d.hpp>
11#include <nirtcpp/core/engine/vector2d.hpp>
12#include <nirtcpp/core/engine/line2d.hpp>
13#include <nirtcpp/core/engine/line3d.hpp>
14#include <nirtcpp/core/engine/triangle3d.hpp>
15#include <nirtcpp/core/engine/position2d.hpp>
16#include <nirtcpp/core/engine/rect.hpp>
17#include <nirtcpp/core/engine/dimension2d.hpp>
18#include <nirtcpp/core/engine/matrix4.hpp>
19#include <nirtcpp/core/engine/quaternion.hpp>
20#include <nirtcpp/core/engine/plane3d.hpp>
21#include <nirtcpp/core/engine/triangle3d.hpp>
22#include <nirtcpp/core/engine/line2d.hpp>
23#include <nirtcpp/core/engine/line3d.hpp>
24#include <nirtcpp/core/engine/irrString.hpp>
25#include <nirtcpp/core/engine/irrArray.hpp>
26#include <nirtcpp/core/engine/IXMLReader.hpp>
27#include <nirtcpp/core/engine/IXMLWriter.hpp>
28#include <nirtcpp/core/engine/EAttributes.hpp>
29#include <nirtcpp/core/engine/path.hpp>
85 virtual bool read(
io::IXMLReader* reader,
bool readCurrentElementOnly=
false,
const wchar_t* elementName=0) = 0;
91 virtual bool write(
io::IXMLWriter* writer,
bool writeXMLHeader=
false,
const wchar_t* elementName=0) = 0;
182 virtual void addString(
const c8* attributeName,
const wchar_t* value) = 0;
217 virtual void addBinary(
const c8* attributeName,
void* data,
s32 dataSizeInBytes) = 0;
274 virtual void addBool(
const c8* attributeName,
bool value) = 0;
299 virtual void addEnum(
const c8* attributeName,
const c8* enumValue,
const c8*
const* enumerationLiterals) = 0;
302 virtual void addEnum(
const c8* attributeName,
s32 enumValue,
const c8*
const* enumerationLiterals) = 0;
305 virtual void setAttribute(
const c8* attributeName,
const c8* enumValue,
const c8*
const* enumerationLiterals) = 0;
Base class of most objects of the Nirtcpp Engine.
Definition IReferenceCounted.hpp:46
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
Definition matrix4.hpp:49
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Quaternion class for representing rotations.
Definition quaternion.hpp:32
Very simple string class with some useful features.
Definition irrString.hpp:94
Provides a generic interface for attributes and their values and the possibility to serialize them.
Definition IAttributes.hpp:42
virtual void setAttribute(s32 index, const core::vector2df &v)=0
Sets an attribute as 2d vector.
virtual void addDimension2d(const c8 *attributeName, const core::dimension2d< u32 > &value)=0
Adds an attribute as dimension2d.
virtual core::stringw getAttributeAsStringW(const c8 *attributeName, const core::stringw &defaultNotFound=core::stringw()) const =0
virtual core::vector2df getAttributeAsVector2d(s32 index) const =0
virtual void setAttribute(const c8 *attributeName, const core::line2df &v)=0
Sets an attribute as a 2d line.
virtual void setAttribute(s32 index, const core::plane3df &v)=0
Sets an attribute as 3d plane.
virtual void setAttribute(s32 index, video::SColor color)=0
Sets an attribute as color.
virtual void addBox3d(const c8 *attributeName, const core::aabbox3df &v)=0
Adds an attribute as axis aligned bounding box.
virtual core::quaternion getAttributeAsQuaternion(s32 index) const =0
virtual core::aabbox3df getAttributeAsBox3d(const c8 *attributeName, const core::aabbox3df &defaultNotFound=core::aabbox3df(0, 0, 0, 0, 0, 0)) const =0
virtual const c8 * getAttributeName(s32 index) const =0
virtual void getAttributeAsString(const c8 *attributeName, c8 *target) const =0
virtual core::plane3df getAttributeAsPlane3d(s32 index) const =0
virtual void setAttribute(const c8 *attributeName, const wchar_t *value)=0
virtual void setAttribute(const c8 *attributeName, const core::plane3df &v)=0
Sets an attribute as 3d plane.
virtual void getAttributeAsStringW(const c8 *attributeName, wchar_t *target) const =0
virtual void setAttribute(const c8 *attributeName, const core::dimension2d< u32 > &v)=0
Sets an attribute as dimension2d.
virtual void setAttribute(const c8 *attributeName, const core::rect< s32 > &v)=0
Sets an attribute as rectangle.
virtual core::dimension2d< u32 > getAttributeAsDimension2d(const c8 *attributeName, const core::dimension2d< u32 > &defaultNotFound=core::dimension2d< u32 >()) const =0
virtual core::line2df getAttributeAsLine2d(s32 index) const =0
virtual void setAttribute(const c8 *attributeName, video::ITexture *texture, const io::path &filename="")=0
Sets an attribute as texture reference.
virtual core::stringc getAttributeAsString(s32 index) const =0
virtual void setAttribute(const c8 *attributeName, const core::vector2df &v)=0
Sets a attribute as 2d vector.
virtual core::matrix4 getAttributeAsMatrix(s32 index) const =0
virtual core::matrix4 getAttributeAsMatrix(const c8 *attributeName, const core::matrix4 &defaultNotFound=core::matrix4()) const =0
virtual void addPosition2d(const c8 *attributeName, const core::position2di &value)=0
Adds an attribute as 2d position.
virtual void setAttribute(const c8 *attributeName, void *data, s32 dataSizeInBytes)=0
Sets an attribute as binary data.
virtual s32 getAttributeAsInt(s32 index) const =0
virtual const wchar_t * getAttributeTypeString(s32 index, const wchar_t *defaultNotFound=L"unknown") const =0
virtual const wchar_t * getAttributeTypeString(const c8 *attributeName, const wchar_t *defaultNotFound=L"unknown") const =0
virtual core::line3df getAttributeAsLine3d(s32 index) const =0
virtual void setAttribute(const c8 *attributeName, f32 value)=0
Sets a attribute as float value.
virtual void setAttribute(s32 index, const core::line2df &v)=0
Sets an attribute as a 2d line.
virtual core::line3df getAttributeAsLine3d(const c8 *attributeName, const core::line3df &defaultNotFound=core::line3df(0, 0, 0, 0, 0, 0)) const =0
virtual s32 getAttributeAsInt(const c8 *attributeName, nirt::s32 defaultNotFound=0) const =0
virtual void getAttributeEnumerationLiteralsOfEnumeration(s32 index, core::array< core::stringc > &outLiterals) const =0
virtual core::quaternion getAttributeAsQuaternion(const c8 *attributeName, const core::quaternion &defaultNotFound=core::quaternion(0, 1, 0, 0)) const =0
virtual void addColorf(const c8 *attributeName, video::SColorf value)=0
Adds an attribute as floating point color.
virtual video::SColorf getAttributeAsColorf(s32 index) const =0
virtual core::array< core::stringw > getAttributeAsArray(const c8 *attributeName, const core::array< core::stringw > &defaultNotFound=core::array< core::stringw >()) const =0
virtual core::position2di getAttributeAsPosition2d(s32 index) const =0
virtual core::line2df getAttributeAsLine2d(const c8 *attributeName, const core::line2df &defaultNotFound=core::line2df(0, 0, 0, 0)) const =0
virtual void setAttribute(const c8 *attributeName, video::SColorf color)=0
Sets a attribute as floating point color.
virtual void setAttribute(s32 index, video::SColorf color)=0
Sets an attribute as floating point color.
virtual void clear()=0
Removes all attributes.
virtual void setAttribute(const c8 *attributeName, const core::aabbox3df &v)=0
Sets an attribute as axis aligned bounding box.
virtual core::vector3df getAttributeAsVector3d(s32 index) const =0
virtual void addColor(const c8 *attributeName, video::SColor value)=0
Adds an attribute as color.
virtual s32 getAttributeAsEnumeration(const c8 *attributeName, const c8 *const *enumerationLiteralsToUse, s32 defaultNotFound=-1) const =0
Gets an attribute as enumeration.
virtual void addArray(const c8 *attributeName, const core::array< core::stringw > &value)=0
Adds an attribute as wide string array.
virtual void addMatrix(const c8 *attributeName, const core::matrix4 &v)=0
Adds an attribute as matrix.
virtual core::plane3df getAttributeAsPlane3d(const c8 *attributeName, const core::plane3df &defaultNotFound=core::plane3df(0, 0, 0, 0, 1, 0)) const =0
virtual bool existsAttribute(const c8 *attributeName) const =0
Returns if an attribute with a name exists.
virtual void * getAttributeAsUserPointer(const c8 *attributeName, void *defaultNotFound=0) const =0
virtual void setAttribute(s32 index, const core::position2di &v)=0
Sets an attribute as 2d position.
virtual void setAttribute(s32 index, f32 value)=0
Sets an attribute as float value.
virtual void getAttributeAsBinaryData(s32 index, void *outData, s32 maxSizeInBytes) const =0
Gets an attribute as binary data.
virtual void setAttribute(s32 index, const core::rect< s32 > &v)=0
Sets an attribute as rectangle.
virtual video::ITexture * getAttributeAsTexture(s32 index) const =0
virtual bool write(io::IXMLWriter *writer, bool writeXMLHeader=false, const wchar_t *elementName=0)=0
virtual void addLine3d(const c8 *attributeName, const core::line3df &v)=0
Adds an attribute as a 3d line.
virtual core::triangle3df getAttributeAsTriangle3d(s32 index) const =0
virtual void setAttribute(s32 index, const core::array< core::stringw > &value)=0
Sets an attribute as an array of wide strings.
virtual void setAttribute(const c8 *attributeName, const core::matrix4 &v)=0
Sets an attribute as matrix.
virtual void addLine2d(const c8 *attributeName, const core::line2df &v)=0
Adds an attribute as a 2d line.
virtual void setAttribute(const c8 *attributeName, video::SColor color)=0
Sets a attribute as color.
virtual s32 findAttribute(const c8 *attributeName) const =0
Returns attribute index from name, -1 if not found.
virtual void setAttribute(const c8 *attributeName, const core::array< core::stringw > &value)=0
virtual f32 getAttributeAsFloat(const c8 *attributeName, nirt::f32 defaultNotFound=0.f) const =0
virtual void addBinary(const c8 *attributeName, void *data, s32 dataSizeInBytes)=0
Adds an attribute as binary data.
virtual u32 getAttributeCount() const =0
Returns amount of attributes in this collection of attributes.
virtual void getAttributeEnumerationLiteralsOfEnumeration(const c8 *attributeName, core::array< core::stringc > &outLiterals) const =0
virtual core::aabbox3df getAttributeAsBox3d(s32 index) const =0
virtual void setAttribute(const c8 *attributeName, const core::quaternion &v)=0
Sets an attribute as quaternion.
virtual void addFloat(const c8 *attributeName, f32 value)=0
Adds an attribute as float.
virtual void addString(const c8 *attributeName, const c8 *value)=0
Adds an attribute as string.
virtual core::vector2df getAttributeAsVector2d(const c8 *attributeName, const core::vector2df &defaultNotFound=core::vector2df(0, 0)) const =0
virtual void setAttribute(s32 index, s32 value)=0
Sets an attribute as integer value.
virtual void setAttribute(s32 index, bool value)=0
Sets an attribute as boolean value.
virtual void addTriangle3d(const c8 *attributeName, const core::triangle3df &v)=0
Adds an attribute as 3d triangle.
virtual void setAttribute(s32 index, void *userPointer)=0
Sets an attribute as user pointer.
virtual bool getAttributeAsBool(const c8 *attributeName, bool defaultNotFound=false) const =0
virtual void addTexture(const c8 *attributeName, video::ITexture *texture, const io::path &filename="")=0
Adds an attribute as texture reference.
virtual void setAttribute(const c8 *attributeName, const core::line3df &v)=0
Sets an attribute as a 3d line.
virtual core::rect< s32 > getAttributeAsRect(const c8 *attributeName, const core::rect< s32 > &defaultNotFound=core::rect< s32 >()) const =0
virtual void setAttribute(const c8 *attributeName, const c8 *value)=0
virtual bool read(io::IXMLReader *reader, bool readCurrentElementOnly=false, const wchar_t *elementName=0)=0
virtual const c8 * getAttributeAsEnumeration(s32 index) const =0
virtual void setAttribute(s32 index, const core::matrix4 &v)=0
Sets an attribute as matrix.
virtual video::ITexture * getAttributeAsTexture(const c8 *attributeName, video::ITexture *defaultNotFound=0) const =0
virtual void setAttribute(s32 index, const core::quaternion &v)=0
Sets an attribute as quaternion.
virtual core::stringw getAttributeAsStringW(s32 index) const =0
virtual void setAttribute(s32 index, void *data, s32 dataSizeInBytes)=0
Sets an attribute as binary data.
virtual core::position2di getAttributeAsPosition2d(const c8 *attributeName, const core::position2di &defaultNotFound=core::position2di(0, 0)) const =0
virtual void setAttribute(const c8 *attributeName, const core::vector3df &v)=0
Sets a attribute as 3d vector.
virtual void addEnum(const c8 *attributeName, s32 enumValue, const c8 *const *enumerationLiterals)=0
Adds an attribute as enum.
virtual void setAttribute(const c8 *attributeName, void *userPointer)=0
Sets an attribute as user pointer.
virtual void setAttribute(const c8 *attributeName, s32 value)=0
Sets an attribute as integer value.
virtual void addEnum(const c8 *attributeName, const c8 *enumValue, const c8 *const *enumerationLiterals)=0
Adds an attribute as enum.
virtual void setAttribute(s32 index, const core::line3df &v)=0
Sets an attribute as a 3d line.
virtual core::stringc getAttributeAsString(const c8 *attributeName, const core::stringc &defaultNotFound=core::stringc()) const =0
virtual void addUserPointer(const c8 *attributeName, void *userPointer)=0
Adds an attribute as user pointer.
virtual void setAttribute(s32 index, const core::aabbox3df &v)=0
Sets an attribute as axis aligned bounding box.
virtual void addVector3d(const c8 *attributeName, const core::vector3df &value)=0
Adds an attribute as 3d vector.
virtual void setAttribute(s32 index, const c8 *enumValue, const c8 *const *enumerationLiterals)=0
Sets an attribute as enumeration.
virtual void setAttribute(const c8 *attributeName, bool value)=0
Sets an attribute as boolean value.
virtual void setAttribute(const c8 *attributeName, const core::position2di &v)=0
Sets a attribute as 2d position.
virtual void setAttribute(const c8 *attributeName, const core::triangle3df &v)=0
Sets an attribute as 3d trianle.
virtual void addVector2d(const c8 *attributeName, const core::vector2df &value)=0
Adds an attribute as 2d vector.
virtual core::dimension2d< u32 > getAttributeAsDimension2d(s32 index) const =0
virtual void addBool(const c8 *attributeName, bool value)=0
Adds an attribute as bool.
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
virtual void setAttribute(s32 index, const core::triangle3df &v)=0
Sets an attribute as 3d triangle.
virtual core::array< core::stringw > getAttributeAsArray(s32 index) const =0
virtual video::SColorf getAttributeAsColorf(const c8 *attributeName, const video::SColorf &defaultNotFound=video::SColorf(0)) const =0
virtual void addRect(const c8 *attributeName, const core::rect< s32 > &value)=0
Adds an attribute as rectangle.
virtual E_ATTRIBUTE_TYPE getAttributeType(const c8 *attributeName) const =0
virtual s32 getAttributeAsEnumeration(s32 index, const c8 *const *enumerationLiteralsToUse, s32 defaultNotFound=-1) const =0
Gets an attribute as enumeration.
virtual const c8 * getAttributeAsEnumeration(const c8 *attributeName, const c8 *defaultNotFound=0) const =0
virtual void addInt(const c8 *attributeName, s32 value)=0
Adds an attribute as integer.
virtual core::vector3df getAttributeAsVector3d(const c8 *attributeName, const core::vector3df &defaultNotFound=core::vector3df(0, 0, 0)) const =0
virtual f32 getAttributeAsFloat(s32 index) const =0
virtual void setAttribute(s32 index, const c8 *value)=0
virtual void setAttribute(s32 index, const core::vector3df &v)=0
Sets an attribute as vector.
virtual bool getAttributeAsBool(s32 index) const =0
virtual void setAttribute(s32 index, video::ITexture *texture, const io::path &filename="")=0
Sets an attribute as texture reference.
virtual void addPlane3d(const c8 *attributeName, const core::plane3df &v)=0
Adds an attribute as 3d plane.
virtual core::rect< s32 > getAttributeAsRect(s32 index) const =0
virtual video::SColor getAttributeAsColor(s32 index) const =0
virtual void setAttribute(s32 index, const core::dimension2d< u32 > &v)=0
Sets an attribute as dimension2d.
virtual video::SColor getAttributeAsColor(const c8 *attributeName, const video::SColor &defaultNotFound=video::SColor(0)) const =0
virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) const =0
virtual void getAttributeAsBinaryData(const c8 *attributeName, void *outData, s32 maxSizeInBytes) const =0
Gets an attribute as binary data.
virtual void addQuaternion(const c8 *attributeName, const core::quaternion &v)=0
Adds an attribute as quaternion.
virtual void setAttribute(s32 index, const wchar_t *value)=0
virtual void setAttribute(const c8 *attributeName, const c8 *enumValue, const c8 *const *enumerationLiterals)=0
Sets an attribute as enumeration.
virtual void addString(const c8 *attributeName, const wchar_t *value)=0
Adds an attribute as string.
virtual void * getAttributeAsUserPointer(s32 index) const =0
Interface providing easy read access to a XML file.
Definition irrXML.hpp:277
Interface providing methods for making it easier to write XML files.
Definition irrXML.hpp:377
Interface of a Video Driver dependent Texture.
Definition ITexture.hpp:186
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
Class representing a color with four floats.
Definition SColor.hpp:574
E_ATTRIBUTE_TYPE
Types of attributes available for IAttributes.
Definition EAttributes.hpp:15
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64
char c8
8 bit character variable.
Definition irrTypes.hpp:37
float f32
32 bit floating point variable.
Definition irrTypes.hpp:110