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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 84 - (show annotations) (download)
Sat Aug 14 20:21:40 2010 UTC (10 years, 8 months ago) by william
File size: 7499 byte(s)
Add Support for:
** Only displaying the Granny2 Properties that are needed (don't show things that don't exist in the rig file)
** Add initial class for VertexData (currently unimplemented)

1 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 using gr2lib.core.ui.typeeditors;
8 using System.Drawing.Design;
9
10 namespace gr2lib.core.coretypes.implementation
11 {
12
13 #region public class ArtToolInfoVersion
14 /// <summary>
15 /// ArtToolInfoVersion class
16 /// </summary>
17 [Browsable(true)]
18 [TypeConverter(typeof(ExpandableObjectConverter))]
19 public class ArtToolInfoVersion : IArtToolInfoVersion
20 {
21 /// <summary>
22 /// default constructor
23 /// </summary>
24 public ArtToolInfoVersion()
25 {
26 this.Major = 0;
27 this.Minor = 0;
28 }
29 /// <summary>
30 /// default constructor - specify: Major, Minor
31 /// </summary>
32 public ArtToolInfoVersion(int Major, int Minor)
33 {
34 this.Major = Major;
35 this.Minor = Minor;
36 }
37
38 private int _Major;
39 /// <summary>
40 /// Get/set the major
41 /// </summary>
42 [RefreshPropertiesAttribute(RefreshProperties.All)]
43 [Browsable(true)]
44 public int Major
45 {
46 get { return _Major; }
47 set { _Major = value; }
48 }
49 private int _Minor;
50 /// <summary>
51 /// Get/set the minor
52 /// </summary>
53 [RefreshPropertiesAttribute(RefreshProperties.All)]
54 [Browsable(true)]
55 public int Minor
56 {
57 get { return _Minor; }
58 set { _Minor = value; }
59 }
60 /// <summary>
61 /// string representation
62 /// </summary>
63 /// <returns></returns>
64 public override string ToString()
65 {
66 return string.Format("{0}.{1}", Major, Minor);
67 }
68 }
69 #endregion
70
71 #region public class ArtToolInfoVector
72 /// <summary>
73 /// ArtToolInfoVector class
74 /// </summary>
75 [Browsable(true)]
76 [TypeConverter(typeof(ExpandableObjectConverter))]
77 public class ArtToolInfoVector : IArtToolInfoVector
78 {
79 private Vector3 _Origin;
80 private Vector3 _Right;
81 private Vector3 _Up;
82 private Vector3 _Back;
83
84 /// <summary>
85 /// default constructor
86 /// </summary>
87 public ArtToolInfoVector()
88 {
89 this.Origin = new Vector3();
90 this.Right = new Vector3();
91 this.Up = new Vector3();
92 this.Back = new Vector3();
93 }
94 /// <summary>
95 /// default constructor - specify: Origin, Right, Up, Back
96 /// </summary>
97 public ArtToolInfoVector(Vector3 Origin, Vector3 Right, Vector3 Up, Vector3 Back)
98 {
99 this.Origin = Origin;
100 this.Right = Right;
101 this.Up = Up;
102 this.Back = Back;
103 }
104 /// <summary>
105 /// Get/set the Origin
106 /// </summary>
107 [RefreshPropertiesAttribute(RefreshProperties.All)]
108 public Vector3 Origin { get { return _Origin; } set { _Origin = value; } }
109 /// <summary>
110 /// Get/set the Right
111 /// </summary>
112 [RefreshPropertiesAttribute(RefreshProperties.All)]
113 public Vector3 Right { get { return _Right; } set { _Right = value; } }
114 /// <summary>
115 /// Get/set the Up
116 /// </summary>
117 [RefreshPropertiesAttribute(RefreshProperties.All)]
118 public Vector3 Up { get { return _Up; } set { _Up = value; } }
119 /// <summary>
120 /// Get/set the Back
121 /// </summary>
122 [RefreshPropertiesAttribute(RefreshProperties.All)]
123 public Vector3 Back { get { return _Back; } set { _Back = value; } }
124
125 /// <summary>
126 /// get string representation
127 /// </summary>
128 /// <returns></returns>
129 public override string ToString()
130 {
131 string format = "0.00";
132
133 string origin = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Origin.x, Origin.y, Origin.z) + "}";
134 string right = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Right.x, Right.y, Right.z) + "}";
135 string up = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Up.x, Up.y, Up.z) + "}";
136 string back = "{" + string.Format("{0:" + format + "},{1:" + format + "},{2:" + format + "}", Back.x, Back.y, Back.z) + "}";
137
138 return string.Format("{0} ; {1} ; {2} ; {3}", origin, right, up, back);
139 }
140
141
142
143 }
144 #endregion
145
146 /// <summary>
147 /// ArtToolInfo class
148 /// </summary>
149 //[Category("Art Tool Info")]
150 [Browsable(true)]
151 [TypeConverter(typeof(ExpandableObjectConverter))]
152 public class ArtToolInfo : IArtToolInfo
153 {
154 private string _fromArtToolName;
155 private float _unitsPerMeter;
156
157 /// <summary>
158 /// default constructor
159 /// </summary>
160 public ArtToolInfo()
161 {
162 this.FromArtToolName = "{NULL}";
163 this.ToolVersion = new ArtToolInfoVersion();
164 this.UnitsPerMeter = 1;
165 this.Vector = new ArtToolInfoVector();
166 this.ExtendedData = new GrannyExtendedData();
167 }
168
169 public override string ToString()
170 {
171 //return string.Format("v{0}", this.ToolVersion.ToString());
172 return this.FromArtToolName;
173 }
174 #region IArtToolInfo Members
175 /// <summary>
176 /// Get/set ArtTool Name
177 /// </summary>
178 [RefreshPropertiesAttribute(RefreshProperties.All)]
179 [CategoryAttribute("Art Tool Info")]
180 public string FromArtToolName { get { return _fromArtToolName; } set { _fromArtToolName = value; } }
181
182 private ArtToolInfoVersion _ToolVersion;
183 /// <summary>
184 /// Get/set ArtTool Version
185 /// </summary>
186 [RefreshPropertiesAttribute(RefreshProperties.All)]
187 [CategoryAttribute("Art Tool Info")]
188 [Browsable(true)]
189 public ArtToolInfoVersion ToolVersion { get { return _ToolVersion; } set { _ToolVersion = value; } }
190
191 /// <summary>
192 ///Get/set ArtTool UnitsPerMeter
193 /// </summary>
194 [RefreshPropertiesAttribute(RefreshProperties.All)]
195 //[Editor(typeof(UINumericEditor<NumericType<float>,float>), typeof(UITypeEditor))]
196 [CategoryAttribute("Art Tool Info")]
197 public float UnitsPerMeter { get { return _unitsPerMeter; } set { _unitsPerMeter = value; } }
198
199
200 private ArtToolInfoVector _Vector;
201 /// <summary>
202 ///Get/set ArtTool Vector
203 /// </summary>
204 [RefreshPropertiesAttribute(RefreshProperties.All)]
205 [CategoryAttribute("Art Tool Info")]
206 [Browsable(true)]
207 public ArtToolInfoVector Vector
208 {
209 get { return _Vector; }
210 set { _Vector = value; }
211 }
212 #endregion
213
214 #region IExtendedData Members
215 private GrannyExtendedData _ExtendedData;
216 /// <summary>
217 /// When used in a derived class, gets the ExtendedData pointer for this instance
218 /// </summary>
219 public GrannyExtendedData ExtendedData { get { return _ExtendedData; } set { _ExtendedData = value; } }
220 #endregion
221
222 }
223 }
224

  ViewVC Help
Powered by ViewVC 1.1.22