Ejemplo n.º 1
0
        private Surfaces[] TranslateAndScale(Surfaces[] ElementSurfaces, double Min, double Max)
        {
            Surfaces.CalculateMinMax_Location(ElementSurfaces, out MinX, out MaxX);
            Vector Scale;

            GetScalingParameters(ref MinX, ref MaxX, out Scale);

            Surfaces[] ScaledSurfaces;
            if (ColorPlotOn)
            {
                double ValueScale;
                if (Math.Abs(Max - Min) > small)
                {
                    ValueScale = 1.0D / (Max - Min);
                }
                else if (Math.Abs(Max) > small)
                {
                    ValueScale = 1.0D / Max;
                }
                else
                {
                    ValueScale = 1.0D;
                }
                ScaledSurfaces = Surfaces.TranslateAndScale(ElementSurfaces, MinX, Scale, Min, ValueScale);
            }
            else
            {
                ScaledSurfaces = Surfaces.TranslateAndScale(ElementSurfaces, MinX, Scale);
            }
            return(ScaledSurfaces);
        }