52 mHeader(strdup(
"/*PEBL VGC-Tool Graph for selected program.\n (C) 2003 Shane T. Mueller, Ph.D.*/\n"))
77 cout << (*mGraph) << endl;
89 ost1 <<
"NODE-" << mNodeIndex++;
91 name = strdup(ost1.str());
106 ost2 <<
"OpNode\\n" << ((
OpNode*)node)->GetOpName();
112 variant = ((
DataNode*)node)->GetValue();
119 ost2 <<
"Unknown Node Type\\nUnknown Value";
125 char* label = strdup(ost2.str());
128 cerr <<
"About to make node with: ["<< name <<
"] and [" << label <<
"]." << endl;
168 left = ((
OpNode*)node)->GetLeft();
169 right = ((
OpNode*)node)->GetRight();
187 mTitle(strdup(
"VCG Graph File for PEBL-Interpreted PCode Tree")),
193 mColor(strdup(
"blue"))
211 mVCGEdges.push_front(*edge);
217 mVCGNodes.push_front(*node);
227 out <<
"graph: { title: \"" << v.
GetTitle() <<
"\"\n";
228 out <<
" splines: no\n";
229 out <<
" layoutalgorithm: tree\n";
230 out <<
" smanhattan_edges: yes\n";
231 out <<
" finetuning: yes\n";
232 out <<
" portsharing: no\n";
233 out <<
" treefactor: 0.2\n";
234 out <<
" width: " << v.
GetWidth() << endl;
235 out <<
" height: " << v.
GetHeight() << endl;
236 out <<
" x: " << v.
GetX() << endl;
237 out <<
" y: " << v.
GetY() << endl;
238 out <<
" color: " << v.
GetColor() << endl;
248 out <<
"\n}" << endl;
256 list<VCGNode>::iterator p = mVCGNodes.begin();
259 while(p != mVCGNodes.end())
271 list<VCGEdge>::iterator p = mVCGEdges.begin();
274 while(p != mVCGEdges.end())
289 mTitle(strdup(
"Default VCG Node Title")),
290 mLabel(strdup(
"Default Label")),
291 mShape(strdup(
"box")),
292 mBorderColor(strdup(
"black"))
302 mTitle(strdup(title)),
303 mLabel(strdup(label)),
304 mShape(strdup(
"box")),
305 mBorderColor(strdup(
"black"))
329 out <<
"node: { title: \"" << v.
GetTitle() <<
"\"\n";
330 out <<
" label: \"" << v.
GetLabel() <<
"\"\n";
331 out <<
" shape: " << v.
GetShape() <<
"\n";
375 out <<
"edge: { sourcename: \"" << v.
GetFrom() <<
"\"\n";
376 out <<
" targetname: \"" << v.
GetTo() <<
"\"\n";
ostream & operator<<(ostream &out, VCGGraph &v)
PNODE_TYPE GetType() const
Access mType data.
~VCGEdge()
Standard Destructor for the 'Edge' class.
VCGEdge()
Standard Constructor for the 'Edge' class.
void SetAnchor(const int i)
void AddNode(VCGNode *node)
void OutputNodes(std::ostream &out)
void AddEdge(VCGEdge *edge)
~VCGGraph()
Standard Destructor for the 'Graph' class.
void OutputEdges(std::ostream &out)
VCGGraph()
Standard Constructor for the 'Graph' class.
VCGNode()
Standard Constructor for the 'Graph' class.
void SetBorderColor(const char *color)
void SetShape(const char *shape)
char * GetBorderColor() const
~VCGNode()
Standard Destructor for the 'Graph' class.
~VCG()
Standard Destructor for Main VCG class.
void Evaluate(const PNode *node, const char *parent, const int anchor)
void MakeGraph(const PNode *node)
VCG()
Standard Constructor for Main VCG class.
std::string GetDataTypeName() const
This returns the type as a string.