public MedicalState createState(String name) { MedicalState state = new MedicalState(name); state.update(); return(state); }
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()); } }
public MedicalState createAndAddState(String name) { MedicalState state = createState(name); addState(state); return(state); }
public MedicalState createFromPreset(PresetState preset) { MedicalState state = new MedicalState(preset.Name); state.update(); preset.applyToState(state); return(state); }
public void destroyState(MedicalState state) { stopBlending(); states.Remove(state); if (StateRemoved != null) { StateRemoved.Invoke(this, state); } state.Dispose(); }
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(); }
/// <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); } }
public void sceneUnloading(SimScene scene) { if (sceneLoadNormalState != null) { states.Remove(sceneLoadNormalState); if (StateRemoved != null) { StateRemoved.Invoke(this, sceneLoadNormalState); } sceneLoadNormalState.Dispose(); sceneLoadNormalState = null; } }
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); } }
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); } }
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); }
public abstract void applyToState(MedicalState state);
public override void applyToState(MedicalState state) { state.Fossa.addPosition(fossaName, position); }
public ChangeMedicalStateAction(MedicalState state, float startTime) { State = state; this.StartTime = StartTime; Duration = 1.0f; }