ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/gr2lib/trunk/gr2lib/core/coretypes/implementation/Bone.cs
(Generate patch)

Comparing trunk/gr2lib/core/coretypes/implementation/Bone.cs (file contents):
Revision 197 by william, Thu Jul 29 07:47:26 2010 UTC vs.
Revision 198 by william, Thu Jul 29 08:12:27 2010 UTC

# Line 16 | Line 16 | namespace gr2lib.core.coretypes.implemen
16      /// </summary>
17      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>
31          /// Gets the string representation of this instance
32          /// </summary>
# Line 51 | Line 62 | namespace gr2lib.core.coretypes.implemen
62          {
63              try
64              {
65 <            if (pointer == IntPtr.Zero) return null;
66 <            native.Bone native = Helpers.ReadFromMemory<native.Bone>(pointer);
67 <            Bone managed = Bone.ReadFromNative(native);
68 <            managed.NativePointer = pointer;
69 <            return managed;
65 >                if (pointer == IntPtr.Zero) return null;
66 >                native.Bone native = Helpers.ReadFromMemory<native.Bone>(pointer);
67 >                Bone managed = Bone.ReadFromNative(native);
68 >                managed.NativePointer = pointer;
69 >                return managed;
70              }
71              catch (Exception ex)
72              {
73                  StackTrace st = new StackTrace(true);
74   #if  ENABLE_EXCEPTION_OUTPUT_TO_CONSOLE
75 <                Granny2ExceptionWriter.WriteToConsole(ex,st);
75 >                Granny2ExceptionWriter.WriteToConsole(ex, st);
76   #endif
77                  return default(Bone);
78              }
# Line 71 | Line 82 | namespace gr2lib.core.coretypes.implemen
82          {
83              try
84              {
85 <            Bone managed = new Bone();
86 <            managed.BoneName = string.IsNullOrEmpty(native.Name) ? "{null}" : native.Name;
87 <            managed.ParentIndex = native.ParentIndex;
88 <            managed.Transform = Transform.ReadFromNative(native.Transform);
89 <            //managed.InverseWorldTransformNode.Matrix = new Geom.Matrix44(native.InverseWorldTransform);
90 <            //managed.InverseWorldTransform = managed.Transform.Matrix;
91 <            managed.LodError = native.LodError;
92 <            managed.LightInfo = LightInfo.ReadFromMemory(native.LightInfo);
93 <            managed.CameraInfo = CameraInfo.ReadFromMemory(native.CameraInfo);
94 <            //managed.ExtendedData = native.ExtendedData;
85 >                Bone managed = new Bone();
86 >                managed.BoneName = string.IsNullOrEmpty(native.Name) ? "{null}" : native.Name;
87 >                managed.ParentIndex = native.ParentIndex;
88 >                managed.Transform = Transform.ReadFromNative(native.Transform);
89 >                //managed.InverseWorldTransformNode.Matrix = new Geom.Matrix44(native.InverseWorldTransform);
90 >                //managed.InverseWorldTransform = managed.Transform.Matrix;
91 >                managed.LodError = native.LodError;
92 >                managed.LightInfo = LightInfo.ReadFromMemory(native.LightInfo);
93 >                managed.CameraInfo = CameraInfo.ReadFromMemory(native.CameraInfo);
94 >                //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;
102 >                return managed;
103              }
104              catch (Exception ex)
105              {
106                  StackTrace st = new StackTrace(true);
107   #if  ENABLE_EXCEPTION_OUTPUT_TO_CONSOLE
108 <                Granny2ExceptionWriter.WriteToConsole(ex,st);
108 >                Granny2ExceptionWriter.WriteToConsole(ex, st);
109   #endif
110                  return default(Bone);
111              }
# Line 146 | Line 163 | namespace gr2lib.core.coretypes.implemen
163  
164  
165  
166 <         private GrannyBonePropertyData _BonePropertyData;
167 <         /// <summary>
168 <         /// Extra Bone Property Data, Not Used by Granny2
169 <         /// </summary>
166 >        private GrannyBonePropertyData _BonePropertyData;
167 >        /// <summary>
168 >        /// Extra Bone Property Data, Not Used by Granny2
169 >        /// </summary>
170          [RefreshPropertiesAttribute(RefreshProperties.All)]
171          public GrannyBonePropertyData BonePropertyData { get { return _BonePropertyData; } set { _BonePropertyData = value; } }
172          #endregion
# Line 173 | Line 190 | namespace gr2lib.core.coretypes.implemen
190          #region IResource Members
191          private int _index;
192          [RefreshPropertiesAttribute(RefreshProperties.All)]
193 <        internal int Index { get { return _index; } set { _index = value; } }
193 >        public int Index { get { return _index; } set { _index = value; } }
194          #endregion
195          #region IEmbeddedResource Members
196          [RefreshPropertiesAttribute(RefreshProperties.All)]

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines