COIN-OR::LEMON - Graph Library

Changeset 166:302d75b08b27 in glemon-0.x


Ignore:
Timestamp:
10/16/06 15:05:25 (18 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@2992
Message:

Graph redesign starts with an initial kick of the first node.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • graph_displayer_canvas.cc

    r160 r166  
    77  isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""),
    88  edgemap_to_edit(""), autoscale(true), zoomtrack(false), radius_size(20), edge_width(10),
    9   iterations(20), attraction(0.05), propulsation(40000), mytab(mainw)
     9  iterations(20), attraction(0.05), propulsation(40000), was_redesigned(false), mytab(mainw)
    1010{
    1111  //base event handler is move tool
     
    256256void GraphDisplayerCanvas::reDesignGraph()
    257257{
    258   double min_dist=40;
     258  double min_dist=20;
     259  double init_vector_length=25;
     260
     261  if(!was_redesigned)
     262    {
     263      NodeIt i((mytab.mapstorage).graph);
     264      double r=random();
     265      dim2::Point<double> init(init_vector_length*sin(r),init_vector_length*cos(r));
     266      moveNode(init.x, init.y, nodesmap[i], i);
     267      was_redesigned=true;
     268    }
     269 
    259270
    260271  //iteration counter
  • graph_displayer_canvas.h

    r160 r166  
    418418  ///Propulsation factor during graph design
    419419  double propulsation;
     420
     421  ///Was redesign run on this graph already?
     422  ///
     423  ///If not, the layout will be modified randomly
     424  ///to avoid frozen layout because of wrong
     425  ///initial state
     426  bool was_redesigned;
    420427 
    421428private:
Note: See TracChangeset for help on using the changeset viewer.