Beispiel #1
0
        public static Type TypeFromShape(ShapeWarp shape)
        {
            switch (shape)
            {
            case ShapeWarp.Cubic:
                return(typeof(Cubic));

            case ShapeWarp.Cylinder:
                return(typeof(Cylindrical));

            case ShapeWarp.Plane:
                return(typeof(Planar));

            case ShapeWarp.Sphere:
                return(typeof(Spherical));

            case ShapeWarp.Torus:
                return(typeof(Toroidal));

            case ShapeWarp.Default:
                return(null);

            default:
                return(null);
            }
        }
Beispiel #2
0
        public static Warp FromShape(ShapeWarp shape)
        {
            Type type = TypeFromShape(shape);

            if (type == null)
            {
                return(null);
            }
            else
            {
                return(Activator.CreateInstance(type) as Warp);
            }
        }