Exemple #1
0
        public void Initialize(FlowSimulation.Enviroment.Map map, Dictionary <string, object> settings)
        {
            _map = map;
            if (settings.ContainsKey("path"))
            {
                _modelPath = (string)settings["path"];
            }
            if (settings.ContainsKey("transparent"))
            {
                _useTransparensy = (bool)settings["transparent"];
            }

            var model = LoadModel(_modelPath);

            if (model != null)
            {
                Background           = model;
                Background.Transform = ReadTransformation(settings);
                CreateTopografy();
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("Не удалось найти файл 3D модели");
                if (_map != null && _map.Count > 0)
                {
                    BitmapImage bi = Helpers.Imaging.ImageManager.BitmapToBitmapImage(_map[0].Substrate);
                    Background = CreateMockModel(bi, _map[0].Width, _map[0].Height);
                    CreateTopografy(true);
                }
            }

            OnPropertyChanged("Background");
        }
Exemple #2
0
 public void Initialize(FlowSimulation.Enviroment.Map map, Dictionary <string, object> settings)
 {
     Layers = map;
     if (Layers.Count > 0)
     {
         SelectedLayer = Layers.First();
     }
     ShowSubstrate = true;
 }
        public void Initialize(FlowSimulation.Enviroment.Map map, Dictionary<string, object> settings)
        {
            _map = map;
            if (settings.ContainsKey("path"))
            {
                _modelPath = (string)settings["path"];
            }
            if (settings.ContainsKey("transparent"))
            {
                _useTransparensy = (bool)settings["transparent"];
            }

            var model = LoadModel(_modelPath);

            if (model != null)
            {
                Background = model;
                Background.Transform = ReadTransformation(settings);
                CreateTopografy();
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("Не удалось найти файл 3D модели");
                if (_map != null && _map.Count > 0)
                {
                    BitmapImage bi = Helpers.Imaging.ImageManager.BitmapToBitmapImage(_map[0].Substrate);
                    Background = CreateMockModel(bi, _map[0].Width, _map[0].Height);
                    CreateTopografy(true);
                }
            }

            OnPropertyChanged("Background");
        }