private OrientationAxis GetOppositeOrientation(OrientationAxis orientation) { switch (orientation) { case OrientationAxis.Anterior: return(OrientationAxis.Posterior); case OrientationAxis.Inferior: return(OrientationAxis.Superior); case OrientationAxis.Left: return(OrientationAxis.Right); case OrientationAxis.Posterior: return(OrientationAxis.Anterior); case OrientationAxis.Right: return(OrientationAxis.Left); case OrientationAxis.Invalid: return(OrientationAxis.Invalid); default: return(OrientationAxis.Inferior); } }
private void comboBoxTop_SelectedIndexChanged(object sender, EventArgs e) { try { if (comboBoxConfigs.SelectedIndex < 0 || comboBoxTop.SelectedIndex < 0) { return; } OrientationAxis orientation = (OrientationAxis)comboBoxTop.SelectedItem; PlaneOrientation po = comboBoxConfigs.SelectedItem as PlaneOrientation; labelBottom.Text = GetOppositeOrientation(orientation).ToString( ); po.Top = orientation; CheckRight(orientation); _OldTopOrientation = orientation; } catch (Exception exception) { Messager.ShowError(this, exception); } }
private void CheckTop(OrientationAxis right) { if (comboBoxTop.SelectedIndex < 0) { return; } if ((OrientationAxis)comboBoxTop.SelectedItem == right) { comboBoxTop.SelectedItem = _OldRightOrientation; } else if (GetOppositeOrientation((OrientationAxis)comboBoxTop.SelectedItem) == right) { comboBoxTop.SelectedItem = _OldRightOrientation; } }
private void CheckRight(OrientationAxis top) { if (comboBoxRight.SelectedItem == null) { return; } if (( OrientationAxis )comboBoxRight.SelectedItem == top) { comboBoxRight.SelectedItem = _OldTopOrientation; } else if (GetOppositeOrientation((OrientationAxis)comboBoxRight.SelectedItem) == top) { comboBoxRight.SelectedItem = _OldTopOrientation; } }
private void ConfigureSagittal( ) { foreach (PlaneOrientation plane in _Configuration.Sagittal) { comboBoxConfigs.Items.Add(plane); } SetOrientationAxis(OrientationAxis.Anterior, OrientationAxis.Posterior, OrientationAxis.Superior, OrientationAxis.Inferior); if (_Configuration.Sagittal.Count > 0) { comboBoxTop.SelectedItem = _Configuration.Sagittal[0].Top; comboBoxRight.SelectedItem = _Configuration.Sagittal[0].Right; labelBottom.Text = GetOppositeOrientation(_Configuration.Sagittal[0].Top).ToString( ); labelLeft.Text = GetOppositeOrientation(_Configuration.Sagittal[0].Right).ToString( ); _OldTopOrientation = _Configuration.Sagittal[0].Top; _OldRightOrientation = _Configuration.Sagittal[0].Right; } }