1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #include <QFile>
- #include <LayoutManager/LayoutManager.h>
- int main(int ac, char *argv[])
- {
- LayoutManager layoutManager;
- const char *inf = argv[1];
- const char *outf = argv[2];
- if(ac==0){}
- if (!inf) {
- inf = (const char *)"nc.graphml";
- }
- if (!outf) {
- outf= (const char *)"output.graphml";
- }
- if (0) {
- QFile filein (inf);
- if (!filein.open (QIODevice::ReadOnly | QIODevice::Text)) {
- printf("cannot open in file\n");
- return 0;
- }
- GraphMLReader reader;
- SubGraph &gInGraph = reader.readGraphML(&filein);
- QFile outFile(outf);
- if (!outFile.open(QFile::WriteOnly | QFile::Truncate))
- {
- cout<<"Write path file could not be open. Exiting.\n";
- }
- else
- {
- GraphMLWriter writer;
- writer.writeGraphml(gInGraph , &outFile);
- }
- } else {
- layoutManager.applyGridBasedLayout("nc.graphml", "output.graphml"); // outf
- }
- return 0;
- }
|