Exemple #1
0
        public LayoutAnimation(AlgorithmBlob blob, Action update, Action finalUpdate, Layout.Algorithm layoutAlgorithm, List <Graphs.Vector> layout = null, object data = null)
        {
            _blob        = blob;
            _update      = update;
            _finalUpdate = finalUpdate;
            try
            {
                _layout = layoutAlgorithm(blob.AlgorithmGraph, layout, data);
            }
            catch { }

            if (_layout == null)
            {
                return;
            }

            try
            {
                _xstep = new double[_layout.Count];
                _ystep = new double[_layout.Count];
                for (int i = 0; i < _layout.Count; i++)
                {
                    _xstep[i] = (_layout[i].X - _blob.UIGraph.Vertices[i].X) / Steps;
                    _ystep[i] = (_layout[i].Y - _blob.UIGraph.Vertices[i].Y) / Steps;
                }

                _storyBoard            = new Storyboard();
                _storyBoard.Duration   = TimeSpan.FromMilliseconds(1);
                _storyBoard.Completed += OnStoryBoardCompleted;
                _storyBoard.Begin();
            }
            catch { }
        }
        public ChooseTermWindow(AlgorithmBlob blob, bool doSign = false)
        {
            InitializeComponent();
            G = blob.AlgorithmGraph;

            _doSign = doSign;
            Show();
        }