Exemplo n.º 1
0
        private void DisconnectionUpdate(Output connection, Output connectorTemp, RectangleF connectorPosition)
        {
            var ui1 = UIInfo(connectorTemp);
            //The nature of the bezier splines means they will never reach outside the bounding rectangle which includes their endpoints
            RectangleF bounds = RectangleF.Union(ui1.Area.Value, connectorPosition);

            var  pair   = UnorderedTuple.Make(connectorTemp, connection);
            bool exists = SpatiallyOrderedConnections.FindTouchingRegion(bounds).Contains(Tuple.Create(pair, bounds));

            if (exists)
            {
                SpatiallyOrderedConnections.Remove(Tuple.Create(pair, bounds));
            }
        }
Exemplo n.º 2
0
        private void ConnectionUpdate(Output connection, Output connectorTemp, bool mustExist)
        {
            var ui1 = UIInfo(connectorTemp, false);
            var ui2 = UIInfo(connection, !mustExist);

            if (ui2 != null)
            {
                //The nature of the bezier splines means they will never reach outside the bounding rectangle which includes their endpoints
                RectangleF bounds = RectangleF.Union(ui1.Area.Value, ui2.Area.Value);

                var  pair   = UnorderedTuple.Make(connectorTemp, connection);
                bool exists = SpatiallyOrderedConnections.FindTouchingRegion(bounds).Contains(Tuple.Create(pair, bounds));
                if (!exists)
                {
                    SpatiallyOrderedConnections.Add(Tuple.Create(pair, bounds), bounds);
                }
                else
                {
                }
            }
        }