From 071010b4eeb09fe72655583ac32b5f5cd191da23 Mon Sep 17 00:00:00 2001 From: rave3d Date: Wed, 9 Dec 2009 07:42:45 +0000 Subject: [PATCH] implementing more public properties arrays of simple datatypes are complete git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@511 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- port/Assimp.NET/Assimp.NET/Animation.h | 2 +- port/Assimp.NET/Assimp.NET/Face.h | 12 ++- port/Assimp.NET/Assimp.NET/MaterialProperty.h | 12 ++- port/Assimp.NET/Assimp.NET/Mesh.h | 6 +- port/Assimp.NET/Assimp.NET/Node.h | 52 +++++++++--- port/Assimp.NET/Assimp.NET/NodeAnim.h | 30 +++++-- port/Assimp.NET/Assimp.NET/QuatKey.h | 20 ++++- port/Assimp.NET/Assimp.NET/Quaternion.h | 40 +++++++-- port/Assimp.NET/Assimp.NET/Scene.h | 81 +++++++++++++++---- port/Assimp.NET/Assimp.NET/Texel.h | 40 +++++++-- port/Assimp.NET/Assimp.NET/Texture.h | 44 ++++++++-- port/Assimp.NET/Assimp.NET/Vector2D.h | 20 ++++- port/Assimp.NET/Assimp.NET/Vector3D.h | 30 +++++-- port/Assimp.NET/Assimp.NET/VectorKey.h | 20 ++++- port/Assimp.NET/Assimp.NET/VertexWeight.h | 20 ++++- 15 files changed, 345 insertions(+), 84 deletions(-) diff --git a/port/Assimp.NET/Assimp.NET/Animation.h b/port/Assimp.NET/Assimp.NET/Animation.h index 59e53aa6d..21ddfc94d 100644 --- a/port/Assimp.NET/Assimp.NET/Animation.h +++ b/port/Assimp.NET/Assimp.NET/Animation.h @@ -66,7 +66,7 @@ namespace AssimpNET } void set(array^ value) { - throw gcnew System::NotImplementedException(); + throw gcnew System::NotImplementedException(); } } property unsigned int mNumAnimChannels diff --git a/port/Assimp.NET/Assimp.NET/Face.h b/port/Assimp.NET/Assimp.NET/Face.h index fcf1cee6a..c219819b9 100644 --- a/port/Assimp.NET/Assimp.NET/Face.h +++ b/port/Assimp.NET/Assimp.NET/Face.h @@ -60,8 +60,16 @@ namespace AssimpNET property array^ mIndices { - array^ get(){throw gcnew System::NotImplementedException();} - void set(array^ value){throw gcnew System::NotImplementedException();} + array^ get() + { + array^ tmp = gcnew array(this->p_native->mNumIndices); + System::Runtime::InteropServices::Marshal::Copy((System::IntPtr)this->p_native->mIndices, (array^)tmp, 0, tmp->Length); + return tmp; + } + void set(array^ value) + { + System::Runtime::InteropServices::Marshal::Copy((array^)value, 0, (System::IntPtr)this->p_native->mIndices, value->Length); + } } property unsigned int mNumIndices diff --git a/port/Assimp.NET/Assimp.NET/MaterialProperty.h b/port/Assimp.NET/Assimp.NET/MaterialProperty.h index c84fb2c14..46334d143 100644 --- a/port/Assimp.NET/Assimp.NET/MaterialProperty.h +++ b/port/Assimp.NET/Assimp.NET/MaterialProperty.h @@ -66,8 +66,16 @@ namespace AssimpNET property array^ mData { - array^ get(){throw gcnew System::NotImplementedException();} - void set(array^ value){throw gcnew System::NotImplementedException();} + array^ get() + { + array^ tmp = gcnew array(this->p_native->mDataLength); + System::Runtime::InteropServices::Marshal::Copy((System::IntPtr)this->p_native->mData, (array^)tmp, 0, this->p_native->mDataLength); + return tmp; + } + void set(array^ value) + { + System::Runtime::InteropServices::Marshal::Copy((array^)value, 0, (System::IntPtr)this->p_native->mData, value->Length); + } } property unsigned int mDataLength diff --git a/port/Assimp.NET/Assimp.NET/Mesh.h b/port/Assimp.NET/Assimp.NET/Mesh.h index 46c888800..a9b0500fb 100644 --- a/port/Assimp.NET/Assimp.NET/Mesh.h +++ b/port/Assimp.NET/Assimp.NET/Mesh.h @@ -141,11 +141,13 @@ namespace AssimpNET { array^get() { - throw gcnew System::NotImplementedException(); + array^ tmp = gcnew array(AI_MAX_NUMBER_OF_TEXTURECOORDS); + System::Runtime::InteropServices::Marshal::Copy((System::IntPtr)this->p_native->mNumUVComponents,(array^)tmp,0,AI_MAX_NUMBER_OF_TEXTURECOORDS); + return tmp; } void set(array^ value) { - throw gcnew System::NotImplementedException(); + System::Runtime::InteropServices::Marshal::Copy((array^)value,0,(System::IntPtr)this->p_native->mNumUVComponents, AI_MAX_NUMBER_OF_TEXTURECOORDS); } } diff --git a/port/Assimp.NET/Assimp.NET/Node.h b/port/Assimp.NET/Assimp.NET/Node.h index bb5372493..fbbfbc6a3 100644 --- a/port/Assimp.NET/Assimp.NET/Node.h +++ b/port/Assimp.NET/Assimp.NET/Node.h @@ -69,8 +69,16 @@ namespace AssimpNET property array^ mMeshes { - array^ get(){throw gcnew System::NotImplementedException();} - void set(array^ value){throw gcnew System::NotImplementedException();} + array^ get() + { + array^ tmp = gcnew array(this->p_native->mNumMeshes); + System::Runtime::InteropServices::Marshal::Copy((System::IntPtr)this->p_native->mMeshes,(array^)tmp,0,this->p_native->mNumMeshes); + return tmp; + } + void set(array^ value) + { + System::Runtime::InteropServices::Marshal::Copy((array^)value,0,(System::IntPtr)this->p_native->mMeshes,this->p_native->mNumMeshes); + } } property String^ mName @@ -87,26 +95,50 @@ namespace AssimpNET property unsigned int mNumChildren { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumChildren; + } + void set(unsigned int value) + { + this->p_native->mNumChildren = value; + } } property unsigned int mNumMeshes { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumMeshes; + } + void set(unsigned int value) + { + this->p_native->mNumMeshes = value; + } } property Matrix4x4^ mTransformation { - Matrix4x4^ get(){throw gcnew System::NotImplementedException();} - void set(Matrix4x4^ value){throw gcnew System::NotImplementedException();} + Matrix4x4^ get() + { + return gcnew Matrix4x4(&this->p_native->mTransformation); + } + void set(Matrix4x4^ value) + { + this->p_native->mTransformation = aiMatrix4x4(*value->getNative()); + } } property Node^ mParent { - Node^ get(){throw gcnew System::NotImplementedException();} - void set(Node^ value){throw gcnew System::NotImplementedException();} + Node^ get() + { + return gcnew Node(this->p_native->mParent); + } + void set(Node^ value) + { + this->p_native->mParent = new aiNode(*value->getNative()); + } } aiNode* getNative(); diff --git a/port/Assimp.NET/Assimp.NET/NodeAnim.h b/port/Assimp.NET/Assimp.NET/NodeAnim.h index b961f04a8..b6abd7506 100644 --- a/port/Assimp.NET/Assimp.NET/NodeAnim.h +++ b/port/Assimp.NET/Assimp.NET/NodeAnim.h @@ -82,20 +82,38 @@ namespace AssimpNET property unsigned int mNumPositionKeys { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumPositionKeys; + } + void set(unsigned int value) + { + this->p_native->mNumPositionKeys = value; + } } property unsigned int mNumRotationKeys { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumRotationKeys; + } + void set(unsigned int value) + { + this->p_native->mNumRotationKeys = value; + } } property unsigned int mNumScalingKeys { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumScalingKeys; + } + void set(unsigned int value) + { + this->p_native->mNumScalingKeys = value; + } } property array^ mPositionKeys diff --git a/port/Assimp.NET/Assimp.NET/QuatKey.h b/port/Assimp.NET/Assimp.NET/QuatKey.h index 58384b697..421b53e01 100644 --- a/port/Assimp.NET/Assimp.NET/QuatKey.h +++ b/port/Assimp.NET/Assimp.NET/QuatKey.h @@ -66,14 +66,26 @@ namespace AssimpNET property double mTime { - double get(){throw gcnew System::NotImplementedException();} - void set(double value){System::NotImplementedException();} + double get() + { + return this->p_native->mTime; + } + void set(double value) + { + this->p_native->mTime = value; + } } property Quaternion^ mValue { - Quaternion^ get() {throw gcnew System::NotImplementedException();} - void set(Quaternion^ value){throw gcnew System::NotImplementedException();} + Quaternion^ get() + { + return gcnew Quaternion(&this->p_native->mValue); + } + void set(Quaternion^ value) + { + this->p_native->mValue = aiQuaternion(*value->getNative()); + } } aiQuatKey* getNative(); diff --git a/port/Assimp.NET/Assimp.NET/Quaternion.h b/port/Assimp.NET/Assimp.NET/Quaternion.h index 2d2a97d4e..a86ccc577 100644 --- a/port/Assimp.NET/Assimp.NET/Quaternion.h +++ b/port/Assimp.NET/Assimp.NET/Quaternion.h @@ -79,26 +79,50 @@ namespace AssimpNET property float x { - float get() { throw gcnew System::NotImplementedException();} - void set(float value) { throw gcnew System::NotImplementedException();} + float get() + { + return this->p_native->x; + } + void set(float value) + { + this->p_native->x = value; + } } property float y { - float get() { throw gcnew System::NotImplementedException();} - void set(float value) { throw gcnew System::NotImplementedException();} + float get() + { + return this->p_native->y; + } + void set(float value) + { + this->p_native->y = value; + } } property float z { - float get() { throw gcnew System::NotImplementedException();} - void set(float value) { throw gcnew System::NotImplementedException();} + float get() + { + return this->p_native->z; + } + void set(float value) + { + this->p_native->z = value; + } } property float w { - float get() { throw gcnew System::NotImplementedException();} - void set(float value) { throw gcnew System::NotImplementedException();} + float get() + { + return this->p_native->w; + } + void set(float value) + { + this->p_native->w = value; + } } aiQuaternion* getNative(); diff --git a/port/Assimp.NET/Assimp.NET/Scene.h b/port/Assimp.NET/Assimp.NET/Scene.h index 6271c7e34..6a2ec7e20 100644 --- a/port/Assimp.NET/Assimp.NET/Scene.h +++ b/port/Assimp.NET/Assimp.NET/Scene.h @@ -84,8 +84,14 @@ namespace AssimpNET } property unsigned int mFlags { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mFlags; + } + void set(unsigned int value) + { + this->p_native->mFlags = value; + } } property array^ mLights { @@ -104,38 +110,81 @@ namespace AssimpNET } property unsigned int mNumAnimations { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumAnimations; + } + void set(unsigned int value) + { + this->p_native->mNumAnimations = value; + } } property unsigned int mNumCameras { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumCameras; + } + void set(unsigned int value) + { + this->p_native->mNumCameras = value; + } } property unsigned int mNumLights { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumLights; + } + void set(unsigned int value) + { + this->p_native->mNumLights = value; + } } property unsigned int mNumMaterials { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumMaterials; + } + void set(unsigned int value) + { + this->p_native->mNumMaterials = value; + } } property unsigned int mNumMeshes { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumMeshes; + } + void set(unsigned int value) + { + this->p_native->mNumMeshes = value; + } } property unsigned int mNumTextures { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mNumTextures; + } + void set(unsigned int value) + { + this->p_native->mNumTextures = value; + } } property Node^ mRootNode { - Node^ get(){throw gcnew System::NotImplementedException();} - void set(Node^ value){throw gcnew System::NotImplementedException();} + Node^ get() + { + return gcnew Node(this->p_native->mRootNode); + } + void set(Node^ value) + { + //this->p_native->mRootNode = new aiNode(value->getNative()); + this->p_native->mRootNode = value->getNative(); + } } property array^ mTextures { diff --git a/port/Assimp.NET/Assimp.NET/Texel.h b/port/Assimp.NET/Assimp.NET/Texel.h index 0257694f6..4c3246806 100644 --- a/port/Assimp.NET/Assimp.NET/Texel.h +++ b/port/Assimp.NET/Assimp.NET/Texel.h @@ -24,26 +24,50 @@ public ref class Texel property unsigned char a { - unsigned char get(){throw gcnew System::NotImplementedException();} - void set(unsigned char value){throw gcnew System::NotImplementedException();} + unsigned char get() + { + return this->p_native->a; + } + void set(unsigned char value) + { + this->p_native->a = value; + } } property unsigned char r { - unsigned char get(){throw gcnew System::NotImplementedException();} - void set(unsigned char value){throw gcnew System::NotImplementedException();} + unsigned char get() + { + return this->p_native->r; + } + void set(unsigned char value) + { + this->p_native->r = value; + } } property unsigned char g { - unsigned char get(){throw gcnew System::NotImplementedException();} - void set(unsigned char value){throw gcnew System::NotImplementedException();} + unsigned char get() + { + return this->p_native->g; + } + void set(unsigned char value) + { + this->p_native->g = value; + } } property unsigned char b { - unsigned char get(){throw gcnew System::NotImplementedException();} - void set(unsigned char value){throw gcnew System::NotImplementedException();} + unsigned char get() + { + return this->p_native->b; + } + void set(unsigned char value) + { + this->p_native->b = value; + } } aiTexel* getNative(); diff --git a/port/Assimp.NET/Assimp.NET/Texture.h b/port/Assimp.NET/Assimp.NET/Texture.h index 03da8d841..37a311b2e 100644 --- a/port/Assimp.NET/Assimp.NET/Texture.h +++ b/port/Assimp.NET/Assimp.NET/Texture.h @@ -108,23 +108,53 @@ namespace AssimpNET property array^ achFormatHint { - array^ get(){throw gcnew System::NotImplementedException();} - void set(array^ value){throw gcnew System::NotImplementedException();} + array^ get() + { + array^ tmp = array(); + System::Runtime::InteropServices::Marshal::Copy((System::IntPtr)this->p_native->achFormatHint,(array^)tmp,0,4); + return tmp; + } + void set(array^ value) + { + System::Runtime::InteropServices::Marshal::Copy((array^)value,0,(System::IntPtr)this->p_native->achFormatHint,4); + } } property unsigned int mHeight { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mHeight; + } + void set(unsigned int value) + { + this->p_native->mHeight = value; + } } property unsigned int mWidth { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mWidth; + } + void set(unsigned int value) + { + this->p_native->mWidth = value; + } } - property Texel^ pcData; + property Texel^ pcData + { + Texel^ get() + { + return gcnew Texel(this->p_native->pcData); + } + void set(Texel^ value) + { + this->p_native->pcData = new aiTexel(*value->getNative()); + } + } aiTexture* getNative(); private: diff --git a/port/Assimp.NET/Assimp.NET/Vector2D.h b/port/Assimp.NET/Assimp.NET/Vector2D.h index d73ef9f30..f8a0bf6ba 100644 --- a/port/Assimp.NET/Assimp.NET/Vector2D.h +++ b/port/Assimp.NET/Assimp.NET/Vector2D.h @@ -72,14 +72,26 @@ namespace AssimpNET property float x { - float get(){throw gcnew System::NotImplementedException();} - void set(float value){throw gcnew System::NotImplementedException();} + float get() + { + return this->p_native->x; + } + void set(float value) + { + this->p_native->x = value; + } } property float y { - float get(){throw gcnew System::NotImplementedException();} - void set(float value){throw gcnew System::NotImplementedException();} + float get() + { + return this->p_native->y; + } + void set(float value) + { + this->p_native->x = value; + } } aiVector2D* getNative(); diff --git a/port/Assimp.NET/Assimp.NET/Vector3D.h b/port/Assimp.NET/Assimp.NET/Vector3D.h index c36b93ece..0780a108c 100644 --- a/port/Assimp.NET/Assimp.NET/Vector3D.h +++ b/port/Assimp.NET/Assimp.NET/Vector3D.h @@ -76,20 +76,38 @@ namespace AssimpNET property float x { - float get(){throw gcnew System::NotImplementedException();} - void set(float value){throw gcnew System::NotImplementedException();} + float get() + { + return this->p_native->x; + } + void set(float value) + { + this->p_native->x = value; + } } property float y { - float get(){throw gcnew System::NotImplementedException();} - void set(float value){throw gcnew System::NotImplementedException();} + float get() + { + return this->p_native->y; + } + void set(float value) + { + this->p_native->y = value; + } } property float z { - float get(){throw gcnew System::NotImplementedException();} - void set(float value){throw gcnew System::NotImplementedException();} + float get() + { + return this->p_native->z; + } + void set(float value) + { + this->p_native->z = value; + } } aiVector3D* getNative(); diff --git a/port/Assimp.NET/Assimp.NET/VectorKey.h b/port/Assimp.NET/Assimp.NET/VectorKey.h index 25852d046..4e76e1a7b 100644 --- a/port/Assimp.NET/Assimp.NET/VectorKey.h +++ b/port/Assimp.NET/Assimp.NET/VectorKey.h @@ -67,14 +67,26 @@ namespace AssimpNET property double mTime { - double get(){throw gcnew System::NotImplementedException();} - void set(double value){System::NotImplementedException();} + double get() + { + return this->p_native->mTime; + } + void set(double value) + { + this->p_native->mTime = value; + } } property Vector3D^ mValue { - Vector3D^ get() {throw gcnew System::NotImplementedException();} - void set(Vector3D^ value){throw gcnew System::NotImplementedException();} + Vector3D^ get() + { + return gcnew Vector3D(&this->p_native->mValue); + } + void set(Vector3D^ value) + { + this->p_native->mValue = aiVector3D(*value->getNative()); + } } aiVectorKey* getNative(); diff --git a/port/Assimp.NET/Assimp.NET/VertexWeight.h b/port/Assimp.NET/Assimp.NET/VertexWeight.h index b257ca97b..94fa6fffc 100644 --- a/port/Assimp.NET/Assimp.NET/VertexWeight.h +++ b/port/Assimp.NET/Assimp.NET/VertexWeight.h @@ -59,14 +59,26 @@ namespace AssimpNET property unsigned int mVertexId { - unsigned int get(){throw gcnew System::NotImplementedException();} - void set(unsigned int value){throw gcnew System::NotImplementedException();} + unsigned int get() + { + return this->p_native->mVertexId; + } + void set(unsigned int value) + { + this->p_native->mVertexId = value; + } } property float mWeight { - float get(){throw gcnew System::NotImplementedException();} - void set(float value){throw gcnew System::NotImplementedException();} + float get() + { + return this->p_native->mWeight; + } + void set(float value) + { + this->p_native->mWeight = value; + } } aiVertexWeight* getNative();