示例#1
0
 public InputController()
 {
     GenerationControler = new BuildingsGenerationController();
     ViewModel           = new BuildingsViewModel();
     //ViewModel.Grammar = new ViewModelGrammar();
     VisualizationController = new VisualizationController();
     ExportController        = new ExportController();
 }
示例#2
0
 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);
 }
示例#3
0
 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();
 }
示例#4
0
        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);
        }