Point2dList.cs 11 KB

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