Irrlicht Engine: IAttributes.h Source File

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-2010 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 #include "EAttributes.h"
    00027
    00028 namespace irr
    00029 {
    00030 namespace video
    00031 {
    00032         class ITexture;
    00033 } // end namespace video
    00034 namespace io
    00035 {
    00036         class IXMLWriter;
    00037
    00039 class IAttributes : public virtual IReferenceCounted
    00040 {
    00041 public:
    00042
    00044         virtual u32 getAttributeCount() const = 0;
    00045
    00048         virtual const c8* getAttributeName(s32 index) = 0;
    00049
    00052         virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) = 0;
    00053
    00056         virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) = 0;
    00057
    00060         virtual const wchar_t* getAttributeTypeString(const c8* attributeName) = 0;
    00061
    00064         virtual const wchar_t* getAttributeTypeString(s32 index) = 0;
    00065
    00067         virtual bool existsAttribute(const c8* attributeName) = 0;
    00068
    00070         virtual s32 findAttribute(const c8* attributeName) = 0;
    00071
    00073         virtual void clear() = 0;
    00074
    00081         virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false, const wchar_t* elementName=0) = 0;
    00082
    00087         virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false, const wchar_t* elementName=0) = 0;
    00088
    00089
    00090         /*
    00091
    00092                 Integer Attribute
    00093
    00094         */
    00095
    00097         virtual void addInt(const c8* attributeName, s32 value) = 0;
    00098
    00100         virtual void setAttribute(const c8* attributeName, s32 value) = 0;
    00101
    00105         virtual s32 getAttributeAsInt(const c8* attributeName) = 0;
    00106
    00109         virtual s32 getAttributeAsInt(s32 index) = 0;
    00110
    00112         virtual void setAttribute(s32 index, s32 value) = 0;
    00113
    00114         /*
    00115
    00116                 Float Attribute
    00117
    00118         */
    00119
    00121         virtual void addFloat(const c8* attributeName, f32 value) = 0;
    00122
    00124         virtual void setAttribute(const c8* attributeName, f32 value) = 0;
    00125
    00129         virtual f32 getAttributeAsFloat(const c8* attributeName) = 0;
    00130
    00133         virtual f32 getAttributeAsFloat(s32 index) = 0;
    00134
    00136         virtual void setAttribute(s32 index, f32 value) = 0;
    00137
    00138         /*
    00139
    00140                 String Attribute
    00141
    00142         */
    00143
    00145         virtual void addString(const c8* attributeName, const c8* value) = 0;
    00146
    00150         virtual void setAttribute(const c8* attributeName, const c8* value) = 0;
    00151
    00156         virtual core::stringc getAttributeAsString(const c8* attributeName) = 0;
    00157
    00161         virtual void getAttributeAsString(const c8* attributeName, c8* target) = 0;
    00162
    00165         virtual core::stringc getAttributeAsString(s32 index) = 0;
    00166
    00170         virtual void setAttribute(s32 index, const c8* value) = 0;
    00171
    00172         // wide strings
    00173
    00175         virtual void addString(const c8* attributeName, const wchar_t* value) = 0;
    00176
    00180         virtual void setAttribute(const c8* attributeName, const wchar_t* value) = 0;
    00181
    00186         virtual core::stringw getAttributeAsStringW(const c8* attributeName) = 0;
    00187
    00191         virtual void getAttributeAsStringW(const c8* attributeName, wchar_t* target) = 0;
    00192
    00195         virtual core::stringw getAttributeAsStringW(s32 index) = 0;
    00196
    00200         virtual void setAttribute(s32 index, const wchar_t* value) = 0;
    00201
    00202         /*
    00203
    00204                 Binary Data Attribute
    00205
    00206         */
    00207
    00209         virtual void addBinary(const c8* attributeName, void* data, s32 dataSizeInBytes) = 0;
    00210
    00212         virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes ) = 0;
    00213
    00215
    00219         virtual void getAttributeAsBinaryData(const c8* attributeName, void* outData, s32 maxSizeInBytes) = 0;
    00220
    00222
    00226         virtual void getAttributeAsBinaryData(s32 index, void* outData, s32 maxSizeInBytes) = 0;
    00227
    00229         virtual void setAttribute(s32 index, void* data, s32 dataSizeInBytes ) = 0;
    00230
    00231
    00232         /*
    00233                 Array Attribute
    00234         */
    00235
    00237         virtual void addArray(const c8* attributeName, const core::array<core::stringw>& value) = 0;
    00238
    00242         virtual void setAttribute(const c8* attributeName, const core::array<core::stringw>& value) = 0;
    00243
    00248         virtual core::array<core::stringw> getAttributeAsArray(const c8* attributeName) = 0;
    00249
    00252         virtual core::array<core::stringw> getAttributeAsArray(s32 index) = 0;
    00253
    00255         virtual void setAttribute(s32 index, const core::array<core::stringw>& value) = 0;
    00256
    00257
    00258         /*
    00259
    00260                 Bool Attribute
    00261
    00262         */
    00263
    00265         virtual void addBool(const c8* attributeName, bool value) = 0;
    00266
    00268         virtual void setAttribute(const c8* attributeName, bool value) = 0;
    00269
    00273         virtual bool getAttributeAsBool(const c8* attributeName) = 0;
    00274
    00277         virtual bool getAttributeAsBool(s32 index) = 0;
    00278
    00280         virtual void setAttribute(s32 index, bool value) = 0;
    00281
    00282         /*
    00283
    00284                 Enumeration Attribute
    00285
    00286         */
    00287
    00289         virtual void addEnum(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
    00290
    00292         virtual void addEnum(const c8* attributeName, s32 enumValue, const c8* const* enumerationLiterals) = 0;
    00293
    00295         virtual void setAttribute(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
    00296
    00300         virtual const c8* getAttributeAsEnumeration(const c8* attributeName) = 0;
    00301
    00303
    00310         virtual s32 getAttributeAsEnumeration(const c8* attributeName, const c8* const* enumerationLiteralsToUse) = 0;
    00311
    00313
    00320         virtual s32 getAttributeAsEnumeration(s32 index, const c8* const* enumerationLiteralsToUse) = 0;
    00321
    00324         virtual const c8* getAttributeAsEnumeration(s32 index) = 0;
    00325
    00329         virtual void getAttributeEnumerationLiteralsOfEnumeration(const c8* attributeName, core::array<core::stringc>& outLiterals) = 0;
    00330
    00334         virtual void getAttributeEnumerationLiteralsOfEnumeration(s32 index, core::array<core::stringc>& outLiterals) = 0;
    00335
    00337         virtual void setAttribute(s32 index, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
    00338
    00339
    00340         /*
    00341
    00342                 SColor Attribute
    00343
    00344         */
    00345
    00347         virtual void addColor(const c8* attributeName, video::SColor value) = 0;
    00348
    00349
    00351         virtual void setAttribute(const c8* attributeName, video::SColor color) = 0;
    00352
    00356         virtual video::SColor getAttributeAsColor(const c8* attributeName) = 0;
    00357
    00360         virtual video::SColor getAttributeAsColor(s32 index) = 0;
    00361
    00363         virtual void setAttribute(s32 index, video::SColor color) = 0;
    00364
    00365         /*
    00366
    00367                 SColorf Attribute
    00368
    00369         */
    00370
    00372         virtual void addColorf(const c8* attributeName, video::SColorf value) = 0;
    00373
    00375         virtual void setAttribute(const c8* attributeName, video::SColorf color) = 0;
    00376
    00380         virtual video::SColorf getAttributeAsColorf(const c8* attributeName) = 0;
    00381
    00384         virtual video::SColorf getAttributeAsColorf(s32 index) = 0;
    00385
    00387         virtual void setAttribute(s32 index, video::SColorf color) = 0;
    00388
    00389
    00390         /*
    00391
    00392                 Vector3d Attribute
    00393
    00394         */
    00395
    00397         virtual void addVector3d(const c8* attributeName, core::vector3df value) = 0;
    00398
    00400         virtual void setAttribute(const c8* attributeName, core::vector3df v) = 0;
    00401
    00405         virtual core::vector3df getAttributeAsVector3d(const c8* attributeName) = 0;
    00406
    00409         virtual core::vector3df getAttributeAsVector3d(s32 index) = 0;
    00410
    00412         virtual void setAttribute(s32 index, core::vector3df v) = 0;
    00413
    00414         /*
    00415
    00416                 Position2d Attribute
    00417
    00418         */
    00419
    00421         virtual void addPosition2d(const c8* attributeName, core::position2di value) = 0;
    00422
    00424         virtual void setAttribute(const c8* attributeName, core::position2di v) = 0;
    00425
    00429         virtual core::position2di getAttributeAsPosition2d(const c8* attributeName) = 0;
    00430
    00433         virtual core::position2di getAttributeAsPosition2d(s32 index) = 0;
    00434
    00436         virtual void setAttribute(s32 index, core::position2di v) = 0;
    00437
    00438         /*
    00439
    00440                 Rectangle Attribute
    00441
    00442         */
    00443
    00445         virtual void addRect(const c8* attributeName, core::rect<s32> value) = 0;
    00446
    00448         virtual void setAttribute(const c8* attributeName, core::rect<s32> v) = 0;
    00449
    00453         virtual core::rect<s32> getAttributeAsRect(const c8* attributeName) = 0;
    00454
    00457         virtual core::rect<s32> getAttributeAsRect(s32 index) = 0;
    00458
    00460         virtual void setAttribute(s32 index, core::rect<s32> v) = 0;
    00461
    00462
    00463         /*
    00464                 matrix attribute
    00465         */
    00466
    00468         virtual void addMatrix(const c8* attributeName, const core::matrix4& v) = 0;
    00469
    00471         virtual void setAttribute(const c8* attributeName, const core::matrix4& v) = 0;
    00472
    00476         virtual core::matrix4 getAttributeAsMatrix(const c8* attributeName) = 0;
    00477
    00480         virtual core::matrix4 getAttributeAsMatrix(s32 index) = 0;
    00481
    00483         virtual void setAttribute(s32 index, const core::matrix4& v) = 0;
    00484
    00485         /*
    00486                 quaternion attribute
    00487
    00488         */
    00489
    00491         virtual void addQuaternion(const c8* attributeName, core::quaternion v) = 0;
    00492
    00494         virtual void setAttribute(const c8* attributeName, core::quaternion v) = 0;
    00495
    00499         virtual core::quaternion getAttributeAsQuaternion(const c8* attributeName) = 0;
    00500
    00503         virtual core::quaternion getAttributeAsQuaternion(s32 index) = 0;
    00504
    00506         virtual void setAttribute(s32 index, core::quaternion v) = 0;
    00507
    00508         /*
    00509
    00510                 3d bounding box
    00511
    00512         */
    00513
    00515         virtual void addBox3d(const c8* attributeName, core::aabbox3df v) = 0;
    00516
    00518         virtual void setAttribute(const c8* attributeName, core::aabbox3df v) = 0;
    00519
    00523         virtual core::aabbox3df getAttributeAsBox3d(const c8* attributeName) = 0;
    00524
    00527         virtual core::aabbox3df getAttributeAsBox3d(s32 index) = 0;
    00528
    00530         virtual void setAttribute(s32 index, core::aabbox3df v) = 0;
    00531
    00532         /*
    00533
    00534                 plane
    00535
    00536         */
    00537
    00539         virtual void addPlane3d(const c8* attributeName, core::plane3df v) = 0;
    00540
    00542         virtual void setAttribute(const c8* attributeName, core::plane3df v) = 0;
    00543
    00547         virtual core::plane3df getAttributeAsPlane3d(const c8* attributeName) = 0;
    00548
    00551         virtual core::plane3df getAttributeAsPlane3d(s32 index) = 0;
    00552
    00554         virtual void setAttribute(s32 index, core::plane3df v) = 0;
    00555
    00556
    00557         /*
    00558
    00559                 3d triangle
    00560
    00561         */
    00562
    00564         virtual void addTriangle3d(const c8* attributeName, core::triangle3df v) = 0;
    00565
    00567         virtual void setAttribute(const c8* attributeName, core::triangle3df v) = 0;
    00568
    00572         virtual core::triangle3df getAttributeAsTriangle3d(const c8* attributeName) = 0;
    00573
    00576         virtual core::triangle3df getAttributeAsTriangle3d(s32 index) = 0;
    00577
    00579         virtual void setAttribute(s32 index, core::triangle3df v) = 0;
    00580
    00581
    00582         /*
    00583
    00584                 line 2d
    00585
    00586         */
    00587
    00589         virtual void addLine2d(const c8* attributeName, core::line2df v) = 0;
    00590
    00592         virtual void setAttribute(const c8* attributeName, core::line2df v) = 0;
    00593
    00597         virtual core::line2df getAttributeAsLine2d(const c8* attributeName) = 0;
    00598
    00601         virtual core::line2df getAttributeAsLine2d(s32 index) = 0;
    00602
    00604         virtual void setAttribute(s32 index, core::line2df v) = 0;
    00605
    00606
    00607         /*
    00608
    00609                 line 3d
    00610
    00611         */
    00612
    00614         virtual void addLine3d(const c8* attributeName, core::line3df v) = 0;
    00615
    00617         virtual void setAttribute(const c8* attributeName, core::line3df v) = 0;
    00618
    00622         virtual core::line3df getAttributeAsLine3d(const c8* attributeName) = 0;
    00623
    00626         virtual core::line3df getAttributeAsLine3d(s32 index) = 0;
    00627
    00629         virtual void setAttribute(s32 index, core::line3df v) = 0;
    00630
    00631
    00632         /*
    00633
    00634                 Texture Attribute
    00635
    00636         */
    00637
    00639         virtual void addTexture(const c8* attributeName, video::ITexture* texture) = 0;
    00640
    00642         virtual void setAttribute(const c8* attributeName, video::ITexture* texture ) = 0;
    00643
    00646         virtual video::ITexture* getAttributeAsTexture(const c8* attributeName) = 0;
    00647
    00650         virtual video::ITexture* getAttributeAsTexture(s32 index) = 0;
    00651
    00653         virtual void setAttribute(s32 index, video::ITexture* texture) = 0;
    00654
    00655
    00656         /*
    00657
    00658                 User Pointer Attribute
    00659
    00660         */
    00661
    00663         virtual void addUserPointer(const c8* attributeName, void* userPointer) = 0;
    00664
    00666         virtual void setAttribute(const c8* attributeName, void* userPointer) = 0;
    00667
    00670         virtual void* getAttributeAsUserPointer(const c8* attributeName) = 0;
    00671
    00674         virtual void* getAttributeAsUserPointer(s32 index) = 0;
    00675
    00677         virtual void setAttribute(s32 index, void* userPointer) = 0;
    00678
    00679 };
    00680
    00681 } // end namespace io
    00682 } // end namespace irr
    00683
    00684 #endif
    00685
    00686
    00687

| The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Sun Oct 24 12:41:56 2010 by Doxygen (1.6.2)