public SequencePlayer(MovementSequenceController sequenceController, MusclePositionController musclePositionController) : base("Medical.GUI.SequencePlayer.SequencePlayer.layout") { this.sequenceController = sequenceController; sequenceMenu = new SequenceMenu(sequenceController); this.musclePositionController = musclePositionController; Button sequenceButton = window.findWidget("Sequence") as Button; sequenceButton.MouseButtonClick += new MyGUIEvent(sequenceButton_MouseButtonClick); playButton = window.findWidget("Play") as Button; playButton.MouseButtonClick += new MyGUIEvent(playButton_MouseButtonClick); stopButton = window.findWidget("Stop") as Button; stopButton.MouseButtonClick += new MyGUIEvent(stopButton_MouseButtonClick); nowPlaying = window.findWidget("NowPlaying") as EditBox; sequenceController.PlaybackStarted += new MovementSequenceEvent(sequenceController_PlaybackStarted); sequenceController.PlaybackStopped += new MovementSequenceEvent(sequenceController_PlaybackStopped); sequenceController.CurrentSequenceChanged += new MovementSequenceEvent(sequenceController_CurrentSequenceChanged); }
public void initializeControllers(BackgroundScene background, LicenseManager licenseManager) { //Background this.background = background; this.LicenseManager = licenseManager; atlasPluginManager = new AtlasPluginManager(this); atlasPluginManager.PluginLoadError += new Medical.AtlasPluginManager.PluginMessageDelegate(atlasPluginManager_PluginLoadError); atlasPluginManager.manageInstalledPlugins(); clipboard = new SaveableClipboard(); //Documents DocumentController = new DocumentController(); //MDI Layout mdiLayout = new MDILayoutManager(); //SceneView MyGUIInterface myGUI = MyGUIInterface.Instance; sceneViewController = new SceneViewController(mdiLayout, medicalController.EventManager, medicalController.MainTimer, medicalController.PluginManager.RendererPlugin.PrimaryWindow, myGUI.OgrePlatform.RenderManager, background); sceneViewController.WindowCreated += sceneViewController_WindowCreated; sceneViewController.WindowDestroyed += sceneViewController_WindowDestroyed; sceneViewController.DefaultBackgroundColor = new Color(0.274f, 0.274f, 0.274f); sceneStatsDisplayManager = new SceneStatsDisplayManager(sceneViewController, OgreInterface.Instance.OgrePrimaryWindow.OgreRenderTarget); sceneStatsDisplayManager.StatsVisible = MedicalConfig.EngineConfig.ShowStatistics; MedicalConfig.EngineConfig.ShowStatsToggled += engineConfig => sceneStatsDisplayManager.StatsVisible = engineConfig.ShowStatistics; lightManager = PluginManager.Instance.RendererPlugin.createSceneViewLightManager(); //Measurement grid measurementGrid = new MeasurementGrid("MeasurementGrid", sceneViewController); SceneUnloading += measurementGrid.sceneUnloading; SceneLoaded += measurementGrid.sceneLoaded; //Image Renderer imageRenderer = new ImageRenderer(medicalController, sceneViewController, idleHandler); imageRenderer.Background = background; imageRenderer.ImageRenderStarted += measurementGrid.ScreenshotRenderStarted; imageRenderer.ImageRenderCompleted += measurementGrid.ScreenshotRenderCompleted; //Anatomy Controller anatomyController = new AnatomyController(); //Medical states medicalStateController = new MedicalStateController(imageRenderer, medicalController); SceneLoaded += medicalStateController.sceneLoaded; SceneUnloading += medicalStateController.sceneUnloading; //Movement sequences movementSequenceController = new MovementSequenceController(medicalController); this.SceneLoaded += movementSequenceController.sceneLoaded; musclePositionController = new MusclePositionController(medicalController.MainTimer, this); SceneLoaded += SleepyActorRepository.SceneLoaded; SceneUnloading += SleepyActorRepository.SceneUnloading; //Props propFactory = new PropFactory(this); //Timeline timelineController = new TimelineController(this); viewHostFactory = new MyGUIViewHostFactory(mdiLayout); mvcCore = new AnomalousMvcCore(this, viewHostFactory); //Patient data patientDataController = new PatientDataController(this); //Tasks taskController = new TaskController(); anatomyTaskManager = new AnatomyTaskManager(taskController, guiManager); //Coroutine Coroutine.SetTimer(medicalController.MainTimer); //Notifications notificationManager = new NotificationGUIManager(); layerController = new LayerController(); //Create virtual texture manager virtualTextureSceneViewLink = new VirtualTextureSceneViewLink(this); }