private void SetManipulator(ManipulatorType manipulator) { OnEachViewDo(view => view.CurrentManipulator = manipulator); Manipulated.CurrentManipulator = manipulator; OnEachViewDo(view => view.Invalidate()); btnSelect.Checked = btnTranslate.Checked = btnRotate.Checked = btnScale.Checked = false; switch (manipulator) { case ManipulatorType.ManipulatorTypeDefault: btnSelect.Checked = true; break; case ManipulatorType.ManipulatorTypeRotation: btnRotate.Checked = true; break; case ManipulatorType.ManipulatorTypeScale: btnScale.Checked = true; break; case ManipulatorType.ManipulatorTypeTranslation: btnTranslate.Checked = true; break; default: break; } }
public ManipulatorControl(ManipulatorType type, Visual3D visual) { targetVisual = visual; Type = type; Transform = targetVisual.Transform; Diameter = 0.5; double l = 5; switch (type) { case ManipulatorType.TranslateX: Normal = new Vector3D(0, 0, 1); Direction = new Vector3D(l, 0, 0); Fill = Brushes.Red; break; case ManipulatorType.TranslateY: Normal = new Vector3D(0, 0, 1); Direction = new Vector3D(0, l, 0); Fill = Brushes.Green; break; case ManipulatorType.TranslateZ: Normal = new Vector3D(0, 1, 0); Direction = new Vector3D(0, 0, l); Fill = Brushes.Blue; break; } }