public AdvancedMandibleMovementDialog(MovementSequenceController movementSequenceController, MusclePositionController musclePositionController)
            : base("Developer.GUI.AdvancedMandibleMovement.AdvancedMandibleMovementDialog.layout")
        {
            this.musclePositionController = musclePositionController;

            openTrackBar             = new AdvancedMandibleControlSlider(window.findWidget("Movement/HingeSlider") as ScrollBar, (EditBox)window.findWidget("HingeEdit"));
            openTrackBar.Minimum     = -3;
            openTrackBar.Maximum     = 10;
            rightForwardBack         = new AdvancedMandibleControlSlider(window.findWidget("Movement/ExcursionRightSlider") as ScrollBar, (EditBox)window.findWidget("ExcursionRightEdit"));
            rightForwardBack.Minimum = 0;
            rightForwardBack.Maximum = 1;
            leftForwardBack          = new AdvancedMandibleControlSlider(window.findWidget("Movement/ExcursionLeftSlider") as ScrollBar, (EditBox)window.findWidget("ExcursionLeftEdit"));
            leftForwardBack.Minimum  = 0;
            leftForwardBack.Maximum  = 1;
            bothForwardBack          = new AdvancedMandibleControlSlider(window.findWidget("Movement/ProtrusionSlider") as ScrollBar, (EditBox)window.findWidget("ProtrusionEdit"));
            bothForwardBack.Minimum  = 0;
            bothForwardBack.Maximum  = 1;
            forceSlider           = new AdvancedMandibleControlSlider(window.findWidget("Movement/ForceSlider") as ScrollBar, (EditBox)window.findWidget("ForceEdit"));
            forceSlider.Minimum   = 0;
            forceSlider.Maximum   = 100;
            resetButton           = window.findWidget("Movement/Reset") as Button;
            restoreButton         = window.findWidget("Movement/Restore") as Button;
            restoreButton.Enabled = false;

            openTrackBar.ValueChanged      += openTrackBar_ValueChanged;
            rightForwardBack.ValueChanged  += rightSliderValueChanged;
            leftForwardBack.ValueChanged   += leftSliderValueChanged;
            bothForwardBack.ValueChanged   += bothForwardBackChanged;
            forceSlider.ValueChanged       += forceSlider_ValueChanged;
            resetButton.MouseButtonClick   += resetButton_Click;
            restoreButton.MouseButtonClick += restoreButton_Click;

            movementSequenceController.PlaybackStarted += new MovementSequenceEvent(movementSequenceController_PlaybackStarted);
            movementSequenceController.PlaybackStopped += new MovementSequenceEvent(movementSequenceController_PlaybackStopped);
        }
Exemplo n.º 2
0
        public void unload(StandaloneController standaloneController, bool willReload, bool shuttingDown)
        {
            //Unload sequences
            if (loadedSequences != null)
            {
                MovementSequenceController movementSequenceController = standaloneController.MovementSequenceController;
                foreach (var info in loadedSequences)
                {
                    movementSequenceController.removeMovementSequence(info.GroupName, info);
                }
            }

            //Also need to unload icon resources, this isn't the best way, but unload by removing the branding image key and all task icons manually (done in task unload).
            ResourceManager.Instance.destroyAllTexturesForResource(BrandingImageKey);
            ResourceManager.Instance.removeByName(BrandingImageKey);

            if (!shuttingDown)
            {
                AnatomyTaskManager anatomyTasks = standaloneController.AnatomyTaskManager;
                foreach (DDPluginTask task in tasks)
                {
                    anatomyTasks.removeTask(task, willReload, task.TaggedAnatomy);
                    ResourceManager.Instance.destroyAllTexturesForResource(task.IconName);
                    ResourceManager.Instance.removeByName(task.IconName);
                }
            }
        }
        public MovementSequenceRecorder(MedicalController medicalController, MovementSequenceController movementSequenceController)
            : base("KinectPlugin.GUI.MovementSequenceRecorder.layout")
        {
            this.medicalController          = medicalController;
            this.movementSequenceController = movementSequenceController;

            record = new CheckButton((Button)window.findWidget("Record"));
            record.CheckedChanged += record_CheckedChanged;

            play = new CheckButton((Button)window.findWidget("Play"));
            play.CheckedChanged += play_CheckedChanged;
            play.Enabled         = false;

            save = (Button)window.findWidget("Save");
            save.MouseButtonClick += save_MouseButtonClick;
            save.Enabled           = false;

            clear = (Button)window.findWidget("Clear");
            clear.MouseButtonClick += clear_MouseButtonClick;
            clear.Enabled           = false;

            captureRate          = new SingleNumericEdit((EditBox)window.findWidget("CaptureRate"));
            captureRate.MinValue = 1.0f;
            captureRate.MaxValue = 60.0f;
            captureRate.Value    = 15.0f;
        }
Exemplo n.º 4
0
        void sequenceController_SequenceRemoved(MovementSequenceController controller, MovementSequenceGroup group, MovementSequenceInfo sequenceInfo)
        {
            var item = buttonGrid.findItemByUserObject(sequenceInfo);

            if (item != null)
            {
                buttonGrid.removeItem(item);
            }
        }
        public MandibleMovementDialog(MovementSequenceController movementSequenceController, MusclePositionController musclePositionController)
            : base("DentalSim.GUI.MandibleMovement.MandibleMovementDialog.layout")
        {
            this.musclePositionController = musclePositionController;
            musclePositionController.OnUndoRedoChanged += musclePositionController_UndoRedoStateAltered;
            musclePositionController.OnRedo            += musclePositionController_UndoRedoStateAltered;
            musclePositionController.OnUndo            += musclePositionController_UndoRedoStateAltered;

            openTrackBar                     = new MandibleControlSlider(window.findWidget("Movement/HingeSlider") as ScrollBar);
            openTrackBar.Minimum             = -3;
            openTrackBar.Maximum             = 10;
            openTrackBar.ValueChangeStarted += mandibleMotionTrackBar_ValueChangeStarted;
            openTrackBar.ValueChangeEnded   += mandibleMotionTrackBar_ValueChangeEnded;

            rightForwardBack                     = new MandibleControlSlider(window.findWidget("Movement/ExcursionRightSlider") as ScrollBar);
            rightForwardBack.Minimum             = 0;
            rightForwardBack.Maximum             = 1;
            rightForwardBack.ValueChangeStarted += mandibleMotionTrackBar_ValueChangeStarted;
            rightForwardBack.ValueChangeEnded   += mandibleMotionTrackBar_ValueChangeEnded;

            leftForwardBack                     = new MandibleControlSlider(window.findWidget("Movement/ExcursionLeftSlider") as ScrollBar);
            leftForwardBack.Minimum             = 0;
            leftForwardBack.Maximum             = 1;
            leftForwardBack.ValueChangeStarted += mandibleMotionTrackBar_ValueChangeStarted;
            leftForwardBack.ValueChangeEnded   += mandibleMotionTrackBar_ValueChangeEnded;

            bothForwardBack                     = new MandibleControlSlider(window.findWidget("Movement/ProtrusionSlider") as ScrollBar);
            bothForwardBack.Minimum             = 0;
            bothForwardBack.Maximum             = 1;
            bothForwardBack.ValueChangeStarted += mandibleMotionTrackBar_ValueChangeStarted;
            bothForwardBack.ValueChangeEnded   += mandibleMotionTrackBar_ValueChangeEnded;

            forceSlider                     = new MandibleControlSlider(window.findWidget("Movement/ForceSlider") as ScrollBar);
            forceSlider.Minimum             = 0;
            forceSlider.Maximum             = 100;
            forceSlider.ValueChangeStarted += mandibleMotionTrackBar_ValueChangeStarted;
            forceSlider.ValueChangeEnded   += mandibleMotionTrackBar_ValueChangeEnded;

            resetButton = window.findWidget("Movement/Reset") as Button;
            undoButton  = window.findWidget("Undo") as Button;
            undoButton.MouseButtonClick += undoButton_MouseButtonClick;
            redoButton = window.findWidget("Redo") as Button;
            redoButton.MouseButtonClick += redoButton_MouseButtonClick;
            undoButton.Enabled           = musclePositionController.HasUndo;
            redoButton.Enabled           = musclePositionController.HasRedo;

            openTrackBar.ValueChanged     += openTrackBar_ValueChanged;
            rightForwardBack.ValueChanged += rightSliderValueChanged;
            leftForwardBack.ValueChanged  += leftSliderValueChanged;
            bothForwardBack.ValueChanged  += bothForwardBackChanged;
            forceSlider.ValueChanged      += forceSlider_ValueChanged;
            resetButton.MouseButtonClick  += resetButton_Click;

            movementSequenceController.PlaybackStarted += new MovementSequenceEvent(movementSequenceController_PlaybackStarted);
            movementSequenceController.PlaybackStopped += new MovementSequenceEvent(movementSequenceController_PlaybackStopped);
        }
Exemplo n.º 6
0
        public SequenceMenu(MovementSequenceController sequenceController)
            : base("Medical.GUI.SequencePlayer.SequenceMenu.layout")
        {
            this.sequenceController = sequenceController;

            sequenceController.SequenceAdded   += sequenceController_SequenceAdded;
            sequenceController.SequenceRemoved += sequenceController_SequenceRemoved;

            buttonGrid = new ButtonGrid(widget as ScrollView, new SingleSelectionStrategy(), new ButtonGridListLayout(), new ButtonGridItemNaturalSort());
        }
Exemplo n.º 7
0
        void MovementSequenceController_GroupAdded(MovementSequenceController controller, MovementSequenceGroup group)
        {
            sequencePlayer = new SequencePlayer(standaloneController.MovementSequenceController, standaloneController.MusclePositionController);
            guiManager.addManagedDialog(sequencePlayer);

            PinableMDIDialogOpenTask sequencePlayerTask = new PinableMDIDialogOpenTask(sequencePlayer, "Medical.Sequences", "Sequences", "SequenceToolstrip/Sequence", TaskMenuCategories.Explore);

            standaloneController.TaskController.addTask(sequencePlayerTask);

            //We only care about the first one of these events that fires.
            standaloneController.MovementSequenceController.GroupAdded -= MovementSequenceController_GroupAdded;
        }
Exemplo n.º 8
0
        void sequenceController_SequenceAdded(MovementSequenceController controller, MovementSequenceGroup group, MovementSequenceInfo sequenceInfo)
        {
            ButtonGridItem item = buttonGrid.addItem(group.Name, sequenceInfo.Name);

            item.UserObject   = sequenceInfo;
            item.ItemClicked += (s, e) =>
            {
                MovementSequence sequence = sequenceController.loadSequence(sequenceInfo);
                sequenceController.stopPlayback();
                sequenceController.CurrentSequence = sequence;
                sequenceController.playCurrentSequence();
                this.hide();
            };
        }
Exemplo n.º 9
0
 void sequenceController_CurrentSequenceChanged(MovementSequenceController controller)
 {
     if (controller.CurrentSequence == null)
     {
         nowPlaying.Caption = "None";
         playButton.Enabled = false;
         stopButton.Enabled = false;
     }
     else
     {
         nowPlaying.Caption = controller.CurrentSequence.Name;
         playButton.Enabled = true;
         stopButton.Enabled = false;
     }
 }
Exemplo n.º 10
0
        public void initialize(StandaloneController standaloneController)
        {
            TimelineController = standaloneController.TimelineController;
            AtlasPluginManager = standaloneController.AtlasPluginManager;
            MvcCore            = standaloneController.MvcCore;
            GuiManager         = standaloneController.GUIManager;

            AnatomyTaskManager anatomyTasks = standaloneController.AnatomyTaskManager;

            foreach (DDPluginTask task in tasks)
            {
                task._setPlugin(this);
                anatomyTasks.addTask(task, task.TaggedAnatomy);
            }

            //Load sequences
            if (!String.IsNullOrEmpty(SequencesDirectory))
            {
                String            fullSequencesDirectory = Path.Combine(PluginRootFolder, SequencesDirectory);
                VirtualFileSystem archive = VirtualFileSystem.Instance;
                if (archive.exists(fullSequencesDirectory))
                {
                    loadedSequences = new List <VirtualFSMovementSequenceInfo>();
                    MovementSequenceController movementSequenceController = standaloneController.MovementSequenceController;
                    foreach (String directory in archive.listDirectories(fullSequencesDirectory, false, false))
                    {
                        String groupName = archive.getFileInfo(directory).Name;
                        foreach (String file in archive.listFiles(directory, false))
                        {
                            VirtualFileInfo fileInfo = archive.getFileInfo(file);
                            String          fileName = fileInfo.Name;
                            if (fileName.EndsWith(".seq"))
                            {
                                VirtualFSMovementSequenceInfo info = new VirtualFSMovementSequenceInfo();
                                info.GroupName = groupName;
                                info.Name      = fileName.Substring(0, fileName.Length - 4);
                                info.FileName  = fileInfo.FullName;
                                movementSequenceController.addMovementSequence(info.GroupName, info);
                                loadedSequences.Add(info);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 11
0
        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);
        }
 void movementSequenceController_PlaybackStopped(MovementSequenceController controller)
 {
     resetButton.Enabled = true;
     undoButton.Enabled  = musclePositionController.HasUndo;
     redoButton.Enabled  = musclePositionController.HasRedo;
 }
Exemplo n.º 13
0
 void sequenceController_PlaybackStarted(MovementSequenceController controller)
 {
     playButton.Enabled = false;
     stopButton.Enabled = true;
 }
 public MovementSequenceEditorFactory(MovementSequenceController movementSequenceController, SaveableClipboard clipboard)
 {
     this.movementSequenceController = movementSequenceController;
     this.clipboard = clipboard;
 }
Exemplo n.º 15
0
 void movementSequenceController_PlaybackStarted(MovementSequenceController controller)
 {
     playButton.Caption = "Stop";
     playButton.ImageBox.setItemResource("Timeline/StopIcon");
 }
 void movementSequenceController_PlaybackStarted(MovementSequenceController controller)
 {
     resetButton.Enabled   = false;
     restoreButton.Enabled = false;
 }
 void movementSequenceController_PlaybackStopped(MovementSequenceController controller)
 {
     resetButton.Enabled   = true;
     restoreButton.Enabled = restorePosition != null;
 }
Exemplo n.º 18
0
 void movementSequenceController_PlaybackUpdate(MovementSequenceController controller)
 {
     timelineView.MarkerTime = controller.CurrentTime;
 }
Exemplo n.º 19
0
        public void initialize(StandaloneController standaloneController)
        {
            standaloneController.DocumentController.addDocumentHandler(new PatientDocumentHandler(standaloneController));

            this.standaloneController = standaloneController;
            standaloneController.PatientDataController.PatientDataChanged += new Action <PatientDataFile>(PatientDataController_PatientDataChanged);

            GUIManager guiManager = standaloneController.GUIManager;

            //Dialogs
            mandibleMovementDialog = new MandibleMovementDialog(standaloneController.MovementSequenceController, standaloneController.MusclePositionController);
            guiManager.addManagedDialog(mandibleMovementDialog);

            notesDialog = new NotesDialog(standaloneController.MedicalStateController);
            guiManager.addManagedDialog(notesDialog);

            stateList = new StateListDialog(standaloneController.MedicalStateController);
            guiManager.addManagedDialog(stateList);

            savePatientDialog           = new SavePatientDialog(guiManager);
            savePatientDialog.SaveFile += new EventHandler(savePatientDialog_SaveFile);

            openPatientDialog           = new OpenPatientDialog(guiManager);
            openPatientDialog.OpenFile += new EventHandler(openPatientDialog_OpenFile);

            //Tasks Menu
            TaskController     taskController = standaloneController.TaskController;
            AnatomyTaskManager anatomyTasks   = standaloneController.AnatomyTaskManager;

            taskController.addTask(new ShowToothContactsTask(0));

            PinableMDIDialogOpenTask mandibleMovementTask = new PinableMDIDialogOpenTask(mandibleMovementDialog, "Medical.ManualMovement", "Manual Movement", "DentalSimIcons/ManualMovement", "Dental Simulation", 2);

            taskController.addTask(mandibleMovementTask);

            anatomyTasks.addTask(new StartEmbeddedMvcTask("DentalSim.Eminence", "Eminence", "DentalSimIcons/Eminence", "Dental Simulation", GetType(), "DentalSim.Wizards.", "Eminence.mvc", standaloneController.TimelineController, standaloneController.MvcCore), new String[] { "Outer Skull", "Inner Skull" });
            anatomyTasks.addTask(new StartEmbeddedMvcTask("DentalSim.Dentition", "Dentition", "DentalSimIcons/Dentition", "Dental Simulation", GetType(), "DentalSim.Wizards.", "Dentition.mvc", standaloneController.TimelineController, standaloneController.MvcCore), TeethNames);
            anatomyTasks.addTask(new StartEmbeddedMvcTask("DentalSim.DiscClockFace", "Disc Clock Face", "DentalSimIcons/DiscClockFace", "Dental Simulation", GetType(), "DentalSim.Wizards.DiscClock.", "DiscClockFace.mvc", standaloneController.TimelineController, standaloneController.MvcCore, true), new String[] { "Left TMJ Disc", "Right TMJ Disc" });
            anatomyTasks.addTask(new StartEmbeddedMvcTask("DentalSim.Mandible", "Mandible", "DentalSimIcons/Mandible", "Dental Simulation", GetType(), "DentalSim.Wizards.", "Mandible.mvc", standaloneController.TimelineController, standaloneController.MvcCore), new String[] { "Mandible" });
            anatomyTasks.addTask(new StartEmbeddedMvcTask("DentalSim.ClinicalDoppler", "Doppler", "DentalSimIcons/ClinicalDoppler", "Dental Simulation", GetType(), "DentalSim.Wizards.ClinicalDoppler.", "ClinicalDoppler.mvc", standaloneController.TimelineController, standaloneController.MvcCore), new String[] { "Left TMJ Disc", "Right TMJ Disc", "Mandible" });
            anatomyTasks.addTask(new StartEmbeddedMvcTask("DentalSim.ClinicalCT", "CT", "DentalSimIcons/ClinicalCT", "Dental Simulation", GetType(), "DentalSim.Wizards.ClinicalCT.", "ClinicalCT.mvc", standaloneController.TimelineController, standaloneController.MvcCore), new String[] { "Left TMJ Disc", "Right TMJ Disc", "Mandible" });
            anatomyTasks.addTask(new StartEmbeddedMvcTask("DentalSim.ClinicalMRI", "MRI", "DentalSimIcons/ClinicalMRI", "Dental Simulation", GetType(), "DentalSim.Wizards.ClinicalMRI.", "ClinicalMRI.mvc", standaloneController.TimelineController, standaloneController.MvcCore), new String[] { "Left TMJ Disc", "Right TMJ Disc", "Mandible" });
            anatomyTasks.addTask(new StartEmbeddedMvcTask("DentalSim.ClinicalOrthoAndSkeletal", "Orthodontic and Skeletal", "DentalSimIcons/ClinicalOrthodonticAndSkeletal", "Dental Simulation", GetType(), "DentalSim.Wizards.", "ClinicalOrthoAndSkeletal.mvc", standaloneController.TimelineController, standaloneController.MvcCore), new String[] { "Left TMJ Disc", "Right TMJ Disc", "Mandible" });

            taskController.addTask(new ShowPopupTask(openPatientDialog, "Medical.OpenPatient", "Open", "DentalSimIcons/Open", TaskMenuCategories.Scene, 1));

            PinableMDIDialogOpenTask statesTask = new PinableMDIDialogOpenTask(stateList, "Medical.StateList", "States", "DentalSimIcons/StatesIcon", TaskMenuCategories.Scene);

            taskController.addTask(statesTask);

            PinableMDIDialogOpenTask notesTask = new PinableMDIDialogOpenTask(notesDialog, "Medical.Notes", "Notes", "DentalSimIcons/NotesIcon", TaskMenuCategories.Scene);

            taskController.addTask(notesTask);

            CallbackTask saveTaskItem = new CallbackTask("Medical.SavePatient", "Save", "CommonToolstrip/Save", TaskMenuCategories.Scene, 2, false);

            saveTaskItem.OnClicked += new CallbackTask.ClickedCallback(saveTaskItem_OnClicked);
            taskController.addTask(saveTaskItem);

            CallbackTask saveAsTaskItem = new CallbackTask("Medical.SavePatientAs", "Save As", "CommonToolstrip/SaveAs", TaskMenuCategories.Scene, 3, false);

            saveAsTaskItem.OnClicked += new CallbackTask.ClickedCallback(saveAsTaskItem_OnClicked);
            taskController.addTask(saveAsTaskItem);

            //Movement Sequences
            MovementSequenceController movementSequenceController = standaloneController.MovementSequenceController;
            Assembly assembly = GetType().Assembly;

            //Border Movements
            movementSequenceController.addMovementSequence("Border Movements", new EmbeddedMovementSequenceInfo(assembly, "Posselt Sagittal", "DentalSim.Sequences.BorderMovements.Posselt Sagittal.seq"));

            //Excursion
            movementSequenceController.addMovementSequence("Excursion", new EmbeddedMovementSequenceInfo(assembly, "Left Tooth Contact Bruxism", "DentalSim.Sequences.Excursion.Left Tooth Contact Bruxism.seq"));
            movementSequenceController.addMovementSequence("Excursion", new EmbeddedMovementSequenceInfo(assembly, "Left Tooth Contact Maximal", "DentalSim.Sequences.Excursion.Left Tooth Contact Maximal.seq"));
            movementSequenceController.addMovementSequence("Excursion", new EmbeddedMovementSequenceInfo(assembly, "Left Tooth Contact", "DentalSim.Sequences.Excursion.Left Tooth Contact.seq"));
            movementSequenceController.addMovementSequence("Excursion", new EmbeddedMovementSequenceInfo(assembly, "Open Bilateral", "DentalSim.Sequences.Excursion.Open Bilateral.seq"));
            movementSequenceController.addMovementSequence("Excursion", new EmbeddedMovementSequenceInfo(assembly, "Open Left", "DentalSim.Sequences.Excursion.Open Left.seq"));
            movementSequenceController.addMovementSequence("Excursion", new EmbeddedMovementSequenceInfo(assembly, "Open Right", "DentalSim.Sequences.Excursion.Open Right.seq"));
            movementSequenceController.addMovementSequence("Excursion", new EmbeddedMovementSequenceInfo(assembly, "Right Tooth Contact Bruxism", "DentalSim.Sequences.Excursion.Right Tooth Contact Bruxism.seq"));
            movementSequenceController.addMovementSequence("Excursion", new EmbeddedMovementSequenceInfo(assembly, "Right Tooth Contact Maximal", "DentalSim.Sequences.Excursion.Right Tooth Contact Maximal.seq"));
            movementSequenceController.addMovementSequence("Excursion", new EmbeddedMovementSequenceInfo(assembly, "Right Tooth Contact", "DentalSim.Sequences.Excursion.Right Tooth Contact.seq"));

            //Normal Chewing
            movementSequenceController.addMovementSequence("Normal Chewing", new EmbeddedMovementSequenceInfo(assembly, "Chewing Left Side", "DentalSim.Sequences.NormalChewing.Chewing Left Side.seq"));
            movementSequenceController.addMovementSequence("Normal Chewing", new EmbeddedMovementSequenceInfo(assembly, "Chewing Right Side", "DentalSim.Sequences.NormalChewing.Chewing Right Side.seq"));

            //Protrusion
            movementSequenceController.addMovementSequence("Protrusion", new EmbeddedMovementSequenceInfo(assembly, "Open Protrusion", "DentalSim.Sequences.Protrusion.Open Protrusion.seq"));
            movementSequenceController.addMovementSequence("Protrusion", new EmbeddedMovementSequenceInfo(assembly, "Protrusion Maximal", "DentalSim.Sequences.Protrusion.Protrusion Maximal.seq"));
            movementSequenceController.addMovementSequence("Protrusion", new EmbeddedMovementSequenceInfo(assembly, "Protrusion Tooth Contact Edge to Edge", "DentalSim.Sequences.Protrusion.Protrusion Tooth Contact Edge to Edge.seq"));

            //Vertical Opening
            movementSequenceController.addMovementSequence("Vertical Opening", new EmbeddedMovementSequenceInfo(assembly, "Hinge Opening", "DentalSim.Sequences.VerticalOpening.Hinge Opening.seq"));
            movementSequenceController.addMovementSequence("Vertical Opening", new EmbeddedMovementSequenceInfo(assembly, "Maximal Opening", "DentalSim.Sequences.VerticalOpening.Maximal Opening.seq"));
            movementSequenceController.addMovementSequence("Vertical Opening", new EmbeddedMovementSequenceInfo(assembly, "Tapping Teeth", "DentalSim.Sequences.VerticalOpening.Tapping Teeth.seq"));
        }
Exemplo n.º 20
0
        public MovementSequenceEditor(MovementSequenceController movementSequenceController, SaveableClipboard clipboard, MyGUIViewHost viewHost, MovementSequenceEditorView view)
            : base("Medical.GUI.Editor.MovementSequence.MovementSequenceEditor.layout", viewHost)
        {
            this.clipboard = clipboard;

            widget.KeyButtonReleased  += new MyGUIEvent(window_KeyButtonReleased);
            widget.RootKeyChangeFocus += new MyGUIEvent(widget_RootKeyChangeFocus);

            this.movementSequenceController             = movementSequenceController;
            movementSequenceController.PlaybackStarted += movementSequenceController_PlaybackStarted;
            movementSequenceController.PlaybackStopped += movementSequenceController_PlaybackStopped;
            movementSequenceController.PlaybackUpdate  += movementSequenceController_PlaybackUpdate;

            //Remove button
            Button removeButton = widget.findWidget("RemoveAction") as Button;

            removeButton.MouseButtonClick += new MyGUIEvent(removeButton_MouseButtonClick);

            //Duration Edit
            durationEdit               = new NumericEdit(widget.findWidget("SequenceDuration") as EditBox);
            durationEdit.AllowFloat    = true;
            durationEdit.ValueChanged += new MyGUIEvent(durationEdit_ValueChanged);
            durationEdit.MinValue      = 0.0f;
            durationEdit.MaxValue      = 600;

            //Play Button
            playButton = widget.findWidget("PlayButton") as Button;
            playButton.MouseButtonClick += new MyGUIEvent(playButton_MouseButtonClick);

            //Timeline view
            ScrollView timelineViewScrollView = widget.findWidget("ActionView") as ScrollView;

            timelineView = new TimelineView(timelineViewScrollView);
            timelineView.DurationChanged += new EventHandler(timelineView_DurationChanged);
            timelineView.Duration         = 5.0f;
            timelineView.KeyReleased     += new EventHandler <KeyEventArgs>(timelineView_KeyReleased);

            //Properties
            ScrollView timelinePropertiesScrollView = widget.findWidget("ActionPropertiesScrollView") as ScrollView;

            actionProperties         = new TimelineDataProperties(timelinePropertiesScrollView, timelineView);
            actionProperties.Visible = false;
            actionProperties.addPanel("Muscle Position", new MovementKeyframeProperties(timelinePropertiesScrollView));

            //Timeline filter
            ScrollView timelineFilterScrollView = widget.findWidget("ActionFilter") as ScrollView;

            trackFilter = new TrackFilter(timelineFilterScrollView, timelineView);
            trackFilter.AddTrackItem += new AddTrackItemCallback(trackFilter_AddTrackItem);

            numberLine = new NumberLine(widget.findWidget("NumberLine") as ScrollView, timelineView);

            //Add tracks to timeline.
            timelineView.addTrack("Muscle Position");

            CurrentSequence = view.Sequence;
            if (view.ListenForSequenceChanges)
            {
                movementSequenceController.CurrentSequenceChanged += movementSequenceController_CurrentSequenceChanged;
                if (CurrentSequence == null)
                {
                    CurrentSequence = movementSequenceController.CurrentSequence;
                }
            }

            ViewHost.Context.getModel <EditMenuManager>(EditMenuManager.DefaultName).setMenuProvider(this);
        }
Exemplo n.º 21
0
        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);
        }
Exemplo n.º 22
0
 void movementSequenceController_CurrentSequenceChanged(MovementSequenceController controller)
 {
     CurrentSequence = controller.CurrentSequence;
 }