コード例 #1
0
        public SimElementManager createSimElementManager()
        {
            SimulationScene scene = new SimulationScene(name);

            scene.PresetDirectory   = presetDirectory;
            scene.SequenceDirectory = sequenceDirectory;
            scene.WindowPresets     = CopySaver.Default.copy(windowPresets);
            scene.AllowIK           = AllowIK;
            return(scene);
        }
コード例 #2
0
        internal IEnumerable <SceneBuildStatus> changeSceneStatus(String file, ResourceProvider resourceProvider)
        {
            Stopwatch sw = new Stopwatch();

            sw.Start();
            sceneViewController.resetAllCameraPositions();
            unloadScene();
            SimObjectErrorManager.Clear();

            foreach (var status in medicalController.openScene(file, resourceProvider))
            {
                yield return(status);
            }

            SimSubScene defaultScene = medicalController.CurrentScene.getDefaultSubScene();

            if (BeforeSceneLoadProperties != null)
            {
                BeforeSceneLoadProperties.Invoke(medicalController.CurrentScene);
            }
            if (defaultScene != null)
            {
                OgreSceneManager ogreScene = defaultScene.getSimElementManager <OgreSceneManager>();

                SimulationScene medicalScene = defaultScene.getSimElementManager <SimulationScene>();
                sceneViewController.createFromPresets(medicalScene.WindowPresets.Default, false);

                sceneViewController.createCameras(medicalController.CurrentScene);
                lightManager.sceneLoaded(medicalController.CurrentScene);

                if (SceneLoaded != null)
                {
                    SceneLoaded.Invoke(medicalController.CurrentScene);
                }

                anatomyController.sceneLoaded();
            }

            if (SimObjectErrorManager.HasErrors)
            {
                NotificationManager.showCallbackNotification("Errors loading the scene.\nClick for details.", MessageBoxIcons.Error, showLoadErrorGui);
            }

            sw.Stop();
            Logging.Log.Debug("Scene '{0}' loaded in {1} ms", file, sw.ElapsedMilliseconds);
        }
コード例 #3
0
        public void sceneLoaded(SimScene scene)
        {
            destroyMenu();

            SimulationScene simScene = scene.getDefaultSubScene().getSimElementManager <SimulationScene>();

            presetWindows = simScene.WindowPresets;

            windowMenu         = Gui.Instance.createWidgetT("PopupMenu", "PopupMenu", 0, 0, 1000, 1000, Align.Default, "Overlapped", "LayerMenu") as PopupMenu;
            windowMenu.Visible = false;
            foreach (SceneViewWindowPresetSet preset in presetWindows.PresetSets)
            {
                MenuItem item = windowMenu.addItem(preset.Name, MenuItemType.Normal);
                item.UserObject        = preset.Name;
                item.MouseButtonClick += item_MouseButtonClick;
            }
            windowMenu.Closed += new MyGUIEvent(windowMenu_Closed);
        }