Ejemplo n.º 1
0
        public SetupSceneAction(String name, CameraPosition cameraPosition, LayerState layers, MusclePosition musclePosition, PresetState medicalState, bool captureHighlight, bool isHighlighted)
        {
            action         = new RunCommandsAction(name);
            Layers         = layers != null;
            Camera         = cameraPosition != null;
            MusclePosition = musclePosition != null;
            MedicalState   = medicalState != null;
            HighlightTeeth = captureHighlight;

            if (Layers)
            {
                ChangeLayersCommand changeLayersCommand = new ChangeLayersCommand();
                changeLayersCommand.Layers.copyFrom(layers);
                action.addCommand(changeLayersCommand);
            }

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

            if (Camera)
            {
                MoveCameraCommand moveCameraCommand = new MoveCameraCommand();
                moveCameraCommand.CameraPosition = cameraPosition;
                action.addCommand(moveCameraCommand);
            }

            if (MedicalState)
            {
                ChangeMedicalStateCommand medicalStateCommand = new ChangeMedicalStateCommand();
                medicalStateCommand.PresetState = medicalState;
                action.addCommand(medicalStateCommand);
            }

            if (HighlightTeeth)
            {
                action.addCommand(new ChangeTeethHighlightsCommand(isHighlighted));
            }

            AllowPreview = true;
        }
Ejemplo n.º 2
0
 public override void configureThumbnailProperties(ImageRendererProperties imageProperties)
 {
     base.configureThumbnailProperties(imageProperties);
     foreach (var command in action.Commands)
     {
         if (command is MoveCameraCommand)
         {
             MoveCameraCommand moveCamera = (MoveCameraCommand)command;
             imageProperties.CameraPosition  = moveCamera.CameraPosition.Translation;
             imageProperties.CameraLookAt    = moveCamera.CameraPosition.LookAt;
             imageProperties.UseIncludePoint = moveCamera.CameraPosition.UseIncludePoint;
             imageProperties.IncludePoint    = moveCamera.CameraPosition.IncludePoint;
         }
         if (command is ChangeLayersCommand)
         {
             ChangeLayersCommand changeLayers = (ChangeLayersCommand)command;
             imageProperties.OverrideLayers = true;
             imageProperties.LayerState     = changeLayers.Layers;
         }
     }
 }
Ejemplo n.º 3
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));
            }
        }