Esempio n. 1
0
        public LinkOptimiser(ChartControl diagram, Diagram_.Options opts)
        {
            m_diagram = diagram;
            m_opts    = opts;
            m_conns   = new List <Connector>();
            m_timer   = new DispatcherTimer(TimeSpan.FromMilliseconds(100), DispatcherPriority.Background, HandleTick, Dispatcher.CurrentDispatcher);
            m_issue   = 0;

            // Handler
            void HandleTick(object?sender, EventArgs e) => Step();
        }
Esempio n. 2
0
        public NodeScatterer(ChartControl diagram, Diagram_.Options opts)
        {
            m_diagram = diagram;
            m_opts    = opts;
            m_rng     = new Random();
            m_springs = new List <Link>();
            m_charges = new List <Link>();
            m_body    = new List <Body>();
            m_timer   = new DispatcherTimer(TimeSpan.FromMilliseconds(10), DispatcherPriority.Background, Step, Dispatcher.CurrentDispatcher);

            Init();

            // Start the sim
            m_timer.Start();
        }