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