Graphviz 16.1.1~dev.20261030.0125
Loading...
Searching...
No Matches
viewport.c
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v2.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include "config.h"
12
13#ifdef _WIN32
14#include <windows.h>
15#endif
16#include <assert.h>
17#include "viewport.h"
18#include "draw.h"
19#include <common/color.h>
20#include <glade/glade.h>
21#include "gui/gui.h"
22#include <limits.h>
23#include "gui/menucallbacks.h"
24#include <stdbool.h>
25#include <stdlib.h>
26#include <string.h>
27#include "gui/glcompui.h"
28#include "gltemplate.h"
29#include <common/colorprocs.h>
30#include "gui/topviewsettings.h"
31#include "arcball.h"
32#include "hotkeymap.h"
33#include "topviewfuncs.h"
34#include <util/alloc.h>
35#include <util/exit.h>
36#include <util/strcasecmp.h>
37
38static colorschemaset create_color_theme(int themeid);
39
41
42static void clear_viewport(ViewInfo *vi) {
43 if (vi->graphCount)
44 agclose(vi->g[vi->activeGraph]);
45}
46static void *get_glut_font(int ind)
47{
48
49 switch (ind) {
50 case 0:
51 return GLUT_BITMAP_9_BY_15;
52 case 1:
53 return GLUT_BITMAP_8_BY_13;
54 case 2:
55 return GLUT_BITMAP_TIMES_ROMAN_10;
56 case 3:
57 return GLUT_BITMAP_HELVETICA_10;
58 case 4:
59 return GLUT_BITMAP_HELVETICA_12;
60 case 5:
61 return GLUT_BITMAP_HELVETICA_18;
62 default:
63 return GLUT_BITMAP_TIMES_ROMAN_10;
64 }
65
66}
67
69 if (vi->activeGraph < 0)
70 return;
72}
73
74char *get_attribute_value(char *attr, ViewInfo *vi, Agraph_t *g) {
75 char *buf;
76 buf = agget(g, attr);
77 if (!buf || *buf == '\0')
78 buf = agget(vi->systemGraphs.def_attrs, attr);
79 return buf;
80}
81
83 gvcolor_t cl;
84 colorxlate(get_attribute_value("bordercolor", vi, g), &cl,
86 vi->borderColor.R = cl.u.RGBA[0];
87 vi->borderColor.G = cl.u.RGBA[1];
88 vi->borderColor.B = cl.u.RGBA[2];
89
90 vi->borderColor.A = atof(get_attribute_value("bordercoloralpha", vi, g));
91
92 vi->bdVisible = atoi(get_attribute_value("bordervisible", vi, g));
93
94 const char *buf = get_attribute_value("gridcolor", vi, g);
95 colorxlate(buf, &cl, RGBA_DOUBLE);
96 vi->gridColor.R = cl.u.RGBA[0];
97 vi->gridColor.G = cl.u.RGBA[1];
98 vi->gridColor.B = cl.u.RGBA[2];
99 vi->gridColor.A = atof(get_attribute_value("gridcoloralpha", vi, g));
100
101 vi->gridSize = (float)atof(get_attribute_value("gridsize", vi, g));
102
103 vi->gridVisible = atoi(get_attribute_value("gridvisible", vi, g));
104
105 //background color , default white
106 colorxlate(get_attribute_value("bgcolor", vi, g), &cl, RGBA_DOUBLE);
107
108 vi->bgColor.R = cl.u.RGBA[0];
109 vi->bgColor.G = cl.u.RGBA[1];
110 vi->bgColor.B = cl.u.RGBA[2];
111 vi->bgColor.A = 1.0;
112
113 //selected nodes are drawn with this color
114 colorxlate(get_attribute_value("selectednodecolor", vi, g), &cl,
116 vi->selectedNodeColor.R = cl.u.RGBA[0];
117 vi->selectedNodeColor.G = cl.u.RGBA[1];
118 vi->selectedNodeColor.B = cl.u.RGBA[2];
119 vi->selectedNodeColor.A =
120 atof(get_attribute_value("selectednodecoloralpha", vi, g));
121
122 vi->defaultnodealpha = atof(get_attribute_value("defaultnodealpha", vi, g));
123
124 /*default line width */
125 vi->LineWidth =
126 (float) atof(get_attribute_value("defaultlinewidth", vi, g));
127
128 vi->drawnodes = atoi(get_attribute_value("drawnodes", vi, g));
129 vi->drawedges = atoi(get_attribute_value("drawedges", vi, g));
130 vi->drawnodelabels=atoi(get_attribute_value("labelshownodes", vi, g));
131 vi->drawedgelabels=atoi(get_attribute_value("labelshowedges", vi, g));
132 vi->nodeScale=atof(get_attribute_value("nodesize", vi, g))*.30;
133
134 vi->glutfont =
135 get_glut_font(atoi(get_attribute_value("labelglutfont", vi, g)));
137 atoi(get_attribute_value("labelnumberofnodes", vi, g));
138 vi->colschms =
140 (get_attribute_value("colortheme", vi, g)));
141
142 if (vi->graphCount > 0)
143 glClearColor((float)vi->bgColor.R, (float)vi->bgColor.G, (float)vi->bgColor.B,
144 (float)vi->bgColor.A); // background color
145}
146
147static gboolean gl_main_expose(void *data) {
148 (void)data;
149
150 if (view->activeGraph >= 0) {
153 return 1;
154 }
155 return 1;
156}
157
158static void get_data_dir(void)
159{
161 view->template_file = smyrnaPath("template.dot");
162}
163
165 *cs = (colorschemaset){0};
166}
167
169 FILE *input_file = NULL;
170 FILE *input_file2 = NULL;
171 get_data_dir();
172 input_file = fopen(vi->template_file, "rb");
173 if (!input_file) {
174 fprintf(stderr,
175 "default attributes template graph file \"%s\" not found\n",
176 vi->template_file);
177 graphviz_exit(-1);
178 }
179 vi->systemGraphs.def_attrs = agread(input_file, NULL);
180 fclose (input_file);
181
182 if (!vi->systemGraphs.def_attrs) {
183 fprintf(stderr,
184 "could not load default attributes template graph file \"%s\"\n",
185 vi->template_file);
186 graphviz_exit(-1);
187 }
188 {
189 char *path = smyrnaPath("attr_widgets.dot");
190 input_file2 = fopen(path, "rb");
191 free(path);
192 }
193 if (!input_file2) {
194 char *attrwidgets = smyrnaPath("attr_widgets.dot");
195 fprintf(stderr, "default attributes template graph file \"%s\" not found\n", attrwidgets);
196 free(attrwidgets);
197 graphviz_exit(-1);
198
199 }
200 vi->systemGraphs.attrs_widgets = agread(input_file2, NULL);
201 fclose (input_file2);
202 if (!vi->systemGraphs.attrs_widgets) {
203 char *attrwidgets = smyrnaPath("attr_widgets.dot");
204 fprintf(stderr,"could not load default attribute widgets graph file \"%s\"\n", attrwidgets);
205 free(attrwidgets);
206 graphviz_exit(-1);
207 }
208 //init graphs
209 vi->g = NULL; //no graph, gl screen should check it
210 vi->graphCount = 0; //and disable interactivity if count is zero
211
212 vi->bdxLeft = 0;
213 vi->bdxRight = 500;
214 vi->bdyBottom = 0;
215 vi->bdyTop = 500;
216
217 vi->borderColor.R = 1;
218 vi->borderColor.G = 0;
219 vi->borderColor.B = 0;
220 vi->borderColor.A = 1;
221
222 vi->bdVisible = 1; //show borders red
223
224 vi->gridSize = 10;
225 vi->gridColor.R = 0.5;
226 vi->gridColor.G = 0.5;
227 vi->gridColor.B = 0.5;
228 vi->gridColor.A = 1;
229 vi->gridVisible = 0; //show grids in light gray
230
231 //mouse mode=pan
232 //pen color
233 vi->penColor.R = 0;
234 vi->penColor.G = 0;
235 vi->penColor.B = 0;
236 vi->penColor.A = 1;
237
238 vi->fillColor.R = 1;
239 vi->fillColor.G = 0;
240 vi->fillColor.B = 0;
241 vi->fillColor.A = 1;
242 //background color , default white
243 vi->bgColor.R = 1;
244 vi->bgColor.G = 1;
245 vi->bgColor.B = 1;
246 vi->bgColor.A = 1;
247
248 //selected objets are drawn with this color
249 vi->selectedNodeColor.R = 1;
250 vi->selectedNodeColor.G = 0;
251 vi->selectedNodeColor.B = 0;
252 vi->selectedNodeColor.A = 1;
253
254 //default line width;
255 vi->LineWidth = 1;
256
257 //default view settings, camera is not active
258 vi->panx = 0;
259 vi->pany = 0;
260
261 vi->zoom = -20;
262
263 vi->mouse.down = false;
264 vi->activeGraph = -1;
265 vi->Topview = gv_alloc(sizeof(topview));
266 vi->Topview->fisheyeParams.fs = 0;
267 vi->Topview->xDot=NULL;
268
269 /* init topfish parameters */
273 vi->Topview->fisheyeParams.repos.width = round(vi->bdxRight - vi->bdxLeft);
274 vi->Topview->fisheyeParams.repos.height = round(vi->bdyTop - vi->bdyBottom);
276 /*create timer */
277 vi->timer = g_timer_new();
278 vi->timer2 = g_timer_new();
279 vi->timer3 = g_timer_new();
280
281 g_timer_stop(vi->timer);
282 vi->active_frame = 0;
283 vi->total_frames = 1500;
284 /*add a call back to the main() */
285 g_timeout_add_full(G_PRIORITY_DEFAULT, 100u, gl_main_expose, NULL, NULL);
286 vi->cameras = NULL;
287 vi->camera_count = 0;
292 vi->arcball = gv_alloc(sizeof(ArcBall_t));
294 if(vi->guiMode!=GUI_FULLSCREEN)
296
297 /*create glcomp menu system */
299}
300
301
302/* update_graph_params:
303 * adds gledit params
304 * assumes custom_graph_data has been attached to the graph.
305 */
307{
308 agattr_text(graph, AGRAPH, "GraphFileName",
310}
311
312static Agraph_t *loadGraph(char *filename)
313{
314 Agraph_t *g;
315 FILE *input_file;
316 if (!(input_file = fopen(filename, "r"))) {
317 g_print("Cannot open %s\n", filename);
318 return 0;
319 }
320 g = agread(input_file, NULL);
321 fclose (input_file);
322 if (!g) {
323 g_print("Cannot read graph in %s\n", filename);
324 return 0;
325 }
326
327 /* If no position info, run layout with -Txdot
328 */
329 if (!agattr_text(g, AGNODE, "pos", NULL)) {
330 g_print("There is no position info in graph %s in %s\n", agnameof(g), filename);
331 agclose (g);
332 return 0;
333 }
335 return g;
336}
337
338/* add_graph_to_viewport_from_file:
339 * returns 1 if successful else 0
340 */
347
348/* updateRecord:
349 * Update fields which may be added dynamically.
350 */
352{
353 GN_size(g) = agattr_text (g, AGNODE, "size", 0);
354 GN_visible(g) = agattr_text (g, AGNODE, "visible", 0);
355 GN_selected(g) = agattr_text (g, AGNODE, "selected", 0);
356 GN_labelattribute(g) = agattr_text (g, AGNODE, "nodelabelattribute", 0);
357
358 GE_pos(g)=agattr_text(g,AGEDGE,"pos",0);
359 GE_visible(g) = agattr_text (g, AGEDGE, "visible", 0);
360 GE_selected(g) = agattr_text (g, AGEDGE, "selected", 0);
361 GE_labelattribute(g) = agattr_text (g, AGEDGE, "edgelabelattribute", 0);
362}
363
364/* graphRecord:
365 * add graphRec to graph if necessary.
366 * update fields of graphRec.
367 * We assume the graph has attributes nodelabelattribute, edgelabelattribute,
368 * nodelabelcolor and edgelabelcolor from template.dot.
369 * We assume nodes have pos attributes.
370 * Only size, visible, selected and edge pos may or may not be defined.
371 */
372static void
374{
375 agbindrec(g, "graphRec", sizeof(graphRec), true);
376
377 GG_nodelabelcolor(g) = agattr_text (g, AGRAPH, "nodelabelcolor", 0);
378 GG_edgelabelcolor(g) = agattr_text (g, AGRAPH, "edgelabelcolor", 0);
379 GG_labelattribute(g) = agattr_text (g, AGRAPH, "nodelabelattribute", 0);
380 GG_elabelattribute(g) = agattr_text (g, AGRAPH, "edgelabelattribute", 0);
381
382 GN_pos(g) = agattr_text (g, AGNODE, "pos", 0);
383
384
385 updateRecord (g);
386}
387
401
402static void activate(int id)
403{
406}
407
409{
410 if (graph) {
412 sizeof(Agraph_t*));
414 view->g[view->graphCount - 1] = graph;
415
416 gtk_combo_box_append_text(view->graphComboBox, id);
417 assert(view->graphCount <= INT_MAX);
418 gtk_combo_box_set_active(view->graphComboBox, (int)view->graphCount - 1);
419 activate((int)view->graphCount - 1);
420 return 1;
421 } else {
422 return 0;
423 }
424
425}
426void switch_graph(int graphId)
427{
428 if (graphId < 0 || (size_t)graphId >= view->graphCount)
429 return; /*wrong entry */
430 else
431 activate(graphId);
432}
433
434/* save_graph_with_file_name:
435 * saves graph with file name; if file name is NULL save as is
436 */
438{
439 int ret;
440 FILE *output_file;
442 if (fileName)
443 output_file = fopen(fileName, "w");
445 output_file = fopen(view->Topview->Graphdata.GraphFileName, "w");
446 else {
447 g_print("there is no file name to save! Programmer error\n");
448 return 0;
449 }
450 if (output_file == NULL) {
451 g_print("Cannot create file \n");
452 return 0;
453 }
454
455 ret = agwrite(graph, output_file);
456 fclose (output_file);
457 if (ret) {
458 g_print("%s successfully saved \n", fileName);
459 return 1;
460 }
461 return 0;
462}
463
464/* save_graph:
465 * save without prompt
466 */
467int save_graph(void)
468{
469 //check if there is an active graph
470 if (view->activeGraph > -1)
471 {
472 //check if active graph has a file name
476 GraphFileName);
477 } else
478 return save_as_graph();
479 }
480 return 1;
481
482}
483
484/* save_as_graph:
485 * save with prompt
486 */
488{
489 //check if there is an active graph
490 if (view->activeGraph > -1) {
491 GtkWidget *dialog = gtk_file_chooser_dialog_new("Save File",
492 NULL,
493 GTK_FILE_CHOOSER_ACTION_SAVE,
494 GTK_STOCK_CANCEL,
495 GTK_RESPONSE_CANCEL,
496 GTK_STOCK_SAVE,
497 GTK_RESPONSE_ACCEPT, NULL);
498 gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER
499 (dialog), TRUE);
500 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
501 char *filename =
502 gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
504 filename);
505 g_free(filename);
506 gtk_widget_destroy(dialog);
507
508 return 1;
509 } else {
510 gtk_widget_destroy(dialog);
511 return 0;
512 }
513 }
514 return 0;
515}
516
517void glexpose(void)
518{
520}
521
522static double interpol(double minv, double maxv, double minc, double maxc,
523 double x) {
524 return (x - minv) * (maxc - minc) / (maxv - minv) + minc;
525}
526
527void getcolorfromschema(const colorschemaset sc, float l, float maxl,
528 glCompColor *c) {
529 size_t ind;
530 float percl = l / maxl;
531
532 // For smooth schemas, s[0].perc = 0, so we start with ind=1
533 for (ind = 1; ind + 1 < sizeof(sc.s) / sizeof(sc.s[0]); ind++) {
534 if (percl < sc.s[ind].perc)
535 break;
536 }
537 c->R = interpol(sc.s[ind - 1].perc, sc.s[ind].perc, sc.s[ind - 1].c.R,
538 sc.s[ind].c.R, percl);
539 c->G = interpol(sc.s[ind - 1].perc, sc.s[ind].perc, sc.s[ind - 1].c.G,
540 sc.s[ind].c.G, percl);
541 c->B = interpol(sc.s[ind - 1].perc, sc.s[ind].perc, sc.s[ind - 1].c.B,
542 sc.s[ind].c.B, percl);
543
544 c->A = 1;
545}
546
547/* set_color_theme_color:
548 * Convert colors as strings to RGB
549 */
550static void set_color_theme_color(colorschemaset *sc, const char **colorstr) {
551 const size_t colorcnt = sizeof(sc->s) / sizeof(sc->s[0]);
552 gvcolor_t cl;
553 float av_perc;
554
555 av_perc = 1.0f / (float)(colorcnt - 1);
556 for (size_t ind = 0; ind < colorcnt; ind++) {
557 colorxlate(colorstr[ind], &cl, RGBA_DOUBLE);
558 sc->s[ind].c.R = cl.u.RGBA[0];
559 sc->s[ind].c.G = cl.u.RGBA[1];
560 sc->s[ind].c.B = cl.u.RGBA[2];
561 sc->s[ind].c.A = cl.u.RGBA[3];
562 sc->s[ind].perc = (float)ind * av_perc;
563 }
564}
565
566static const char *deep_blue[SCHEMACOUNT] = {
567 "#C8CBED", "#9297D3", "#0000FF", "#2C2E41"
568};
569static const char *pastel[SCHEMACOUNT] = {
570 "#EBBE29", "#D58C4A", "#74AE09", "#893C49"
571};
572static const char *magma[SCHEMACOUNT] = {
573 "#E0061E", "#F0F143", "#95192B", "#EB712F"
574};
575static const char *rain_forest[SCHEMACOUNT] = {
576 "#1E6A10", "#2ABE0E", "#AEDD39", "#5EE88B"
577};
578typedef struct {
579 const char **colors;
580} colordata;
581static const colordata palette[] = {
582 {deep_blue},
583 {pastel},
584 {magma},
585 {rain_forest},
586};
587#define NUM_SCHEMES (sizeof(palette)/sizeof(colordata))
588
590 if (themeid < 0 || (int)NUM_SCHEMES <= themeid) {
591 fprintf (stderr, "colorschemaset: illegal themeid %d\n", themeid);
592 return view->colschms;
593 }
594
595 colorschemaset s = {0};
597
598 set_color_theme_color(&s, palette[themeid].colors);
599
600 return s;
601}
602
Memory allocation wrappers that exit on failure.
static void * gv_recalloc(void *ptr, size_t old_nmemb, size_t new_nmemb, size_t size)
Definition alloc.h:73
static char * gv_strdup(const char *original)
Definition alloc.h:101
static void * gv_alloc(size_t size)
Definition alloc.h:47
@ RGBA_DOUBLE
Definition color.h:27
void colorxlate(char *str, agxbuf *buf)
Definition colxlate.c:48
static NORETURN void graphviz_exit(int status)
Definition exit.h:23
glCompSet * glcreate_gl_topview_menu(void)
Definition glcompui.c:203
gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, void *data)
Definition gltemplate.c:147
void free(void *)
#define SIZE_MAX
Definition gmlscan.c:347
node NULL
Definition grammar.y:181
Agsym_t * agattr_text(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up text attributes of a graph
Definition attr.c:333
char * agget(void *obj, char *name)
Definition attr.c:447
int agclose(Agraph_t *g)
deletes a graph, freeing its associated storage
Definition graph.c:97
int agwrite(Agraph_t *g, void *chan)
Return 0 on success, EOF on failure.
Definition write.c:736
Agraph_t * agread(void *chan, Agdisc_t *disc)
constructs a new graph
Definition grammar.c:2052
char * agnameof(void *)
returns a string descriptor for the object.
Definition id.c:145
@ AGEDGE
Definition cgraph.h:207
@ AGNODE
Definition cgraph.h:207
@ AGRAPH
Definition cgraph.h:207
void * agbindrec(void *obj, const char *name, unsigned int recsize, int move_to_front)
attaches a new record of the given size to the object
Definition rec.c:91
static uint64_t id
Definition gv2gml.c:42
Agraph_t * graph(char *name)
Definition gv.cpp:34
void load_mouse_actions(ViewInfo *v)
Definition hotkeymap.c:117
char * fileName(ingraph_state *sp)
Return name of current file being processed.
Definition ingraphs.c:156
char * smyrnaPath(char *suffix)
Definition main.c:51
#define GUI_FULLSCREEN
Definition smyrnadefs.h:203
#define GG_labelattribute(g)
Definition smyrnadefs.h:194
#define GG_nodelabelcolor(g)
Definition smyrnadefs.h:192
#define GE_pos(g)
Definition smyrnadefs.h:195
#define GN_labelattribute(g)
Definition smyrnadefs.h:193
#define GN_selected(g)
Definition smyrnadefs.h:191
#define GG_edgelabelcolor(g)
Definition smyrnadefs.h:198
#define GE_labelattribute(g)
Definition smyrnadefs.h:199
#define GE_selected(g)
Definition smyrnadefs.h:197
@ SCHEMACOUNT
Definition smyrnadefs.h:95
#define GE_visible(g)
Definition smyrnadefs.h:196
#define GG_elabelattribute(g)
Definition smyrnadefs.h:200
#define GN_size(g)
Definition smyrnadefs.h:189
#define GUI_WINDOWED
Definition smyrnadefs.h:202
#define GN_visible(g)
Definition smyrnadefs.h:190
#define GN_pos(g)
Definition smyrnadefs.h:188
platform abstraction for case-insensitive string functions
graph or subgraph
Definition cgraph.h:424
int active_frame
Definition smyrnadefs.h:312
ArcBall_t * arcball
Definition smyrnadefs.h:331
topview * Topview
Definition smyrnadefs.h:305
int drawnodes
Definition smyrnadefs.h:315
Agraph_t ** g
Definition smyrnadefs.h:288
double bdxRight
Definition smyrnadefs.h:283
int total_frames
Definition smyrnadefs.h:313
float LineWidth
Definition smyrnadefs.h:271
int drawnodelabels
Definition smyrnadefs.h:317
char * template_file
Definition smyrnadefs.h:329
int labelnumberofnodes
Definition smyrnadefs.h:322
double bdyBottom
Definition smyrnadefs.h:283
double zoom
Definition smyrnadefs.h:250
double bdyTop
Definition smyrnadefs.h:282
int drawedges
Definition smyrnadefs.h:316
GtkComboBox * graphComboBox
Definition smyrnadefs.h:330
GTimer * timer
Definition smyrnadefs.h:307
glCompSet * widgets
Definition smyrnadefs.h:324
size_t camera_count
Definition smyrnadefs.h:298
size_t graphCount
Definition smyrnadefs.h:290
glCompColor fillColor
Definition smyrnadefs.h:260
glCompColor borderColor
Definition smyrnadefs.h:264
colorschemaset colschms
Definition smyrnadefs.h:328
float gridSize
Definition smyrnadefs.h:276
double defaultnodealpha
Definition smyrnadefs.h:268
GTimer * timer2
Definition smyrnadefs.h:309
int activeGraph
Definition smyrnadefs.h:292
glCompColor selectedNodeColor
Definition smyrnadefs.h:266
glCompColor bgColor
Definition smyrnadefs.h:256
double nodeScale
Definition smyrnadefs.h:335
viewport_camera ** cameras
Definition smyrnadefs.h:297
double bdxLeft
Definition smyrnadefs.h:282
GtkWidget * drawing_area
open gl canvas
Definition smyrnadefs.h:302
systemgraphs systemGraphs
Definition smyrnadefs.h:246
int gridVisible
Definition smyrnadefs.h:274
double panx
Definition smyrnadefs.h:248
double pany
Definition smyrnadefs.h:249
int bdVisible
Definition smyrnadefs.h:279
int drawedgelabels
Definition smyrnadefs.h:318
glCompMouse mouse
Definition smyrnadefs.h:295
GTimer * timer3
Definition smyrnadefs.h:311
glCompColor gridColor
Definition smyrnadefs.h:262
glCompColor penColor
Definition smyrnadefs.h:258
size_t active_camera
<number of cameras
Definition smyrnadefs.h:299
void * glutfont
Definition smyrnadefs.h:321
double RGBA[4]
Definition color.h:32
union color_s::@40 u
const char ** colors
Definition viewport.c:579
glCompColor c
Definition smyrnadefs.h:91
colorschema s[SCHEMACOUNT]
Definition smyrnadefs.h:98
char * GraphFileName
Definition smyrnadefs.h:138
int num_fine_nodes
Definition hierarchy.h:55
double coarsening_rate
Definition hierarchy.h:56
Definition types.h:81
double distortion
Definition hier.h:28
double height
viewport height
Definition hier.h:27
double width
viewport width
Definition hier.h:26
Agraph_t * attrs_widgets
Definition smyrnadefs.h:241
Agraph_t * def_attrs
Definition smyrnadefs.h:240
graph_data Graphdata
Definition smyrnadefs.h:227
int animate
Definition smyrnadefs.h:221
struct topview::@22 fisheyeParams
reposition_t repos
Definition smyrnadefs.h:215
xdot * xDot
Definition smyrnadefs.h:230
focus_t * fs
Definition smyrnadefs.h:224
bool dist2_limit
Definition smyrnadefs.h:219
levelparms_t level
Definition smyrnadefs.h:216
void initSmGraph(Agraph_t *g, topview *rv)
void load_settings_from_graph(void)
void update_graph_from_settings(Agraph_t *g)
Definition grammar.c:90
static void clear_color_theme(colorschemaset *cs)
Definition viewport.c:164
void set_viewport_settings_from_template(ViewInfo *vi, Agraph_t *g)
Definition viewport.c:82
static gboolean gl_main_expose(void *data)
Definition viewport.c:147
static colorschemaset create_color_theme(int themeid)
Definition viewport.c:589
static void set_color_theme_color(colorschemaset *sc, const char **colorstr)
Definition viewport.c:550
ViewInfo * view
Definition viewport.c:40
void close_graph(ViewInfo *vi)
Definition viewport.c:68
int save_graph_with_file_name(Agraph_t *graph, char *fileName)
Definition viewport.c:437
static const colordata palette[]
Definition viewport.c:581
void switch_graph(int graphId)
Definition viewport.c:426
static void * get_glut_font(int ind)
Definition viewport.c:46
void getcolorfromschema(const colorschemaset sc, float l, float maxl, glCompColor *c)
Definition viewport.c:527
static double interpol(double minv, double maxv, double minc, double maxc, double x)
Definition viewport.c:522
static Agraph_t * loadGraph(char *filename)
Definition viewport.c:312
void init_viewport(ViewInfo *vi)
Definition viewport.c:168
static void activate(int id)
Definition viewport.c:402
static void get_data_dir(void)
Definition viewport.c:158
#define NUM_SCHEMES
Definition viewport.c:587
static void update_graph_params(Agraph_t *graph)
Definition viewport.c:306
char * get_attribute_value(char *attr, ViewInfo *vi, Agraph_t *g)
Definition viewport.c:74
static const char * magma[SCHEMACOUNT]
Definition viewport.c:572
void updateRecord(Agraph_t *g)
Definition viewport.c:351
int add_graph_to_viewport_from_file(char *fileName)
Definition viewport.c:341
static const char * pastel[SCHEMACOUNT]
Definition viewport.c:569
int save_as_graph(void)
Definition viewport.c:487
static const char * rain_forest[SCHEMACOUNT]
Definition viewport.c:575
void refreshViewport(void)
Definition viewport.c:388
int add_graph_to_viewport(Agraph_t *graph, char *id)
Definition viewport.c:408
static const char * deep_blue[SCHEMACOUNT]
Definition viewport.c:566
static void clear_viewport(ViewInfo *vi)
Definition viewport.c:42
void glexpose(void)
Definition viewport.c:517
static void graphRecord(Agraph_t *g)
Definition viewport.c:373
int save_graph(void)
Definition viewport.c:467