PageRenderTime 56ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/Lib/assimp-3.1.1/port/Assimp.NET/Assimp.NET_CS/aiBoneVector.cs

https://gitlab.com/Cerulean/yurina-GL
C# | 348 lines | 281 code | 53 blank | 14 comment | 45 complexity | 287d78ba5a02f3886dee53caf3f0a4c5 MD5 | raw file
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.8
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. using System;
  9. using System.Runtime.InteropServices;
  10. public class aiBoneVector : IDisposable, System.Collections.IEnumerable
  11. #if !SWIG_DOTNET_1
  12. , System.Collections.Generic.IList<aiBone>
  13. #endif
  14. {
  15. private HandleRef swigCPtr;
  16. protected bool swigCMemOwn;
  17. internal aiBoneVector(IntPtr cPtr, bool cMemoryOwn) {
  18. swigCMemOwn = cMemoryOwn;
  19. swigCPtr = new HandleRef(this, cPtr);
  20. }
  21. internal static HandleRef getCPtr(aiBoneVector obj) {
  22. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  23. }
  24. ~aiBoneVector() {
  25. Dispose();
  26. }
  27. public virtual void Dispose() {
  28. lock(this) {
  29. if (swigCPtr.Handle != IntPtr.Zero) {
  30. if (swigCMemOwn) {
  31. swigCMemOwn = false;
  32. AssimpPINVOKE.delete_aiBoneVector(swigCPtr);
  33. }
  34. swigCPtr = new HandleRef(null, IntPtr.Zero);
  35. }
  36. GC.SuppressFinalize(this);
  37. }
  38. }
  39. public aiBoneVector(System.Collections.ICollection c) : this() {
  40. if (c == null)
  41. throw new ArgumentNullException("c");
  42. foreach (aiBone element in c) {
  43. this.Add(element);
  44. }
  45. }
  46. public bool IsFixedSize {
  47. get {
  48. return false;
  49. }
  50. }
  51. public bool IsReadOnly {
  52. get {
  53. return false;
  54. }
  55. }
  56. public aiBone this[int index] {
  57. get {
  58. return getitem(index);
  59. }
  60. set {
  61. setitem(index, value);
  62. }
  63. }
  64. public int Capacity {
  65. get {
  66. return (int)capacity();
  67. }
  68. set {
  69. if (value < size())
  70. throw new ArgumentOutOfRangeException("Capacity");
  71. reserve((uint)value);
  72. }
  73. }
  74. public int Count {
  75. get {
  76. return (int)size();
  77. }
  78. }
  79. public bool IsSynchronized {
  80. get {
  81. return false;
  82. }
  83. }
  84. #if SWIG_DOTNET_1
  85. public void CopyTo(System.Array array)
  86. #else
  87. public void CopyTo(aiBone[] array)
  88. #endif
  89. {
  90. CopyTo(0, array, 0, this.Count);
  91. }
  92. #if SWIG_DOTNET_1
  93. public void CopyTo(System.Array array, int arrayIndex)
  94. #else
  95. public void CopyTo(aiBone[] array, int arrayIndex)
  96. #endif
  97. {
  98. CopyTo(0, array, arrayIndex, this.Count);
  99. }
  100. #if SWIG_DOTNET_1
  101. public void CopyTo(int index, System.Array array, int arrayIndex, int count)
  102. #else
  103. public void CopyTo(int index, aiBone[] array, int arrayIndex, int count)
  104. #endif
  105. {
  106. if (array == null)
  107. throw new ArgumentNullException("array");
  108. if (index < 0)
  109. throw new ArgumentOutOfRangeException("index", "Value is less than zero");
  110. if (arrayIndex < 0)
  111. throw new ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
  112. if (count < 0)
  113. throw new ArgumentOutOfRangeException("count", "Value is less than zero");
  114. if (array.Rank > 1)
  115. throw new ArgumentException("Multi dimensional array.", "array");
  116. if (index+count > this.Count || arrayIndex+count > array.Length)
  117. throw new ArgumentException("Number of elements to copy is too large.");
  118. for (int i=0; i<count; i++)
  119. array.SetValue(getitemcopy(index+i), arrayIndex+i);
  120. }
  121. #if !SWIG_DOTNET_1
  122. System.Collections.Generic.IEnumerator<aiBone> System.Collections.Generic.IEnumerable<aiBone>.GetEnumerator() {
  123. return new aiBoneVectorEnumerator(this);
  124. }
  125. #endif
  126. System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
  127. return new aiBoneVectorEnumerator(this);
  128. }
  129. public aiBoneVectorEnumerator GetEnumerator() {
  130. return new aiBoneVectorEnumerator(this);
  131. }
  132. // Type-safe enumerator
  133. /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
  134. /// whenever the collection is modified. This has been done for changes in the size of the
  135. /// collection but not when one of the elements of the collection is modified as it is a bit
  136. /// tricky to detect unmanaged code that modifies the collection under our feet.
  137. public sealed class aiBoneVectorEnumerator : System.Collections.IEnumerator
  138. #if !SWIG_DOTNET_1
  139. , System.Collections.Generic.IEnumerator<aiBone>
  140. #endif
  141. {
  142. private aiBoneVector collectionRef;
  143. private int currentIndex;
  144. private object currentObject;
  145. private int currentSize;
  146. public aiBoneVectorEnumerator(aiBoneVector collection) {
  147. collectionRef = collection;
  148. currentIndex = -1;
  149. currentObject = null;
  150. currentSize = collectionRef.Count;
  151. }
  152. // Type-safe iterator Current
  153. public aiBone Current {
  154. get {
  155. if (currentIndex == -1)
  156. throw new InvalidOperationException("Enumeration not started.");
  157. if (currentIndex > currentSize - 1)
  158. throw new InvalidOperationException("Enumeration finished.");
  159. if (currentObject == null)
  160. throw new InvalidOperationException("Collection modified.");
  161. return (aiBone)currentObject;
  162. }
  163. }
  164. // Type-unsafe IEnumerator.Current
  165. object System.Collections.IEnumerator.Current {
  166. get {
  167. return Current;
  168. }
  169. }
  170. public bool MoveNext() {
  171. int size = collectionRef.Count;
  172. bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
  173. if (moveOkay) {
  174. currentIndex++;
  175. currentObject = collectionRef[currentIndex];
  176. } else {
  177. currentObject = null;
  178. }
  179. return moveOkay;
  180. }
  181. public void Reset() {
  182. currentIndex = -1;
  183. currentObject = null;
  184. if (collectionRef.Count != currentSize) {
  185. throw new InvalidOperationException("Collection modified.");
  186. }
  187. }
  188. #if !SWIG_DOTNET_1
  189. public void Dispose() {
  190. currentIndex = -1;
  191. currentObject = null;
  192. }
  193. #endif
  194. }
  195. public void Clear() {
  196. AssimpPINVOKE.aiBoneVector_Clear(swigCPtr);
  197. }
  198. public void Add(aiBone x) {
  199. AssimpPINVOKE.aiBoneVector_Add(swigCPtr, aiBone.getCPtr(x));
  200. }
  201. private uint size() {
  202. uint ret = AssimpPINVOKE.aiBoneVector_size(swigCPtr);
  203. return ret;
  204. }
  205. private uint capacity() {
  206. uint ret = AssimpPINVOKE.aiBoneVector_capacity(swigCPtr);
  207. return ret;
  208. }
  209. private void reserve(uint n) {
  210. AssimpPINVOKE.aiBoneVector_reserve(swigCPtr, n);
  211. }
  212. public aiBoneVector() : this(AssimpPINVOKE.new_aiBoneVector__SWIG_0(), true) {
  213. }
  214. public aiBoneVector(aiBoneVector other) : this(AssimpPINVOKE.new_aiBoneVector__SWIG_1(aiBoneVector.getCPtr(other)), true) {
  215. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  216. }
  217. public aiBoneVector(int capacity) : this(AssimpPINVOKE.new_aiBoneVector__SWIG_2(capacity), true) {
  218. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  219. }
  220. private aiBone getitemcopy(int index) {
  221. IntPtr cPtr = AssimpPINVOKE.aiBoneVector_getitemcopy(swigCPtr, index);
  222. aiBone ret = (cPtr == IntPtr.Zero) ? null : new aiBone(cPtr, false);
  223. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  224. return ret;
  225. }
  226. private aiBone getitem(int index) {
  227. IntPtr cPtr = AssimpPINVOKE.aiBoneVector_getitem(swigCPtr, index);
  228. aiBone ret = (cPtr == IntPtr.Zero) ? null : new aiBone(cPtr, false);
  229. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  230. return ret;
  231. }
  232. private void setitem(int index, aiBone val) {
  233. AssimpPINVOKE.aiBoneVector_setitem(swigCPtr, index, aiBone.getCPtr(val));
  234. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  235. }
  236. public void AddRange(aiBoneVector values) {
  237. AssimpPINVOKE.aiBoneVector_AddRange(swigCPtr, aiBoneVector.getCPtr(values));
  238. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  239. }
  240. public aiBoneVector GetRange(int index, int count) {
  241. IntPtr cPtr = AssimpPINVOKE.aiBoneVector_GetRange(swigCPtr, index, count);
  242. aiBoneVector ret = (cPtr == IntPtr.Zero) ? null : new aiBoneVector(cPtr, true);
  243. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  244. return ret;
  245. }
  246. public void Insert(int index, aiBone x) {
  247. AssimpPINVOKE.aiBoneVector_Insert(swigCPtr, index, aiBone.getCPtr(x));
  248. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  249. }
  250. public void InsertRange(int index, aiBoneVector values) {
  251. AssimpPINVOKE.aiBoneVector_InsertRange(swigCPtr, index, aiBoneVector.getCPtr(values));
  252. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  253. }
  254. public void RemoveAt(int index) {
  255. AssimpPINVOKE.aiBoneVector_RemoveAt(swigCPtr, index);
  256. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  257. }
  258. public void RemoveRange(int index, int count) {
  259. AssimpPINVOKE.aiBoneVector_RemoveRange(swigCPtr, index, count);
  260. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  261. }
  262. public static aiBoneVector Repeat(aiBone value, int count) {
  263. IntPtr cPtr = AssimpPINVOKE.aiBoneVector_Repeat(aiBone.getCPtr(value), count);
  264. aiBoneVector ret = (cPtr == IntPtr.Zero) ? null : new aiBoneVector(cPtr, true);
  265. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  266. return ret;
  267. }
  268. public void Reverse() {
  269. AssimpPINVOKE.aiBoneVector_Reverse__SWIG_0(swigCPtr);
  270. }
  271. public void Reverse(int index, int count) {
  272. AssimpPINVOKE.aiBoneVector_Reverse__SWIG_1(swigCPtr, index, count);
  273. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  274. }
  275. public void SetRange(int index, aiBoneVector values) {
  276. AssimpPINVOKE.aiBoneVector_SetRange(swigCPtr, index, aiBoneVector.getCPtr(values));
  277. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  278. }
  279. public bool Contains(aiBone value) {
  280. bool ret = AssimpPINVOKE.aiBoneVector_Contains(swigCPtr, aiBone.getCPtr(value));
  281. return ret;
  282. }
  283. public int IndexOf(aiBone value) {
  284. int ret = AssimpPINVOKE.aiBoneVector_IndexOf(swigCPtr, aiBone.getCPtr(value));
  285. return ret;
  286. }
  287. public int LastIndexOf(aiBone value) {
  288. int ret = AssimpPINVOKE.aiBoneVector_LastIndexOf(swigCPtr, aiBone.getCPtr(value));
  289. return ret;
  290. }
  291. public bool Remove(aiBone value) {
  292. bool ret = AssimpPINVOKE.aiBoneVector_Remove(swigCPtr, aiBone.getCPtr(value));
  293. return ret;
  294. }
  295. }