Ejemplo n.º 1
0
        public static ViewerConfig LoadFromModels(ModelsEx models, Components c)
        {
            var res = new ViewerConfig();

            if (c.HasFlag(Components.Images))
            {
                res.Images = ImagesConfig.LoadFromModels(models);
            }

            if (c.HasFlag(Components.Equations))
            {
                res.Equation = EquationConfig.LoadFromModels(models);
            }

            if (c.HasFlag(Components.Filter))
            {
                res.Filter = FilterConfig.LoadFromModels(models);
            }

            if (c.HasFlag(Components.Display))
            {
                res.Display = DisplayConfig.LoadFromModels(models);
            }

            if (c.HasFlag(Components.Export))
            {
                res.Export = ExportConfig.LoadFromModels(models);
            }

            return(res);
        }
Ejemplo n.º 2
0
        public static EquationConfig LoadFromModels(ModelsEx models)
        {
            var res = new EquationConfig();

            foreach (var pipe in models.Pipelines)
            {
                res.Equations.Add(new Equation
                {
                    IsEnabled    = pipe.IsEnabled,
                    ColorFormula = pipe.Color.Formula,
                    AlphaFormula = pipe.Alpha.Formula,
                    GenMipmaps   = pipe.RecomputeMipmaps,
                    UseFilter    = pipe.UseFilter
                });
            }
            return(res);
        }