Ejemplo n.º 1
0
        private void buttonCompute_Click(object sender, EventArgs e)
        {
            m_Probe.ComputeKMeans(
                integerTrackbarControlK.Value,
                floatTrackbarControlPosition.Value,
                floatTrackbarControlNormal.Value,
                floatTrackbarControlAlbedo.Value,
                floatTrackbarControlLambda.Value);

            //////////////////////////////////////////////////////////////////////////
            // Refresh UI
            textBoxResults.Text = m_Probe.m_Sets.Length + " sets generated:\r\n\r\n";
            for (int SetIndex = 0; SetIndex < m_Probe.m_Sets.Length; SetIndex++)
            {
                Probe.Set S = m_Probe.m_Sets[SetIndex];
                textBoxResults.Text += SetIndex + ") " + S.SetPixels.Count + " pixels (" + (100.0f * S.SetPixels.Count / m_Probe.m_ScenePixels.Count).ToString("G4") + "%)\r\n"
                                       + "Albedo = (" + S.Albedo.x.ToString("G4") + ", " + S.Albedo.y.ToString("G4") + ", " + S.Albedo.z.ToString("G4") + ")\r\n\r\n";
            }

            integerTrackbarControlSetIsolation.RangeMax        = m_Probe.m_Sets.Length - 1;
            integerTrackbarControlSetIsolation.VisibleRangeMax = integerTrackbarControlSetIsolation.RangeMax;

            saveResultsToolStripMenuItem.Enabled = m_Probe.m_Sets.Length > 0;
            outputPanel1.UpdateBitmap();
        }