-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphpainter.h
33 lines (33 loc) · 1.08 KB
/
graphpainter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#ifndef __GRAPHPAINTER__
#define __GRAPHPAINTER__
#include <cstdlib>
#include <string.h>
#include <fstream>
#include <stdexcept>
#include <sstream>
#include <iostream>
using namespace std;
enum GraphType { Graph = 0, DiGraph = 1 ,BT=2};
enum LayoutType {none=0,bt=1,graphviz=2,joel=3,joel2=4,auto_=5};
class graphpainter
{
public:
char filename[256]; //Êä³öµØÖ·
char exeaddr[256]; //graphpainterÖ´ÐÐÎļþµØÖ·
graphpainter(const char* addr = "python graphpainter.py");
bool newpainter(const char* filename, const GraphType gtype, const LayoutType ltype=auto_);
void close();
void setgraph(const char* attr, const char* value);
void setfigure(const char *attr, const char* value);
void setlayout(const char *attr, const char* value);
void setdraw(const char *attr, const char* value);
void setnode(const char *nodeid, const char* label = "");
void setedge(const char *uid, const char* vid);
void setbtnode(char bind, const char * nodeid, const char * label);
void draw(const char* tip = "Drawing...\n");
private:
int mode;
fstream fout;
};
#endif