COIN-OR::LEMON - Graph Library

source: lemon-0.x/gui/graph-displayer.cc @ 1616:78704393218d

Last change on this file since 1616:78704393218d was 1616:78704393218d, checked in by Akos Ladanyi, 15 years ago

open file from command line

File size: 1.4 KB
RevLine 
[1606]1#include "all_include.h"
2#include "mapstorage.h"
3#include "main_win.h"
[1412]4#include <libgnomecanvasmm.h>
5#include <libgnomecanvasmm/polygon.h>
6
7#define MAIN_PART
8
[1512]9std::vector <std::string> edge_property_strings;
10std::vector <double> edge_property_defaults;
11std::vector <std::string> node_property_strings;
12std::vector <double> node_property_defaults;
[1412]13
14
15int main(int argc, char *argv[])
16{
[1440]17
18  //initializing
19
[1512]20  edge_property_strings.resize(EDGE_PROPERTY_NUM);
21  edge_property_strings[E_WIDTH]="Edge Width";
22  edge_property_strings[E_COLOR]="Edge Color";
23  edge_property_strings[E_TEXT]="Edge Text";
[1412]24
[1512]25  edge_property_defaults.resize(EDGE_PROPERTY_NUM);
26  edge_property_defaults[E_WIDTH]=10.0;
27  edge_property_defaults[E_COLOR]=100;
28  edge_property_defaults[E_TEXT]=0;
29
30  node_property_strings.resize(NODE_PROPERTY_NUM);
31  node_property_strings[N_RADIUS]="Node Radius";
32  node_property_strings[N_COLOR]="Node Color";
33  node_property_strings[N_TEXT]="Node Text";
34
35  node_property_defaults.resize(NODE_PROPERTY_NUM);
36  node_property_defaults[N_RADIUS]=20.0;
37  node_property_defaults[N_COLOR]=100;
38  node_property_defaults[N_TEXT]=0;
[1412]39
[1440]40  //initializing GUI
41
[1412]42  Gnome::Canvas::init();
43  Gtk::Main app(argc, argv);
44
[1606]45  MainWin mainwin("Displayed Graph");
[1616]46
47  if ((argc == 2) && (Glib::file_test(argv[1], Glib::FILE_TEST_IS_REGULAR)))
48  {
49    mainwin.readFile(argv[1]);
50  }
51 
[1412]52  app.run(mainwin);
53
54  return 0;
55}
Note: See TracBrowser for help on using the repository browser.