public SetEvaluator ( IEvaluator newEvaluator ) : void | ||
newEvaluator | IEvaluator | |
리턴 | void |
void OpenProject(string filename) { if (!stopped) { Stop(); } NBTag taskData = NBTag.ReadFile(filename); State = new TaskState(taskData); BackColor = State.ProjectOptions.BackColor; if (filename.EndsWith(".autosave.sie")) { State.ProjectFileName = filename.Substring(0, filename.Length - 13); } else { State.ProjectFileName = filename; } Text = Path.GetFileName(State.ProjectFileName) + " | SuperImageEvolver"; nVertices.Value = State.Vertices; nPolygons.Value = State.Shapes; SetImage(State.OriginalImage); if (taskData.Contains("Presentation")) { NBTag presentationTag = taskData["Presentation"]; picOriginal.Visible = presentationTag.GetBool("OriginalVisible", picOriginal.Visible); OriginalZoom = presentationTag.GetFloat("OriginalZoom", OriginalZoom); picBestMatch.Visible = presentationTag.GetBool("BestMatchVisible", picBestMatch.Visible); picBestMatch.Zoom = presentationTag.GetFloat("BestMatchZoom", picBestMatch.Zoom); picBestMatch.Wireframe = presentationTag.GetBool("BestMatchWireframe", picBestMatch.Wireframe); picBestMatch.ShowLastChange = presentationTag.GetBool("BestMatchShowLastChange", picBestMatch.ShowLastChange); picDiff.Visible = presentationTag.GetBool("DiffVisible", picDiff.Visible); picDiff.Invert = presentationTag.GetBool("DiffInvert", picDiff.Invert); picDiff.Exaggerate = presentationTag.GetBool("DiffExaggerate", picDiff.Exaggerate); picDiff.ShowColor = presentationTag.GetBool("DiffShowColor", picDiff.ShowColor); picDiff.Zoom = presentationTag.GetFloat("DiffZoom", picDiff.Zoom); picDiff.ShowLastChange = presentationTag.GetBool("DiffShowLastChange", picDiff.ShowLastChange); } State.SetEvaluator(State.Evaluator); UpdateTick(); picDiff.Invalidate(); picBestMatch.Invalidate(); State.HasChangedSinceSave = false; bStart.Enabled = true; bRestart.Enabled = true; bSaveProject.Enabled = true; bSaveProjectAs.Enabled = true; menuExport.Enabled = true; }
void CreateProject(string fileName) { Bitmap image = (Bitmap)Image.FromFile(fileName); State = new TaskState(); SetImage(image); Reset(); ResetUI(); State.SetEvaluator(State.Evaluator); UpdateTick(); picDiff.Invalidate(); picBestMatch.Invalidate(); bStart.Enabled = true; bRestart.Enabled = true; bSaveProject.Enabled = true; bSaveProjectAs.Enabled = true; menuExport.Enabled = true; }
void OpenProject(string filename) { if (!stopped) Stop(); NBTag taskData = NBTag.ReadFile(filename); State = new TaskState(taskData); BackColor = State.ProjectOptions.BackColor; if (filename.EndsWith(".autosave.sie")) { State.ProjectFileName = filename.Substring(0, filename.Length - 13); } else { State.ProjectFileName = filename; } Text = Path.GetFileName(State.ProjectFileName) + " | SuperImageEvolver"; nVertices.Value = State.Vertices; nPolygons.Value = State.Shapes; SetImage(State.OriginalImage); if (taskData.Contains("Presentation")) { NBTag presentationTag = taskData["Presentation"]; picOriginal.Visible = presentationTag.GetBool("OriginalVisible", picOriginal.Visible); OriginalZoom = presentationTag.GetFloat("OriginalZoom", OriginalZoom); picBestMatch.Visible = presentationTag.GetBool("BestMatchVisible", picBestMatch.Visible); picBestMatch.Zoom = presentationTag.GetFloat("BestMatchZoom", picBestMatch.Zoom); picBestMatch.Wireframe = presentationTag.GetBool("BestMatchWireframe", picBestMatch.Wireframe); picBestMatch.ShowLastChange = presentationTag.GetBool("BestMatchShowLastChange", picBestMatch.ShowLastChange); picDiff.Visible = presentationTag.GetBool("DiffVisible", picDiff.Visible); picDiff.Invert = presentationTag.GetBool("DiffInvert", picDiff.Invert); picDiff.Exaggerate = presentationTag.GetBool("DiffExaggerate", picDiff.Exaggerate); picDiff.ShowColor = presentationTag.GetBool("DiffShowColor", picDiff.ShowColor); picDiff.Zoom = presentationTag.GetFloat("DiffZoom", picDiff.Zoom); picDiff.ShowLastChange = presentationTag.GetBool("DiffShowLastChange", picDiff.ShowLastChange); } State.SetEvaluator(State.Evaluator); UpdateTick(); picDiff.Invalidate(); picBestMatch.Invalidate(); State.HasChangedSinceSave = false; bStart.Enabled = true; bRestart.Enabled = true; bSaveProject.Enabled = true; bSaveProjectAs.Enabled = true; menuExport.Enabled = true; }
void CreateProject(string fileName) { Bitmap image = (Bitmap)Image.FromFile(fileName); State = new TaskState(); SetImage(image); Reset(); ResetUI(); State.SetEvaluator(State.Evaluator); UpdateTick(); picDiff.Invalidate(); picBestMatch.Invalidate(); bStart.Enabled = true; bRestart.Enabled = true; bSaveProject.Enabled = true; bSaveProjectAs.Enabled = true; menuExport.Enabled = true; }
void Start(bool reset) { cInitializer.Enabled = false; nPolygons.Enabled = false; nVertices.Enabled = false; if (reset) { Reset(); } else { lastMutationCounter = State.MutationCounter; } State.SetEvaluator(State.Evaluator); stopped = false; for (int i = 0; i < threads.Length; i++) { threads[i] = new Thread(Run); threads[i].Start(); } updateThread = new Thread(UpdateStatus); updateThread.Start(); bStart.Enabled = false; bRestart.Enabled = true; bStop.Enabled = true; }