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

Diff of /trunk/gr2lib/core/coretypes/implementation/Bone.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 197 by william, Thu Jul 29 07:47:26 2010 UTC revision 198 by william, Thu Jul 29 08:12:27 2010 UTC
# Line 16  namespace gr2lib.core.coretypes.implemen Line 16  namespace gr2lib.core.coretypes.implemen
16      /// </summary>      /// </summary>
17      public class Bone : IBone      public class Bone : IBone
18      {      {
19            #region default IComparable Support
20            /// <summary>
21            /// IComparable Support
22            /// </summary>
23            /// <param name="obj"></param>
24            /// <returns></returns>
25            public int CompareTo(object obj)
26            {
27                return this.Index.CompareTo((obj as Bone).Index);
28            }
29            #endregion
30          /// <summary>          /// <summary>
31          /// Gets the string representation of this instance          /// Gets the string representation of this instance
32          /// </summary>          /// </summary>
# Line 51  namespace gr2lib.core.coretypes.implemen Line 62  namespace gr2lib.core.coretypes.implemen
62          {          {
63              try              try
64              {              {
65              if (pointer == IntPtr.Zero) return null;                  if (pointer == IntPtr.Zero) return null;
66              native.Bone native = Helpers.ReadFromMemory<native.Bone>(pointer);                  native.Bone native = Helpers.ReadFromMemory<native.Bone>(pointer);
67              Bone managed = Bone.ReadFromNative(native);                  Bone managed = Bone.ReadFromNative(native);
68              managed.NativePointer = pointer;                  managed.NativePointer = pointer;
69              return managed;                  return managed;
70              }              }
71              catch (Exception ex)              catch (Exception ex)
72              {              {
73                  StackTrace st = new StackTrace(true);                  StackTrace st = new StackTrace(true);
74  #if  ENABLE_EXCEPTION_OUTPUT_TO_CONSOLE  #if  ENABLE_EXCEPTION_OUTPUT_TO_CONSOLE
75                  Granny2ExceptionWriter.WriteToConsole(ex,st);                  Granny2ExceptionWriter.WriteToConsole(ex, st);
76  #endif  #endif
77                  return default(Bone);                  return default(Bone);
78              }              }
# Line 71  namespace gr2lib.core.coretypes.implemen Line 82  namespace gr2lib.core.coretypes.implemen
82          {          {
83              try              try
84              {              {
85              Bone managed = new Bone();                  Bone managed = new Bone();
86              managed.BoneName = string.IsNullOrEmpty(native.Name) ? "{null}" : native.Name;                  managed.BoneName = string.IsNullOrEmpty(native.Name) ? "{null}" : native.Name;
87              managed.ParentIndex = native.ParentIndex;                  managed.ParentIndex = native.ParentIndex;
88              managed.Transform = Transform.ReadFromNative(native.Transform);                  managed.Transform = Transform.ReadFromNative(native.Transform);
89              //managed.InverseWorldTransformNode.Matrix = new Geom.Matrix44(native.InverseWorldTransform);                  //managed.InverseWorldTransformNode.Matrix = new Geom.Matrix44(native.InverseWorldTransform);
90              //managed.InverseWorldTransform = managed.Transform.Matrix;                  //managed.InverseWorldTransform = managed.Transform.Matrix;
91              managed.LodError = native.LodError;                  managed.LodError = native.LodError;
92              managed.LightInfo = LightInfo.ReadFromMemory(native.LightInfo);                  managed.LightInfo = LightInfo.ReadFromMemory(native.LightInfo);
93              managed.CameraInfo = CameraInfo.ReadFromMemory(native.CameraInfo);                  managed.CameraInfo = CameraInfo.ReadFromMemory(native.CameraInfo);
94              //managed.ExtendedData = native.ExtendedData;                  //managed.ExtendedData = native.ExtendedData;
95    
96                    // BOne property data
97                    managed.BonePropertyData = new GrannyBonePropertyData();
98                    managed.BonePropertyData.BoneColor = System.Drawing.Color.LimeGreen;
99                    managed.BonePropertyData.BoneJointColor = System.Drawing.Color.White;
100    
101    
102              return managed;                  return managed;
103              }              }
104              catch (Exception ex)              catch (Exception ex)
105              {              {
106                  StackTrace st = new StackTrace(true);                  StackTrace st = new StackTrace(true);
107  #if  ENABLE_EXCEPTION_OUTPUT_TO_CONSOLE  #if  ENABLE_EXCEPTION_OUTPUT_TO_CONSOLE
108                  Granny2ExceptionWriter.WriteToConsole(ex,st);                  Granny2ExceptionWriter.WriteToConsole(ex, st);
109  #endif  #endif
110                  return default(Bone);                  return default(Bone);
111              }              }
# Line 146  namespace gr2lib.core.coretypes.implemen Line 163  namespace gr2lib.core.coretypes.implemen
163    
164    
165    
166           private GrannyBonePropertyData _BonePropertyData;          private GrannyBonePropertyData _BonePropertyData;
167           /// <summary>          /// <summary>
168           /// Extra Bone Property Data, Not Used by Granny2          /// Extra Bone Property Data, Not Used by Granny2
169           /// </summary>          /// </summary>
170          [RefreshPropertiesAttribute(RefreshProperties.All)]          [RefreshPropertiesAttribute(RefreshProperties.All)]
171          public GrannyBonePropertyData BonePropertyData { get { return _BonePropertyData; } set { _BonePropertyData = value; } }          public GrannyBonePropertyData BonePropertyData { get { return _BonePropertyData; } set { _BonePropertyData = value; } }
172          #endregion          #endregion
# Line 173  namespace gr2lib.core.coretypes.implemen Line 190  namespace gr2lib.core.coretypes.implemen
190          #region IResource Members          #region IResource Members
191          private int _index;          private int _index;
192          [RefreshPropertiesAttribute(RefreshProperties.All)]          [RefreshPropertiesAttribute(RefreshProperties.All)]
193          internal int Index { get { return _index; } set { _index = value; } }          public int Index { get { return _index; } set { _index = value; } }
194          #endregion          #endregion
195          #region IEmbeddedResource Members          #region IEmbeddedResource Members
196          [RefreshPropertiesAttribute(RefreshProperties.All)]          [RefreshPropertiesAttribute(RefreshProperties.All)]

Legend:
Removed from v.197  
changed lines
  Added in v.198

  ViewVC Help
Powered by ViewVC 1.1.22