Beispiel #1
0
        private void integerTrackbarControlTargetPosition_ValueChanged(IntegerTrackbarControl _Sender, int _FormerValue)
        {
            bool simulable = integerTrackbarControlStartPosition.Value != integerTrackbarControlTargetPosition.Value;

            buttonStepSimulation.Enabled = simulable;
            buttonRunSimulation.Enabled  = simulable;
        }
Beispiel #2
0
 private void integerTrackbarControlSHCoeffsCount_ValueChanged(IntegerTrackbarControl _Sender, int _FormerValue)
 {
     integerTrackbarControlm.RangeMin        = -integerTrackbarControlSHCoeffsCount.Value;
     integerTrackbarControlm.RangeMax        = integerTrackbarControlSHCoeffsCount.Value;
     integerTrackbarControlm.VisibleRangeMin = -integerTrackbarControlSHCoeffsCount.Value;
     integerTrackbarControlm.VisibleRangeMax = integerTrackbarControlSHCoeffsCount.Value;
 }
Beispiel #3
0
 private void integerTrackbarControlSimulationSourceIndex_ValueChanged(IntegerTrackbarControl _Sender, int _formerValue)
 {
     if (_formerValue >= 0 && _formerValue <= integerTrackbarControlSimulationSourceIndex.RangeMax)
     {
         DownloadHeatMap(_formerValue);                          // Download previous results first
     }
     UploadHeatMap(integerTrackbarControlSimulationSourceIndex.Value);
 }
Beispiel #4
0
        private void integerTrackbarControlNeighborsCount_ValueChanged(IntegerTrackbarControl _Sender, int _FormerValue)
        {
            int NeighborsCount = integerTrackbarControlNeighborsCount.Value;

            if (m_SB_Neighbors != null)
            {
                m_SB_Neighbors.Dispose();
            }
            m_SB_Neighbors = new StructuredBuffer <SB_Neighbor>(m_Device, (uint)NeighborsCount, true, false);

            float3[] directions = null;
            if (radioButtonHammersley.Checked)
            {
                double[,]       samples = m_hammersley.BuildSequence(NeighborsCount, 2);
                directions = m_hammersley.MapSequenceToSphere(samples);
            }
            else
            {
                Random TempRNG = new Random();
                directions = new float3[NeighborsCount];
                for (int i = 0; i < NeighborsCount; i++)
                {
                    directions[i] = new float3(2.0f * (float)TempRNG.NextDouble() - 1.0f, 2.0f * (float)TempRNG.NextDouble() - 1.0f, 2.0f * (float)TempRNG.NextDouble() - 1.0f);
                    directions[i].Normalize();
                }
            }

            Random RNG = new Random(1);

            m_neighborPositions = new float3[NeighborsCount];
            m_NeighborColors    = new float3[NeighborsCount];
            for (int NeighborIndex = 0; NeighborIndex < NeighborsCount; NeighborIndex++)
            {
                float Radius = 2.0f;                    // Make that random!
                m_neighborPositions[NeighborIndex] = Radius * new float3(directions[NeighborIndex].x, directions[NeighborIndex].y, directions[NeighborIndex].z);

                float R = (float)RNG.NextDouble();
                float G = (float)RNG.NextDouble();
                float B = (float)RNG.NextDouble();
                m_NeighborColors[NeighborIndex] = new float3(R, G, B);

                m_SB_Neighbors.m[NeighborIndex].m_Position = m_neighborPositions[NeighborIndex];
                m_SB_Neighbors.m[NeighborIndex].m_Color    = m_NeighborColors[NeighborIndex];
            }

            m_SB_Neighbors.Write();             // Upload

            // Build initial cell
            buttonBuildCell_Click(this, EventArgs.Empty);
        }
Beispiel #5
0
        private void integerTrackbarControlNeighborsCount_ValueChanged(IntegerTrackbarControl _Sender, int _FormerValue)
        {
            int NeighborsCount = integerTrackbarControlNeighborsCount.Value;

            if (m_SB_Neighbors != null)
            {
                m_SB_Neighbors.Dispose();
            }
            m_SB_Neighbors = new StructuredBuffer <SB_Neighbor>(m_Device, NeighborsCount, true);

            WMath.Vector[] Directions = null;
            if (radioButtonHammersley.Checked)
            {
                double[,]               Samples = m_Hammersley.BuildSequence(NeighborsCount, 2);
                Directions = m_Hammersley.MapSequenceToSphere(Samples);
            }
            else
            {
                Random TempRNG = new Random();
                Directions = new WMath.Vector[NeighborsCount];
                for (int i = 0; i < NeighborsCount; i++)
                {
                    Directions[i] = new WMath.Vector(2.0f * (float)TempRNG.NextDouble() - 1.0f, 2.0f * (float)TempRNG.NextDouble() - 1.0f, 2.0f * (float)TempRNG.NextDouble() - 1.0f);
                    Directions[i].Normalize();
                }
            }

            Random RNG = new Random(1);

            m_NeighborPositions = new float3[NeighborsCount];
            m_NeighborColors    = new float3[NeighborsCount];
            for (int NeighborIndex = 0; NeighborIndex < NeighborsCount; NeighborIndex++)
            {
                float Radius = 2.0f;                    // Make that random!
                m_NeighborPositions[NeighborIndex] = Radius * new float3(Directions[NeighborIndex].x, Directions[NeighborIndex].y, Directions[NeighborIndex].z);

                float R = (float)RNG.NextDouble();
                float G = (float)RNG.NextDouble();
                float B = (float)RNG.NextDouble();
                m_NeighborColors[NeighborIndex] = new float3(R, G, B);

                m_SB_Neighbors.m[NeighborIndex].m_Position = m_NeighborPositions[NeighborIndex];
                m_SB_Neighbors.m[NeighborIndex].m_Color    = m_NeighborColors[NeighborIndex];
            }

            m_SB_Neighbors.Write();             // Upload
        }
Beispiel #6
0
 private void integerTrackbarControlVertex_ValueChanged(IntegerTrackbarControl _Sender, int _FormerValue)
 {
     UpdateVertexInfos();
 }
Beispiel #7
0
 private void integerTrackbarControlLine_ValueChanged(IntegerTrackbarControl _Sender, int _FormerValue)
 {
     UpdateLineInfos();
 }