initial
[prop.git] / include / AD / visualize / vcg.h
blobf5191c36d50462008241e46de76c8bee16535dd9
1 //////////////////////////////////////////////////////////////////////////////
2 // NOTICE:
3 //
4 // ADLib, Prop and their related set of tools and documentation are in the
5 // public domain. The author(s) of this software reserve no copyrights on
6 // the source code and any code generated using the tools. You are encouraged
7 // to use ADLib and Prop to develop software, in both academic and commercial
8 // settings, and are welcomed to incorporate any part of ADLib and Prop into
9 // your programs.
11 // Although you are under no obligation to do so, we strongly recommend that
12 // you give away all software developed using our tools.
14 // We also ask that credit be given to us when ADLib and/or Prop are used in
15 // your programs, and that this notice be preserved intact in all the source
16 // code.
18 // This software is still under development and we welcome(read crave for)
19 // any suggestions and help from the users.
21 // Allen Leung (leunga@cs.nyu.edu)
22 // 1994-1997
23 //////////////////////////////////////////////////////////////////////////////
25 #ifndef vcg_visualizer_h
26 #define vcg_visualizer_h
28 #include <AD/generic/generic.h>
29 #include <stdarg.h>
31 class VCG_Internal;
32 class ostream;
34 //////////////////////////////////////////////////////////////////////////////
36 // Visualizer base class
38 //////////////////////////////////////////////////////////////////////////////
39 class VCG
40 { VCG(const VCG&);
41 void operator = (const VCG&);
43 public:
44 //////////////////////////////////////////////////////////////////////////
46 // Attribute types
48 //////////////////////////////////////////////////////////////////////////
49 typedef const char * Label;
50 typedef const char * String;
51 typedef const struct color * Color;
52 typedef const void * Node;
53 typedef Node Graph;
54 typedef const struct text_mode * TextMode;
55 typedef const struct shape * Shape;
56 typedef const struct algorithm * Algorithm;
57 typedef const struct linestyle * LineStyle;
58 typedef const struct arrowstyle * ArrowStyle;
59 enum EdgeType { NORMAL_EDGE, BACK_EDGE, NEAR_EDGE, BENT_NEAR_EDGE };
61 public:
62 ///////////////////////////////////////////////////////////////////////////
64 // Predefined constants
66 ///////////////////////////////////////////////////////////////////////////
67 static Color black, blue, red, green, yellow, magenta, cyan,
68 white, darkgrey, darkblue, darkred, darkgreen,
69 darkyellow, darkmagneta, darkcyan, gold, lightgrey,
70 lightblue, lightred, lightgreen, lightyellow,
71 lightmagenta, lightcyan, lilac, turquoise, aquamarine,
72 khaki, purple, yellowgreen, pink, orange, orchid;
74 static TextMode center, left_justify, right_justify;
76 static Shape box, rhomb, ellipse, triangle;
78 static Algorithm maxdepth, mindepth, maxdepthslow, mindepthslow,
79 maxdegree, mindegree, maxindegree, minindegree,
80 maxoutdegree, minoutdegree, minbackward, dfs, tree;
82 static LineStyle continuous, dashed, dotted, invisible;
84 static ArrowStyle solid, line, none;
86 public:
87 VCG();
88 virtual ~VCG();
90 ///////////////////////////////////////////////////////////////////////////
92 // Test whether a node/graph or an edge has already been visited.
94 ///////////////////////////////////////////////////////////////////////////
95 Bool visited(Node) const;
96 Bool visited(Node, Node) const;
98 ///////////////////////////////////////////////////////////////////////////
100 // Error handling method
102 ///////////////////////////////////////////////////////////////////////////
103 virtual VCG& error (const char *, ...);
105 ///////////////////////////////////////////////////////////////////////////
107 // Create graph objects
109 ///////////////////////////////////////////////////////////////////////////
110 virtual VCG& begin_graph(Graph);
111 virtual VCG& end_graph(Graph);
112 virtual VCG& begin_node(Node);
113 virtual VCG& end_node(Node);
114 virtual VCG& begin_edge(Node, Node, EdgeType = NORMAL_EDGE);
115 virtual VCG& end_edge(Node, Node);
116 VCG& node(Node);
117 VCG& edge(Node, Node, EdgeType = NORMAL_EDGE);
118 VCG& begin_backedge(Node, Node);
119 VCG& begin_nearedge(Node, Node);
120 VCG& begin_bentnearedge(Node, Node);
122 ///////////////////////////////////////////////////////////////////////////
124 // Print Graph Description Language(GDL)
126 ///////////////////////////////////////////////////////////////////////////
127 virtual VCG& print_GDL_on(ostream&);
129 ///////////////////////////////////////////////////////////////////////////
131 // Object attributes
133 ///////////////////////////////////////////////////////////////////////////
134 VCG& begin_node_default();
135 VCG& begin_edge_default();
136 VCG& end_default();
137 virtual VCG& attrib(String,String);
138 virtual VCG& attrib_quoted(String,String);
139 virtual VCG& attrib_int(String,int);
140 virtual VCG& attrib_bool(String,Bool);
142 ///////////////////////////////////////////////////////////////////////////
144 // Common object attributes
146 ///////////////////////////////////////////////////////////////////////////
147 VCG& label(Label);
148 VCG& label(int);
149 VCG& color(Color);
150 VCG& textcolor(Color);
151 VCG& width(int);
152 VCG& height(int);
153 VCG& borderwidth(int);
154 VCG& x(int);
155 VCG& y(int);
156 VCG& folding(int);
157 VCG& shrink(int);
158 VCG& stretch(int);
159 VCG& textmode(TextMode);
160 VCG& shape(Shape);
161 VCG& vertical_order(int);
162 VCG& horizontal_order(int);
163 VCG& xmax(int);
164 VCG& ymax(int);
165 VCG& xbase(int);
166 VCG& ybase(int);
167 VCG& xlspace(int);
168 VCG& xspace(int);
169 VCG& yspace(int);
170 VCG& xlraster(int);
171 VCG& ylraster(int);
172 VCG& hidden(int);
173 VCG& classname(String);
174 VCG& infoname(String);
175 VCG& layoutalgorithm(Algorithm);
176 VCG& layout_downfactor(int);
177 VCG& layout_upfactor(int);
178 VCG& layout_nearfactor(int);
179 VCG& layout_splinefactor(int);
180 VCG& late_edge_labels(Bool);
181 VCG& display_edge_labels(Bool);
182 VCG& dirty_edge_labels(Bool);
183 VCG& finetuning(Bool);
185 VCG& thickness(int i);
186 VCG& linestyle(LineStyle s);
187 VCG& arrowstyle(ArrowStyle s);
188 VCG& backarrowstyle(ArrowStyle s);
189 VCG& arrowsize(int i);
190 VCG& backarrowsize(int i);
191 VCG& arrowcolor(Color c);
192 VCG& backarrowcolor(Color c);
193 VCG& priority(int i);
194 VCG& anchor(int i);
196 protected:
197 VCG_Internal * impl;
200 #endif