/[Sims3RigEditor]/trunk/gr2lib_typedefs/typedefs/ArtToolInfo.cs
ViewVC logotype

Annotation of /trunk/gr2lib_typedefs/typedefs/ArtToolInfo.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (hide annotations) (download)
Thu Jul 29 17:25:37 2010 UTC (10 years, 8 months ago) by william
File size: 8609 byte(s)
initial commit --

** Started implementing native unmanaged <=> managed conversion

1 william 5 using System;
2     using System.Collections.Generic;
3     using System.Text;
4     using gr2lib.core.interfaces;
5     using System.Diagnostics;
6     using System.ComponentModel;
7    
8     namespace gr2lib.core.coretypes.implementation
9     {
10     #region public class ArtToolInfoVersion
11     /// <summary>
12     /// ArtToolInfoVersion class
13     /// </summary>
14     public class ArtToolInfoVersion : IArtToolInfoVersion
15     {
16     /// <summary>
17     /// default constructor
18     /// </summary>
19     public ArtToolInfoVersion()
20     {
21     this.Major = 0;
22     this.Minor = 0;
23     }
24     /// <summary>
25     /// default constructor - specify: Major, Minor
26     /// </summary>
27     public ArtToolInfoVersion(int Major, int Minor)
28     {
29     this.Major = Major;
30     this.Minor = Minor;
31     }
32    
33     private int _Major;
34     /// <summary>
35     /// Get/set the major
36     /// </summary>
37     [RefreshPropertiesAttribute(RefreshProperties.All)]
38     public int Major
39     {
40     get { return _Major; }
41     set { _Major = value; }
42     }
43     private int _Minor;
44     /// <summary>
45     /// Get/set the minor
46     /// </summary>
47     [RefreshPropertiesAttribute(RefreshProperties.All)]
48     public int Minor
49     {
50     get { return _Minor; }
51     set { _Minor = value; }
52     }
53     /// <summary>
54     /// string representation
55     /// </summary>
56     /// <returns></returns>
57     public override string ToString()
58     {
59     return string.Format("{0}.{1}", Major, Minor);
60     }
61     }
62     #endregion
63    
64     #region public class ArtToolInfoVector
65     /// <summary>
66     /// ArtToolInfoVector class
67     /// </summary>
68     public class ArtToolInfoVector : IArtToolInfoVector
69     {
70     private Vector3 _Origin;
71     private Vector3 _Right;
72     private Vector3 _Up;
73     private Vector3 _Back;
74    
75     /// <summary>
76     /// default constructor
77     /// </summary>
78     public ArtToolInfoVector()
79     {
80     this.Origin = new Vector3();
81     this.Right = new Vector3();
82     this.Up = new Vector3();
83     this.Back = new Vector3();
84     }
85     /// <summary>
86     /// default constructor - specify: Origin, Right, Up, Back
87     /// </summary>
88     public ArtToolInfoVector(Vector3 Origin, Vector3 Right, Vector3 Up, Vector3 Back)
89     {
90     this.Origin = Origin;
91     this.Right = Right;
92     this.Up = Up;
93     this.Back = Back;
94     }
95     /// <summary>
96     /// Get/set the Origin
97     /// </summary>
98     [RefreshPropertiesAttribute(RefreshProperties.All)]
99     public Vector3 Origin { get { return _Origin; } set { _Origin = value; } }
100     /// <summary>
101     /// Get/set the Right
102     /// </summary>
103     [RefreshPropertiesAttribute(RefreshProperties.All)]
104     public Vector3 Right { get { return _Right; } set { _Right = value; } }
105     /// <summary>
106     /// Get/set the Up
107     /// </summary>
108     [RefreshPropertiesAttribute(RefreshProperties.All)]
109     public Vector3 Up { get { return _Up; } set { _Up = value; } }
110     /// <summary>
111     /// Get/set the Back
112     /// </summary>
113     [RefreshPropertiesAttribute(RefreshProperties.All)]
114     public Vector3 Back { get { return _Back; } set { _Back = value; } }
115    
116     /// <summary>
117     /// get string representation
118     /// </summary>
119     /// <returns></returns>
120     public override string ToString()
121     {
122     string format = "0.00";
123    
124     string origin = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Origin.x, Origin.y, Origin.z) + "}";
125     string right = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Right.x, Right.y, Right.z) + "}";
126     string up = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Up.x, Up.y, Up.z) + "}";
127     string back = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Back.x, Back.y, Back.z) + "}";
128    
129     return string.Format("{0} ; {1} ; {2} ; {3}", origin, right, up, back);
130     }
131    
132    
133    
134     }
135     #endregion
136    
137     /// <summary>
138     /// ArtToolInfo class
139     /// </summary>
140     public class ArtToolInfo : IArtToolInfo
141     {
142     //private string _ParentResourceName;
143     /// <summary>
144     /// Get's the parent resource name
145     /// </summary>
146     protected internal string ParentResourceName { get { return "Art Tool Info"; } }
147    
148     private string _fromArtToolName;
149     //private granny_int32 _artToolMajorRevision;
150     //private granny_int32 _artToolMinorRevision;
151     private float _unitsPerMeter;
152    
153    
154    
155    
156     //private Vector3 _Origin;
157     //private Vector3 _Right;
158     //private Vector3 _Up;
159     //private Vector3 _Back;
160    
161     /// <summary>
162     /// default constructor
163     /// </summary>
164     public ArtToolInfo()
165     {
166     this.FromArtToolName = "";
167     this.ToolVersion = new ArtToolInfoVersion();
168    
169     this.ArtToolMajorRevision = 0;
170     this.ArtToolMinorRevision = 0;
171     this.UnitsPerMeter = 1;
172     //this.ExtendedData = IntPtr.Zero;
173     //this.NativePointer = IntPtr.Zero;
174     this.Vector = new ArtToolInfoVector();
175    
176     //this.Origin = new Vector3(0, 0, 0);
177     //this.Right = new Vector3(0, 0, 0);
178     //this.Up = new Vector3(0, 0, 0);
179     //this.Back = new Vector3(0, 0, 0);
180    
181    
182    
183     }
184    
185    
186     #region IArtToolInfo Members
187     /// <summary>
188     /// Get/set ArtTool Name
189     /// </summary>
190     [RefreshPropertiesAttribute(RefreshProperties.All)]
191     public string FromArtToolName { get { return _fromArtToolName; } set { _fromArtToolName = value; } }
192     /// <summary>
193     /// Get/set ArtTool Major
194     /// </summary>
195     [RefreshPropertiesAttribute(RefreshProperties.All)]
196     public int ArtToolMajorRevision { get { return _ToolVersion.Major; } set { _ToolVersion.Major = value; } }
197     /// <summary>
198     /// Get/set ArtTool Minor
199     /// </summary>
200     [RefreshPropertiesAttribute(RefreshProperties.All)]
201     public int ArtToolMinorRevision { get { return _ToolVersion.Minor; } set { _ToolVersion.Minor = value; } }
202    
203     private ArtToolInfoVersion _ToolVersion;
204     /// <summary>
205     /// Get/set ArtTool Version
206     /// </summary>
207     [RefreshPropertiesAttribute(RefreshProperties.All)]
208     public ArtToolInfoVersion ToolVersion { get { return _ToolVersion; } set { _ToolVersion = value; } }
209    
210     /// <summary>
211     ///Get/set ArtTool UnitsPerMeter
212     /// </summary>
213     [RefreshPropertiesAttribute(RefreshProperties.All)]
214     //[Editor(typeof(UINumericEditor<NumericType<float>,float>), typeof(UITypeEditor))]
215     public float UnitsPerMeter { get { return _unitsPerMeter; } set { _unitsPerMeter = value; } }
216    
217     /// <summary>
218     ///Get/set ArtTool Origin
219     /// </summary>
220     [RefreshPropertiesAttribute(RefreshProperties.All)]
221     public Vector3 Origin { get { return Vector.Origin; } set { Vector.Origin = value; } }
222     /// <summary>
223     ///Get/set ArtTool Right
224     /// </summary>
225     [RefreshPropertiesAttribute(RefreshProperties.All)]
226     public Vector3 Right { get { return Vector.Right; } set { Vector.Right = value; } }
227     /// <summary>
228     ///Get/set ArtTool Up
229     /// </summary>
230     [RefreshPropertiesAttribute(RefreshProperties.All)]
231     public Vector3 Up { get { return Vector.Up; } set { Vector.Up = value; } }
232     /// <summary>
233     ///Get/set ArtTool Back
234     /// </summary>
235     [RefreshPropertiesAttribute(RefreshProperties.All)]
236     public Vector3 Back { get { return Vector.Back; } set { Vector.Back = value; } }
237    
238     private ArtToolInfoVector _Vector;
239     /// <summary>
240     ///Get/set ArtTool Vector
241     /// </summary>
242     [RefreshPropertiesAttribute(RefreshProperties.All)]
243     public ArtToolInfoVector Vector
244     {
245     get { return _Vector; }
246     set { _Vector = value; }
247     }
248     #endregion
249    
250    
251     }
252     }
253    

  ViewVC Help
Powered by ViewVC 1.1.22