private void ProcessContoursMultiThreaded(FullWrist fullWrist, int refBoneIndex, int testBoneIndex, int[] posList) { Queue <Queue <BulkCalculator.DistanceCalculationJob> > q; q = BuildMasterQueue(fullWrist, refBoneIndex, testBoneIndex, posList, _cDistances); //go compute this! BulkCalculator calculator = new BulkCalculator(); calculator.ProcessMasterQueue(q); }
public override void calculateDistanceMapsToolClickedHandler() { //setup the dialog window DistanceAndContourDialog dialog = new DistanceAndContourDialog(_fullWrist.ContourDistances); dialog.ColorMapMaxDistance = _fullWrist.ColorMapDistance; dialog.setContourColors(_fullWrist.ContourColors); dialog.CalculateColorMap = _fullWrist.ShowColorMap; dialog.CalculateContours = _fullWrist.ShowContours; //show the dialog window DialogResult r = dialog.ShowDialog(); if (r != DialogResult.OK) { return; } double colorDistance = -1; double[] contourDistances = new double[0]; if (dialog.CalculateColorMap) { colorDistance = dialog.ColorMapMaxDistance; } if (dialog.CalculateContours) { contourDistances = dialog.getContourDistancesToCalculate(); } //get the queue to calculate stuff Queue <Queue <BulkCalculator.DistanceCalculationJob> > q = _fullWrist.CreateDistanceMapMasterQueue(colorDistance, contourDistances, dialog.getContourColorsToCalculate()); //go compute this! _calculator.ProcessMasterQueue(q); //update on screen now to current settings _fullWrist.ShowColorMap = dialog.CalculateColorMap; _fullWrist.ShowContours = dialog.CalculateContours; _fullWrist.UpdateColorsAndContoursForCurrentPosition(); }