Update of C#/.NET bindings plus working Managed DirectX Viewer that displays standard DirectX Fixed Function Materials (Ambient, Diffuse, Specular, Emissive) and the first set of texture coordinates if contained in the model.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@782 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
348
port/Assimp.NET/Assimp.NET_CS/aiVectorKeyVector.cs
Normal file
348
port/Assimp.NET/Assimp.NET_CS/aiVectorKeyVector.cs
Normal file
@@ -0,0 +1,348 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 2.0.0
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class aiVectorKeyVector : IDisposable, System.Collections.IEnumerable
|
||||
#if !SWIG_DOTNET_1
|
||||
, System.Collections.Generic.IList<aiVectorKey>
|
||||
#endif
|
||||
{
|
||||
private HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal aiVectorKeyVector(IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static HandleRef getCPtr(aiVectorKeyVector obj) {
|
||||
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~aiVectorKeyVector() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
AssimpPINVOKE.delete_aiVectorKeyVector(swigCPtr);
|
||||
}
|
||||
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||
}
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public aiVectorKeyVector(System.Collections.ICollection c) : this() {
|
||||
if (c == null)
|
||||
throw new ArgumentNullException("c");
|
||||
foreach (aiVectorKey element in c) {
|
||||
this.Add(element);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsFixedSize {
|
||||
get {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsReadOnly {
|
||||
get {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public aiVectorKey this[int index] {
|
||||
get {
|
||||
return getitem(index);
|
||||
}
|
||||
set {
|
||||
setitem(index, value);
|
||||
}
|
||||
}
|
||||
|
||||
public int Capacity {
|
||||
get {
|
||||
return (int)capacity();
|
||||
}
|
||||
set {
|
||||
if (value < size())
|
||||
throw new ArgumentOutOfRangeException("Capacity");
|
||||
reserve((uint)value);
|
||||
}
|
||||
}
|
||||
|
||||
public int Count {
|
||||
get {
|
||||
return (int)size();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSynchronized {
|
||||
get {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#if SWIG_DOTNET_1
|
||||
public void CopyTo(System.Array array)
|
||||
#else
|
||||
public void CopyTo(aiVectorKey[] array)
|
||||
#endif
|
||||
{
|
||||
CopyTo(0, array, 0, this.Count);
|
||||
}
|
||||
|
||||
#if SWIG_DOTNET_1
|
||||
public void CopyTo(System.Array array, int arrayIndex)
|
||||
#else
|
||||
public void CopyTo(aiVectorKey[] array, int arrayIndex)
|
||||
#endif
|
||||
{
|
||||
CopyTo(0, array, arrayIndex, this.Count);
|
||||
}
|
||||
|
||||
#if SWIG_DOTNET_1
|
||||
public void CopyTo(int index, System.Array array, int arrayIndex, int count)
|
||||
#else
|
||||
public void CopyTo(int index, aiVectorKey[] array, int arrayIndex, int count)
|
||||
#endif
|
||||
{
|
||||
if (array == null)
|
||||
throw new ArgumentNullException("array");
|
||||
if (index < 0)
|
||||
throw new ArgumentOutOfRangeException("index", "Value is less than zero");
|
||||
if (arrayIndex < 0)
|
||||
throw new ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
|
||||
if (count < 0)
|
||||
throw new ArgumentOutOfRangeException("count", "Value is less than zero");
|
||||
if (array.Rank > 1)
|
||||
throw new ArgumentException("Multi dimensional array.", "array");
|
||||
if (index+count > this.Count || arrayIndex+count > array.Length)
|
||||
throw new ArgumentException("Number of elements to copy is too large.");
|
||||
for (int i=0; i<count; i++)
|
||||
array.SetValue(getitemcopy(index+i), arrayIndex+i);
|
||||
}
|
||||
|
||||
#if !SWIG_DOTNET_1
|
||||
System.Collections.Generic.IEnumerator<aiVectorKey> System.Collections.Generic.IEnumerable<aiVectorKey>.GetEnumerator() {
|
||||
return new aiVectorKeyVectorEnumerator(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
|
||||
return new aiVectorKeyVectorEnumerator(this);
|
||||
}
|
||||
|
||||
public aiVectorKeyVectorEnumerator GetEnumerator() {
|
||||
return new aiVectorKeyVectorEnumerator(this);
|
||||
}
|
||||
|
||||
// Type-safe enumerator
|
||||
/// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
|
||||
/// whenever the collection is modified. This has been done for changes in the size of the
|
||||
/// collection but not when one of the elements of the collection is modified as it is a bit
|
||||
/// tricky to detect unmanaged code that modifies the collection under our feet.
|
||||
public sealed class aiVectorKeyVectorEnumerator : System.Collections.IEnumerator
|
||||
#if !SWIG_DOTNET_1
|
||||
, System.Collections.Generic.IEnumerator<aiVectorKey>
|
||||
#endif
|
||||
{
|
||||
private aiVectorKeyVector collectionRef;
|
||||
private int currentIndex;
|
||||
private object currentObject;
|
||||
private int currentSize;
|
||||
|
||||
public aiVectorKeyVectorEnumerator(aiVectorKeyVector collection) {
|
||||
collectionRef = collection;
|
||||
currentIndex = -1;
|
||||
currentObject = null;
|
||||
currentSize = collectionRef.Count;
|
||||
}
|
||||
|
||||
// Type-safe iterator Current
|
||||
public aiVectorKey Current {
|
||||
get {
|
||||
if (currentIndex == -1)
|
||||
throw new InvalidOperationException("Enumeration not started.");
|
||||
if (currentIndex > currentSize - 1)
|
||||
throw new InvalidOperationException("Enumeration finished.");
|
||||
if (currentObject == null)
|
||||
throw new InvalidOperationException("Collection modified.");
|
||||
return (aiVectorKey)currentObject;
|
||||
}
|
||||
}
|
||||
|
||||
// Type-unsafe IEnumerator.Current
|
||||
object System.Collections.IEnumerator.Current {
|
||||
get {
|
||||
return Current;
|
||||
}
|
||||
}
|
||||
|
||||
public bool MoveNext() {
|
||||
int size = collectionRef.Count;
|
||||
bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
|
||||
if (moveOkay) {
|
||||
currentIndex++;
|
||||
currentObject = collectionRef[currentIndex];
|
||||
} else {
|
||||
currentObject = null;
|
||||
}
|
||||
return moveOkay;
|
||||
}
|
||||
|
||||
public void Reset() {
|
||||
currentIndex = -1;
|
||||
currentObject = null;
|
||||
if (collectionRef.Count != currentSize) {
|
||||
throw new InvalidOperationException("Collection modified.");
|
||||
}
|
||||
}
|
||||
|
||||
#if !SWIG_DOTNET_1
|
||||
public void Dispose() {
|
||||
currentIndex = -1;
|
||||
currentObject = null;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public void Clear() {
|
||||
AssimpPINVOKE.aiVectorKeyVector_Clear(swigCPtr);
|
||||
}
|
||||
|
||||
public void Add(aiVectorKey x) {
|
||||
AssimpPINVOKE.aiVectorKeyVector_Add(swigCPtr, aiVectorKey.getCPtr(x));
|
||||
}
|
||||
|
||||
private uint size() {
|
||||
uint ret = AssimpPINVOKE.aiVectorKeyVector_size(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
private uint capacity() {
|
||||
uint ret = AssimpPINVOKE.aiVectorKeyVector_capacity(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void reserve(uint n) {
|
||||
AssimpPINVOKE.aiVectorKeyVector_reserve(swigCPtr, n);
|
||||
}
|
||||
|
||||
public aiVectorKeyVector() : this(AssimpPINVOKE.new_aiVectorKeyVector__SWIG_0(), true) {
|
||||
}
|
||||
|
||||
public aiVectorKeyVector(aiVectorKeyVector other) : this(AssimpPINVOKE.new_aiVectorKeyVector__SWIG_1(aiVectorKeyVector.getCPtr(other)), true) {
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public aiVectorKeyVector(int capacity) : this(AssimpPINVOKE.new_aiVectorKeyVector__SWIG_2(capacity), true) {
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
private aiVectorKey getitemcopy(int index) {
|
||||
IntPtr cPtr = AssimpPINVOKE.aiVectorKeyVector_getitemcopy(swigCPtr, index);
|
||||
aiVectorKey ret = (cPtr == IntPtr.Zero) ? null : new aiVectorKey(cPtr, false);
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
private aiVectorKey getitem(int index) {
|
||||
IntPtr cPtr = AssimpPINVOKE.aiVectorKeyVector_getitem(swigCPtr, index);
|
||||
aiVectorKey ret = (cPtr == IntPtr.Zero) ? null : new aiVectorKey(cPtr, false);
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void setitem(int index, aiVectorKey val) {
|
||||
AssimpPINVOKE.aiVectorKeyVector_setitem(swigCPtr, index, aiVectorKey.getCPtr(val));
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public void AddRange(aiVectorKeyVector values) {
|
||||
AssimpPINVOKE.aiVectorKeyVector_AddRange(swigCPtr, aiVectorKeyVector.getCPtr(values));
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public aiVectorKeyVector GetRange(int index, int count) {
|
||||
IntPtr cPtr = AssimpPINVOKE.aiVectorKeyVector_GetRange(swigCPtr, index, count);
|
||||
aiVectorKeyVector ret = (cPtr == IntPtr.Zero) ? null : new aiVectorKeyVector(cPtr, true);
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void Insert(int index, aiVectorKey x) {
|
||||
AssimpPINVOKE.aiVectorKeyVector_Insert(swigCPtr, index, aiVectorKey.getCPtr(x));
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public void InsertRange(int index, aiVectorKeyVector values) {
|
||||
AssimpPINVOKE.aiVectorKeyVector_InsertRange(swigCPtr, index, aiVectorKeyVector.getCPtr(values));
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public void RemoveAt(int index) {
|
||||
AssimpPINVOKE.aiVectorKeyVector_RemoveAt(swigCPtr, index);
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public void RemoveRange(int index, int count) {
|
||||
AssimpPINVOKE.aiVectorKeyVector_RemoveRange(swigCPtr, index, count);
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public static aiVectorKeyVector Repeat(aiVectorKey value, int count) {
|
||||
IntPtr cPtr = AssimpPINVOKE.aiVectorKeyVector_Repeat(aiVectorKey.getCPtr(value), count);
|
||||
aiVectorKeyVector ret = (cPtr == IntPtr.Zero) ? null : new aiVectorKeyVector(cPtr, true);
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void Reverse() {
|
||||
AssimpPINVOKE.aiVectorKeyVector_Reverse__SWIG_0(swigCPtr);
|
||||
}
|
||||
|
||||
public void Reverse(int index, int count) {
|
||||
AssimpPINVOKE.aiVectorKeyVector_Reverse__SWIG_1(swigCPtr, index, count);
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public void SetRange(int index, aiVectorKeyVector values) {
|
||||
AssimpPINVOKE.aiVectorKeyVector_SetRange(swigCPtr, index, aiVectorKeyVector.getCPtr(values));
|
||||
if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
|
||||
}
|
||||
|
||||
public bool Contains(aiVectorKey value) {
|
||||
bool ret = AssimpPINVOKE.aiVectorKeyVector_Contains(swigCPtr, aiVectorKey.getCPtr(value));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int IndexOf(aiVectorKey value) {
|
||||
int ret = AssimpPINVOKE.aiVectorKeyVector_IndexOf(swigCPtr, aiVectorKey.getCPtr(value));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int LastIndexOf(aiVectorKey value) {
|
||||
int ret = AssimpPINVOKE.aiVectorKeyVector_LastIndexOf(swigCPtr, aiVectorKey.getCPtr(value));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool Remove(aiVectorKey value) {
|
||||
bool ret = AssimpPINVOKE.aiVectorKeyVector_Remove(swigCPtr, aiVectorKey.getCPtr(value));
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user