PageRenderTime 127ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 1ms

/src/Assets_Assimp/port/Assimp.NET/Assimp.NET_CS/aiCameraVector.cs

https://github.com/Akranar/daguerreo
C# | 348 lines | 281 code | 53 blank | 14 comment | 45 complexity | 803c70c55230bd6f6ce694e0a0e61cba MD5 | raw file
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.1
  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 aiCameraVector : IDisposable, System.Collections.IEnumerable
  11. #if !SWIG_DOTNET_1
  12. , System.Collections.Generic.IList<aiCamera>
  13. #endif
  14. {
  15. private HandleRef swigCPtr;
  16. protected bool swigCMemOwn;
  17. internal aiCameraVector(IntPtr cPtr, bool cMemoryOwn) {
  18. swigCMemOwn = cMemoryOwn;
  19. swigCPtr = new HandleRef(this, cPtr);
  20. }
  21. internal static HandleRef getCPtr(aiCameraVector obj) {
  22. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  23. }
  24. ~aiCameraVector() {
  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_aiCameraVector(swigCPtr);
  33. }
  34. swigCPtr = new HandleRef(null, IntPtr.Zero);
  35. }
  36. GC.SuppressFinalize(this);
  37. }
  38. }
  39. public aiCameraVector(System.Collections.ICollection c) : this() {
  40. if (c == null)
  41. throw new ArgumentNullException("c");
  42. foreach (aiCamera 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 aiCamera 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(aiCamera[] 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(aiCamera[] 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, aiCamera[] 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<aiCamera> System.Collections.Generic.IEnumerable<aiCamera>.GetEnumerator() {
  123. return new aiCameraVectorEnumerator(this);
  124. }
  125. #endif
  126. System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
  127. return new aiCameraVectorEnumerator(this);
  128. }
  129. public aiCameraVectorEnumerator GetEnumerator() {
  130. return new aiCameraVectorEnumerator(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 aiCameraVectorEnumerator : System.Collections.IEnumerator
  138. #if !SWIG_DOTNET_1
  139. , System.Collections.Generic.IEnumerator<aiCamera>
  140. #endif
  141. {
  142. private aiCameraVector collectionRef;
  143. private int currentIndex;
  144. private object currentObject;
  145. private int currentSize;
  146. public aiCameraVectorEnumerator(aiCameraVector collection) {
  147. collectionRef = collection;
  148. currentIndex = -1;
  149. currentObject = null;
  150. currentSize = collectionRef.Count;
  151. }
  152. // Type-safe iterator Current
  153. public aiCamera 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 (aiCamera)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.aiCameraVector_Clear(swigCPtr);
  197. }
  198. public void Add(aiCamera x) {
  199. AssimpPINVOKE.aiCameraVector_Add(swigCPtr, aiCamera.getCPtr(x));
  200. }
  201. private uint size() {
  202. uint ret = AssimpPINVOKE.aiCameraVector_size(swigCPtr);
  203. return ret;
  204. }
  205. private uint capacity() {
  206. uint ret = AssimpPINVOKE.aiCameraVector_capacity(swigCPtr);
  207. return ret;
  208. }
  209. private void reserve(uint n) {
  210. AssimpPINVOKE.aiCameraVector_reserve(swigCPtr, n);
  211. }
  212. public aiCameraVector() : this(AssimpPINVOKE.new_aiCameraVector__SWIG_0(), true) {
  213. }
  214. public aiCameraVector(aiCameraVector other) : this(AssimpPINVOKE.new_aiCameraVector__SWIG_1(aiCameraVector.getCPtr(other)), true) {
  215. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  216. }
  217. public aiCameraVector(int capacity) : this(AssimpPINVOKE.new_aiCameraVector__SWIG_2(capacity), true) {
  218. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  219. }
  220. private aiCamera getitemcopy(int index) {
  221. IntPtr cPtr = AssimpPINVOKE.aiCameraVector_getitemcopy(swigCPtr, index);
  222. aiCamera ret = (cPtr == IntPtr.Zero) ? null : new aiCamera(cPtr, false);
  223. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  224. return ret;
  225. }
  226. private aiCamera getitem(int index) {
  227. IntPtr cPtr = AssimpPINVOKE.aiCameraVector_getitem(swigCPtr, index);
  228. aiCamera ret = (cPtr == IntPtr.Zero) ? null : new aiCamera(cPtr, false);
  229. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  230. return ret;
  231. }
  232. private void setitem(int index, aiCamera val) {
  233. AssimpPINVOKE.aiCameraVector_setitem(swigCPtr, index, aiCamera.getCPtr(val));
  234. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  235. }
  236. public void AddRange(aiCameraVector values) {
  237. AssimpPINVOKE.aiCameraVector_AddRange(swigCPtr, aiCameraVector.getCPtr(values));
  238. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  239. }
  240. public aiCameraVector GetRange(int index, int count) {
  241. IntPtr cPtr = AssimpPINVOKE.aiCameraVector_GetRange(swigCPtr, index, count);
  242. aiCameraVector ret = (cPtr == IntPtr.Zero) ? null : new aiCameraVector(cPtr, true);
  243. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  244. return ret;
  245. }
  246. public void Insert(int index, aiCamera x) {
  247. AssimpPINVOKE.aiCameraVector_Insert(swigCPtr, index, aiCamera.getCPtr(x));
  248. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  249. }
  250. public void InsertRange(int index, aiCameraVector values) {
  251. AssimpPINVOKE.aiCameraVector_InsertRange(swigCPtr, index, aiCameraVector.getCPtr(values));
  252. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  253. }
  254. public void RemoveAt(int index) {
  255. AssimpPINVOKE.aiCameraVector_RemoveAt(swigCPtr, index);
  256. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  257. }
  258. public void RemoveRange(int index, int count) {
  259. AssimpPINVOKE.aiCameraVector_RemoveRange(swigCPtr, index, count);
  260. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  261. }
  262. public static aiCameraVector Repeat(aiCamera value, int count) {
  263. IntPtr cPtr = AssimpPINVOKE.aiCameraVector_Repeat(aiCamera.getCPtr(value), count);
  264. aiCameraVector ret = (cPtr == IntPtr.Zero) ? null : new aiCameraVector(cPtr, true);
  265. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  266. return ret;
  267. }
  268. public void Reverse() {
  269. AssimpPINVOKE.aiCameraVector_Reverse__SWIG_0(swigCPtr);
  270. }
  271. public void Reverse(int index, int count) {
  272. AssimpPINVOKE.aiCameraVector_Reverse__SWIG_1(swigCPtr, index, count);
  273. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  274. }
  275. public void SetRange(int index, aiCameraVector values) {
  276. AssimpPINVOKE.aiCameraVector_SetRange(swigCPtr, index, aiCameraVector.getCPtr(values));
  277. if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
  278. }
  279. public bool Contains(aiCamera value) {
  280. bool ret = AssimpPINVOKE.aiCameraVector_Contains(swigCPtr, aiCamera.getCPtr(value));
  281. return ret;
  282. }
  283. public int IndexOf(aiCamera value) {
  284. int ret = AssimpPINVOKE.aiCameraVector_IndexOf(swigCPtr, aiCamera.getCPtr(value));
  285. return ret;
  286. }
  287. public int LastIndexOf(aiCamera value) {
  288. int ret = AssimpPINVOKE.aiCameraVector_LastIndexOf(swigCPtr, aiCamera.getCPtr(value));
  289. return ret;
  290. }
  291. public bool Remove(aiCamera value) {
  292. bool ret = AssimpPINVOKE.aiCameraVector_Remove(swigCPtr, aiCamera.getCPtr(value));
  293. return ret;
  294. }
  295. }