示例#1
0
        public MovementDialog(MusclePositionController musclePositionController, PoseController poseController, MedicalController medicalController)
            : base("Medical.Movement.GUI.MovementDialog.layout")
        {
            this.medicalController              = medicalController;
            this.musclePositionController       = musclePositionController;
            this.poseController                 = poseController;
            poseController.PoseModeActivated   += poseController_PoseModeActivated;
            poseController.PoseModeDeactivated += poseController_PoseModeDeactivated;

            musclePositionController.OnUndoRedoChanged += musclePositionController_UndoRedoStateAltered;
            musclePositionController.OnRedo            += musclePositionController_UndoRedoStateAltered;
            musclePositionController.OnUndo            += musclePositionController_UndoRedoStateAltered;

            controlButtonPanel = window.findWidget("ControlButtonPanel");
            foreach (Widget widget in controlButtonPanel.Children)
            {
                Button button = widget as Button;
                if (button != null)
                {
                    button.MouseButtonClick += widget_MouseButtonClick;
                }
            }

            undoButton = window.findWidget("Undo") as Button;
            undoButton.MouseButtonClick += undoButton_MouseButtonClick;

            redoButton = window.findWidget("Redo") as Button;
            redoButton.MouseButtonClick += redoButton_MouseButtonClick;

            Button resetButton = (Button)window.findWidget("Reset");

            resetButton.MouseButtonClick += resetButton_MouseButtonClick;

            musclePositionController_UndoRedoStateAltered(musclePositionController);
        }
        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);
        }
        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);
        }
示例#4
0
        public PoseController(StandaloneController controller)
        {
            activeModes.Add("Main");

            controller.SceneLoaded    += controller_SceneLoaded;
            controller.SceneUnloading += controller_SceneUnloading;
            sceneViewController        = controller.SceneViewController;
            anatomyController          = controller.AnatomyController;
            musclePositionController   = controller.MusclePositionController;

            if (controller.MedicalController.CurrentScene != null)
            {
                controller_SceneLoaded(controller.MedicalController.CurrentScene);
            }
        }
示例#5
0
 void musclePositionController_UndoRedoStateAltered(MusclePositionController musclePositionController)
 {
     undoButton.Enabled = musclePositionController.HasUndo;
     redoButton.Enabled = musclePositionController.HasRedo;
 }