示例#1
0
 public override bool ProcessMouseButtonUp(CanonicalMouseEventArgs e, InteractionContext context)
 {
     if (this.IsActive)
     {
         if (this.ValidForZoom)
         {
             Rectangle2D zoomRectangle = this.ZoomRectangle;
             Vector2D    vector2D      = this.TransformationProvider.ViewWindow.Center - zoomRectangle.Center;
             double      num           = System.Math.Min(this.TransformationProvider.ViewWindow.Width / zoomRectangle.Width, this.TransformationProvider.ViewWindow.Height / zoomRectangle.Height);
             this.TransformationProvider.PanView(vector2D.X, vector2D.Y);
             this.TransformationProvider.ViewScaling /= num;
         }
         this.Deactivate();
     }
     return(this.IsActive);
 }
示例#2
0
            public override void Draw(
                PaintEventArgs e,
                GraphicsHelper graphicsHelper,
                InteractionContext context)
            {
                if (!this.rotateInteractor_0.IsActive || !(context.CanvasRectangle != Rectangle2D.Empty))
                {
                    return;
                }
                float rotationCircleRadius = this.rotateInteractor_0.GetRotationCircleRadius(context.CanvasRectangle.Size);

                using (Pen pen = new Pen((Color)RotateInteractor.RotationCircleColor))
                {
                    Point2D    center = context.CanvasRectangle.Center;
                    RectangleF rect   = new RectangleF((float)center.X - rotationCircleRadius, (float)center.Y - rotationCircleRadius, 2f * rotationCircleRadius, 2f * rotationCircleRadius);
                    e.Graphics.DrawArc(pen, rect, 0.0f, 6.283185f);
                }
            }
示例#3
0
 public override bool ProcessMouseWheel(CanonicalMouseEventArgs e, InteractionContext context)
 {
     if (this.IsActive)
     {
         this.OnBeforeScaleFactorChanged((EventArgs)e);
         int num = System.Math.Sign(e.MouseWheelDelta);
         if (num > 0)
         {
             this.double_0 *= 1.1;
         }
         else if (num < 0)
         {
             this.double_0 /= 1.1;
         }
         this.OnScaleFactorChanged((EventArgs)e);
     }
     return(this.IsActive);
 }
示例#4
0
        private void method_0(CanonicalMouseEventArgs e, InteractionContext context)
        {
            Point2D  point2D   = new Point2D(0.5 * context.CanvasRectangle.Size.X, 0.5 * context.CanvasRectangle.Size.Y);
            Point2D  position  = e.Position;
            Vector2D vector2D1 = position - point2D;

            if (!(vector2D1 != Vector2D.Zero))
            {
                return;
            }
            double num1 = System.Math.Atan2(-vector2D1.Y, vector2D1.X);

            if (this.nullable_0.HasValue)
            {
                Vector2D vector2D2 = this.nullable_0.Value - point2D;
                double   num2      = System.Math.Atan2(-vector2D2.Y, vector2D2.X);
                if (num1 != num2)
                {
                    this.TransformationProvider.ModelOrientation *= QuaternionD.FromAxisAngle(Vector3D.ZAxis, num1 - num2);
                }
            }
            this.nullable_0 = new Point2D?(position);
        }
示例#5
0
        private void method_0(CanonicalMouseEventArgs e, InteractionContext context)
        {
            Point2D  point2D   = new Point2D(0.5 * context.CanvasRectangle.Size.X, 0.5 * context.CanvasRectangle.Size.Y);
            Point2D  position  = e.Position;
            Vector2D vector2D1 = position - point2D;

            if (!(vector2D1 != Vector2D.Zero))
            {
                return;
            }
            double num1 = System.Math.Atan2(-vector2D1.Y, vector2D1.X);

            if (this.nullable_0.HasValue)
            {
                Vector2D vector2D2 = this.nullable_0.Value - point2D;
                double   num2      = System.Math.Atan2(-vector2D2.Y, vector2D2.X);
                if (num1 != num2)
                {
                    this.double_0 += num1 - num2;
                    this.OnOrientationChanged((EventArgs)e);
                }
            }
            this.nullable_0 = new Point2D?(position);
        }
示例#6
0
 public bool ProcessMouseDoubleClick(CanonicalMouseEventArgs e, InteractionContext context)
 {
     return(this.iinteractor_0.ProcessMouseDoubleClick(e, context));
 }
示例#7
0
 public virtual bool ProcessMouseWheel(CanonicalMouseEventArgs e, InteractionContext context)
 {
     return(this.iinteractor_0.ProcessMouseWheel(e, context));
 }
示例#8
0
 public bool ProcessTextInput(string text, InteractionContext context)
 {
     return(this.iinteractor_0.ProcessTextInput(text, context));
 }
示例#9
0
文件: Interactor.cs 项目: 15831944/WW
 public virtual bool ProcessMouseClick(CanonicalMouseEventArgs e, InteractionContext context)
 {
     return(false);
 }
示例#10
0
文件: Interactor.cs 项目: 15831944/WW
 public virtual void Draw(
     PaintEventArgs e,
     GraphicsHelper graphicsHelper,
     InteractionContext context)
 {
 }
示例#11
0
文件: Interactor.cs 项目: 15831944/WW
 public virtual bool ProcessTextInput(string text, InteractionContext context)
 {
     return(false);
 }