/[gr2lib]/trunk/gr2lib/core/coretypes/implementation/ArtToolInfo.cs
ViewVC logotype

Contents of /trunk/gr2lib/core/coretypes/implementation/ArtToolInfo.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 73 - (show annotations) (download)
Thu Jul 15 14:31:59 2010 UTC (11 years, 4 months ago) by william
File size: 4032 byte(s)
setup default constructors to initialize each class to its default values

1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using gr2lib.core.typedefs;
5 using gr2lib.core.helpers;
6 using Microsoft.Xna.Framework;
7
8 namespace gr2lib.core.coretypes.implementation
9 {
10 public interface IArtToolInfo
11 {
12 string FromArtToolName { get; set; }
13 granny_int32 ArtToolMajorRevision { get; set; }
14 granny_int32 ArtToolMinorRevision { get; set; }
15 granny_real32 UnitsPerMeter { get; set; }
16 Vector3 Origin { get; set; }
17 Vector3 Right { get; set; }
18 Vector3 Up { get; set; }
19 Vector3 Back { get; set; }
20 IntPtr ExtendedData { get; set; }
21 }
22
23 public class ArtToolInfo : IArtToolInfo
24 {
25 internal string _fromArtToolName;
26 internal granny_int32 _artToolMajorRevision;
27 internal granny_int32 _artToolMinorRevision;
28 internal granny_real32 _unitsPerMeter;
29 internal IntPtr _ExtendedData;
30
31 internal IntPtr NativePointer;
32
33 internal Vector3 _Origin;
34 internal Vector3 _Right;
35 internal Vector3 _Up;
36 internal Vector3 _Back;
37
38 public ArtToolInfo()
39 {
40 this.FromArtToolName = "";
41 this.ArtToolMajorRevision = 0;
42 this.ArtToolMinorRevision = 0;
43 this.UnitsPerMeter = 1;
44 this.ExtendedData = IntPtr.Zero;
45 this.NativePointer = IntPtr.Zero;
46 this.Origin = new Vector3(0, 0, 0);
47 this.Right = new Vector3(0, 0, 0);
48 this.Up = new Vector3(0, 0, 0);
49 this.Back = new Vector3(0, 0, 0);
50
51
52 }
53 internal static ArtToolInfo ReadFromMemory(IntPtr pointer)
54 {
55 if (pointer == IntPtr.Zero) return null;
56 native.ArtToolInfo native = Helpers.ReadFromMemory<native.ArtToolInfo>(pointer);
57 ArtToolInfo managed = ReadFromNative(native);
58 managed.NativePointer = pointer;
59 return managed;
60 }
61 internal static ArtToolInfo ReadFromNative(gr2lib.core.coretypes.native.ArtToolInfo native)
62 {
63 ArtToolInfo managed = new ArtToolInfo();
64 managed.FromArtToolName = string.IsNullOrEmpty(native.FromArtToolName) ? "{null}" : native.FromArtToolName;
65 managed.ArtToolMajorRevision = native.ArtToolMajorRevision;
66 managed.ArtToolMinorRevision = native.ArtToolMinorRevision;
67 //managed.ArtToolPointerSize = native.ArtToolPointerSize;
68 managed.UnitsPerMeter = native.UnitsPerMeter;
69 managed.Origin = new Vector3(native.Origin.X, native.Origin.Y, native.Origin.Z );
70 managed.Right = new Vector3( native.Right.X, native.Right.Y, native.Right.Z );
71 managed.Up = new Vector3(native.Up.X, native.Up.Y, native.Up.Z );
72 managed.Back = new Vector3(native.Back.X, native.Back.Y, native.Back.Z);
73 managed.ExtendedData = native.ExtendedData;
74 //managed.OnInvalidate();
75 return managed;
76 }
77
78 #region IArtToolInfo Members
79 public string FromArtToolName { get { return _fromArtToolName; } set { _fromArtToolName = value; } }
80 public granny_int32 ArtToolMajorRevision { get { return _artToolMajorRevision; } set { _artToolMajorRevision = value; } }
81 public granny_int32 ArtToolMinorRevision { get { return _artToolMinorRevision; } set { _artToolMinorRevision = value; } }
82 public granny_real32 UnitsPerMeter { get { return _unitsPerMeter; } set { _unitsPerMeter = value; } }
83 public Vector3 Origin { get { return _Origin; } set { _Origin = value; } }
84 public Vector3 Right { get { return _Right; } set { _Right = value; } }
85 public Vector3 Up { get { return _Up; } set { _Up = value; } }
86 public Vector3 Back { get { return _Back; } set { _Back = value; } }
87 public IntPtr ExtendedData { get { return _ExtendedData; } set { _ExtendedData = value; } }
88 #endregion
89 }
90 }
91

  ViewVC Help
Powered by ViewVC 1.1.22