예제 #1
0
        //No longer previewing
        protected override void LeftMouseUpResizing(Viewport2D viewport, ViewportEvent e)
        {
            if (_currentTool == null)
            {
                base.LeftMouseUpResizing(viewport, e);
                return;
            }
            var transformation = GetTransformMatrix(viewport, e);

            if (transformation.HasValue)
            {
                Matrix4           m = (Matrix4)transformation;
                Vector3           c = m.ExtractTranslation();
                OpenTK.Quaternion q = m.ExtractRotation();
                if (_currentTool.GetType() == typeof(MoveTool))
                {
                    TotalTranslation += new Coordinate((decimal)c.X, (decimal)c.Y, (decimal)c.Z);
                }
                else if (_currentTool.GetType() == typeof(RotateTool))
                {
                    q.Invert();
                    TotalRotation *= q;
                }
                _form.KeyFrameEdit(-1, TotalTranslation, ToGeometric(TotalRotation));

                //var createClone = KeyboardState.Shift && State.Handle == ResizeHandle.Center;
                //ExecuteTransform(_currentTool.GetTransformName(), CreateMatrixMultTransformation(transformation.Value), createClone);
            }
            Document.EndSelectionTransform();
            State.ActiveViewport = null;
            State.Action         = BoxAction.Drawn;

            SelectionChanged();
        }
예제 #2
0
 public void TransformationToolChanged(TransformationTool tt)
 {
     _selectedType = tt == null ? null : tt.GetType();
     SetCheckState();
 }