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