Exemplo n.º 1
0
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService edSvc =
                (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (edSvc == null)
            {
                return(value);
            }

            pd        = context.PropertyDescriptor;
            component = context.Instance;
            Matrix rot   = (Matrix)value;
            Euler  euler = Euler.FromMatrix(rot);

            using (EulerEditor ctrol = new EulerEditor(euler))
            {
                ctrol.EulerChanged += ctrol_EulerChanged;
                edSvc.DropDownControl(ctrol);
                return(ctrol.Orientation.ToMatrix());
            }
        }
Exemplo n.º 2
0
 public static Euler GetEulerAngles(this IRotable o)
 {
     return(Euler.FromMatrix(o.LocalRotation));
 }