/src/Assets_Assimp/port/Assimp.NET/Assimp.NET_CS/aiCameraVector.cs
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
9
10using System;
11using System.Runtime.InteropServices;
12
13public class aiCameraVector : IDisposable, System.Collections.IEnumerable
14#if !SWIG_DOTNET_1
15 , System.Collections.Generic.IList<aiCamera>
16#endif
17 {
18 private HandleRef swigCPtr;
19 protected bool swigCMemOwn;
20
21 internal aiCameraVector(IntPtr cPtr, bool cMemoryOwn) {
22 swigCMemOwn = cMemoryOwn;
23 swigCPtr = new HandleRef(this, cPtr);
24 }
25
26 internal static HandleRef getCPtr(aiCameraVector obj) {
27 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
28 }
29
30 ~aiCameraVector() {
31 Dispose();
32 }
33
34 public virtual void Dispose() {
35 lock(this) {
36 if (swigCPtr.Handle != IntPtr.Zero) {
37 if (swigCMemOwn) {
38 swigCMemOwn = false;
39 AssimpPINVOKE.delete_aiCameraVector(swigCPtr);
40 }
41 swigCPtr = new HandleRef(null, IntPtr.Zero);
42 }
43 GC.SuppressFinalize(this);
44 }
45 }
46
47 public aiCameraVector(System.Collections.ICollection c) : this() {
48 if (c == null)
49 throw new ArgumentNullException("c");
50 foreach (aiCamera element in c) {
51 this.Add(element);
52 }
53 }
54
55 public bool IsFixedSize {
56 get {
57 return false;
58 }
59 }
60
61 public bool IsReadOnly {
62 get {
63 return false;
64 }
65 }
66
67 public aiCamera this[int index] {
68 get {
69 return getitem(index);
70 }
71 set {
72 setitem(index, value);
73 }
74 }
75
76 public int Capacity {
77 get {
78 return (int)capacity();
79 }
80 set {
81 if (value < size())
82 throw new ArgumentOutOfRangeException("Capacity");
83 reserve((uint)value);
84 }
85 }
86
87 public int Count {
88 get {
89 return (int)size();
90 }
91 }
92
93 public bool IsSynchronized {
94 get {
95 return false;
96 }
97 }
98
99#if SWIG_DOTNET_1
100 public void CopyTo(System.Array array)
101#else
102 public void CopyTo(aiCamera[] array)
103#endif
104 {
105 CopyTo(0, array, 0, this.Count);
106 }
107
108#if SWIG_DOTNET_1
109 public void CopyTo(System.Array array, int arrayIndex)
110#else
111 public void CopyTo(aiCamera[] array, int arrayIndex)
112#endif
113 {
114 CopyTo(0, array, arrayIndex, this.Count);
115 }
116
117#if SWIG_DOTNET_1
118 public void CopyTo(int index, System.Array array, int arrayIndex, int count)
119#else
120 public void CopyTo(int index, aiCamera[] array, int arrayIndex, int count)
121#endif
122 {
123 if (array == null)
124 throw new ArgumentNullException("array");
125 if (index < 0)
126 throw new ArgumentOutOfRangeException("index", "Value is less than zero");
127 if (arrayIndex < 0)
128 throw new ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
129 if (count < 0)
130 throw new ArgumentOutOfRangeException("count", "Value is less than zero");
131 if (array.Rank > 1)
132 throw new ArgumentException("Multi dimensional array.", "array");
133 if (index+count > this.Count || arrayIndex+count > array.Length)
134 throw new ArgumentException("Number of elements to copy is too large.");
135 for (int i=0; i<count; i++)
136 array.SetValue(getitemcopy(index+i), arrayIndex+i);
137 }
138
139#if !SWIG_DOTNET_1
140 System.Collections.Generic.IEnumerator<aiCamera> System.Collections.Generic.IEnumerable<aiCamera>.GetEnumerator() {
141 return new aiCameraVectorEnumerator(this);
142 }
143#endif
144
145 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
146 return new aiCameraVectorEnumerator(this);
147 }
148
149 public aiCameraVectorEnumerator GetEnumerator() {
150 return new aiCameraVectorEnumerator(this);
151 }
152
153 // Type-safe enumerator
154 /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
155 /// whenever the collection is modified. This has been done for changes in the size of the
156 /// collection but not when one of the elements of the collection is modified as it is a bit
157 /// tricky to detect unmanaged code that modifies the collection under our feet.
158 public sealed class aiCameraVectorEnumerator : System.Collections.IEnumerator
159#if !SWIG_DOTNET_1
160 , System.Collections.Generic.IEnumerator<aiCamera>
161#endif
162 {
163 private aiCameraVector collectionRef;
164 private int currentIndex;
165 private object currentObject;
166 private int currentSize;
167
168 public aiCameraVectorEnumerator(aiCameraVector collection) {
169 collectionRef = collection;
170 currentIndex = -1;
171 currentObject = null;
172 currentSize = collectionRef.Count;
173 }
174
175 // Type-safe iterator Current
176 public aiCamera Current {
177 get {
178 if (currentIndex == -1)
179 throw new InvalidOperationException("Enumeration not started.");
180 if (currentIndex > currentSize - 1)
181 throw new InvalidOperationException("Enumeration finished.");
182 if (currentObject == null)
183 throw new InvalidOperationException("Collection modified.");
184 return (aiCamera)currentObject;
185 }
186 }
187
188 // Type-unsafe IEnumerator.Current
189 object System.Collections.IEnumerator.Current {
190 get {
191 return Current;
192 }
193 }
194
195 public bool MoveNext() {
196 int size = collectionRef.Count;
197 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
198 if (moveOkay) {
199 currentIndex++;
200 currentObject = collectionRef[currentIndex];
201 } else {
202 currentObject = null;
203 }
204 return moveOkay;
205 }
206
207 public void Reset() {
208 currentIndex = -1;
209 currentObject = null;
210 if (collectionRef.Count != currentSize) {
211 throw new InvalidOperationException("Collection modified.");
212 }
213 }
214
215#if !SWIG_DOTNET_1
216 public void Dispose() {
217 currentIndex = -1;
218 currentObject = null;
219 }
220#endif
221 }
222
223 public void Clear() {
224 AssimpPINVOKE.aiCameraVector_Clear(swigCPtr);
225 }
226
227 public void Add(aiCamera x) {
228 AssimpPINVOKE.aiCameraVector_Add(swigCPtr, aiCamera.getCPtr(x));
229 }
230
231 private uint size() {
232 uint ret = AssimpPINVOKE.aiCameraVector_size(swigCPtr);
233 return ret;
234 }
235
236 private uint capacity() {
237 uint ret = AssimpPINVOKE.aiCameraVector_capacity(swigCPtr);
238 return ret;
239 }
240
241 private void reserve(uint n) {
242 AssimpPINVOKE.aiCameraVector_reserve(swigCPtr, n);
243 }
244
245 public aiCameraVector() : this(AssimpPINVOKE.new_aiCameraVector__SWIG_0(), true) {
246 }
247
248 public aiCameraVector(aiCameraVector other) : this(AssimpPINVOKE.new_aiCameraVector__SWIG_1(aiCameraVector.getCPtr(other)), true) {
249 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
250 }
251
252 public aiCameraVector(int capacity) : this(AssimpPINVOKE.new_aiCameraVector__SWIG_2(capacity), true) {
253 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
254 }
255
256 private aiCamera getitemcopy(int index) {
257 IntPtr cPtr = AssimpPINVOKE.aiCameraVector_getitemcopy(swigCPtr, index);
258 aiCamera ret = (cPtr == IntPtr.Zero) ? null : new aiCamera(cPtr, false);
259 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
260 return ret;
261 }
262
263 private aiCamera getitem(int index) {
264 IntPtr cPtr = AssimpPINVOKE.aiCameraVector_getitem(swigCPtr, index);
265 aiCamera ret = (cPtr == IntPtr.Zero) ? null : new aiCamera(cPtr, false);
266 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
267 return ret;
268 }
269
270 private void setitem(int index, aiCamera val) {
271 AssimpPINVOKE.aiCameraVector_setitem(swigCPtr, index, aiCamera.getCPtr(val));
272 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
273 }
274
275 public void AddRange(aiCameraVector values) {
276 AssimpPINVOKE.aiCameraVector_AddRange(swigCPtr, aiCameraVector.getCPtr(values));
277 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
278 }
279
280 public aiCameraVector GetRange(int index, int count) {
281 IntPtr cPtr = AssimpPINVOKE.aiCameraVector_GetRange(swigCPtr, index, count);
282 aiCameraVector ret = (cPtr == IntPtr.Zero) ? null : new aiCameraVector(cPtr, true);
283 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
284 return ret;
285 }
286
287 public void Insert(int index, aiCamera x) {
288 AssimpPINVOKE.aiCameraVector_Insert(swigCPtr, index, aiCamera.getCPtr(x));
289 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
290 }
291
292 public void InsertRange(int index, aiCameraVector values) {
293 AssimpPINVOKE.aiCameraVector_InsertRange(swigCPtr, index, aiCameraVector.getCPtr(values));
294 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
295 }
296
297 public void RemoveAt(int index) {
298 AssimpPINVOKE.aiCameraVector_RemoveAt(swigCPtr, index);
299 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
300 }
301
302 public void RemoveRange(int index, int count) {
303 AssimpPINVOKE.aiCameraVector_RemoveRange(swigCPtr, index, count);
304 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
305 }
306
307 public static aiCameraVector Repeat(aiCamera value, int count) {
308 IntPtr cPtr = AssimpPINVOKE.aiCameraVector_Repeat(aiCamera.getCPtr(value), count);
309 aiCameraVector ret = (cPtr == IntPtr.Zero) ? null : new aiCameraVector(cPtr, true);
310 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
311 return ret;
312 }
313
314 public void Reverse() {
315 AssimpPINVOKE.aiCameraVector_Reverse__SWIG_0(swigCPtr);
316 }
317
318 public void Reverse(int index, int count) {
319 AssimpPINVOKE.aiCameraVector_Reverse__SWIG_1(swigCPtr, index, count);
320 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
321 }
322
323 public void SetRange(int index, aiCameraVector values) {
324 AssimpPINVOKE.aiCameraVector_SetRange(swigCPtr, index, aiCameraVector.getCPtr(values));
325 if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve();
326 }
327
328 public bool Contains(aiCamera value) {
329 bool ret = AssimpPINVOKE.aiCameraVector_Contains(swigCPtr, aiCamera.getCPtr(value));
330 return ret;
331 }
332
333 public int IndexOf(aiCamera value) {
334 int ret = AssimpPINVOKE.aiCameraVector_IndexOf(swigCPtr, aiCamera.getCPtr(value));
335 return ret;
336 }
337
338 public int LastIndexOf(aiCamera value) {
339 int ret = AssimpPINVOKE.aiCameraVector_LastIndexOf(swigCPtr, aiCamera.getCPtr(value));
340 return ret;
341 }
342
343 public bool Remove(aiCamera value) {
344 bool ret = AssimpPINVOKE.aiCameraVector_Remove(swigCPtr, aiCamera.getCPtr(value));
345 return ret;
346 }
347
348}