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