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