graph_displayer_canvas.cc
changeset 157 7e6ad28aeb9e
parent 156 c5cdf6690cdf
child 160 14a76109b561
equal deleted inserted replaced
43:3cf36220023e 44:507415e4eca8
     3 
     3 
     4 GraphDisplayerCanvas::GraphDisplayerCanvas(NoteBookTab & mainw) :
     4 GraphDisplayerCanvas::GraphDisplayerCanvas(NoteBookTab & mainw) :
     5   nodesmap(mainw.mapstorage.graph), edgesmap(mainw.mapstorage.graph), edgetextmap(mainw.mapstorage.graph),
     5   nodesmap(mainw.mapstorage.graph), edgesmap(mainw.mapstorage.graph), edgetextmap(mainw.mapstorage.graph),
     6   nodetextmap(mainw.mapstorage.graph), displayed_graph(*(root()), 0, 0),
     6   nodetextmap(mainw.mapstorage.graph), displayed_graph(*(root()), 0, 0),
     7   isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""),
     7   isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""),
     8   edgemap_to_edit(""), autoscale(true), zoomtrack(false), radius_min(10), radius_max(40), radius_unit(1), mytab(mainw)
     8   edgemap_to_edit(""), autoscale(true), zoomtrack(false), radius_size(20), edge_width(10), mytab(mainw)
     9 {
     9 {
    10   //base event handler is move tool
    10   //base event handler is move tool
    11   actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false);
    11   actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false);
    12   actual_tool=MOVE;
    12   actual_tool=MOVE;
    13 
    13 
   225     delete edgesmap[e];
   225     delete edgesmap[e];
   226     delete edgetextmap[e];
   226     delete edgetextmap[e];
   227   }
   227   }
   228 }
   228 }
   229 
   229 
   230 void GraphDisplayerCanvas::setNodeView(bool autoscale_p, bool zoomtrack_p, double min_p, double max_p, double unit_p)
   230 void GraphDisplayerCanvas::setView(bool autoscale_p, bool zoomtrack_p, double width_p, double radius_p)
   231 {
   231 {
   232   autoscale=autoscale_p;
   232   autoscale=autoscale_p;
   233   radius_min=min_p;
   233   edge_width=width_p;
   234   radius_max=max_p;
   234   radius_size=radius_p;
   235   radius_unit=unit_p;
       
   236 
   235 
   237   if((!zoomtrack) && zoomtrack_p)
   236   if((!zoomtrack) && zoomtrack_p)
   238     {
   237     {
   239       fixed_zoom_factor=get_pixels_per_unit();
   238       fixed_zoom_factor=get_pixels_per_unit();
   240     }
   239     }
   241 
   240 
   242   zoomtrack=zoomtrack_p;
   241   zoomtrack=zoomtrack_p;
   243 
   242 
   244   propertyChange(false, N_RADIUS);
   243   propertyChange(false, N_RADIUS);
   245 }
   244   propertyChange(true, E_WIDTH);
   246 
   245 }
   247 void GraphDisplayerCanvas::getNodeView(bool & autoscale_p, bool & zoomtrack_p, double& min_p, double& max_p, double& unit_p)
   246 
       
   247 void GraphDisplayerCanvas::getView(bool & autoscale_p, bool & zoomtrack_p, double& width_p, double& radius_p)
   248 {
   248 {
   249   autoscale_p=autoscale;
   249   autoscale_p=autoscale;
   250   zoomtrack_p=zoomtrack;
   250   zoomtrack_p=zoomtrack;
   251   min_p=radius_min;
   251   width_p=edge_width;
   252   max_p=radius_max;
   252   radius_p=radius_size;
   253   unit_p=radius_unit;
   253 }
   254 }