Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

# IAttributes.h

Go to the documentation of this file.

    00001 // Copyright (C) 2002-2009 Nikolaus Gebhardt
    00002 // This file is part of the "Irrlicht Engine".
    00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
    00004
    00005 #ifndef __I_ATTRIBUTES_H_INCLUDED__
    00006 #define __I_ATTRIBUTES_H_INCLUDED__
    00007
    00008 #include "IReferenceCounted.h"
    00009 #include "SColor.h"
    00010 #include "vector3d.h"
    00011 #include "vector2d.h"
    00012 #include "line2d.h"
    00013 #include "line3d.h"
    00014 #include "triangle3d.h"
    00015 #include "position2d.h"
    00016 #include "rect.h"
    00017 #include "matrix4.h"
    00018 #include "quaternion.h"
    00019 #include "plane3d.h"
    00020 #include "triangle3d.h"
    00021 #include "line2d.h"
    00022 #include "line3d.h"
    00023 #include "irrString.h"
    00024 #include "irrArray.h"
    00025 #include "IXMLReader.h"
    00026
    00027 namespace irr
    00028 {
    00029 namespace video
    00030 {
    00031         class ITexture;
    00032 } // end namespace video
    00033 namespace io
    00034 {
    00035         class IXMLWriter;
    00036
    00038 enum E_ATTRIBUTE_TYPE
    00039 {
    00040         // integer attribute
    00041         EAT_INT = 0,
    00042
    00043         // float attribute
    00044         EAT_FLOAT,
    00045
    00046         // string attribute
    00047         EAT_STRING,
    00048
    00049         // boolean attribute
    00050         EAT_BOOL,
    00051
    00052         // enumeration attribute
    00053         EAT_ENUM,
    00054
    00055         // color attribute
    00056         EAT_COLOR,
    00057
    00058         // floating point color attribute
    00059         EAT_COLORF,
    00060
    00061         // 3d vector attribute
    00062         EAT_VECTOR3D,
    00063
    00064         // 2d position attribute
    00065         EAT_POSITION2D,
    00066
    00067         // vector 2d
    00068         EAT_VECTOR2D,
    00069
    00070         // rectangle attribute
    00071         EAT_RECT,
    00072
    00073         // matrix attribute
    00074         EAT_MATRIX,
    00075
    00076         // quaternion attribute
    00077         EAT_QUATERNION,
    00078
    00079         // 3d bounding box
    00080         EAT_BBOX,
    00081
    00082         // plane
    00083         EAT_PLANE,
    00084
    00085         // 3d triangle
    00086         EAT_TRIANGLE3D,
    00087
    00088         // line 2d
    00089         EAT_LINE2D,
    00090
    00091         // line 3d
    00092         EAT_LINE3D,
    00093
    00094         // array of stringws attribute
    00095         EAT_STRINGWARRAY,
    00096
    00097         // array of float
    00098         EAT_FLOATARRAY,
    00099
    00100         // array of int
    00101         EAT_INTARRAY,
    00102
    00103         // binary data attribute
    00104         EAT_BINARY,
    00105
    00106         // texture reference attribute
    00107         EAT_TEXTURE,
    00108
    00109         // user pointer void*
    00110         EAT_USER_POINTER,
    00111
    00112         // known attribute type count
    00113         EAT_COUNT,
    00114
    00115         // unknown attribute
    00116         EAT_UNKNOWN
    00117 };
    00118
    00120 class IAttributes : public virtual IReferenceCounted
    00121 {
    00122 public:
    00123
    00125         virtual u32 getAttributeCount() const = 0;
    00126
    00129         virtual const c8* getAttributeName(s32 index) = 0;
    00130
    00133         virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) = 0;
    00134
    00137         virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) = 0;
    00138
    00141         virtual const wchar_t* getAttributeTypeString(const c8* attributeName) = 0;
    00142
    00145         virtual const wchar_t* getAttributeTypeString(s32 index) = 0;
    00146
    00148         virtual bool existsAttribute(const c8* attributeName) = 0;
    00149
    00151         virtual s32 findAttribute(const c8* attributeName) = 0;
    00152
    00154         virtual void clear() = 0;
    00155
    00162         virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false, const wchar_t* elementName=0) = 0;
    00163
    00168         virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false, const wchar_t* elementName=0) = 0;
    00169
    00170
    00171         /*
    00172
    00173                 Integer Attribute
    00174
    00175         */
    00176
    00178         virtual void addInt(const c8* attributeName, s32 value) = 0;
    00179
    00181         virtual void setAttribute(const c8* attributeName, s32 value) = 0;
    00182
    00186         virtual s32 getAttributeAsInt(const c8* attributeName) = 0;
    00187
    00190         virtual s32 getAttributeAsInt(s32 index) = 0;
    00191
    00193         virtual void setAttribute(s32 index, s32 value) = 0;
    00194
    00195         /*
    00196
    00197                 Float Attribute
    00198
    00199         */
    00200
    00202         virtual void addFloat(const c8* attributeName, f32 value) = 0;
    00203
    00205         virtual void setAttribute(const c8* attributeName, f32 value) = 0;
    00206
    00210         virtual f32 getAttributeAsFloat(const c8* attributeName) = 0;
    00211
    00214         virtual f32 getAttributeAsFloat(s32 index) = 0;
    00215
    00217         virtual void setAttribute(s32 index, f32 value) = 0;
    00218
    00219         /*
    00220
    00221                 String Attribute
    00222
    00223         */
    00224
    00226         virtual void addString(const c8* attributeName, const c8* value) = 0;
    00227
    00231         virtual void setAttribute(const c8* attributeName, const c8* value) = 0;
    00232
    00237         virtual core::stringc getAttributeAsString(const c8* attributeName) = 0;
    00238
    00242         virtual void getAttributeAsString(const c8* attributeName, c8* target) = 0;
    00243
    00246         virtual core::stringc getAttributeAsString(s32 index) = 0;
    00247
    00251         virtual void setAttribute(s32 index, const c8* value) = 0;
    00252
    00253         // wide strings
    00254
    00256         virtual void addString(const c8* attributeName, const wchar_t* value) = 0;
    00257
    00261         virtual void setAttribute(const c8* attributeName, const wchar_t* value) = 0;
    00262
    00267         virtual core::stringw getAttributeAsStringW(const c8* attributeName) = 0;
    00268
    00272         virtual void getAttributeAsStringW(const c8* attributeName, wchar_t* target) = 0;
    00273
    00276         virtual core::stringw getAttributeAsStringW(s32 index) = 0;
    00277
    00281         virtual void setAttribute(s32 index, const wchar_t* value) = 0;
    00282
    00283         /*
    00284
    00285                 Binary Data Attribute
    00286
    00287         */
    00288
    00290         virtual void addBinary(const c8* attributeName, void* data, s32 dataSizeInBytes) = 0;
    00291
    00293         virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes ) = 0;
    00294
    00296
    00300         virtual void getAttributeAsBinaryData(const c8* attributeName, void* outData, s32 maxSizeInBytes) = 0;
    00301
    00303
    00307         virtual void getAttributeAsBinaryData(s32 index, void* outData, s32 maxSizeInBytes) = 0;
    00308
    00310         virtual void setAttribute(s32 index, void* data, s32 dataSizeInBytes ) = 0;
    00311
    00312
    00313         /*
    00314                 Array Attribute
    00315         */
    00316
    00318         virtual void addArray(const c8* attributeName, core::array<core::stringw> value) = 0;
    00319
    00323         virtual void setAttribute(const c8* attributeName, const core::array<core::stringw> value) = 0;
    00324
    00329         virtual core::array<core::stringw> getAttributeAsArray(const c8* attributeName) = 0;
    00330
    00333         virtual core::array<core::stringw> getAttributeAsArray(s32 index) = 0;
    00334
    00336         virtual void setAttribute(s32 index, core::array<core::stringw> value) = 0;
    00337
    00338
    00339         /*
    00340
    00341                 Bool Attribute
    00342
    00343         */
    00344
    00346         virtual void addBool(const c8* attributeName, bool value) = 0;
    00347
    00349         virtual void setAttribute(const c8* attributeName, bool value) = 0;
    00350
    00354         virtual bool getAttributeAsBool(const c8* attributeName) = 0;
    00355
    00358         virtual bool getAttributeAsBool(s32 index) = 0;
    00359
    00361         virtual void setAttribute(s32 index, bool value) = 0;
    00362
    00363         /*
    00364
    00365                 Enumeration Attribute
    00366
    00367         */
    00368
    00370         virtual void addEnum(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
    00371
    00373         virtual void addEnum(const c8* attributeName, s32 enumValue, const c8* const* enumerationLiterals) = 0;
    00374
    00376         virtual void setAttribute(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
    00377
    00381         virtual const c8* getAttributeAsEnumeration(const c8* attributeName) = 0;
    00382
    00384
    00391         virtual s32 getAttributeAsEnumeration(const c8* attributeName, const c8* const* enumerationLiteralsToUse) = 0;
    00392
    00394
    00401         virtual s32 getAttributeAsEnumeration(s32 index, const c8* const* enumerationLiteralsToUse) = 0;
    00402
    00405         virtual const c8* getAttributeAsEnumeration(s32 index) = 0;
    00406
    00410         virtual void getAttributeEnumerationLiteralsOfEnumeration(const c8* attributeName, core::array<core::stringc>& outLiterals) = 0;
    00411
    00415         virtual void getAttributeEnumerationLiteralsOfEnumeration(s32 index, core::array<core::stringc>& outLiterals) = 0;
    00416
    00418         virtual void setAttribute(s32 index, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
    00419
    00420
    00421         /*
    00422
    00423                 SColor Attribute
    00424
    00425         */
    00426
    00428         virtual void addColor(const c8* attributeName, video::SColor value) = 0;
    00429
    00430
    00432         virtual void setAttribute(const c8* attributeName, video::SColor color) = 0;
    00433
    00437         virtual video::SColor getAttributeAsColor(const c8* attributeName) = 0;
    00438
    00441         virtual video::SColor getAttributeAsColor(s32 index) = 0;
    00442
    00444         virtual void setAttribute(s32 index, video::SColor color) = 0;
    00445
    00446         /*
    00447
    00448                 SColorf Attribute
    00449
    00450         */
    00451
    00453         virtual void addColorf(const c8* attributeName, video::SColorf value) = 0;
    00454
    00456         virtual void setAttribute(const c8* attributeName, video::SColorf color) = 0;
    00457
    00461         virtual video::SColorf getAttributeAsColorf(const c8* attributeName) = 0;
    00462
    00465         virtual video::SColorf getAttributeAsColorf(s32 index) = 0;
    00466
    00468         virtual void setAttribute(s32 index, video::SColorf color) = 0;
    00469
    00470
    00471         /*
    00472
    00473                 Vector3d Attribute
    00474
    00475         */
    00476
    00478         virtual void addVector3d(const c8* attributeName, core::vector3df value) = 0;
    00479
    00481         virtual void setAttribute(const c8* attributeName, core::vector3df v) = 0;
    00482
    00486         virtual core::vector3df getAttributeAsVector3d(const c8* attributeName) = 0;
    00487
    00490         virtual core::vector3df getAttributeAsVector3d(s32 index) = 0;
    00491
    00493         virtual void setAttribute(s32 index, core::vector3df v) = 0;
    00494
    00495         /*
    00496
    00497                 Position2d Attribute
    00498
    00499         */
    00500
    00502         virtual void addPosition2d(const c8* attributeName, core::position2di value) = 0;
    00503
    00505         virtual void setAttribute(const c8* attributeName, core::position2di v) = 0;
    00506
    00510         virtual core::position2di getAttributeAsPosition2d(const c8* attributeName) = 0;
    00511
    00514         virtual core::position2di getAttributeAsPosition2d(s32 index) = 0;
    00515
    00517         virtual void setAttribute(s32 index, core::position2di v) = 0;
    00518
    00519         /*
    00520
    00521                 Rectangle Attribute
    00522
    00523         */
    00524
    00526         virtual void addRect(const c8* attributeName, core::rect<s32> value) = 0;
    00527
    00529         virtual void setAttribute(const c8* attributeName, core::rect<s32> v) = 0;
    00530
    00534         virtual core::rect<s32> getAttributeAsRect(const c8* attributeName) = 0;
    00535
    00538         virtual core::rect<s32> getAttributeAsRect(s32 index) = 0;
    00539
    00541         virtual void setAttribute(s32 index, core::rect<s32> v) = 0;
    00542
    00543
    00544         /*
    00545                 matrix attribute
    00546         */
    00547
    00549         virtual void addMatrix(const c8* attributeName, const core::matrix4& v) = 0;
    00550
    00552         virtual void setAttribute(const c8* attributeName, const core::matrix4& v) = 0;
    00553
    00557         virtual core::matrix4 getAttributeAsMatrix(const c8* attributeName) = 0;
    00558
    00561         virtual core::matrix4 getAttributeAsMatrix(s32 index) = 0;
    00562
    00564         virtual void setAttribute(s32 index, const core::matrix4& v) = 0;
    00565
    00566         /*
    00567                 quaternion attribute
    00568
    00569         */
    00570
    00572         virtual void addQuaternion(const c8* attributeName, core::quaternion v) = 0;
    00573
    00575         virtual void setAttribute(const c8* attributeName, core::quaternion v) = 0;
    00576
    00580         virtual core::quaternion getAttributeAsQuaternion(const c8* attributeName) = 0;
    00581
    00584         virtual core::quaternion getAttributeAsQuaternion(s32 index) = 0;
    00585
    00587         virtual void setAttribute(s32 index, core::quaternion v) = 0;
    00588
    00589         /*
    00590
    00591                 3d bounding box
    00592
    00593         */
    00594
    00596         virtual void addBox3d(const c8* attributeName, core::aabbox3df v) = 0;
    00597
    00599         virtual void setAttribute(const c8* attributeName, core::aabbox3df v) = 0;
    00600
    00604         virtual core::aabbox3df getAttributeAsBox3d(const c8* attributeName) = 0;
    00605
    00608         virtual core::aabbox3df getAttributeAsBox3d(s32 index) = 0;
    00609
    00611         virtual void setAttribute(s32 index, core::aabbox3df v) = 0;
    00612
    00613         /*
    00614
    00615                 plane
    00616
    00617         */
    00618
    00620         virtual void addPlane3d(const c8* attributeName, core::plane3df v) = 0;
    00621
    00623         virtual void setAttribute(const c8* attributeName, core::plane3df v) = 0;
    00624
    00628         virtual core::plane3df getAttributeAsPlane3d(const c8* attributeName) = 0;
    00629
    00632         virtual core::plane3df getAttributeAsPlane3d(s32 index) = 0;
    00633
    00635         virtual void setAttribute(s32 index, core::plane3df v) = 0;
    00636
    00637
    00638         /*
    00639
    00640                 3d triangle
    00641
    00642         */
    00643
    00645         virtual void addTriangle3d(const c8* attributeName, core::triangle3df v) = 0;
    00646
    00648         virtual void setAttribute(const c8* attributeName, core::triangle3df v) = 0;
    00649
    00653         virtual core::triangle3df getAttributeAsTriangle3d(const c8* attributeName) = 0;
    00654
    00657         virtual core::triangle3df getAttributeAsTriangle3d(s32 index) = 0;
    00658
    00660         virtual void setAttribute(s32 index, core::triangle3df v) = 0;
    00661
    00662
    00663         /*
    00664
    00665                 line 2d
    00666
    00667         */
    00668
    00670         virtual void addLine2d(const c8* attributeName, core::line2df v) = 0;
    00671
    00673         virtual void setAttribute(const c8* attributeName, core::line2df v) = 0;
    00674
    00678         virtual core::line2df getAttributeAsLine2d(const c8* attributeName) = 0;
    00679
    00682         virtual core::line2df getAttributeAsLine2d(s32 index) = 0;
    00683
    00685         virtual void setAttribute(s32 index, core::line2df v) = 0;
    00686
    00687
    00688         /*
    00689
    00690                 line 3d
    00691
    00692         */
    00693
    00695         virtual void addLine3d(const c8* attributeName, core::line3df v) = 0;
    00696
    00698         virtual void setAttribute(const c8* attributeName, core::line3df v) = 0;
    00699
    00703         virtual core::line3df getAttributeAsLine3d(const c8* attributeName) = 0;
    00704
    00707         virtual core::line3df getAttributeAsLine3d(s32 index) = 0;
    00708
    00710         virtual void setAttribute(s32 index, core::line3df v) = 0;
    00711
    00712
    00713         /*
    00714
    00715                 Texture Attribute
    00716
    00717         */
    00718
    00720         virtual void addTexture(const c8* attributeName, video::ITexture* texture) = 0;
    00721
    00723         virtual void setAttribute(const c8* attributeName, video::ITexture* texture ) = 0;
    00724
    00727         virtual video::ITexture* getAttributeAsTexture(const c8* attributeName) = 0;
    00728
    00731         virtual video::ITexture* getAttributeAsTexture(s32 index) = 0;
    00732
    00734         virtual void setAttribute(s32 index, video::ITexture* texture) = 0;
    00735
    00736
    00737         /*
    00738
    00739                 User Pointer Attribute
    00740
    00741         */
    00742
    00744         virtual void addUserPointer(const c8* attributeName, void* userPointer) = 0;
    00745
    00747         virtual void setAttribute(const c8* attributeName, void* userPointer) = 0;
    00748
    00751         virtual void* getAttributeAsUserPointer(const c8* attributeName) = 0;
    00752
    00755         virtual void* getAttributeAsUserPointer(s32 index) = 0;
    00756
    00758         virtual void setAttribute(s32 index, void* userPointer) = 0;
    00759
    00760 };
    00761
    00762 } // end namespace io
    00763 } // end namespace irr
    00764
    00765 #endif
    00766
    00767
    00768

| The Irrlicht Engine Documentation © 2003-2009 by Nikolaus Gebhardt. Generated on Sun Jan 10 09:24:03 2010 by Doxygen (1.5.6)