Exemple #1
0
        public void captureSceneState(EditUICallback callback)
        {
            action.clear();
            if (Layers)
            {
                ChangeLayersCommand changeLayers = new ChangeLayersCommand();
                changeLayers.Layers.captureState();
                action.addCommand(changeLayers);
            }

            if (MusclePosition)
            {
                SetMusclePositionCommand musclePosition = new SetMusclePositionCommand();
                musclePosition.MusclePosition.captureState();
                action.addCommand(musclePosition);
            }

            if (Camera)
            {
                MoveCameraCommand moveCamera = new MoveCameraCommand();
                callback.runOneWayCustomQuery(CameraPosition.CustomEditQueries.CaptureCameraPosition, moveCamera.CameraPosition);
                action.addCommand(moveCamera);
            }

            if (MedicalState)
            {
                ChangeMedicalStateCommand medicalState = new ChangeMedicalStateCommand();
                MedicalState medState = new MedicalState("");
                medState.update();
                medicalState.captureFromMedicalState(medState);
                action.addCommand(medicalState);
            }

            if (HighlightTeeth)
            {
                action.addCommand(new ChangeTeethHighlightsCommand(TeethController.HighlightContacts));
            }
        }
Exemple #2
0
        void captureButton_MouseButtonClick(Widget source, EventArgs e)
        {
            MedicalState medicalState = new MedicalState("");

            medicalState.update();
            CompoundPresetState compoundPresetState = new CompoundPresetState("", "", "");

            if (leftDisc.Checked)
            {
                DiscPresetState leftDiscPreset = new DiscPresetState("LeftTMJDisc", "", "", "");
                leftDiscPreset.captureFromState(medicalState.Disc.getPosition("LeftTMJDisc"));
                compoundPresetState.addSubState(leftDiscPreset);
            }
            if (rightDisc.Checked)
            {
                DiscPresetState rightDiscPreset = new DiscPresetState("RightTMJDisc", "", "", "");
                rightDiscPreset.captureFromState(medicalState.Disc.getPosition("RightTMJDisc"));
                compoundPresetState.addSubState(rightDiscPreset);
            }
            if (leftFossa.Checked)
            {
                FossaPresetState leftFossaPreset = new FossaPresetState("", "", "");
                leftFossaPreset.captureFromState("LeftFossa", medicalState.Fossa);
                compoundPresetState.addSubState(leftFossaPreset);
            }
            if (rightFossa.Checked)
            {
                FossaPresetState rightFossaPreset = new FossaPresetState("", "", "");
                rightFossaPreset.captureFromState("RightFossa", medicalState.Fossa);
                compoundPresetState.addSubState(rightFossaPreset);
            }
            if (mandible.Checked)
            {
                AnimationManipulatorPresetState animationManipPresetState = new AnimationManipulatorPresetState("", "", "");
                animationManipPresetState.captureFromState(medicalState.BoneManipulator);
                compoundPresetState.addSubState(animationManipPresetState);
                //Need to implement mandible, may be just as easy to support each individual element

                /* bonescalarstateentry
                 * rightRamusHeightMandible
                 * rightAntegonialNotchMandible
                 * rightCondyleHeightMandible
                 * rightCondyleDegenerationMandible
                 * rightMandibularNotchMandible
                 * rightLateralPoleMandible
                 * rightMedialPoleScaleMandible
                 *
                 * leftRamusHeightMandible
                 * leftCondyleHeightMandible
                 * leftAntegonialNotchMandible
                 * leftMandibularNotchMandible
                 * leftCondyleDegenerationMandible
                 * leftLateralPoleMandible
                 * leftMedialPoleScaleMandible
                 */
                /* bonerotator
                 * leftCondyleRotationMandible
                 * rightCondyleRotationMandible
                 */
                /* Pose Manipulator
                 * leftCondyleRoughnessMandible
                 * rightCondyleRoughnessMandible
                 */
            }
            if (teeth.Checked)
            {
                TeethPresetState teethPreset = new TeethPresetState("", "", "");
                teethPreset.captureFromState(medicalState.Teeth);
                compoundPresetState.addSubState(teethPreset);
            }

            String errorPrompt = null;

            resultCallback.Invoke(compoundPresetState, ref errorPrompt);
            this.close();
        }
Exemple #3
0
        public void captureSceneStateTo(EditUICallback callback, Action setLayerState, Action setMusclePosition, Action <CameraPosition> setCameraPosition, Action <MedicalState> setMedicalState)
        {
            if (Layers)
            {
                if (layersCommand == null)
                {
                    layersCommand = new BlendLayersCommand();
                    action.addCommand(layersCommand);
                }

                setLayerState();
            }
            else if (layersCommand != null)
            {
                action.removeCommand(layersCommand);
                layersCommand = null;
            }

            if (MusclePosition)
            {
                if (muscleCommand == null)
                {
                    muscleCommand = new BlendMusclePositionCommand();
                    action.addCommand(muscleCommand);
                }

                setMusclePosition();
            }
            else if (muscleCommand != null)
            {
                action.removeCommand(muscleCommand);
                muscleCommand = null;
            }

            if (Camera)
            {
                if (cameraCommand == null)
                {
                    cameraCommand = new MoveBlendedCameraCommand();
                    action.addCommand(cameraCommand);
                }

                CameraPosition camPos = new CameraPosition();
                callback.runOneWayCustomQuery(CameraPosition.CustomEditQueries.CaptureCameraPosition, camPos);
                setCameraPosition(camPos);
            }
            else if (cameraCommand != null)
            {
                action.removeCommand(cameraCommand);
                cameraCommand = null;
            }

            if (MedicalState)
            {
                if (medicalStateCommand == null)
                {
                    medicalStateCommand = new BlendMedicalStateCommand();
                    action.addCommand(medicalStateCommand);
                }

                MedicalState medState = new MedicalState("");
                medState.update();
                setMedicalState(medState);
            }
            else if (medicalStateCommand != null)
            {
                action.removeCommand(medicalStateCommand);
                medicalStateCommand = null;
            }
        }