Esempio n. 1
0
        public ForceDirectedGraphForm()
        {
            InitializeComponent();

            this.DoubleBuffered = true;
            this.Width          = (width + 1) * 20;
            this.Height         = (height + 1) * 20 + 100;
            this.MaximumSize    = new Size(this.Width, this.Height);
            this.MaximizeBox    = false;

            tbStiffness.Text = "81.76";
            tbRepulsion.Text = "20000.0";
            tbDamping.Text   = "0.5";

            m_fdgGraph    = new PositionalGraph();
            m_fdgPhysics  = new ForceDirected2D(m_fdgGraph, 81.76f, 20000.0f, 0.5f);
            m_fdgRenderer = new Renderer(m_fdgPhysics, pDrawPanel.Size.Height, pDrawPanel.Size.Width);


            pDrawPanel.Paint += new PaintEventHandler(DrawPanel_Paint);

            timer.Interval = 30;
            timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
            timer.Start();
        }
Esempio n. 2
0
        public ForceDirected(PositionalGraph iGraph, float iStiffness, float iRepulsion, float iDamping)
        {
            graph         = iGraph;
            Stiffness     = iStiffness;
            Repulsion     = iRepulsion;
            Damping       = iDamping;
            m_nodePoints  = new Dictionary <string, Point>();
            m_edgeSprings = new Dictionary <string, Spring>();

            Threadshold = 0.01f;
        }
Esempio n. 3
0
 public ForceDirected2D(PositionalGraph iGraph, float iStiffness, float iRepulsion, float iDamping)
     : base(iGraph, iStiffness, iRepulsion, iDamping)
 {
 }