public InputController() { GenerationControler = new BuildingsGenerationController(); ViewModel = new BuildingsViewModel(); //ViewModel.Grammar = new ViewModelGrammar(); VisualizationController = new VisualizationController(); ExportController = new ExportController(); }
public bool RequestExport(string filepath) { if (m_latestModel != null) { var exportResult = ExportController.ExportInFile(m_latestModel, new FileExportParameters { FilePath = filepath, ModelFormat = ExportParameters.FormatFromFilePath(filepath) }); return(exportResult); } return(false); }
public void RequestGenerate() { VisualizationController.OpenVisualizers(); m_latestModel = GenerationControler.Generate(ViewModel); LatestModelTemporaryFileFormat = ModelFormat.OBJ; m_latestModelTemporaryfile?.Dispose(); ExportController.ExportInStream(m_latestModel, new ExportParameters { ModelFormat = LatestModelTemporaryFileFormat }, out m_latestModelTemporaryfile); RequestVisualize(); }
public async Task <DateTime> RequestGenerateAsync(Dispatcher uiDispatcher) { m_latestModel = await GenerationControler.GenerateAsync(ViewModel, uiDispatcher); var generationEndTimestamp = DateTime.Now; VisualizationController.OpenVisualizers(); LatestModelTemporaryFileFormat = ModelFormat.OBJ; Task.Run(() => m_latestModelTemporaryfile?.Dispose()); await Task.Run(() => { ExportController.ExportInStream(m_latestModel, new ExportParameters { ModelFormat = LatestModelTemporaryFileFormat }, out m_latestModelTemporaryfile); RequestVisualize(); }); return(generationEndTimestamp); }