Exemple #1
0
        static void SettingLight <T>() where T : SettingLightDirect
        {
            List <PropertyAdditionalAttributes> list = new List <PropertyAdditionalAttributes>();

            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "LightPosition",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-10, 10, 0.1)
                }
            });
            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "SpotDirection",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-10, 10, 0.1)
                }
            });

            PropertyAttributesTypeDescriptionProvider provider = new PropertyAttributesTypeDescriptionProvider(
                typeof(T), list.ToArray());

            TypeDescriptor.AddProvider(provider, typeof(T));
        }
Exemple #2
0
        static void SettingTexture()
        {
            List <PropertyAdditionalAttributes> list = new List <PropertyAdditionalAttributes>();

            foreach (var item in "STR")
            {
                list.Add(new PropertyAdditionalAttributes
                {
                    PropertyName = "Plane" + item,
                    PropertyType = typeof(Plane),
                    Attributes   = new Attribute[] {
                        new EditorAttribute(typeof(PlaneEditor), typeof(UITypeEditor)),
                        new RangeAttribute(-10, 10, 0.1)
                    }
                });
            }

            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "Transform",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-10, 10, 0.1)
                }
            });
            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "Rotation",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-10, 10, 0.1)
                }
            });
            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "Scale",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-10, 10, 0.1)
                }
            });

            PropertyAttributesTypeDescriptionProvider provider = new PropertyAttributesTypeDescriptionProvider(
                typeof(SettingTexture), list.ToArray());

            TypeDescriptor.AddProvider(provider, typeof(SettingTexture));
        }
Exemple #3
0
        static void DisplaySetting()
        {
            List <PropertyAdditionalAttributes> list = new List <PropertyAdditionalAttributes>();

            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "Alpha",
                PropertyType = typeof(int),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(NumericScrollBarEditor), typeof(UITypeEditor)),
                    new RangeAttribute(0, 255, 1)
                }
            });

            PropertyAttributesTypeDescriptionProvider provider = new PropertyAttributesTypeDescriptionProvider(
                typeof(DisplaySetting), list.ToArray());

            TypeDescriptor.AddProvider(provider, typeof(DisplaySetting));
        }
Exemple #4
0
        static void SettingClipPlane()
        {
            List <PropertyAdditionalAttributes> list = new List <PropertyAdditionalAttributes>();

            for (int i = 0; i < 6; i++)
            {
                list.Add(new PropertyAdditionalAttributes
                {
                    PropertyName = "Plane" + i,
                    PropertyType = typeof(Plane),
                    Attributes   = new Attribute[] {
                        new EditorAttribute(typeof(PlaneEditor), typeof(UITypeEditor)),
                        new RangeAttribute(-2.5, 2.5, 0.005)
                    }
                });
            }

            PropertyAttributesTypeDescriptionProvider provider = new PropertyAttributesTypeDescriptionProvider(
                typeof(SettingClipPlane), list.ToArray());

            TypeDescriptor.AddProvider(provider, typeof(SettingClipPlane));
        }
Exemple #5
0
        static void SettingTransform()
        {
            List <PropertyAdditionalAttributes> list = new List <PropertyAdditionalAttributes>();



            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "RotationAxis",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-360, 360, 0.01)
                }
            });

            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "ModelTranslate",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-1, 1, 0.001)
                }
            });


            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "ModelRotation",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-360, 360, 0.1)
                }
            });


            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "ModelScale",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-2, 2, 0.001)
                }
            });

            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "ModelShearing",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-2, 2, 0.01)
                }
            });
            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "ModelMirror",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(0, 3, 0.1)
                }
            });
            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "EyePos",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-10, 10, 0.01)
                }
            });

            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "EyeDirection",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-360, 360, 0.1)
                }
            });


            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "Quaternion",
                PropertyType = typeof(Vector3D),
                Attributes   = new Attribute[] {
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-360, 360, 0.1)
                }
            });



            PropertyAttributesTypeDescriptionProvider provider = new PropertyAttributesTypeDescriptionProvider(
                typeof(SettingTransform), list.ToArray());

            TypeDescriptor.AddProvider(provider, typeof(SettingTransform));
        }
        static void SettingTransform()
        {
            List<PropertyAdditionalAttributes> list = new List<PropertyAdditionalAttributes>();
            

          
            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "RotationAxis",
                PropertyType = typeof(Vector3D),
                Attributes = new Attribute[]{
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-360, 360, 0.01)}
            });

            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "ModelTranslate",
                PropertyType = typeof(Vector3D),
                Attributes = new Attribute[]{
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-1, 1, 0.001)}
            });


            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "ModelRotation",
                PropertyType = typeof(Vector3D),
                Attributes = new Attribute[]{
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-360, 360, 0.1)}
            });


            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "ModelScale",
                PropertyType = typeof(Vector3D),
                Attributes = new Attribute[]{
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-2, 2, 0.001)}
            });

            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "ModelShearing",
                PropertyType = typeof(Vector3D),
                Attributes = new Attribute[]{
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-2, 2, 0.01)}
            });
            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "ModelMirror",
                PropertyType = typeof(Vector3D),
                Attributes = new Attribute[]{
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(0, 3, 0.1)}
            });
            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "EyePos",
                PropertyType = typeof(Vector3D),
                Attributes = new Attribute[]{
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-10, 10, 0.01)}
            });

            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "EyeDirection",
                PropertyType = typeof(Vector3D),
                Attributes = new Attribute[]{
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-360, 360, 0.1)}
            });


            list.Add(new PropertyAdditionalAttributes
            {
                PropertyName = "Quaternion",
                PropertyType = typeof(Vector3D),
                Attributes = new Attribute[]{
                    new EditorAttribute(typeof(VectorEditor), typeof(UITypeEditor)),
                    new RangeAttribute(-360, 360, 0.1)}
            });
 
 
 
            

            PropertyAttributesTypeDescriptionProvider provider = new PropertyAttributesTypeDescriptionProvider(
                typeof(SettingTransform), list.ToArray());
            TypeDescriptor.AddProvider(provider, typeof(SettingTransform));
        }