private void ProcessBuildingPoints() { for (int i = 0; i < building.Count; i++) { if (CProjectData.backgroundWorker.CancellationPending) { return; } Vector3 point = building[i]; buildingArray.AddPointInField(point); } }
/// <summary> /// Assigns all vege points in preprocess arrays. /// Then it calculates the expected average tree height. /// </summary> private void PreprocessVegePoints() { const int debugFrequency = 10000; DateTime PreprocessVegePointsStart = DateTime.Now; CDebug.WriteLine("PreprocessVegePoints", true); DateTime preprocessVegePointsStart = DateTime.Now; DateTime previousDebugStart = DateTime.Now; for (int i = 0; i < vege.Count; i++) { if (CProjectData.backgroundWorker.CancellationPending) { return; } Vector3 point = vege[i]; preprocessDetailArray.AddPointInField(point); preprocessNormalArray.AddPointInField(point); CDebug.Progress(i, vege.Count, debugFrequency, ref previousDebugStart, preprocessVegePointsStart, "preprocessed point"); } //fill missing heigh - will be used in detection process //rank 2 - rank 1 (max) extends local maximas -> unwanted effect preprocessDetailArray.FillMissingHeights(2); preprocessDetailArray.FillMissingHeights(2); CDebug.Duration("PreprocessVegePoints", PreprocessVegePointsStart); //determine average tree height if (CParameterSetter.GetBoolSettings(ESettings.autoAverageTreeHeight)) { //not valid anymore //why not valid??...seems to work fine CTreeManager.AVERAGE_TREE_HEIGHT = preprocessNormalArray.GetAverageZ(); if (float.IsNaN(CTreeManager.AVERAGE_TREE_HEIGHT)) { CDebug.Error("AVERAGE_TREE_HEIGHT = NaN. using input value"); CTreeManager.AVERAGE_TREE_HEIGHT = CParameterSetter.GetIntSettings(ESettings.avgTreeHeigh); } } else { CTreeManager.AVERAGE_TREE_HEIGHT = CParameterSetter.GetIntSettings(ESettings.avgTreeHeigh); } }