Graphviz 13.0.0~dev.20241220.2304
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 <common/color.h>
17#include <glade/glade.h>
18#include "gui.h"
19#include <limits.h>
20#include "menucallbacks.h"
21#include <stdbool.h>
22#include <stdlib.h>
23#include <string.h>
24#include "glcompui.h"
25#include "gltemplate.h"
26#include <common/colorprocs.h>
27#include "topviewsettings.h"
28#include "arcball.h"
29#include "hotkeymap.h"
30#include "topviewfuncs.h"
31#include <util/alloc.h>
32#include <util/exit.h>
33#include <util/strcasecmp.h>
34
35static colorschemaset create_color_theme(int themeid);
36
38
39static void clear_viewport(ViewInfo *vi) {
40 if (vi->graphCount)
41 agclose(vi->g[vi->activeGraph]);
42}
43static void *get_glut_font(int ind)
44{
45
46 switch (ind) {
47 case 0:
48 return GLUT_BITMAP_9_BY_15;
49 break;
50 case 1:
51 return GLUT_BITMAP_8_BY_13;
52 break;
53 case 2:
54 return GLUT_BITMAP_TIMES_ROMAN_10;
55 break;
56 case 3:
57 return GLUT_BITMAP_HELVETICA_10;
58 break;
59 case 4:
60 return GLUT_BITMAP_HELVETICA_12;
61 break;
62 case 5:
63 return GLUT_BITMAP_HELVETICA_18;
64 break;
65 default:
66 return GLUT_BITMAP_TIMES_ROMAN_10;
67 }
68
69}
70
72 if (vi->activeGraph < 0)
73 return;
75}
76
77char *get_attribute_value(char *attr, ViewInfo *vi, Agraph_t *g) {
78 char *buf;
79 buf = agget(g, attr);
80 if (!buf || *buf == '\0')
81 buf = agget(vi->systemGraphs.def_attrs, attr);
82 return buf;
83}
84
86 gvcolor_t cl;
87 colorxlate(get_attribute_value("bordercolor", vi, g), &cl,
89 vi->borderColor.R = (float)cl.u.RGBA[0];
90 vi->borderColor.G = (float)cl.u.RGBA[1];
91 vi->borderColor.B = (float)cl.u.RGBA[2];
92
93 vi->borderColor.A =
94 (float)atof(get_attribute_value("bordercoloralpha", vi, g));
95
96 vi->bdVisible = atoi(get_attribute_value("bordervisible", vi, g));
97
98 const char *buf = get_attribute_value("gridcolor", vi, g);
99 colorxlate(buf, &cl, RGBA_DOUBLE);
100 vi->gridColor.R = (float)cl.u.RGBA[0];
101 vi->gridColor.G = (float)cl.u.RGBA[1];
102 vi->gridColor.B = (float)cl.u.RGBA[2];
103 vi->gridColor.A =
104 (float) atof(get_attribute_value("gridcoloralpha", vi, g));
105
106 vi->gridSize = (float)atof(buf = get_attribute_value("gridsize", vi, g));
107
108 vi->gridVisible = atoi(get_attribute_value("gridvisible", vi, g));
109
110 //background color , default white
111 colorxlate(get_attribute_value("bgcolor", vi, g), &cl, RGBA_DOUBLE);
112
113 vi->bgColor.R = (float)cl.u.RGBA[0];
114 vi->bgColor.G = (float)cl.u.RGBA[1];
115 vi->bgColor.B = (float)cl.u.RGBA[2];
116 vi->bgColor.A = 1.0f;
117
118 //selected nodes are drawn with this color
119 colorxlate(get_attribute_value("selectednodecolor", vi, g), &cl,
121 vi->selectedNodeColor.R = (float)cl.u.RGBA[0];
122 vi->selectedNodeColor.G = (float)cl.u.RGBA[1];
123 vi->selectedNodeColor.B = (float)cl.u.RGBA[2];
124 vi->selectedNodeColor.A = (float)
125 atof(get_attribute_value("selectednodecoloralpha", vi, g));
126
127 vi->defaultnodealpha = (float)
128 atof(get_attribute_value("defaultnodealpha", vi, g));
129
130 /*default line width */
131 vi->LineWidth =
132 (float) atof(get_attribute_value("defaultlinewidth", vi, g));
133
134 vi->drawnodes = atoi(get_attribute_value("drawnodes", vi, g));
135 vi->drawedges = atoi(get_attribute_value("drawedges", vi, g));
136 vi->drawnodelabels=atoi(get_attribute_value("labelshownodes", vi, g));
137 vi->drawedgelabels=atoi(get_attribute_value("labelshowedges", vi, g));
138 vi->nodeScale=atof(get_attribute_value("nodesize", vi, g))*.30;
139
140 vi->glutfont =
141 get_glut_font(atoi(get_attribute_value("labelglutfont", vi, g)));
142 colorxlate(get_attribute_value("nodelabelcolor", vi, g), &cl,
144 vi->nodelabelcolor.R = (float)cl.u.RGBA[0];
145 vi->nodelabelcolor.G = (float)cl.u.RGBA[1];
146 vi->nodelabelcolor.B = (float)cl.u.RGBA[2];
147 vi->nodelabelcolor.A =
148 (float) atof(get_attribute_value("defaultnodealpha", vi, g));
149 colorxlate(get_attribute_value("edgelabelcolor", vi, g), &cl,
151 vi->edgelabelcolor.R = (float)cl.u.RGBA[0];
152 vi->edgelabelcolor.G = (float)cl.u.RGBA[1];
153 vi->edgelabelcolor.B = (float)cl.u.RGBA[2];
154 vi->edgelabelcolor.A =
155 (float) atof(get_attribute_value("defaultedgealpha", vi, g));
157 atof(get_attribute_value("labelnumberofnodes", vi, g));
158 vi->labelshownodes = atoi(get_attribute_value("labelshownodes", vi, g));
159 vi->labelshowedges = atoi(get_attribute_value("labelshowedges", vi, g));
160 vi->colschms =
162 (get_attribute_value("colortheme", vi, g)));
163
164 if (vi->graphCount > 0)
165 glClearColor(vi->bgColor.R, vi->bgColor.G, vi->bgColor.B, vi->bgColor.A); //background color
166}
167
168static gboolean gl_main_expose(void *data) {
169 (void)data;
170
171 if (view->activeGraph >= 0) {
174 return 1;
175 }
176 return 1;
177}
178
179static void get_data_dir(void)
180{
182 view->template_file = smyrnaPath("template.dot");
183}
184
186 free(cs->s);
187 *cs = (colorschemaset){0};
188}
189
191 FILE *input_file = NULL;
192 FILE *input_file2 = NULL;
193 get_data_dir();
194 input_file = fopen(vi->template_file, "rb");
195 if (!input_file) {
196 fprintf(stderr,
197 "default attributes template graph file \"%s\" not found\n",
198 vi->template_file);
199 graphviz_exit(-1);
200 }
201 vi->systemGraphs.def_attrs = agread(input_file, NULL);
202 fclose (input_file);
203
204 if (!vi->systemGraphs.def_attrs) {
205 fprintf(stderr,
206 "could not load default attributes template graph file \"%s\"\n",
207 vi->template_file);
208 graphviz_exit(-1);
209 }
210 {
211 char *path = smyrnaPath("attr_widgets.dot");
212 input_file2 = fopen(path, "rb");
213 free(path);
214 }
215 if (!input_file2) {
216 char *attrwidgets = smyrnaPath("attr_widgets.dot");
217 fprintf(stderr, "default attributes template graph file \"%s\" not found\n", attrwidgets);
218 free(attrwidgets);
219 graphviz_exit(-1);
220
221 }
222 vi->systemGraphs.attrs_widgets = agread(input_file2, NULL);
223 fclose (input_file2);
224 if (!vi->systemGraphs.attrs_widgets) {
225 char *attrwidgets = smyrnaPath("attr_widgets.dot");
226 fprintf(stderr,"could not load default attribute widgets graph file \"%s\"\n", attrwidgets);
227 free(attrwidgets);
228 graphviz_exit(-1);
229 }
230 //init graphs
231 vi->g = NULL; //no graph, gl screen should check it
232 vi->graphCount = 0; //and disable interactivity if count is zero
233
234 vi->bdxLeft = 0;
235 vi->bdxRight = 500;
236 vi->bdyBottom = 0;
237 vi->bdyTop = 500;
238
239 vi->borderColor.R = 1;
240 vi->borderColor.G = 0;
241 vi->borderColor.B = 0;
242 vi->borderColor.A = 1;
243
244 vi->bdVisible = 1; //show borders red
245
246 vi->gridSize = 10;
247 vi->gridColor.R = 0.5;
248 vi->gridColor.G = 0.5;
249 vi->gridColor.B = 0.5;
250 vi->gridColor.A = 1;
251 vi->gridVisible = 0; //show grids in light gray
252
253 //mouse mode=pan
254 //pen color
255 vi->penColor.R = 0;
256 vi->penColor.G = 0;
257 vi->penColor.B = 0;
258 vi->penColor.A = 1;
259
260 vi->fillColor.R = 1;
261 vi->fillColor.G = 0;
262 vi->fillColor.B = 0;
263 vi->fillColor.A = 1;
264 //background color , default white
265 vi->bgColor.R = 1;
266 vi->bgColor.G = 1;
267 vi->bgColor.B = 1;
268 vi->bgColor.A = 1;
269
270 //selected objets are drawn with this color
271 vi->selectedNodeColor.R = 1;
272 vi->selectedNodeColor.G = 0;
273 vi->selectedNodeColor.B = 0;
274 vi->selectedNodeColor.A = 1;
275
276 //default line width;
277 vi->LineWidth = 1;
278
279 //default view settings, camera is not active
280 vi->panx = 0;
281 vi->pany = 0;
282 vi->panz = 0;
283
284 vi->zoom = -20;
285
286 vi->mouse.down = 0;
287 vi->activeGraph = -1;
288 vi->Topview = gv_alloc(sizeof(topview));
289 vi->Topview->fisheyeParams.fs = 0;
290 vi->Topview->xDot=NULL;
291
292 /* init topfish parameters */
296 vi->Topview->fisheyeParams.repos.width = (int)(vi->bdxRight - vi->bdxLeft);
297 vi->Topview->fisheyeParams.repos.height = (int)(vi->bdyTop - vi->bdyBottom);
299 /*create timer */
300 vi->timer = g_timer_new();
301 vi->timer2 = g_timer_new();
302 vi->timer3 = g_timer_new();
303
304 g_timer_stop(vi->timer);
305 vi->active_frame = 0;
306 vi->total_frames = 1500;
307 /*add a call back to the main() */
308 g_timeout_add_full(G_PRIORITY_DEFAULT, 100u, gl_main_expose, NULL, NULL);
309 vi->cameras = NULL;
310 vi->camera_count = 0;
315 vi->arcball = gv_alloc(sizeof(ArcBall_t));
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
424
425static void activate(int id)
426{
429}
430
432{
433 if (graph) {
435 sizeof(Agraph_t*));
437 view->g[view->graphCount - 1] = graph;
438
439 gtk_combo_box_append_text(view->graphComboBox, id);
440 assert(view->graphCount <= INT_MAX);
441 gtk_combo_box_set_active(view->graphComboBox, (int)view->graphCount - 1);
442 activate((int)view->graphCount - 1);
443 return 1;
444 } else {
445 return 0;
446 }
447
448}
449void switch_graph(int graphId)
450{
451 if (graphId < 0 || (size_t)graphId >= view->graphCount)
452 return; /*wrong entry */
453 else
454 activate(graphId);
455}
456
457/* save_graph_with_file_name:
458 * saves graph with file name; if file name is NULL save as is
459 */
461{
462 int ret;
463 FILE *output_file;
465 if (fileName)
466 output_file = fopen(fileName, "w");
468 output_file = fopen(view->Topview->Graphdata.GraphFileName, "w");
469 else {
470 g_print("there is no file name to save! Programmer error\n");
471 return 0;
472 }
473 if (output_file == NULL) {
474 g_print("Cannot create file \n");
475 return 0;
476 }
477
478 ret = agwrite(graph, output_file);
479 fclose (output_file);
480 if (ret) {
481 g_print("%s successfully saved \n", fileName);
482 return 1;
483 }
484 return 0;
485}
486
487/* save_graph:
488 * save without prompt
489 */
490int save_graph(void)
491{
492 //check if there is an active graph
493 if (view->activeGraph > -1)
494 {
495 //check if active graph has a file name
499 GraphFileName);
500 } else
501 return save_as_graph();
502 }
503 return 1;
504
505}
506
507/* save_as_graph:
508 * save with prompt
509 */
511{
512 //check if there is an active graph
513 if (view->activeGraph > -1) {
514 GtkWidget *dialog = gtk_file_chooser_dialog_new("Save File",
515 NULL,
516 GTK_FILE_CHOOSER_ACTION_SAVE,
517 GTK_STOCK_CANCEL,
518 GTK_RESPONSE_CANCEL,
519 GTK_STOCK_SAVE,
520 GTK_RESPONSE_ACCEPT, NULL);
521 gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER
522 (dialog), TRUE);
523 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
524 char *filename =
525 gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
527 filename);
528 g_free(filename);
529 gtk_widget_destroy(dialog);
530
531 return 1;
532 } else {
533 gtk_widget_destroy(dialog);
534 return 0;
535 }
536 }
537 return 0;
538}
539
540void glexpose(void)
541{
543}
544
545static float interpol(float minv, float maxv, float minc, float maxc, float x)
546{
547 return (x - minv) * (maxc - minc) / (maxv - minv) + minc;
548}
549
550void getcolorfromschema(const colorschemaset sc, float l, float maxl,
551 glCompColor *c) {
552 size_t ind;
553 float percl = l / maxl;
554
555 // For smooth schemas, s[0].perc = 0, so we start with ind=1
556 for (ind = 1; ind + 1 < sc.schemacount; ind++) {
557 if (percl < sc.s[ind].perc)
558 break;
559 }
560 c->R = interpol(sc.s[ind - 1].perc, sc.s[ind].perc, sc.s[ind - 1].c.R,
561 sc.s[ind].c.R, percl);
562 c->G = interpol(sc.s[ind - 1].perc, sc.s[ind].perc, sc.s[ind - 1].c.G,
563 sc.s[ind].c.G, percl);
564 c->B = interpol(sc.s[ind - 1].perc, sc.s[ind].perc, sc.s[ind - 1].c.B,
565 sc.s[ind].c.B, percl);
566
567 c->A = 1;
568}
569
570/* set_color_theme_color:
571 * Convert colors as strings to RGB
572 */
573static void set_color_theme_color(colorschemaset * sc, char **colorstr)
574{
575 const size_t colorcnt = sc->schemacount;
576 gvcolor_t cl;
577 float av_perc;
578
579 av_perc = 1.0f / (float)(colorcnt - 1);
580 for (size_t ind = 0; ind < colorcnt; ind++) {
581 colorxlate(colorstr[ind], &cl, RGBA_DOUBLE);
582 sc->s[ind].c.R = cl.u.RGBA[0];
583 sc->s[ind].c.G = cl.u.RGBA[1];
584 sc->s[ind].c.B = cl.u.RGBA[2];
585 sc->s[ind].c.A = cl.u.RGBA[3];
586 sc->s[ind].perc = (float)ind * av_perc;
587 }
588}
589
590static char *deep_blue[] = {
591 "#C8CBED", "#9297D3", "#0000FF", "#2C2E41"
592};
593static char *pastel[] = {
594 "#EBBE29", "#D58C4A", "#74AE09", "#893C49"
595};
596static char *magma[] = {
597 "#E0061E", "#F0F143", "#95192B", "#EB712F"
598};
599static char *rain_forest[] = {
600 "#1E6A10", "#2ABE0E", "#AEDD39", "#5EE88B"
601};
602#define CSZ(x) (sizeof(x)/sizeof(char*))
603typedef struct {
604 size_t cnt;
605 char **colors;
606} colordata;
607static colordata palette[] = {
609 {CSZ(pastel), pastel},
610 {CSZ(magma), magma},
612};
613#define NUM_SCHEMES (sizeof(palette)/sizeof(colordata))
614
616 if (themeid < 0 || (int)NUM_SCHEMES <= themeid) {
617 fprintf (stderr, "colorschemaset: illegal themeid %d\n", themeid);
618 return view->colschms;
619 }
620
621 colorschemaset s = {0};
623
624 s.schemacount = palette[themeid].cnt;
625 s.s = gv_calloc(s.schemacount, sizeof(colorschema));
626 set_color_theme_color(&s, palette[themeid].colors);
627
628 return s;
629}
630
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:46
static NORETURN void graphviz_exit(int status)
Definition exit.h:23
glCompSet * glcreate_gl_topview_menu(void)
Definition glcompui.c:214
gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, void *data)
Definition gltemplate.c:143
void free(void *)
#define SIZE_MAX
Definition gmlscan.c:347
node NULL
Definition grammar.y:163
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
Definition attr.c:338
char * agget(void *obj, char *name)
Definition attr.c:439
int agclose(Agraph_t *g)
deletes a graph, freeing its associated storage
Definition graph.c:102
int agwrite(Agraph_t *g, void *chan)
Return 0 on success, EOF on failure.
Definition write.c:730
Agraph_t * agread(void *chan, Agdisc_t *disc)
constructs a new graph
Definition grammar.c:2292
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:89
static uint64_t id
Definition gv2gml.c:42
Agraph_t * graph(char *name)
Definition gv.cpp:30
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:211
#define GG_labelattribute(g)
Definition smyrnadefs.h:202
#define GG_nodelabelcolor(g)
Definition smyrnadefs.h:200
#define GE_pos(g)
Definition smyrnadefs.h:203
#define GN_labelattribute(g)
Definition smyrnadefs.h:201
#define GN_selected(g)
Definition smyrnadefs.h:199
#define GG_edgelabelcolor(g)
Definition smyrnadefs.h:206
#define GE_labelattribute(g)
Definition smyrnadefs.h:207
#define GE_selected(g)
Definition smyrnadefs.h:205
#define GE_visible(g)
Definition smyrnadefs.h:204
#define GG_elabelattribute(g)
Definition smyrnadefs.h:208
#define GN_size(g)
Definition smyrnadefs.h:197
#define GUI_WINDOWED
Definition smyrnadefs.h:210
#define GN_visible(g)
Definition smyrnadefs.h:198
#define GN_pos(g)
Definition smyrnadefs.h:196
platform abstraction for case-insensitive string functions
graph or subgraph
Definition cgraph.h:425
float bdxLeft
Definition smyrnadefs.h:290
int active_frame
Definition smyrnadefs.h:320
ArcBall_t * arcball
Definition smyrnadefs.h:343
topview * Topview
Definition smyrnadefs.h:313
int drawnodes
Definition smyrnadefs.h:323
Agraph_t ** g
Definition smyrnadefs.h:296
float pany
Definition smyrnadefs.h:256
int total_frames
Definition smyrnadefs.h:321
float LineWidth
Definition smyrnadefs.h:279
int drawnodelabels
Definition smyrnadefs.h:325
char * template_file
Definition smyrnadefs.h:341
int labelnumberofnodes
Definition smyrnadefs.h:332
float bdyTop
Definition smyrnadefs.h:290
int drawedges
Definition smyrnadefs.h:324
float nodeScale
Definition smyrnadefs.h:347
GtkComboBox * graphComboBox
Definition smyrnadefs.h:342
GTimer * timer
Definition smyrnadefs.h:315
glCompSet * widgets
Definition smyrnadefs.h:336
size_t camera_count
Definition smyrnadefs.h:306
size_t graphCount
Definition smyrnadefs.h:298
glCompColor nodelabelcolor
Definition smyrnadefs.h:330
glCompColor fillColor
Definition smyrnadefs.h:268
glCompColor borderColor
Definition smyrnadefs.h:272
int labelshowedges
Definition smyrnadefs.h:334
colorschemaset colschms
Definition smyrnadefs.h:340
float gridSize
Definition smyrnadefs.h:284
glCompColor edgelabelcolor
Definition smyrnadefs.h:331
float panx
Definition smyrnadefs.h:255
GTimer * timer2
Definition smyrnadefs.h:317
int activeGraph
Definition smyrnadefs.h:300
glCompColor selectedNodeColor
Definition smyrnadefs.h:274
glCompColor bgColor
Definition smyrnadefs.h:264
viewport_camera ** cameras
Definition smyrnadefs.h:305
int labelshownodes
Definition smyrnadefs.h:333
GtkWidget * drawing_area
open gl canvas
Definition smyrnadefs.h:310
float bdxRight
Definition smyrnadefs.h:291
float bdyBottom
Definition smyrnadefs.h:291
systemgraphs systemGraphs
Definition smyrnadefs.h:253
int gridVisible
Definition smyrnadefs.h:282
float zoom
Definition smyrnadefs.h:258
float panz
Definition smyrnadefs.h:257
int bdVisible
Definition smyrnadefs.h:287
int drawedgelabels
Definition smyrnadefs.h:326
glCompMouse mouse
Definition smyrnadefs.h:303
GTimer * timer3
Definition smyrnadefs.h:319
glCompColor gridColor
Definition smyrnadefs.h:270
glCompColor penColor
Definition smyrnadefs.h:266
size_t active_camera
<number of cameras
Definition smyrnadefs.h:307
float defaultnodealpha
Definition smyrnadefs.h:276
void * glutfont
Definition smyrnadefs.h:329
char * GraphFileName
Definition smyrnadefs.h:146
double RGBA[4]
Definition color.h:32
union color_s::@71 u
char ** colors
Definition viewport.c:605
size_t cnt
Definition viewport.c:604
glCompColor c
Definition smyrnadefs.h:95
colorschema * s
Definition smyrnadefs.h:101
size_t schemacount
Definition smyrnadefs.h:100
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:248
Agraph_t * def_attrs
Definition smyrnadefs.h:247
graph_data Graphdata
Definition smyrnadefs.h:233
hierparms_t hier
Definition smyrnadefs.h:225
int animate
Definition smyrnadefs.h:227
reposition_t repos
Definition smyrnadefs.h:223
xdot * xDot
Definition smyrnadefs.h:237
focus_t * fs
Definition smyrnadefs.h:230
struct topview::@55 fisheyeParams
levelparms_t level
Definition smyrnadefs.h:224
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:545
static void clear_color_theme(colorschemaset *cs)
Definition viewport.c:185
void set_viewport_settings_from_template(ViewInfo *vi, Agraph_t *g)
Definition viewport.c:85
static gboolean gl_main_expose(void *data)
Definition viewport.c:168
static char * deep_blue[]
Definition viewport.c:590
static void set_color_theme_color(colorschemaset *sc, char **colorstr)
Definition viewport.c:573
static colorschemaset create_color_theme(int themeid)
Definition viewport.c:615
ViewInfo * view
Definition viewport.c:37
static char * rain_forest[]
Definition viewport.c:599
void close_graph(ViewInfo *vi)
Definition viewport.c:71
int save_graph_with_file_name(Agraph_t *graph, char *fileName)
Definition viewport.c:460
void switch_graph(int graphId)
Definition viewport.c:449
static colordata palette[]
Definition viewport.c:607
static char * magma[]
Definition viewport.c:596
static void * get_glut_font(int ind)
Definition viewport.c:43
void getcolorfromschema(const colorschemaset sc, float l, float maxl, glCompColor *c)
Definition viewport.c:550
static Agraph_t * loadGraph(char *filename)
Definition viewport.c:335
void init_viewport(ViewInfo *vi)
Definition viewport.c:190
static void activate(int id)
Definition viewport.c:425
static void get_data_dir(void)
Definition viewport.c:179
#define NUM_SCHEMES
Definition viewport.c:613
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:77
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:602
int save_as_graph(void)
Definition viewport.c:510
void refreshViewport(void)
Definition viewport.c:411
int add_graph_to_viewport(Agraph_t *graph, char *id)
Definition viewport.c:431
static void clear_viewport(ViewInfo *vi)
Definition viewport.c:39
void glexpose(void)
Definition viewport.c:540
static void graphRecord(Agraph_t *g)
Definition viewport.c:396
static char * pastel[]
Definition viewport.c:593
int save_graph(void)
Definition viewport.c:490