public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { if (mesh == null) return; base.MouseDown(mouseDownPos, button); bool haveSelected = false; for (int i = 0; i < mesh.Vertices.Count; i++) { if (mesh.Vertices[i].Traits.SelectedFlag == (byte)1) haveSelected = true; } if (button == EnumMouseButton.Left && !haveSelected) { selectedPoint = SelectByPoint(); } if (StartMoving() == false) return; Vector2D p = mouseDownPos - new Vector2D(projectedCenter.x, projectedCenter.y); p.x += 100; p.y += 100; switch (button) { case EnumMouseButton.Middle: movingBall.Click(p, ArcBall.MotionType.Rotation); break; case EnumMouseButton.Left: movingBall.Click(p / this.ScaleRatio, ArcBall.MotionType.Pan); break; case EnumMouseButton.Right: movingBall.Click(p, ArcBall.MotionType.Scale); break; } TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseDown(mouseDownPos, button); if (StartMoving() == false) { return; } Vector2D p = mouseDownPos - new Vector2D(projectedCenter.x, projectedCenter.y); p.x += 100; p.y += 100; switch (button) { case EnumMouseButton.Middle: movingBall.Click(p, ArcBall.MotionType.Rotation); break; case EnumMouseButton.Left: movingBall.Click(p / this.ScaleRatio, ArcBall.MotionType.Pan); break; case EnumMouseButton.Right: movingBall.Click(p, ArcBall.MotionType.Scale); break; } TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { //if ((Control.ModifierKeys & Keys.Control) == Keys.Control) //{ // if (button == EnumMouseButton.Left) // { // if ((Control.ModifierKeys & Keys.Shift) != Keys.Shift) // { // NonManifoldMesh m =mesh; // int n = m.VertexCount; // for (int i = 0; i < n; i++) // { // m.VertexFlag[i] = (byte)0; // } // } // SelectRandomPoint(); // } //} //if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt) //{ // NonManifoldMesh m = mesh; // int n = m.VertexCount; // for (int i = 0; i < n; i++) // { // m.VertexFlag[i] = (byte)0; // } //} //base.MouseUp(mouseUpPos,button); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { //if ((Control.ModifierKeys & Keys.Control) == Keys.Control) //{ // if (button == EnumMouseButton.Left) // { // if ((Control.ModifierKeys & Keys.Shift) != Keys.Shift) // { // NonManifoldMesh m =mesh; // int n = m.VertexCount; // for (int i = 0; i < n; i++) // { // m.VertexFlag[i] = (byte)0; // } // } // SelectRandomPoint(); // } //} //if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt) //{ // NonManifoldMesh m = mesh; // int n = m.VertexCount; // for (int i = 0; i < n; i++) // { // m.VertexFlag[i] = (byte)0; // } //} //base.MouseUp(mouseUpPos,button); }
public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { if (mesh == null) return; base.MouseDown(mouseDownPos, button); }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { base.MouseMove(mouseMovePos,button); switch (ParameterCurve.Instance.currentCurve) { case EnumCurveComplex.FourPointBezier : curve = ParameterCurve.Instance.CreateFourBezierCurve(mesh); break; case EnumCurveComplex.ThreePointBezier: curve = ParameterCurve.Instance.CreateThreeBezierCurve(mesh); break; case EnumCurveComplex.NPointBezier: curve = ParameterCurve.Instance.CreateNBezierCurve(mesh); break; case EnumCurveComplex.FourPointBSpline: curve = ParameterCurve.Instance.CreateFourPointBSplineCurve(mesh); break; case EnumCurveComplex.NPointBSpline: curve = ParameterCurve.Instance.CreateNBsplineCurve(mesh); break; case EnumCurveComplex.NURBS: curve = ParameterCurve.Instance.CreateNURBS(mesh); break; case EnumCurveComplex.NURBSCicle: curve = ParameterCurve.Instance.CreateNURBSCicle(mesh); break; case EnumCurveComplex.NURBSEllipse: curve = ParameterCurve.Instance.CreateNURBSEllipse(mesh); break; } }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { base.MouseMove(mouseMovePos, button); if (handleIndex == null) { return; } Vector2D p = mouseCurrPos - new Vector2D(projectedCenter.x, projectedCenter.y); p.x += 100; p.y += 100; switch (button) { case EnumMouseButton.Middle: movingBall.Drag(p); break; case EnumMouseButton.Left: movingBall.Drag(p / this.ScaleRatio); break; case EnumMouseButton.Right: movingBall.Drag(p); break; } Matrix4D tran = TransformController.Instance.TransformInverse * movingBall.CreateMatrix().Transpose() * TransformController.Instance.ModelMatrix; for (int i = 0; i < handleIndex.Count; i++) { int j = handleIndex[i]; Vector4D q = new Vector4D((Vector3D)oldHandlePos[i], 1); q = tran * (q - handleCenter) + handleCenter; mesh.Vertices[j].Traits.Position.x = q.x; mesh.Vertices[j].Traits.Position.y = q.y; mesh.Vertices[j].Traits.Position.z = q.z; } TriMeshUtil.SetUpNormalVertex(mesh); OnChanged(EventArgs.Empty); }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { base.MouseMove(mouseMovePos, button); if (handleIndex == null) return; Vector2D p = mouseCurrPos - new Vector2D(projectedCenter.x, projectedCenter.y); p.x += 100; p.y += 100; switch (button) { case EnumMouseButton.Middle: movingBall.Drag(p); break; case EnumMouseButton.Left: movingBall.Drag(p / this.ScaleRatio); break; case EnumMouseButton.Right: movingBall.Drag(p); break; } Matrix4D tran = TransformController.Instance.TransformInverse * movingBall.CreateMatrix().Transpose() * TransformController.Instance.ModelMatrix; for (int i = 0; i < handleIndex.Count; i++) { int j = handleIndex[i]; Vector4D q = new Vector4D((Vector3D)oldHandlePos[i], 1); q = tran * (q - handleCenter) + handleCenter; mesh.Vertices[j].Traits.Position.x = q.x; mesh.Vertices[j].Traits.Position.y = q.y; mesh.Vertices[j].Traits.Position.z = q.z; } //TriMeshUtil.SetUpNormalVertex(mesh); OnChanged(EventArgs.Empty); }
public ItemStackMoveOperation(IWorldAccessor world, EnumMouseButton mouseButton, EnumModifierKey modifiers, EnumMergePriority currentPriority, int requestedQuantity = 0) { World = world; MouseButton = mouseButton; Modifiers = modifiers; CurrentPriority = currentPriority; RequestedQuantity = requestedQuantity; }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { base.MouseUp(mouseUpPos, button); Matrix4D m = this.Ball.CreateMatrix(); TransformController.Instance.ModelMatrix = m * TransformController.Instance.ModelMatrix; this.Ball.End(); OnChanged(EventArgs.Empty); }
public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseDown(mouseDownPos, button); }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { if (mesh == null) return; base.MouseMove(mouseMovePos, button); OnChanged(EventArgs.Empty); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { base.MouseUp(mouseUpPos, button); Matrix4D m = this.Ball.CreateMatrix(); TransformController.Instance.ModelMatrix = m * TransformController.Instance.ModelMatrix; this.Ball.End(); OnChanged(EventArgs.Empty); }
public virtual void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { if (this.isMouseDown == false) { return; } this.mouseCurrPos = mouseMovePos; }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseMove(mouseMovePos, button); OnChanged(EventArgs.Empty); }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { if (mesh == null) return; base.MouseMove(mouseMovePos,button); SelectByCircle(); TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) return; base.MouseUp(mouseUpPos, button); mesh.GroupingFlags(); OnChanged(EventArgs.Empty); }
public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { base.MouseDown(mouseDownPos, button); switch (button) { case EnumMouseButton.Left: this.Ball.Click( mouseDownPos, ArcBall.MotionType.Rotation); break; case EnumMouseButton.Middle: this.Ball.Click(mouseDownPos / this.ScaleRatio, ArcBall.MotionType.Pan); break; case EnumMouseButton.Right: this.Ball.Click(mouseDownPos, ArcBall.MotionType.Scale); break; } }
public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { if (mesh == null) return; base.MouseDown(mouseDownPos, button); List<int> line = new List<int>(); lines.Add(line); }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseMove(mouseMovePos, button); SelectByCircle(); TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { base.MouseMove(mouseMovePos, button); switch (button) { case EnumMouseButton.Left: this.Ball.Drag(mouseCurrPos); break; case EnumMouseButton.Middle: this.Ball.Drag(mouseCurrPos / this.ScaleRatio); break; case EnumMouseButton.Right: this.Ball.Drag(mouseCurrPos); break; } OnChanged(EventArgs.Empty); }
public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { base.MouseDown(mouseDownPos, button); switch (button) { case EnumMouseButton.Left: this.Ball.Click(mouseDownPos, ArcBall.MotionType.Rotation); break; case EnumMouseButton.Middle: this.Ball.Click(mouseDownPos / this.ScaleRatio, ArcBall.MotionType.Pan); break; case EnumMouseButton.Right: this.Ball.Click(mouseDownPos, ArcBall.MotionType.Scale); break; } }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseUp(mouseUpPos, button); mesh.GroupingFlags(); OnChanged(EventArgs.Empty); }
public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseDown(mouseDownPos, button); List <int> line = new List <int>(); lines.Add(line); }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { base.MouseMove(mouseMovePos, button); switch (button) { case EnumMouseButton.Left: this.Ball.Drag(mouseCurrPos); break; case EnumMouseButton.Middle: this.Ball.Drag(mouseCurrPos / this.ScaleRatio); break; case EnumMouseButton.Right: this.Ball.Drag(mouseCurrPos); break; } OnChanged(EventArgs.Empty); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) return; base.MouseUp(mouseUpPos, button); if (button == EnumMouseButton.Left) { selectedPoint = SelectByPoint(); } mesh.GroupingFlags(); OnChanged(EventArgs.Empty); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) return; base.MouseUp(mouseUpPos, button); if (button == EnumMouseButton.Left) { selectedEdge = SelectByPoint(); } TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseUp(mouseUpPos, button); if (button == EnumMouseButton.Left) { selectedEdge = SelectByPoint(); } TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); Vector2D mouseUpPos = new Vector2D(e.X, this.Height - e.Y); EnumMouseButton button = EnumMouseButton.Left; switch (e.Button) { case MouseButtons.Middle: button = EnumMouseButton.Middle; break; case MouseButtons.Left: button = EnumMouseButton.Left; break; case MouseButtons.Right: button = EnumMouseButton.Right; break; } ToolPool.Instance.Tool.MouseUp(mouseUpPos, button); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseUp(mouseUpPos, button); if (button == EnumMouseButton.Left) { selectedPoint = SelectByPoint(); } mesh.GroupingFlags(); OnChanged(EventArgs.Empty); }
public virtual void SlotClick(ICoreClientAPI api, int slotId, EnumMouseButton mouseButton, bool shiftPressed, bool ctrlPressed, bool altPressed) { //Console.WriteLine("client side slot click on " + slotId); List <IInventory> inventories = api.World.Player.InventoryManager.OpenedInventories; IInventory mouseCursorInv = api.World.Player.InventoryManager.GetOwnInventory(GlobalConstants.mousecursorInvClassName); object packet; EnumModifierKey modifiers = (shiftPressed ? EnumModifierKey.SHIFT : 0) | (ctrlPressed ? EnumModifierKey.CTRL : 0) | (altPressed ? EnumModifierKey.ALT : 0) ; ItemStackMoveOperation op = new ItemStackMoveOperation(api.World, mouseButton, modifiers, EnumMergePriority.AutoMerge); op.ActingPlayer = api.World.Player; if (shiftPressed) { ItemSlot sourceSlot = inventory[slotId]; op.RequestedQuantity = sourceSlot.StackSize; packet = inventory.ActivateSlot(slotId, sourceSlot, ref op); } else { op.CurrentPriority = EnumMergePriority.DirectMerge; packet = inventory.ActivateSlot(slotId, mouseCursorInv[0], ref op); } if (packet != null) { if (packet is object[] packets) { for (int i = 0; i < packets.Length; i++) { SendPacketHandler(packets[i]); } } else { SendPacketHandler?.Invoke(packet); } } api.Input.TriggerOnMouseClickSlot(inventory[slotId]); }
public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseDown(mouseDownPos, button); bool haveSelected = false; for (int i = 0; i < mesh.Vertices.Count; i++) { if (mesh.Vertices[i].Traits.SelectedFlag == (byte)1) { haveSelected = true; } } if (button == EnumMouseButton.Left && !haveSelected) { selectedPoint = SelectByPoint(); } if (StartMoving() == false) { return; } Vector2D p = mouseDownPos - new Vector2D(projectedCenter.x, projectedCenter.y); p.x += 100; p.y += 100; switch (button) { case EnumMouseButton.Middle: movingBall.Click(p, ArcBall.MotionType.Rotation); break; case EnumMouseButton.Left: movingBall.Click(p / this.ScaleRatio, ArcBall.MotionType.Pan); break; case EnumMouseButton.Right: movingBall.Click(p, ArcBall.MotionType.Scale); break; } TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseUp(mouseUpPos, button); if (handleIndex == null) { return; } movingBall.End(); OnChanged(EventArgs.Empty); }
static void Prefix(ref WorldInteraction wi, out EnumMouseButton __state) { // Save initial state (because the draw call can happen with the same WorldInterraction multiple times) __state = wi.MouseButton; // Switch mouse buttons switch (wi.MouseButton) { case EnumMouseButton.Left: wi.MouseButton = EnumMouseButton.Right; break; case EnumMouseButton.Right: wi.MouseButton = EnumMouseButton.Left; break; } }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) return; base.MouseUp(mouseUpPos, button); switch (ToolSetting.ToolsSetting.SelectionMethod) { case ToolsSettingRecord.EnumSelectingMethod.Rectangle: SelectVertexByRect(); break; case ToolsSettingRecord.EnumSelectingMethod.Point: SelectVertexByPoint(); break; } mesh.GroupingFlags(); OnChanged(EventArgs.Empty); }
public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { if (mesh == null) return; base.MouseDown(mouseDownPos, button); if (StartMoving() == false) return; Vector2D p = mouseDownPos - new Vector2D(projectedCenter.x, projectedCenter.y); p.x += 100; p.y += 100; switch (button) { case EnumMouseButton.Middle: movingBall.Click(p, ArcBall.MotionType.Rotation); break; case EnumMouseButton.Left: movingBall.Click(p / this.ScaleRatio, ArcBall.MotionType.Pan); break; case EnumMouseButton.Right: movingBall.Click(p, ArcBall.MotionType.Scale); break; } TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { base.MouseMove(mouseMovePos, button); switch (ParameterCurve.Instance.currentCurve) { case EnumCurveComplex.FourPointBezier: curve = ParameterCurve.Instance.CreateFourBezierCurve(mesh); break; case EnumCurveComplex.ThreePointBezier: curve = ParameterCurve.Instance.CreateThreeBezierCurve(mesh); break; case EnumCurveComplex.NPointBezier: curve = ParameterCurve.Instance.CreateNBezierCurve(mesh); break; case EnumCurveComplex.FourPointBSpline: curve = ParameterCurve.Instance.CreateFourPointBSplineCurve(mesh); break; case EnumCurveComplex.NPointBSpline: curve = ParameterCurve.Instance.CreateNBsplineCurve(mesh); break; case EnumCurveComplex.NURBS: curve = ParameterCurve.Instance.CreateNURBS(mesh); break; case EnumCurveComplex.NURBSCicle: curve = ParameterCurve.Instance.CreateNURBSCicle(mesh); break; case EnumCurveComplex.NURBSEllipse: curve = ParameterCurve.Instance.CreateNURBSEllipse(mesh); break; } }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseUp(mouseUpPos, button); for (int i = 0; i < mesh.Vertices.Count; i++) { mesh.Vertices[i].Traits.SelectedFlag = (byte)0; } if (handleIndex == null) { return; } movingBall.End(); OnChanged(EventArgs.Empty); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseUp(mouseUpPos, button); switch (ToolSetting.ToolsSetting.SelectionMethod) { case ToolsSettingRecord.EnumSelectingMethod.Rectangle: SelectVertexByRect(); break; case ToolsSettingRecord.EnumSelectingMethod.Point: SelectVertexByPoint(); break; } mesh.GroupingFlags(); OnChanged(EventArgs.Empty); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) return; base.MouseUp(mouseUpPos, button); if (handleIndex == null) return; movingBall.End(); OnChanged(EventArgs.Empty); }
public virtual void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { this.isMouseDown = false; this.mouseCurrPos = mouseUpPos; }
public virtual void MouseDown(Vector2D mouseDownPos,EnumMouseButton button) { this.mouseDownPos = mouseDownPos; this.isMouseDown = true; }
static void Postfix(ref WorldInteraction wi, EnumMouseButton __state) { // Restore original state wi.MouseButton = __state; }
public ItemStackMergeOperation(IWorldAccessor world, EnumMouseButton mouseButton, EnumModifierKey modifiers, EnumMergePriority currentPriority, int requestedQuantity) : base(world, mouseButton, modifiers, currentPriority, requestedQuantity) { }
/// <summary> /// This is apparently used for mouse move events (set to true if the mouse state has changed during constant polling, set to false if the move event came from opentk. This emulated state is apparantly used to determine the correct delta position to turn the camera. /// </summary> /// <returns></returns> /// //public bool Emulated; public MouseEvent(int x, int y, int deltaX, int deltaY, EnumMouseButton button) { X = x; Y = y; DeltaX = deltaX; DeltaY = deltaY; Button = button; }
public MouseEvent(int x, int y, EnumMouseButton button) : this(x, y, 0, 0, button) { }
public virtual void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { this.mouseDownPos = mouseDownPos; this.isMouseDown = true; }
public virtual void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { if (this.isMouseDown == false) return; this.mouseCurrPos = mouseMovePos; }
public virtual void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { this.isMouseDown = false; this.mouseCurrPos = mouseUpPos; }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) return; base.MouseUp(mouseUpPos, button); for (int i = 0; i < mesh.Vertices.Count; i++) { mesh.Vertices[i].Traits.SelectedFlag = (byte)0; } if (handleIndex == null) return; movingBall.End(); OnChanged(EventArgs.Empty); }