Browse Source

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

rave3d 15 years ago
parent
commit
071010b4ee

+ 1 - 1
port/Assimp.NET/Assimp.NET/Animation.h

@@ -66,7 +66,7 @@ namespace AssimpNET
 			}
 			}
 			void set(array<NodeAnim^>^ value)
 			void set(array<NodeAnim^>^ value)
 			{
 			{
-				throw gcnew System::NotImplementedException();		
+				throw gcnew System::NotImplementedException();
 			}
 			}
 		}
 		}
 		property unsigned int mNumAnimChannels
 		property unsigned int mNumAnimChannels

+ 10 - 2
port/Assimp.NET/Assimp.NET/Face.h

@@ -60,8 +60,16 @@ namespace AssimpNET
 
 
 		property array<unsigned int>^ mIndices
 		property array<unsigned int>^ mIndices
 		{
 		{
-			array<unsigned int>^ get(){throw gcnew System::NotImplementedException();}
-			void set(array<unsigned int>^ value){throw gcnew System::NotImplementedException();}
+			array<unsigned int>^ get()
+			{
+				array<unsigned int>^ tmp = gcnew array<unsigned int>(this->p_native->mNumIndices);
+				System::Runtime::InteropServices::Marshal::Copy((System::IntPtr)this->p_native->mIndices, (array<int>^)tmp, 0, tmp->Length);
+				return tmp;
+			}
+			void set(array<unsigned int>^ value)
+			{
+				System::Runtime::InteropServices::Marshal::Copy((array<int>^)value, 0, (System::IntPtr)this->p_native->mIndices, value->Length);
+			}
 		}
 		}
 
 
 		property unsigned int mNumIndices
 		property unsigned int mNumIndices

+ 10 - 2
port/Assimp.NET/Assimp.NET/MaterialProperty.h

@@ -66,8 +66,16 @@ namespace AssimpNET
 
 
 		property array<char>^ mData
 		property array<char>^ mData
 		{
 		{
-			array<char>^ get(){throw gcnew System::NotImplementedException();}
-			void set(array<char>^ value){throw gcnew System::NotImplementedException();}
+			array<char>^ get()
+			{
+				array<char>^ tmp = gcnew array<char>(this->p_native->mDataLength);
+				System::Runtime::InteropServices::Marshal::Copy((System::IntPtr)this->p_native->mData, (array<unsigned char>^)tmp, 0, this->p_native->mDataLength);
+				return tmp;				
+			}
+			void set(array<char>^ value)
+			{
+				System::Runtime::InteropServices::Marshal::Copy((array<unsigned char>^)value, 0, (System::IntPtr)this->p_native->mData, value->Length);
+			}
 		}
 		}
 
 
 		property unsigned int mDataLength
 		property unsigned int mDataLength

+ 4 - 2
port/Assimp.NET/Assimp.NET/Mesh.h

@@ -141,11 +141,13 @@ namespace AssimpNET
 		{
 		{
 			array<unsigned int>^get()
 			array<unsigned int>^get()
 			{
 			{
-				throw gcnew System::NotImplementedException();
+				array<unsigned int>^ tmp = gcnew array<unsigned int>(AI_MAX_NUMBER_OF_TEXTURECOORDS);
+				System::Runtime::InteropServices::Marshal::Copy((System::IntPtr)this->p_native->mNumUVComponents,(array<int>^)tmp,0,AI_MAX_NUMBER_OF_TEXTURECOORDS);
+				return tmp;
 			}
 			}
 			void set(array<unsigned int>^ value)
 			void set(array<unsigned int>^ value)
 			{
 			{
-				throw gcnew System::NotImplementedException();
+				System::Runtime::InteropServices::Marshal::Copy((array<int>^)value,0,(System::IntPtr)this->p_native->mNumUVComponents, AI_MAX_NUMBER_OF_TEXTURECOORDS);
 			}
 			}
 		}
 		}
 
 

+ 42 - 10
port/Assimp.NET/Assimp.NET/Node.h

@@ -69,8 +69,16 @@ namespace AssimpNET
 
 
 		property array<unsigned int>^ mMeshes
 		property array<unsigned int>^ mMeshes
 		{
 		{
-			array<unsigned int>^ get(){throw gcnew System::NotImplementedException();}
-			void set(array<unsigned int>^ value){throw gcnew System::NotImplementedException();}
+			array<unsigned int>^ get()
+			{
+				array<unsigned int>^ tmp = gcnew array<unsigned int>(this->p_native->mNumMeshes);
+				System::Runtime::InteropServices::Marshal::Copy((System::IntPtr)this->p_native->mMeshes,(array<int>^)tmp,0,this->p_native->mNumMeshes);
+				return tmp;
+			}
+			void set(array<unsigned int>^ value)
+			{
+				System::Runtime::InteropServices::Marshal::Copy((array<int>^)value,0,(System::IntPtr)this->p_native->mMeshes,this->p_native->mNumMeshes);
+			}
 		}
 		}
 
 
 		property String^ mName
 		property String^ mName
@@ -87,26 +95,50 @@ namespace AssimpNET
 
 
 		property unsigned int mNumChildren
 		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
 		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
 		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
 		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();	
 		aiNode* getNative();	

+ 24 - 6
port/Assimp.NET/Assimp.NET/NodeAnim.h

@@ -82,20 +82,38 @@ namespace AssimpNET
 
 
 		property unsigned int mNumPositionKeys
 		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
 		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
 		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<VectorKey^>^ mPositionKeys
 		property array<VectorKey^>^ mPositionKeys

+ 16 - 4
port/Assimp.NET/Assimp.NET/QuatKey.h

@@ -66,14 +66,26 @@ namespace AssimpNET
 
 
 		property double mTime
 		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
 		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();	
 		aiQuatKey* getNative();	

+ 32 - 8
port/Assimp.NET/Assimp.NET/Quaternion.h

@@ -79,26 +79,50 @@ namespace AssimpNET
 
 
 		property float x
 		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
 		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
 		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
 		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();	
 		aiQuaternion* getNative();	

+ 65 - 16
port/Assimp.NET/Assimp.NET/Scene.h

@@ -84,8 +84,14 @@ namespace AssimpNET
 		}
 		}
 		property unsigned int mFlags
 		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<Light^>^ mLights
 		property array<Light^>^ mLights
 		{
 		{
@@ -104,38 +110,81 @@ namespace AssimpNET
 		}
 		}
 		property unsigned int mNumAnimations
 		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
 		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
 		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
 		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
 		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
 		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
 		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<Texture^>^ mTextures
 		property array<Texture^>^ mTextures
 		{
 		{

+ 32 - 8
port/Assimp.NET/Assimp.NET/Texel.h

@@ -24,26 +24,50 @@ public ref class Texel
 
 
 		property unsigned char a
 		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
 		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
 		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
 		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();	
 		aiTexel* getNative();	

+ 37 - 7
port/Assimp.NET/Assimp.NET/Texture.h

@@ -108,23 +108,53 @@ namespace AssimpNET
 
 
 		property array<char, 4>^ achFormatHint
 		property array<char, 4>^ achFormatHint
 		{
 		{
-			array<char, 4>^ get(){throw gcnew System::NotImplementedException();}
-			void set(array<char, 4>^ value){throw gcnew System::NotImplementedException();}
+			array<char, 4>^ get()
+			{
+				array<char, 4>^ tmp = array<char, 4>();
+				System::Runtime::InteropServices::Marshal::Copy((System::IntPtr)this->p_native->achFormatHint,(array<unsigned char>^)tmp,0,4);
+				return tmp;
+			}
+			void set(array<char, 4>^ value)
+			{
+				System::Runtime::InteropServices::Marshal::Copy((array<unsigned char>^)value,0,(System::IntPtr)this->p_native->achFormatHint,4);
+			}
 		}
 		}
 
 
 		property unsigned int mHeight
 		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
 		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();	
 		aiTexture* getNative();	
 	private:
 	private:

+ 16 - 4
port/Assimp.NET/Assimp.NET/Vector2D.h

@@ -72,14 +72,26 @@ namespace AssimpNET
 
 
 		property float x
 		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
 		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();	
 		aiVector2D* getNative();	

+ 24 - 6
port/Assimp.NET/Assimp.NET/Vector3D.h

@@ -76,20 +76,38 @@ namespace AssimpNET
 
 
 		property float x
 		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
 		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
 		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();	
 		aiVector3D* getNative();	

+ 16 - 4
port/Assimp.NET/Assimp.NET/VectorKey.h

@@ -67,14 +67,26 @@ namespace AssimpNET
 
 
 		property double mTime
 		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
 		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();	
 		aiVectorKey* getNative();	

+ 16 - 4
port/Assimp.NET/Assimp.NET/VertexWeight.h

@@ -59,14 +59,26 @@ namespace AssimpNET
 
 
 		property unsigned int mVertexId
 		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
 		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();
 		aiVertexWeight* getNative();