Beispiel #1
0
        public MedicalState createState(String name)
        {
            MedicalState state = new MedicalState(name);

            state.update();
            return(state);
        }
Beispiel #2
0
 public void alertStateUpdated(MedicalState state)
 {
     if (StateUpdated != null && states.Contains(state))
     {
         StateUpdated.Invoke(state);
     }
 }
 public void blend(float percent, MedicalState target)
 {
     boneState.blend(target.boneState, percent);
     discState.blend(target.discState, percent);
     teethState.blend(target.teethState, percent);
     fossaState.blend(target.fossaState, percent);
 }
 public override void applyToState(MedicalState state)
 {
     foreach (ToothState tooth in teeth)
     {
         state.Teeth.addPosition(new ToothState(tooth));
     }
 }
 public override void applyToState(MedicalState state)
 {
     foreach (PresetState subState in subStates)
     {
         subState.applyToState(state);
     }
 }
 public override void applyToState(MedicalState state)
 {
     foreach (AnimationManipulatorStateEntry position in positions)
     {
         state.BoneManipulator.addPosition(position.clone());
     }
 }
Beispiel #7
0
        public MedicalState createAndAddState(String name)
        {
            MedicalState state = createState(name);

            addState(state);
            return(state);
        }
Beispiel #8
0
        public MedicalState createFromPreset(PresetState preset)
        {
            MedicalState state = new MedicalState(preset.Name);

            state.update();
            preset.applyToState(state);
            return(state);
        }
Beispiel #9
0
 public void destroyState(MedicalState state)
 {
     stopBlending();
     states.Remove(state);
     if (StateRemoved != null)
     {
         StateRemoved.Invoke(this, state);
     }
     state.Dispose();
 }
Beispiel #10
0
 public void blendTo(MedicalState state, float duration)
 {
     this.directStartState = createState("DirectStart");
     this.directEndState   = state;
     blendElapsed          = 0.0f;
     blendDuration         = duration;
     if (blendDuration <= 0.0f)
     {
         blendDuration = float.Epsilon;
     }
     startPlayback();
 }
Beispiel #11
0
 /// <summary>
 /// Use the current setup of the scene to create a "normal" state.
 /// </summary>
 public void sceneLoaded(SimScene scene)
 {
     sceneLoadNormalState                  = this.createState("Normal");
     sceneLoadNormalState.Notes.Notes      = "Normal";
     sceneLoadNormalState.Notes.DataSource = "Automatic";
     sceneLoadNormalState.Thumbnail        = imageRenderer.renderImage(imageProperties);
     states.Add(sceneLoadNormalState);
     if (StateAdded != null)
     {
         StateAdded.Invoke(this, sceneLoadNormalState);
     }
 }
Beispiel #12
0
 public void sceneUnloading(SimScene scene)
 {
     if (sceneLoadNormalState != null)
     {
         states.Remove(sceneLoadNormalState);
         if (StateRemoved != null)
         {
             StateRemoved.Invoke(this, sceneLoadNormalState);
         }
         sceneLoadNormalState.Dispose();
         sceneLoadNormalState = null;
     }
 }
Beispiel #13
0
 public override void applyToState(MedicalState state)
 {
     if (state != null)
     {
         DiscStateProperties disc = new DiscStateProperties(discName);
         disc.DiscOffset          = discOffset;
         disc.HorizontalOffset    = horizontalOffset;
         disc.Locked              = locked;
         disc.PopLocation         = popLocation;
         disc.RDAOffset           = rdaOffset;
         disc.DisplaceLateralPole = displaceLateralPole;
         disc.ClockFaceOffset     = clockFaceOffset;
         state.Disc.addPosition(disc);
     }
 }
Beispiel #14
0
 public void addState(MedicalState state)
 {
     //No states and normal state defined, add it as the first state.
     if (states.Count == 0)
     {
         states.Add(sceneLoadNormalState);
         if (StateAdded != null)
         {
             StateAdded.Invoke(this, sceneLoadNormalState);
         }
     }
     states.Add(state);
     if (state.Thumbnail == null)
     {
         state.Thumbnail = imageRenderer.renderImage(imageProperties);
     }
     if (StateAdded != null)
     {
         StateAdded.Invoke(this, state);
     }
 }
Beispiel #15
0
        public PresetState createPresetState(String name)
        {
            MedicalState medicalState = new MedicalState(name);

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

            DiscPresetState leftDiscPreset = new DiscPresetState("LeftTMJDisc", "", "", "");

            leftDiscPreset.captureFromState(medicalState.Disc.getPosition("LeftTMJDisc"));
            compoundPresetState.addSubState(leftDiscPreset);

            DiscPresetState rightDiscPreset = new DiscPresetState("RightTMJDisc", "", "", "");

            rightDiscPreset.captureFromState(medicalState.Disc.getPosition("RightTMJDisc"));
            compoundPresetState.addSubState(rightDiscPreset);

            FossaPresetState leftFossaPreset = new FossaPresetState("", "", "");

            leftFossaPreset.captureFromState("LeftFossa", medicalState.Fossa);
            compoundPresetState.addSubState(leftFossaPreset);

            FossaPresetState rightFossaPreset = new FossaPresetState("", "", "");

            rightFossaPreset.captureFromState("RightFossa", medicalState.Fossa);
            compoundPresetState.addSubState(rightFossaPreset);

            AnimationManipulatorPresetState animationManipPresetState = new AnimationManipulatorPresetState("", "", "");

            animationManipPresetState.captureFromState(medicalState.BoneManipulator);
            compoundPresetState.addSubState(animationManipPresetState);

            TeethPresetState teethPreset = new TeethPresetState("", "", "");

            teethPreset.captureFromState(medicalState.Teeth);
            compoundPresetState.addSubState(teethPreset);

            return(compoundPresetState);
        }
Beispiel #16
0
 public abstract void applyToState(MedicalState state);
Beispiel #17
0
 public override void applyToState(MedicalState state)
 {
     state.Fossa.addPosition(fossaName, position);
 }
Beispiel #18
0
 public ChangeMedicalStateAction(MedicalState state, float startTime)
 {
     State          = state;
     this.StartTime = StartTime;
     Duration       = 1.0f;
 }