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