Changeset 156:c5cdf6690cdf in glemon-0.x
- Timestamp:
- 09/28/06 16:32:40 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/trunk@2961
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
graph_displayer_canvas-node.cc
r155 r156 37 37 { 38 38 w=5; 39 } 40 41 if(zoomtrack) 42 { 43 double actual_ppu=get_pixels_per_unit(); 44 w=(int)(w/actual_ppu*fixed_zoom_factor); 39 45 } 40 46 … … 96 102 w=(int)(MIN_NODE_RADIUS+(v-min)/(max-min)*(MAX_NODE_RADIUS-MIN_NODE_RADIUS)); 97 103 } 104 if(zoomtrack) 105 { 106 double actual_ppu=get_pixels_per_unit(); 107 w=(int)(w/actual_ppu*fixed_zoom_factor); 108 } 98 109 if(w>=0) 99 110 { -
graph_displayer_canvas-zoom.cc
r89 r156 6 6 set_pixels_per_unit( 7 7 (1.0 + (double) zoom_step / 100.0) * get_pixels_per_unit()); 8 if(zoomtrack) 9 { 10 propertyChange(false, N_RADIUS); 11 } 8 12 } 9 13 … … 12 16 set_pixels_per_unit( 13 17 (1.0 - (double) zoom_step / 100.0) * get_pixels_per_unit()); 18 if(zoomtrack) 19 { 20 propertyChange(false, N_RADIUS); 21 } 14 22 } 15 23 … … 32 40 double ppu2 = (double) ah / fabs(y2 - y1); 33 41 set_pixels_per_unit((ppu1 < ppu2) ? ppu1 : ppu2); 42 43 if(zoomtrack) 44 { 45 propertyChange(false, N_RADIUS); 46 } 34 47 } 35 48 … … 38 51 updateScrollRegion(); 39 52 set_pixels_per_unit(1.0); 53 54 if(zoomtrack) 55 { 56 propertyChange(false, N_RADIUS); 57 } 40 58 } 41 59 -
graph_displayer_canvas.cc
r154 r156 6 6 nodetextmap(mainw.mapstorage.graph), displayed_graph(*(root()), 0, 0), 7 7 isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""), 8 edgemap_to_edit(""), autoscale(true), radius_min(10), radius_max(40), radius_unit(1), mytab(mainw)8 edgemap_to_edit(""), autoscale(true), zoomtrack(false), radius_min(10), radius_max(40), radius_unit(1), mytab(mainw) 9 9 { 10 10 //base event handler is move tool … … 228 228 } 229 229 230 void GraphDisplayerCanvas::setNodeView(bool autoscale_p, double min_p, double max_p, double unit_p)230 void GraphDisplayerCanvas::setNodeView(bool autoscale_p, bool zoomtrack_p, double min_p, double max_p, double unit_p) 231 231 { 232 232 autoscale=autoscale_p; … … 234 234 radius_max=max_p; 235 235 radius_unit=unit_p; 236 237 if((!zoomtrack) && zoomtrack_p) 238 { 239 fixed_zoom_factor=get_pixels_per_unit(); 240 } 241 242 zoomtrack=zoomtrack_p; 243 236 244 propertyChange(false, N_RADIUS); 237 245 } 238 246 239 void GraphDisplayerCanvas::getNodeView(bool & autoscale_p, double& min_p, double& max_p, double& unit_p)247 void GraphDisplayerCanvas::getNodeView(bool & autoscale_p, bool & zoomtrack_p, double& min_p, double& max_p, double& unit_p) 240 248 { 241 249 autoscale_p=autoscale; 250 zoomtrack_p=zoomtrack; 242 251 min_p=radius_min; 243 252 max_p=radius_max; -
graph_displayer_canvas.h
r154 r156 288 288 289 289 ///Sets node representation settings 290 void setNodeView(bool, double, double, double);290 void setNodeView(bool, bool, double, double, double); 291 291 292 292 ///Gets node representation settings 293 void getNodeView(bool &, double&, double&, double&);293 void getNodeView(bool &, bool &, double&, double&, double&); 294 294 295 295 ///draws the graph … … 387 387 bool autoscale; 388 388 389 ///Should we track zoomfactor changes 390 bool zoomtrack; 391 392 ///to store the zoom factor when it was "fixed" 393 double fixed_zoom_factor; 394 389 395 ///Minimum node radius 390 396 double radius_min; -
main_win.cc
r155 r156 200 200 201 201 } 202 203 auto_scale= new Gtk::CheckButton("Autoscale"); 202 203 table2.set_row_spacings(10); 204 table2.set_col_spacings(5); 205 206 auto_scale = new Gtk::CheckButton("Autoscale"); 204 207 auto_scale->set_active(false); 205 208 auto_scale->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged)); 206 207 table2.set_row_spacings(10);208 table2.set_col_spacings(5);209 210 209 table2.attach(*auto_scale, 0,2,0,1); 211 210 212 211 Gtk::Label * unit_label= new Gtk::Label("Unit:"); 213 212 // table2.attach(*unit_label, 2,3,0,1); … … 236 235 radius_max->signal_value_changed().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged)); 237 236 table2.attach(*radius_max, 3,4,1,2); 237 238 zoom_track = new Gtk::CheckButton("Zoom tracking"); 239 zoom_track->set_active(false); 240 zoom_track->signal_toggled().connect(sigc::mem_fun(*this, &MainWin::nodeViewChanged)); 241 table2.attach(*zoom_track, 2,4,0,1); 242 238 243 239 244 //vbox.pack_start(hbox, Gtk::PACK_SHRINK); … … 363 368 set_title(tabnames[active_tab]); 364 369 bool autoscale; 370 bool zoomtrack; 365 371 double min; 366 372 double max; 367 373 double unit; 368 tabs[active_tab]->getNodeView(autoscale, min, max, unit);374 tabs[active_tab]->getNodeView(autoscale, zoomtrack, min, max, unit); 369 375 radius_min->set_value(min); 370 376 radius_max->set_value(max); 371 377 radius_unit->set_value(unit); 378 zoom_track->set_active(zoomtrack); 372 379 auto_scale->set_active(autoscale); 373 380 … … 540 547 double max=radius_max->get_value(); 541 548 double unit=radius_unit->get_value(); 549 bool zoomtrack=zoom_track->get_active(); 542 550 bool autoscale=auto_scale->get_active(); 543 tabs[active_tab]->setNodeView(autoscale, min, max, unit);544 } 551 tabs[active_tab]->setNodeView(autoscale, zoomtrack, min, max, unit); 552 } -
main_win.h
r154 r156 30 30 ///Should nodes be autoscaled or not? 31 31 Gtk::CheckButton * auto_scale; 32 33 ///Should node size track zoom factor? 34 Gtk::CheckButton * zoom_track; 32 35 33 36 ///Minimum and maximum node radius entry -
nbtab.cc
r154 r156 219 219 } 220 220 221 void NoteBookTab::setNodeView(bool autoscale, double min, double max, double unit)222 { 223 gd_canvas->setNodeView(autoscale, min, max, unit);224 } 225 226 void NoteBookTab::getNodeView(bool & autoscale, double& min, double& max, double& unit)227 { 228 gd_canvas->getNodeView(autoscale, min, max, unit);229 } 221 void NoteBookTab::setNodeView(bool autoscale, bool zoomtrack, double min, double max, double unit) 222 { 223 gd_canvas->setNodeView(autoscale, zoomtrack, min, max, unit); 224 } 225 226 void NoteBookTab::getNodeView(bool & autoscale, bool & zoomtrack, double& min, double& max, double& unit) 227 { 228 gd_canvas->getNodeView(autoscale, zoomtrack, min, max, unit); 229 } -
nbtab.h
r154 r156 159 159 160 160 ///Sets node representation settings 161 void setNodeView(bool, double, double, double);161 void setNodeView(bool, bool, double, double, double); 162 162 163 163 ///Gets node representation settings 164 void getNodeView(bool &, double&, double&, double&);164 void getNodeView(bool &, bool &, double&, double&, double&); 165 165 }; 166 166
Note: See TracChangeset
for help on using the changeset viewer.