Esempio n. 1
0
        private void LoadFile(string filename)
        {
            try
            {
                var building = Loader.Load(filename);
                _displayModel = Converter.Convert(building);
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Unable to load file: {filename}.\n error: {ex.Message}",
                                "Loading failed",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            var(minWorld, maxWorld) = DisplayModelQuery.GetModelBounds(_displayModel);
            _viewPort = new ViewPort(pbMain.Width, pbMain.Height, minWorld, maxWorld);

            _renderer = new Renderer(_displayModel, _viewPort);
        }
Esempio n. 2
0
 public Renderer(DisplayModel displayModel, ViewPort viewPort)
 {
     _displayModel = displayModel;
     _viewPort     = viewPort;
 }