Beispiel #1
0
        internal void SetJoin(MillingItem shape1, MillingItem shape2)
        {
            var joinCopy = _itemJoins.ToArray();

            foreach (var join in joinCopy)
            {
                if (join.Item2 == shape2)
                {
                    //shape can have only one target join
                    _itemJoins.Remove(join);
                }

                if (join.Item1 == shape2 && join.Item2 == shape1)
                {
                    //cyclic joins are not allowes
                    _itemJoins.Remove(join);
                }
            }

            var newJoin = new MillingJoin(shape1, shape2);

            _itemJoins.Add(newJoin);

            InvalidateVisual();
            fireOnSettingsChanged();
            fireOnWorkItemListChanged();
        }
Beispiel #2
0
        private Point getJoinPointProjected(MillingItem item)
        {
            var point = item.EntryPoint;

            var x = ActualWidth * point.C1 / RangeX;
            var y = ActualHeight * point.C2 / RangeY;

            return(new Point(x, y));
        }
Beispiel #3
0
        internal IEnumerable <MillingJoin> FindOutgoingJoins(MillingItem item)
        {
            var result = new List <MillingJoin>();

            foreach (var join in _itemJoins)
            {
                if (join.Item1 == item)
                {
                    result.Add(join);
                }
            }

            return(result);
        }