/[gr2lib]/trunk/gr2lib/core/typedefs/typedefs.cs
ViewVC logotype

Contents of /trunk/gr2lib/core/typedefs/typedefs.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 85 - (show annotations) (download)
Fri Jul 16 23:34:41 2010 UTC (10 years, 2 months ago) by william
File size: 24193 byte(s)
remove unsafe keyword

1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Runtime.InteropServices;
5
6 namespace gr2lib.core.typedefs
7 {
8 #region typedefs
9
10 #region public enum granny_member_type
11 public enum granny_member_type
12 {
13 GrannyEndMember,
14 GrannyInlineMember,
15 GrannyReferenceMember,
16 GrannyReferenceToArrayMember,
17 GrannyArrayOfReferencesMember,
18 GrannyVariantReferenceMember,
19 GrannyUnsupportedMemberType_Remove,
20 GrannyReferenceToVariantArrayMember,
21 GrannyStringMember,
22 GrannyTransformMember,
23 GrannyReal32Member,
24 GrannyInt8Member,
25 GrannyUInt8Member,
26 GrannyBinormalInt8Member,
27 GrannyNormalUInt8Member,
28 GrannyInt16Member,
29 GrannyUInt16Member,
30 GrannyBinormalInt16Member,
31 GrannyNormalUInt16Member,
32 GrannyInt32Member,
33 GrannyUInt32Member,
34 GrannyReal16Member,
35 GrannyEmptyReferenceMember,
36 GrannyOnePastLastMemberType,
37 GrannyBool32Member = GrannyInt32Member
38 };
39 #endregion
40
41 public struct granny_transform
42 {
43 #pragma warning disable 0169
44 granny_uint32 Flags;
45 granny_triple Position;
46 granny_quad Orientation;
47 granny_triple[] ScaleShear;//[3];
48 #pragma warning restore 0169
49 };
50 public struct granny_curve2
51 {
52 #pragma warning disable 0169
53 granny_variant CurveData;
54 #pragma warning restore 0169
55 };
56 #region public struct granny_data_type_definition
57 [StructLayout(LayoutKind.Sequential)]
58 public struct granny_data_type_definition
59 {
60 granny_member_type Type;
61 string Name;
62 //unsafe granny_data_type_definition* ReferenceType;
63 granny_int32 ArrayWidth;
64 granny_int32 Extra;//[3];
65 granny_uintaddrx Ignored__Ignored;
66 };
67 #endregion
68
69 #region public struct granny_variant
70 public struct granny_variant
71 {
72 #pragma warning disable 0169
73 granny_data_type_definition Type;
74 object Object;
75 #pragma warning restore 0169
76 }
77 #endregion
78
79 #region public struct granny_uint32
80 public struct granny_uintaddrx
81 {
82 public granny_uintaddrx(System.UInt32 value)
83 {
84 this.realValue = value;
85 }
86 private System.UInt32 realValue;
87 public static implicit operator System.UInt32(granny_uintaddrx value)
88 {
89 return value.realValue;
90 }
91
92 public static implicit operator granny_uintaddrx(System.UInt32 value)
93 {
94 return new granny_uintaddrx(value);
95 }
96 public static implicit operator granny_uintaddrx(string value)
97 {
98 return Convert.ToUInt32(value);
99 }
100 public static implicit operator string(granny_uintaddrx value)
101 {
102 return value.ToString();
103 }
104 public override string ToString()
105 {
106 return realValue.ToString();
107 }
108 };//System.UInt32
109 #endregion
110
111 #region public struct granny_uint32
112 public struct granny_uint32
113 {
114 public granny_uint32(System.UInt32 value)
115 {
116 this.realValue = value;
117 }
118 private System.UInt32 realValue;
119 public static implicit operator System.UInt32(granny_uint32 value)
120 {
121 return value.realValue;
122 }
123
124 public static implicit operator granny_uint32(System.UInt32 value)
125 {
126 return new granny_uint32(value);
127 }
128 public static implicit operator granny_uint32(string value)
129 {
130 return Convert.ToUInt32(value);
131 }
132 public static implicit operator string(granny_uint32 value)
133 {
134 return value.ToString();
135 }
136 public override string ToString()
137 {
138 return realValue.ToString();
139 }
140 };//System.UInt32
141 #endregion
142
143 #region public struct granny_uint16
144 public struct granny_uint16
145 {
146 public granny_uint16(System.UInt16 value)
147 {
148 this.realValue = value;
149 }
150 private System.UInt16 realValue;
151 public static implicit operator System.UInt16(granny_uint16 value)
152 {
153 return value.realValue;
154 }
155
156 public static implicit operator granny_uint16(System.UInt16 value)
157 {
158 return new granny_uint16(value);
159 }
160 public static implicit operator granny_uint16(string value)
161 {
162 return Convert.ToUInt16(value);
163 }
164 public static implicit operator string(granny_uint16 value)
165 {
166 return value.ToString();
167 }
168 public override string ToString()
169 {
170 return realValue.ToString();
171 }
172 };//System.UInt16;
173 #endregion
174
175 #region public struct granny_uint8
176 public struct granny_uint8
177 {
178 public granny_uint8(System.Byte value)
179 {
180 this.realValue = value;
181 }
182 private System.Byte realValue;
183 public static implicit operator System.Byte(granny_uint8 value)
184 {
185 return value.realValue;
186 }
187
188 public static implicit operator granny_uint8(System.Byte value)
189 {
190 return new granny_uint8(value);
191 }
192 public static implicit operator granny_uint8(string value)
193 {
194 return Convert.ToByte(value);
195 }
196 public static implicit operator string(granny_uint8 value)
197 {
198 return value.ToString();
199 }
200 public override string ToString()
201 {
202 return realValue.ToString();
203 }
204 }; //System.Byte;
205 #endregion
206
207 #region public struct granny_int32
208 public struct granny_int32
209 {
210 public granny_int32(System.Int32 value)
211 {
212 this.realValue = value;
213 }
214 private System.Int32 realValue;
215 public static implicit operator System.Int32(granny_int32 value)
216 {
217 return value.realValue;
218 }
219
220 public static implicit operator granny_int32(System.Int32 value)
221 {
222 return new granny_int32(value);
223 }
224 public static implicit operator granny_int32(string value)
225 {
226 return Convert.ToInt32(value);
227 }
228 public static implicit operator string(granny_int32 value)
229 {
230 return value.ToString();
231 }
232 public override string ToString()
233 {
234 return realValue.ToString();
235 }
236 }; //System.Int32;
237 #endregion
238
239 #region public struct granny_int16
240 public struct granny_int16
241 {
242 public granny_int16(System.Int16 value)
243 {
244 this.realValue = value;
245 }
246 private System.Int16 realValue;
247 public static implicit operator System.Int16(granny_int16 value)
248 {
249 return value.realValue;
250 }
251
252 public static implicit operator granny_int16(System.Int16 value)
253 {
254 return new granny_int16(value);
255 }
256 public static implicit operator granny_int16(string value)
257 {
258 return Convert.ToInt16(value);
259 }
260 public static implicit operator string(granny_int16 value)
261 {
262 return value.ToString();
263 }
264 public override string ToString()
265 {
266 return realValue.ToString();
267 }
268 };//System.Int16;
269 #endregion
270
271 #region public struct granny_int8
272 public struct granny_int8
273 {
274 public granny_int8(System.SByte value)
275 {
276 this.realValue = value;
277 }
278 private System.SByte realValue;
279 public static implicit operator System.SByte(granny_int8 value)
280 {
281 return value.realValue;
282 }
283
284 public static implicit operator granny_int8(System.SByte value)
285 {
286 return new granny_int8(value);
287 }
288 public static implicit operator granny_int8(string value)
289 {
290 return Convert.ToSByte(value);
291 }
292 public static implicit operator string(granny_int8 value)
293 {
294 return value.ToString();
295 }
296 public override string ToString()
297 {
298 return realValue.ToString();
299 }
300 };//System.SByte;
301 #endregion
302
303 #region public struct granny_bool32
304 public struct granny_bool32
305 {
306 public granny_bool32(System.Int32 value)
307 {
308 this.realValue = value;
309 }
310 private System.Int32 realValue;
311 public static implicit operator System.Int32(granny_bool32 value)
312 {
313 return value.realValue;
314 }
315
316 public static implicit operator granny_bool32(System.Int32 value)
317 {
318 return new granny_bool32(value);
319 }
320 public static implicit operator granny_bool32(string value)
321 {
322 return Convert.ToInt32(value);
323 }
324 public static implicit operator string(granny_bool32 value)
325 {
326 return value.ToString();
327 }
328 public override string ToString()
329 {
330 return realValue.ToString();
331 }
332 }; //System.Int32;
333 #endregion
334
335 #region public struct granny_real32
336 public struct granny_real32
337 {
338 public granny_real32(System.Single value)
339 {
340 this.realValue = value;
341 }
342 private System.Single realValue;
343 public static implicit operator System.Single(granny_real32 value)
344 {
345 return value.realValue;
346 }
347
348 public static implicit operator granny_real32(System.Single value)
349 {
350 return new granny_real32(value);
351 }
352 public static implicit operator granny_real32(string value)
353 {
354 return Convert.ToSingle(value);
355 }
356 public static implicit operator string(granny_real32 value)
357 {
358 return value.ToString();
359 }
360 public override string ToString()
361 {
362 return realValue.ToString();
363 }
364 }; //System.Single;
365 #endregion
366
367 #region public struct granny_real16
368 public struct granny_real16
369 {
370 public granny_real16(System.UInt16 value)
371 {
372 this.realValue = value;
373 }
374 private System.UInt16 realValue;
375 public static implicit operator System.UInt16(granny_real16 value)
376 {
377 return value.realValue;
378 }
379
380 public static implicit operator granny_real16(System.UInt16 value)
381 {
382 return new granny_real16(value);
383 }
384 public static implicit operator granny_real16(string value)
385 {
386 return Convert.ToUInt16(value);
387 }
388 public static implicit operator string(granny_real16 value)
389 {
390 return value.ToString();
391 }
392 public override string ToString()
393 {
394 return realValue.ToString();
395 }
396 };//System.UInt16;
397 #endregion
398
399 #region public struct granny_uint32x
400 public struct granny_uint32x
401 {
402 public granny_uint32x(System.UInt32 value)
403 {
404 this.realValue = value;
405 }
406 private System.UInt32 realValue;
407 public static implicit operator System.UInt32(granny_uint32x value)
408 {
409 return value.realValue;
410 }
411
412 public static implicit operator granny_uint32x(System.UInt32 value)
413 {
414 return new granny_uint32x(value);
415 }
416 public static implicit operator granny_uint32x(string value)
417 {
418 return Convert.ToUInt32(value);
419 }
420 public static implicit operator string(granny_uint32x value)
421 {
422 return value.ToString();
423 }
424 public override string ToString()
425 {
426 return realValue.ToString();
427 }
428 }; //System.UInt32;
429 #endregion
430
431 #region public struct granny_uint16x
432 public struct granny_uint16x
433 {
434 public granny_uint16x(System.UInt32 value)
435 {
436 this.realValue = value;
437 }
438 private System.UInt32 realValue;
439 public static implicit operator System.UInt32(granny_uint16x value)
440 {
441 return value.realValue;
442 }
443
444 public static implicit operator granny_uint16x(System.UInt32 value)
445 {
446 return new granny_uint16x(value);
447 }
448 public static implicit operator granny_uint16x(string value)
449 {
450 return Convert.ToUInt32(value);
451 }
452 public static implicit operator string(granny_uint16x value)
453 {
454 return value.ToString();
455 }
456 public override string ToString()
457 {
458 return realValue.ToString();
459 }
460 };//System.UInt32;
461 #endregion
462
463 #region public struct granny_uint8x
464 public struct granny_uint8x
465 {
466 public granny_uint8x(System.UInt32 value)
467 {
468 this.realValue = value;
469 }
470 private System.UInt32 realValue;
471 public static implicit operator System.UInt32(granny_uint8x value)
472 {
473 return value.realValue;
474 }
475
476 public static implicit operator granny_uint8x(System.UInt32 value)
477 {
478 return new granny_uint8x(value);
479 }
480 public static implicit operator granny_uint8x(string value)
481 {
482 return Convert.ToUInt32(value);
483 }
484 public static implicit operator string(granny_uint8x value)
485 {
486 return value.ToString();
487 }
488 public override string ToString()
489 {
490 return realValue.ToString();
491 }
492 };//System.UInt32;
493 #endregion
494
495 #region public struct granny_int32x
496 public struct granny_int32x
497 {
498 public granny_int32x(System.Int32 value)
499 {
500 this.realValue = value;
501 }
502 private System.Int32 realValue;
503 public static implicit operator System.Int32(granny_int32x value)
504 {
505 return value.realValue;
506 }
507
508 public static implicit operator granny_int32x(System.Int32 value)
509 {
510 return new granny_int32x(value);
511 }
512 public static implicit operator granny_int32x(string value)
513 {
514 return Convert.ToInt32(value);
515 }
516 public static implicit operator string(granny_int32x value)
517 {
518 return value.ToString();
519 }
520 public override string ToString()
521 {
522 return realValue.ToString();
523 }
524
525 }; //System.Int32;
526 #endregion
527
528 #region public struct granny_int16x
529 public struct granny_int16x
530 {
531 public granny_int16x(System.Int32 value)
532 {
533 this.realValue = value;
534 }
535 private System.Int32 realValue;
536 public static implicit operator System.Int32(granny_int16x value)
537 {
538 return value.realValue;
539 }
540
541 public static implicit operator granny_int16x(System.Int32 value)
542 {
543 return new granny_int16x(value);
544 }
545 public static implicit operator granny_int16x(string value)
546 {
547 return Convert.ToInt32(value);
548 }
549 public static implicit operator string(granny_int16x value)
550 {
551 return value.ToString();
552 }
553 public override string ToString()
554 {
555 return realValue.ToString();
556 }
557 };//System.Int32;
558 #endregion
559
560 #region public struct granny_int8x
561 public struct granny_int8x
562 {
563 public granny_int8x(System.Int32 value)
564 {
565 this.realValue = value;
566 }
567 private System.Int32 realValue;
568 public static implicit operator System.Int32(granny_int8x value)
569 {
570 return value.realValue;
571 }
572
573 public static implicit operator granny_int8x(System.Int32 value)
574 {
575 return new granny_int8x(value);
576 }
577 public static implicit operator granny_int8x(string value)
578 {
579 return Convert.ToInt32(value);
580 }
581 public static implicit operator string(granny_int8x value)
582 {
583 return value.ToString();
584 }
585 public override string ToString()
586 {
587 return realValue.ToString();
588 }
589 }; //System.Int32;
590 #endregion
591
592 #region public struct granny_bool32x
593 public struct granny_bool32x
594 {
595 public granny_bool32x(System.Int32 value)
596 {
597 this.realValue = value;
598 }
599 private System.Int32 realValue;
600 public static implicit operator System.Int32(granny_bool32x value)
601 {
602 return value.realValue;
603 }
604
605 public static implicit operator granny_bool32x(System.Int32 value)
606 {
607 return new granny_bool32x(value);
608 }
609 public static implicit operator granny_bool32x(string value)
610 {
611 return Convert.ToInt32(value);
612 }
613 public static implicit operator string(granny_bool32x value)
614 {
615 return value.ToString();
616 }
617 public override string ToString()
618 {
619 return realValue.ToString();
620 }
621 };//System.Int32;
622 #endregion
623
624 #region public struct granny_real64x
625 public struct granny_real64x
626 {
627 public granny_real64x(System.Double value)
628 {
629 this.realValue = value;
630 }
631 private System.Double realValue;
632 public static implicit operator System.Double(granny_real64x value)
633 {
634 return value.realValue;
635 }
636
637 public static implicit operator granny_real64x(System.Double value)
638 {
639 return new granny_real64x(value);
640 }
641 public static implicit operator granny_real64x(string value)
642 {
643 return Convert.ToDouble(value);
644 }
645 public static implicit operator string(granny_real64x value)
646 {
647 return value.ToString();
648 }
649 public override string ToString()
650 {
651 return realValue.ToString();
652 }
653 }; //System.Double;
654 #endregion
655
656 #region public struct granny_real32x
657 public struct granny_real32x
658 {
659 public granny_real32x(System.Single value)
660 {
661 this.realValue = value;
662 }
663 private System.Single realValue;
664 public static implicit operator System.Single(granny_real32x value)
665 {
666 return value.realValue;
667 }
668
669 public static implicit operator granny_real32x(System.Single value)
670 {
671 return new granny_real32x(value);
672 }
673 public static implicit operator granny_real32x(string value)
674 {
675 return Convert.ToSingle(value);
676 }
677 public static implicit operator string(granny_real32x value)
678 {
679 return value.ToString();
680 }
681 };//System.Single;
682 #endregion
683
684 #region public struct granny_triple
685 public struct granny_triple
686 {
687 public granny_triple(System.Single[] value)
688 {
689 this.realValue = value;
690 }
691 private System.Single[] realValue;
692 public static implicit operator System.Single[](granny_triple value)
693 {
694 return value.realValue;
695 }
696
697 public static implicit operator granny_triple(System.Single[] value)
698 {
699 return new granny_triple(value);
700 }
701 public override string ToString()
702 {
703 string val = "";
704 foreach (System.Single f in realValue)
705 {
706 val = val + "[" + f.ToString() + "]";
707 }
708 return val;
709 }
710 public System.Single this[int index]
711 {
712 get { return this.realValue[index]; }
713 }
714 }; //System.Single;//[3]; // declare type -> unsafe fixed
715 #endregion
716
717 #region public struct granny_quad
718 public struct granny_quad
719 {
720 public granny_quad(System.Single[] value)
721 {
722 this.realValue = value;
723 }
724 private System.Single[] realValue;//[4];
725 public static implicit operator System.Single[](granny_quad value)
726 {
727 return value.realValue;
728 }
729
730 public static implicit operator granny_quad(System.Single[] value)
731 {
732 return new granny_quad(value);
733 }
734 public override string ToString()
735 {
736 string val = "";
737 foreach (System.Single f in realValue)
738 {
739 val = val + "[" + f.ToString() + "]";
740 }
741 return val;
742 }
743 };//System.Single;//[4]; // declare type -> unsafe fixed
744 #endregion
745
746 #region public struct granny_matrix_3x3
747 public struct granny_matrix_3x3
748 {
749 public granny_matrix_3x3(System.Single[,] value)
750 {
751 this.realValue = value;
752 }
753 private System.Single[,] realValue;
754 public static implicit operator System.Single[,](granny_matrix_3x3 value)
755 {
756 return value.realValue;
757 }
758
759 public static implicit operator granny_matrix_3x3(System.Single[,] value)
760 {
761 return new granny_matrix_3x3(value);
762 }
763 public override string ToString()
764 {
765 string val = "";
766 foreach (System.Single f in realValue)
767 {
768 val = val + "[" + f.ToString() + "]";
769 }
770 return val;
771 }
772 }; //System.Single;//[3][3]; // declare type -> unsafe fixed
773 #endregion
774
775 #region public struct granny_matrix_4x4
776 public struct granny_matrix_4x4
777 {
778 public granny_matrix_4x4(System.Single[,] value)
779 {
780 this.realValue = value;
781 }
782 private System.Single[,] realValue;
783 public static implicit operator System.Single[,](granny_matrix_4x4 value)
784 {
785 return value.realValue;
786 }
787
788 public static implicit operator granny_matrix_4x4(System.Single[,] value)
789 {
790 return new granny_matrix_4x4(value);
791 }
792 public override string ToString()
793 {
794 string val = "";
795 foreach (System.Single f in realValue)
796 {
797 val = val + "[" + f.ToString() + "]";
798 }
799 return val;
800 }
801 };//System.Single;//[4][4]; // declare type -> unsafe fixed
802 #endregion
803
804 #region public struct granny_matrix_3x4
805 public struct granny_matrix_3x4
806 {
807 public granny_matrix_3x4(System.Single[,] value)
808 {
809 this.realValue = value;
810 }
811 private System.Single[,] realValue;
812 public static implicit operator System.Single[,](granny_matrix_3x4 value)
813 {
814 return value.realValue;
815 }
816
817 public static implicit operator granny_matrix_3x4(System.Single[,] value)
818 {
819 return new granny_matrix_3x4(value);
820 }
821 public override string ToString()
822 {
823 string val = "";
824 foreach (System.Single f in realValue)
825 {
826 val = val + "[" + f.ToString() + "]";
827 }
828 return val;
829 }
830 }; //System.Single;//[3][4]; // declare type -> unsafe fixed
831 #endregion
832
833 #endregion
834 }

  ViewVC Help
Powered by ViewVC 1.1.22