You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

347 lines
10 KiB

  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 UintVector : IDisposable, System.Collections.IEnumerable
  11. #if !SWIG_DOTNET_1
  12. , System.Collections.Generic.IList<uint>
  13. #endif
  14. {
  15. private HandleRef swigCPtr;
  16. protected bool swigCMemOwn;
  17. internal UintVector(IntPtr cPtr, bool cMemoryOwn) {
  18. swigCMemOwn = cMemoryOwn;
  19. swigCPtr = new HandleRef(this, cPtr);
  20. }
  21. internal static HandleRef getCPtr(UintVector obj) {
  22. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  23. }
  24. ~UintVector() {
  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_UintVector(swigCPtr);
  33. }
  34. swigCPtr = new HandleRef(null, IntPtr.Zero);
  35. }
  36. GC.SuppressFinalize(this);
  37. }
  38. }
  39. public UintVector(System.Collections.ICollection c) : this() {
  40. if (c == null)
  41. throw new ArgumentNullException("c");
  42. foreach (uint 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 uint 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(uint[] 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(uint[] 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, uint[] 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<uint> System.Collections.Generic.IEnumerable<uint>.GetEnumerator() {
  123. return new UintVectorEnumerator(this);
  124. }
  125. #endif
  126. System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
  127. return new UintVectorEnumerator(this);
  128. }
  129. public UintVectorEnumerator GetEnumerator() {
  130. return new UintVectorEnumerator(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 UintVectorEnumerator : System.Collections.IEnumerator
  138. #if !SWIG_DOTNET_1
  139. , System.Collections.Generic.IEnumerator<uint>
  140. #endif
  141. {
  142. private UintVector collectionRef;
  143. private int currentIndex;
  144. private object currentObject;
  145. private int currentSize;
  146. public UintVectorEnumerator(UintVector collection) {
  147. collectionRef = collection;
  148. currentIndex = -1;
  149. currentObject = null;
  150. currentSize = collectionRef.Count;
  151. }
  152. // Type-safe iterator Current
  153. public uint 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 (uint)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.UintVector_Clear(swigCPtr);
  197. }
  198. public void Add(uint x) {
  199. AssimpPINVOKE.UintVector_Add(swigCPtr, x);
  200. }
  201. private uint size() {
  202. uint ret = AssimpPINVOKE.UintVector_size(swigCPtr);
  203. return ret;
  204. }
  205. private uint capacity() {
  206. uint ret = AssimpPINVOKE.UintVector_capacity(swigCPtr);
  207. return ret;
  208. }
  209. private void reserve(uint n) {
  210. AssimpPINVOKE.UintVector_reserve(swigCPtr, n);
  211. }
  212. public UintVector() : this(AssimpPINVOKE.new_UintVector__SWIG_0(), true) {
  213. }
  214. public UintVector(UintVector other) : this(AssimpPINVOKE.new_UintVector__SWIG_1(UintVector.getCPtr(other)), true) {
  215. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  216. }
  217. public UintVector(int capacity) : this(AssimpPINVOKE.new_UintVector__SWIG_2(capacity), true) {
  218. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  219. }
  220. private uint getitemcopy(int index) {
  221. uint ret = AssimpPINVOKE.UintVector_getitemcopy(swigCPtr, index);
  222. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  223. return ret;
  224. }
  225. private uint getitem(int index) {
  226. uint ret = AssimpPINVOKE.UintVector_getitem(swigCPtr, index);
  227. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  228. return ret;
  229. }
  230. private void setitem(int index, uint val) {
  231. AssimpPINVOKE.UintVector_setitem(swigCPtr, index, val);
  232. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  233. }
  234. public void AddRange(UintVector values) {
  235. AssimpPINVOKE.UintVector_AddRange(swigCPtr, UintVector.getCPtr(values));
  236. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  237. }
  238. public UintVector GetRange(int index, int count) {
  239. IntPtr cPtr = AssimpPINVOKE.UintVector_GetRange(swigCPtr, index, count);
  240. UintVector ret = (cPtr == IntPtr.Zero) ? null : new UintVector(cPtr, true);
  241. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  242. return ret;
  243. }
  244. public void Insert(int index, uint x) {
  245. AssimpPINVOKE.UintVector_Insert(swigCPtr, index, x);
  246. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  247. }
  248. public void InsertRange(int index, UintVector values) {
  249. AssimpPINVOKE.UintVector_InsertRange(swigCPtr, index, UintVector.getCPtr(values));
  250. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  251. }
  252. public void RemoveAt(int index) {
  253. AssimpPINVOKE.UintVector_RemoveAt(swigCPtr, index);
  254. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  255. }
  256. public void RemoveRange(int index, int count) {
  257. AssimpPINVOKE.UintVector_RemoveRange(swigCPtr, index, count);
  258. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  259. }
  260. public static UintVector Repeat(uint value, int count) {
  261. IntPtr cPtr = AssimpPINVOKE.UintVector_Repeat(value, count);
  262. UintVector ret = (cPtr == IntPtr.Zero) ? null : new UintVector(cPtr, true);
  263. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  264. return ret;
  265. }
  266. public void Reverse() {
  267. AssimpPINVOKE.UintVector_Reverse__SWIG_0(swigCPtr);
  268. }
  269. public void Reverse(int index, int count) {
  270. AssimpPINVOKE.UintVector_Reverse__SWIG_1(swigCPtr, index, count);
  271. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  272. }
  273. public void SetRange(int index, UintVector values) {
  274. AssimpPINVOKE.UintVector_SetRange(swigCPtr, index, UintVector.getCPtr(values));
  275. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  276. }
  277. public bool Contains(uint value) {
  278. bool ret = AssimpPINVOKE.UintVector_Contains(swigCPtr, value);
  279. return ret;
  280. }
  281. public int IndexOf(uint value) {
  282. int ret = AssimpPINVOKE.UintVector_IndexOf(swigCPtr, value);
  283. return ret;
  284. }
  285. public int LastIndexOf(uint value) {
  286. int ret = AssimpPINVOKE.UintVector_LastIndexOf(swigCPtr, value);
  287. return ret;
  288. }
  289. public bool Remove(uint value) {
  290. bool ret = AssimpPINVOKE.UintVector_Remove(swigCPtr, value);
  291. return ret;
  292. }
  293. }