public bool HandleMouseDown(UnitPoint mouseunitpoint, ref bool handled, ISnapPoint snapPt = null) { handled = false; if (m_nodes.Count == 0) // no nodes selected yet { if (m_canvas.Model.SelectedCount > 0) { foreach (IDrawObject obj in m_canvas.Model.SelectedObjects) { INodePoint p = obj.NodePoint(m_canvas, mouseunitpoint); if (p != null) { m_nodes.Add(p); } } } handled = m_nodes.Count > 0; if (handled) { m_originPoint = mouseunitpoint; } return(handled); } // update selected nodes m_canvas.Model.MoveNodes(mouseunitpoint, m_nodes); MoveReferenceNodesOfRect(m_nodes, snapPt, mouseunitpoint); m_nodes.Clear(); handled = true; m_canvas.CanvasCtrl.DoInvalidate(true); return(handled); }
public void DeattachConnectionCrvNode(INodePoint node) { ConnectionCrvNodeToRectBaseNodePair existNode = m_allConnectionCrvNodes.Find( curNode => curNode.connectionCrvNode.GetOriginal() == node.GetOriginal() ); if (existNode.connectionCrvNode != null) { m_allConnectionCrvNodes.Remove(existNode); } }
public void AttachConnectionCrvNode(INodePoint node) { ConnectionCrvNodeToRectBaseNodePair existNode = m_allConnectionCrvNodes.Find( curNode => curNode.connectionCrvNode.GetOriginal() == node.GetOriginal() ); if (existNode.connectionCrvNode == null) { m_allConnectionCrvNodes.Add(new ConnectionCrvNodeToRectBaseNodePair(node, GetVertexIdFromPoint(node.GetPosition()))); } }
void DeattachConnectionNode(INodePoint node) { foreach (var curLayer in m_canvas.Model.Layers) { DrawingLayer drawingLayer = curLayer as DrawingLayer; if (drawingLayer == null) { continue; } foreach (var curObj in drawingLayer.Objects) { if (!(curObj is DrawTools.RectBase)) { continue; } ((DrawTools.RectBase)curObj).DeattachConnectionCrvNode(node); } } }
public bool HandleMouseDown(UnitPoint mouseunitpoint, ref bool handled) { handled = false; if (nodePoints.Count == 0) // no nodes selected yet { if (canvasWrapper.DataModel.SelectedCount > 0) { foreach (IDrawObject obj in canvasWrapper.DataModel.DrawingLayer.SelectedObjects) { if (obj.IsLocked == true) { continue; } INodePoint p = obj.NodePoint(mouseunitpoint); if (p != null) { nodePoints.Add(p); this.drawObjectsEdit.Add(obj); } } } handled = nodePoints.Count > 0; if (handled) { originalPoint = mouseunitpoint; } return(handled); } // update selected nodes canvasWrapper.DataModel.MoveNodes(mouseunitpoint, nodePoints); nodePoints.Clear(); this.drawObjectsEdit.Clear(); handled = true; canvasWrapper.UCCanvas.DoInvalidate(true); return(handled); }
public ConnectionCrvNodeToRectBaseNodePair(INodePoint node, eVertexId rectNodeId) { this.connectionCrvNode = node; this.rectNodeId = rectNodeId; }