Exemplo n.º 1
0
        void loadAndPrepareData(string filePath)
        {
            if (task.Make(filePath))
            {
                calculateGridArrays(xSplit, ySplit);

                if (xPoints[xPoints.Length - 1] - xPoints[0] < yPoints[yPoints.Length - 1] - yPoints[0])
                {
                    if (OpenGLForm.ActualWidth < OpenGLForm.ActualHeight)
                    {
                        scaleX = OpenGLForm.ActualWidth / (xPoints[xPoints.Length - 1] - xPoints[0]);
                        scaleY = scaleX;
                    }
                    else
                    {
                        scaleX = OpenGLForm.ActualHeight / (xPoints[xPoints.Length - 1] - xPoints[0]);
                        scaleY = scaleX;
                    }
                }
                else
                {
                    if (OpenGLForm.Width < OpenGLForm.Height)
                    {
                        scaleX = OpenGLForm.ActualWidth / (yPoints[yPoints.Length - 1] - yPoints[0]);
                        scaleY = scaleX;
                    }
                    else
                    {
                        scaleX = OpenGLForm.ActualHeight / (yPoints[yPoints.Length - 1] - yPoints[0]);
                        scaleY = scaleX;
                    }
                }
                translateX = xPoints[0];
                translateY = yPoints[0];
            }
        }