Graphviz 13.0.0~dev.20250121.0651
Loading...
Searching...
No Matches
viewport.c
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10#ifdef _WIN32
11#include <windows.h>
12#endif
13#include <assert.h>
14#include "viewport.h"
15#include "draw.h"
16#include <common/color.h>
17#include <glade/glade.h>
18#include "gui.h"
19#include <limits.h>
20#include "menucallbacks.h"
21#include <stdbool.h>
22#include <stdlib.h>
23#include <string.h>
24#include "glcompui.h"
25#include "gltemplate.h"
26#include <common/colorprocs.h>
27#include "topviewsettings.h"
28#include "arcball.h"
29#include "hotkeymap.h"
30#include "topviewfuncs.h"
31#include <util/alloc.h>
32#include <util/exit.h>
33#include <util/strcasecmp.h>
34
35static colorschemaset create_color_theme(int themeid);
36
38
39static void clear_viewport(ViewInfo *vi) {
40 if (vi->graphCount)
41 agclose(vi->g[vi->activeGraph]);
42}
43static void *get_glut_font(int ind)
44{
45
46 switch (ind) {
47 case 0:
48 return GLUT_BITMAP_9_BY_15;
49 break;
50 case 1:
51 return GLUT_BITMAP_8_BY_13;
52 break;
53 case 2:
54 return GLUT_BITMAP_TIMES_ROMAN_10;
55 break;
56 case 3:
57 return GLUT_BITMAP_HELVETICA_10;
58 break;
59 case 4:
60 return GLUT_BITMAP_HELVETICA_12;
61 break;
62 case 5:
63 return GLUT_BITMAP_HELVETICA_18;
64 break;
65 default:
66 return GLUT_BITMAP_TIMES_ROMAN_10;
67 }
68
69}
70
72 if (vi->activeGraph < 0)
73 return;
75}
76
77char *get_attribute_value(char *attr, ViewInfo *vi, Agraph_t *g) {
78 char *buf;
79 buf = agget(g, attr);
80 if (!buf || *buf == '\0')
81 buf = agget(vi->systemGraphs.def_attrs, attr);
82 return buf;
83}
84
86 gvcolor_t cl;
87 colorxlate(get_attribute_value("bordercolor", vi, g), &cl,
89 vi->borderColor.R = (float)cl.u.RGBA[0];
90 vi->borderColor.G = (float)cl.u.RGBA[1];
91 vi->borderColor.B = (float)cl.u.RGBA[2];
92
93 vi->borderColor.A =
94 (float)atof(get_attribute_value("bordercoloralpha", vi, g));
95
96 vi->bdVisible = atoi(get_attribute_value("bordervisible", vi, g));
97
98 const char *buf = get_attribute_value("gridcolor", vi, g);
99 colorxlate(buf, &cl, RGBA_DOUBLE);
100 vi->gridColor.R = (float)cl.u.RGBA[0];
101 vi->gridColor.G = (float)cl.u.RGBA[1];
102 vi->gridColor.B = (float)cl.u.RGBA[2];
103 vi->gridColor.A =
104 (float) atof(get_attribute_value("gridcoloralpha", vi, g));
105
106 vi->gridSize = (float)atof(buf = get_attribute_value("gridsize", vi, g));
107
108 vi->gridVisible = atoi(get_attribute_value("gridvisible", vi, g));
109
110 //background color , default white
111 colorxlate(get_attribute_value("bgcolor", vi, g), &cl, RGBA_DOUBLE);
112
113 vi->bgColor.R = (float)cl.u.RGBA[0];
114 vi->bgColor.G = (float)cl.u.RGBA[1];
115 vi->bgColor.B = (float)cl.u.RGBA[2];
116 vi->bgColor.A = 1.0f;
117
118 //selected nodes are drawn with this color
119 colorxlate(get_attribute_value("selectednodecolor", vi, g), &cl,
121 vi->selectedNodeColor.R = (float)cl.u.RGBA[0];
122 vi->selectedNodeColor.G = (float)cl.u.RGBA[1];
123 vi->selectedNodeColor.B = (float)cl.u.RGBA[2];
124 vi->selectedNodeColor.A = (float)
125 atof(get_attribute_value("selectednodecoloralpha", vi, g));
126
127 vi->defaultnodealpha = (float)
128 atof(get_attribute_value("defaultnodealpha", vi, g));
129
130 /*default line width */
131 vi->LineWidth =
132 (float) atof(get_attribute_value("defaultlinewidth", vi, g));
133
134 vi->drawnodes = atoi(get_attribute_value("drawnodes", vi, g));
135 vi->drawedges = atoi(get_attribute_value("drawedges", vi, g));
136 vi->drawnodelabels=atoi(get_attribute_value("labelshownodes", vi, g));
137 vi->drawedgelabels=atoi(get_attribute_value("labelshowedges", vi, g));
138 vi->nodeScale=atof(get_attribute_value("nodesize", vi, g))*.30;
139
140 vi->glutfont =
141 get_glut_font(atoi(get_attribute_value("labelglutfont", vi, g)));
142 colorxlate(get_attribute_value("nodelabelcolor", vi, g), &cl,
144 vi->nodelabelcolor.R = (float)cl.u.RGBA[0];
145 vi->nodelabelcolor.G = (float)cl.u.RGBA[1];
146 vi->nodelabelcolor.B = (float)cl.u.RGBA[2];
147 vi->nodelabelcolor.A =
148 (float) atof(get_attribute_value("defaultnodealpha", vi, g));
149 colorxlate(get_attribute_value("edgelabelcolor", vi, g), &cl,
151 vi->edgelabelcolor.R = (float)cl.u.RGBA[0];
152 vi->edgelabelcolor.G = (float)cl.u.RGBA[1];
153 vi->edgelabelcolor.B = (float)cl.u.RGBA[2];
154 vi->edgelabelcolor.A =
155 (float) atof(get_attribute_value("defaultedgealpha", vi, g));
157 atof(get_attribute_value("labelnumberofnodes", vi, g));
158 vi->labelshownodes = atoi(get_attribute_value("labelshownodes", vi, g));
159 vi->labelshowedges = atoi(get_attribute_value("labelshowedges", vi, g));
160 vi->colschms =
162 (get_attribute_value("colortheme", vi, g)));
163
164 if (vi->graphCount > 0)
165 glClearColor(vi->bgColor.R, vi->bgColor.G, vi->bgColor.B, vi->bgColor.A); //background color
166}
167
168static gboolean gl_main_expose(void *data) {
169 (void)data;
170
171 if (view->activeGraph >= 0) {
174 return 1;
175 }
176 return 1;
177}
178
179static void get_data_dir(void)
180{
182 view->template_file = smyrnaPath("template.dot");
183}
184
186 free(cs->s);
187 *cs = (colorschemaset){0};
188}
189
191 FILE *input_file = NULL;
192 FILE *input_file2 = NULL;
193 get_data_dir();
194 input_file = fopen(vi->template_file, "rb");
195 if (!input_file) {
196 fprintf(stderr,
197 "default attributes template graph file \"%s\" not found\n",
198 vi->template_file);
199 graphviz_exit(-1);
200 }
201 vi->systemGraphs.def_attrs = agread(input_file, NULL);
202 fclose (input_file);
203
204 if (!vi->systemGraphs.def_attrs) {
205 fprintf(stderr,
206 "could not load default attributes template graph file \"%s\"\n",
207 vi->template_file);
208 graphviz_exit(-1);
209 }
210 {
211 char *path = smyrnaPath("attr_widgets.dot");
212 input_file2 = fopen(path, "rb");
213 free(path);
214 }
215 if (!input_file2) {
216 char *attrwidgets = smyrnaPath("attr_widgets.dot");
217 fprintf(stderr, "default attributes template graph file \"%s\" not found\n", attrwidgets);
218 free(attrwidgets);
219 graphviz_exit(-1);
220
221 }
222 vi->systemGraphs.attrs_widgets = agread(input_file2, NULL);
223 fclose (input_file2);
224 if (!vi->systemGraphs.attrs_widgets) {
225 char *attrwidgets = smyrnaPath("attr_widgets.dot");
226 fprintf(stderr,"could not load default attribute widgets graph file \"%s\"\n", attrwidgets);
227 free(attrwidgets);
228 graphviz_exit(-1);
229 }
230 //init graphs
231 vi->g = NULL; //no graph, gl screen should check it
232 vi->graphCount = 0; //and disable interactivity if count is zero
233
234 vi->bdxLeft = 0;
235 vi->bdxRight = 500;
236 vi->bdyBottom = 0;
237 vi->bdyTop = 500;
238
239 vi->borderColor.R = 1;
240 vi->borderColor.G = 0;
241 vi->borderColor.B = 0;
242 vi->borderColor.A = 1;
243
244 vi->bdVisible = 1; //show borders red
245
246 vi->gridSize = 10;
247 vi->gridColor.R = 0.5;
248 vi->gridColor.G = 0.5;
249 vi->gridColor.B = 0.5;
250 vi->gridColor.A = 1;
251 vi->gridVisible = 0; //show grids in light gray
252
253 //mouse mode=pan
254 //pen color
255 vi->penColor.R = 0;
256 vi->penColor.G = 0;
257 vi->penColor.B = 0;
258 vi->penColor.A = 1;
259
260 vi->fillColor.R = 1;
261 vi->fillColor.G = 0;
262 vi->fillColor.B = 0;
263 vi->fillColor.A = 1;
264 //background color , default white
265 vi->bgColor.R = 1;
266 vi->bgColor.G = 1;
267 vi->bgColor.B = 1;
268 vi->bgColor.A = 1;
269
270 //selected objets are drawn with this color
271 vi->selectedNodeColor.R = 1;
272 vi->selectedNodeColor.G = 0;
273 vi->selectedNodeColor.B = 0;
274 vi->selectedNodeColor.A = 1;
275
276 //default line width;
277 vi->LineWidth = 1;
278
279 //default view settings, camera is not active
280 vi->panx = 0;
281 vi->pany = 0;
282
283 vi->zoom = -20;
284
285 vi->mouse.down = 0;
286 vi->activeGraph = -1;
287 vi->Topview = gv_alloc(sizeof(topview));
288 vi->Topview->fisheyeParams.fs = 0;
289 vi->Topview->xDot=NULL;
290
291 /* init topfish parameters */
295 vi->Topview->fisheyeParams.repos.width = (int)(vi->bdxRight - vi->bdxLeft);
296 vi->Topview->fisheyeParams.repos.height = (int)(vi->bdyTop - vi->bdyBottom);
298 /*create timer */
299 vi->timer = g_timer_new();
300 vi->timer2 = g_timer_new();
301 vi->timer3 = g_timer_new();
302
303 g_timer_stop(vi->timer);
304 vi->active_frame = 0;
305 vi->total_frames = 1500;
306 /*add a call back to the main() */
307 g_timeout_add_full(G_PRIORITY_DEFAULT, 100u, gl_main_expose, NULL, NULL);
308 vi->cameras = NULL;
309 vi->camera_count = 0;
314 vi->arcball = gv_alloc(sizeof(ArcBall_t));
316 if(vi->guiMode!=GUI_FULLSCREEN)
318
319 /*create glcomp menu system */
321}
322
323
324/* update_graph_params:
325 * adds gledit params
326 * assumes custom_graph_data has been attached to the graph.
327 */
329{
330 agattr(graph, AGRAPH, "GraphFileName",
332}
333
334static Agraph_t *loadGraph(char *filename)
335{
336 Agraph_t *g;
337 FILE *input_file;
338 if (!(input_file = fopen(filename, "r"))) {
339 g_print("Cannot open %s\n", filename);
340 return 0;
341 }
342 g = agread(input_file, NULL);
343 fclose (input_file);
344 if (!g) {
345 g_print("Cannot read graph in %s\n", filename);
346 return 0;
347 }
348
349 /* If no position info, run layout with -Txdot
350 */
351 if (!agattr(g, AGNODE, "pos", NULL)) {
352 g_print("There is no position info in graph %s in %s\n", agnameof(g), filename);
353 agclose (g);
354 return 0;
355 }
357 return g;
358}
359
360/* add_graph_to_viewport_from_file:
361 * returns 1 if successful else 0
362 */
369
370/* updateRecord:
371 * Update fields which may be added dynamically.
372 */
374{
375 GN_size(g) = agattr (g, AGNODE, "size", 0);
376 GN_visible(g) = agattr (g, AGNODE, "visible", 0);
377 GN_selected(g) = agattr (g, AGNODE, "selected", 0);
378 GN_labelattribute(g) = agattr (g, AGNODE, "nodelabelattribute", 0);
379
380 GE_pos(g)=agattr(g,AGEDGE,"pos",0);
381 GE_visible(g) = agattr (g, AGEDGE, "visible", 0);
382 GE_selected(g) = agattr (g, AGEDGE, "selected", 0);
383 GE_labelattribute(g) = agattr (g, AGEDGE, "edgelabelattribute", 0);
384}
385
386/* graphRecord:
387 * add graphRec to graph if necessary.
388 * update fields of graphRec.
389 * We assume the graph has attributes nodelabelattribute, edgelabelattribute,
390 * nodelabelcolor and edgelabelcolor from template.dot.
391 * We assume nodes have pos attributes.
392 * Only size, visible, selected and edge pos may or may not be defined.
393 */
394static void
396{
397 agbindrec(g, "graphRec", sizeof(graphRec), true);
398
399 GG_nodelabelcolor(g) = agattr (g, AGRAPH, "nodelabelcolor", 0);
400 GG_edgelabelcolor(g) = agattr (g, AGRAPH, "edgelabelcolor", 0);
401 GG_labelattribute(g) = agattr (g, AGRAPH, "nodelabelattribute", 0);
402 GG_elabelattribute(g) = agattr (g, AGRAPH, "edgelabelattribute", 0);
403
404 GN_pos(g) = agattr (g, AGNODE, "pos", 0);
405
406
407 updateRecord (g);
408}
409
423
424static void activate(int id)
425{
428}
429
431{
432 if (graph) {
434 sizeof(Agraph_t*));
436 view->g[view->graphCount - 1] = graph;
437
438 gtk_combo_box_append_text(view->graphComboBox, id);
439 assert(view->graphCount <= INT_MAX);
440 gtk_combo_box_set_active(view->graphComboBox, (int)view->graphCount - 1);
441 activate((int)view->graphCount - 1);
442 return 1;
443 } else {
444 return 0;
445 }
446
447}
448void switch_graph(int graphId)
449{
450 if (graphId < 0 || (size_t)graphId >= view->graphCount)
451 return; /*wrong entry */
452 else
453 activate(graphId);
454}
455
456/* save_graph_with_file_name:
457 * saves graph with file name; if file name is NULL save as is
458 */
460{
461 int ret;
462 FILE *output_file;
464 if (fileName)
465 output_file = fopen(fileName, "w");
467 output_file = fopen(view->Topview->Graphdata.GraphFileName, "w");
468 else {
469 g_print("there is no file name to save! Programmer error\n");
470 return 0;
471 }
472 if (output_file == NULL) {
473 g_print("Cannot create file \n");
474 return 0;
475 }
476
477 ret = agwrite(graph, output_file);
478 fclose (output_file);
479 if (ret) {
480 g_print("%s successfully saved \n", fileName);
481 return 1;
482 }
483 return 0;
484}
485
486/* save_graph:
487 * save without prompt
488 */
489int save_graph(void)
490{
491 //check if there is an active graph
492 if (view->activeGraph > -1)
493 {
494 //check if active graph has a file name
498 GraphFileName);
499 } else
500 return save_as_graph();
501 }
502 return 1;
503
504}
505
506/* save_as_graph:
507 * save with prompt
508 */
510{
511 //check if there is an active graph
512 if (view->activeGraph > -1) {
513 GtkWidget *dialog = gtk_file_chooser_dialog_new("Save File",
514 NULL,
515 GTK_FILE_CHOOSER_ACTION_SAVE,
516 GTK_STOCK_CANCEL,
517 GTK_RESPONSE_CANCEL,
518 GTK_STOCK_SAVE,
519 GTK_RESPONSE_ACCEPT, NULL);
520 gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER
521 (dialog), TRUE);
522 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
523 char *filename =
524 gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
526 filename);
527 g_free(filename);
528 gtk_widget_destroy(dialog);
529
530 return 1;
531 } else {
532 gtk_widget_destroy(dialog);
533 return 0;
534 }
535 }
536 return 0;
537}
538
539void glexpose(void)
540{
542}
543
544static float interpol(float minv, float maxv, float minc, float maxc, float x)
545{
546 return (x - minv) * (maxc - minc) / (maxv - minv) + minc;
547}
548
549void getcolorfromschema(const colorschemaset sc, float l, float maxl,
550 glCompColor *c) {
551 size_t ind;
552 float percl = l / maxl;
553
554 // For smooth schemas, s[0].perc = 0, so we start with ind=1
555 for (ind = 1; ind + 1 < sc.schemacount; ind++) {
556 if (percl < sc.s[ind].perc)
557 break;
558 }
559 c->R = interpol(sc.s[ind - 1].perc, sc.s[ind].perc, sc.s[ind - 1].c.R,
560 sc.s[ind].c.R, percl);
561 c->G = interpol(sc.s[ind - 1].perc, sc.s[ind].perc, sc.s[ind - 1].c.G,
562 sc.s[ind].c.G, percl);
563 c->B = interpol(sc.s[ind - 1].perc, sc.s[ind].perc, sc.s[ind - 1].c.B,
564 sc.s[ind].c.B, percl);
565
566 c->A = 1;
567}
568
569/* set_color_theme_color:
570 * Convert colors as strings to RGB
571 */
572static void set_color_theme_color(colorschemaset * sc, char **colorstr)
573{
574 const size_t colorcnt = sc->schemacount;
575 gvcolor_t cl;
576 float av_perc;
577
578 av_perc = 1.0f / (float)(colorcnt - 1);
579 for (size_t ind = 0; ind < colorcnt; ind++) {
580 colorxlate(colorstr[ind], &cl, RGBA_DOUBLE);
581 sc->s[ind].c.R = cl.u.RGBA[0];
582 sc->s[ind].c.G = cl.u.RGBA[1];
583 sc->s[ind].c.B = cl.u.RGBA[2];
584 sc->s[ind].c.A = cl.u.RGBA[3];
585 sc->s[ind].perc = (float)ind * av_perc;
586 }
587}
588
589static char *deep_blue[] = {
590 "#C8CBED", "#9297D3", "#0000FF", "#2C2E41"
591};
592static char *pastel[] = {
593 "#EBBE29", "#D58C4A", "#74AE09", "#893C49"
594};
595static char *magma[] = {
596 "#E0061E", "#F0F143", "#95192B", "#EB712F"
597};
598static char *rain_forest[] = {
599 "#1E6A10", "#2ABE0E", "#AEDD39", "#5EE88B"
600};
601#define CSZ(x) (sizeof(x)/sizeof(char*))
602typedef struct {
603 size_t cnt;
604 char **colors;
605} colordata;
606static colordata palette[] = {
608 {CSZ(pastel), pastel},
609 {CSZ(magma), magma},
611};
612#define NUM_SCHEMES (sizeof(palette)/sizeof(colordata))
613
615 if (themeid < 0 || (int)NUM_SCHEMES <= themeid) {
616 fprintf (stderr, "colorschemaset: illegal themeid %d\n", themeid);
617 return view->colschms;
618 }
619
620 colorschemaset s = {0};
622
623 s.schemacount = palette[themeid].cnt;
624 s.s = gv_calloc(s.schemacount, sizeof(colorschema));
625 set_color_theme_color(&s, palette[themeid].colors);
626
627 return s;
628}
629
Memory allocation wrappers that exit on failure.
static void * gv_recalloc(void *ptr, size_t old_nmemb, size_t new_nmemb, size_t size)
Definition alloc.h:73
static char * gv_strdup(const char *original)
Definition alloc.h:101
static void * gv_calloc(size_t nmemb, size_t size)
Definition alloc.h:26
static void * gv_alloc(size_t size)
Definition alloc.h:47
@ RGBA_DOUBLE
Definition color.h:27
void colorxlate(char *str, agxbuf *buf)
Definition colxlate.c:46
static NORETURN void graphviz_exit(int status)
Definition exit.h:23
glCompSet * glcreate_gl_topview_menu(void)
Definition glcompui.c:214
gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, void *data)
Definition gltemplate.c:143
void free(void *)
#define SIZE_MAX
Definition gmlscan.c:347
node NULL
Definition grammar.y:163
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
Definition attr.c:371
char * agget(void *obj, char *name)
Definition attr.c:465
int agclose(Agraph_t *g)
deletes a graph, freeing its associated storage
Definition graph.c:99
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:42
Agraph_t * graph(char *name)
Definition gv.cpp:30
void load_mouse_actions(ViewInfo *v)
Definition hotkeymap.c:115
char * fileName(ingraph_state *sp)
Return name of current file being processed.
Definition ingraphs.c:156
char * smyrnaPath(char *suffix)
Definition main.c:54
#define GUI_FULLSCREEN
Definition smyrnadefs.h:209
#define GG_labelattribute(g)
Definition smyrnadefs.h:200
#define GG_nodelabelcolor(g)
Definition smyrnadefs.h:198
#define GE_pos(g)
Definition smyrnadefs.h:201
#define GN_labelattribute(g)
Definition smyrnadefs.h:199
#define GN_selected(g)
Definition smyrnadefs.h:197
#define GG_edgelabelcolor(g)
Definition smyrnadefs.h:204
#define GE_labelattribute(g)
Definition smyrnadefs.h:205
#define GE_selected(g)
Definition smyrnadefs.h:203
#define GE_visible(g)
Definition smyrnadefs.h:202
#define GG_elabelattribute(g)
Definition smyrnadefs.h:206
#define GN_size(g)
Definition smyrnadefs.h:195
#define GUI_WINDOWED
Definition smyrnadefs.h:208
#define GN_visible(g)
Definition smyrnadefs.h:196
#define GN_pos(g)
Definition smyrnadefs.h:194
platform abstraction for case-insensitive string functions
graph or subgraph
Definition cgraph.h:424
float bdxLeft
Definition smyrnadefs.h:287
int active_frame
Definition smyrnadefs.h:317
ArcBall_t * arcball
Definition smyrnadefs.h:340
topview * Topview
Definition smyrnadefs.h:310
int drawnodes
Definition smyrnadefs.h:320
Agraph_t ** g
Definition smyrnadefs.h:293
float pany
Definition smyrnadefs.h:254
int total_frames
Definition smyrnadefs.h:318
float LineWidth
Definition smyrnadefs.h:276
int drawnodelabels
Definition smyrnadefs.h:322
char * template_file
Definition smyrnadefs.h:338
int labelnumberofnodes
Definition smyrnadefs.h:329
float bdyTop
Definition smyrnadefs.h:287
int drawedges
Definition smyrnadefs.h:321
float nodeScale
Definition smyrnadefs.h:344
GtkComboBox * graphComboBox
Definition smyrnadefs.h:339
GTimer * timer
Definition smyrnadefs.h:312
glCompSet * widgets
Definition smyrnadefs.h:333
size_t camera_count
Definition smyrnadefs.h:303
size_t graphCount
Definition smyrnadefs.h:295
glCompColor nodelabelcolor
Definition smyrnadefs.h:327
glCompColor fillColor
Definition smyrnadefs.h:265
glCompColor borderColor
Definition smyrnadefs.h:269
int labelshowedges
Definition smyrnadefs.h:331
colorschemaset colschms
Definition smyrnadefs.h:337
float gridSize
Definition smyrnadefs.h:281
glCompColor edgelabelcolor
Definition smyrnadefs.h:328
float panx
Definition smyrnadefs.h:253
GTimer * timer2
Definition smyrnadefs.h:314
int activeGraph
Definition smyrnadefs.h:297
glCompColor selectedNodeColor
Definition smyrnadefs.h:271
glCompColor bgColor
Definition smyrnadefs.h:261
viewport_camera ** cameras
Definition smyrnadefs.h:302
int labelshownodes
Definition smyrnadefs.h:330
GtkWidget * drawing_area
open gl canvas
Definition smyrnadefs.h:307
float bdxRight
Definition smyrnadefs.h:288
float bdyBottom
Definition smyrnadefs.h:288
systemgraphs systemGraphs
Definition smyrnadefs.h:251
int gridVisible
Definition smyrnadefs.h:279
float zoom
Definition smyrnadefs.h:255
int bdVisible
Definition smyrnadefs.h:284
int drawedgelabels
Definition smyrnadefs.h:323
glCompMouse mouse
Definition smyrnadefs.h:300
GTimer * timer3
Definition smyrnadefs.h:316
glCompColor gridColor
Definition smyrnadefs.h:267
glCompColor penColor
Definition smyrnadefs.h:263
size_t active_camera
<number of cameras
Definition smyrnadefs.h:304
float defaultnodealpha
Definition smyrnadefs.h:273
void * glutfont
Definition smyrnadefs.h:326
char * GraphFileName
Definition smyrnadefs.h:144
double RGBA[4]
Definition color.h:32
union color_s::@71 u
char ** colors
Definition viewport.c:604
size_t cnt
Definition viewport.c:603
glCompColor c
Definition smyrnadefs.h:95
colorschema * s
Definition smyrnadefs.h:101
size_t schemacount
Definition smyrnadefs.h:100
Definition legal.c:50
int dist2_limit
Definition hierarchy.h:63
int num_fine_nodes
Definition hierarchy.h:56
double coarsening_rate
Definition hierarchy.h:57
Definition types.h:81
double distortion
Definition hier.h:26
int height
Definition hier.h:25
int width
Definition hier.h:24
Agraph_t * attrs_widgets
Definition smyrnadefs.h:246
Agraph_t * def_attrs
Definition smyrnadefs.h:245
graph_data Graphdata
Definition smyrnadefs.h:231
hierparms_t hier
Definition smyrnadefs.h:223
int animate
Definition smyrnadefs.h:225
reposition_t repos
Definition smyrnadefs.h:221
xdot * xDot
Definition smyrnadefs.h:235
focus_t * fs
Definition smyrnadefs.h:228
struct topview::@55 fisheyeParams
levelparms_t level
Definition smyrnadefs.h:222
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:544
static void clear_color_theme(colorschemaset *cs)
Definition viewport.c:185
void set_viewport_settings_from_template(ViewInfo *vi, Agraph_t *g)
Definition viewport.c:85
static gboolean gl_main_expose(void *data)
Definition viewport.c:168
static char * deep_blue[]
Definition viewport.c:589
static void set_color_theme_color(colorschemaset *sc, char **colorstr)
Definition viewport.c:572
static colorschemaset create_color_theme(int themeid)
Definition viewport.c:614
ViewInfo * view
Definition viewport.c:37
static char * rain_forest[]
Definition viewport.c:598
void close_graph(ViewInfo *vi)
Definition viewport.c:71
int save_graph_with_file_name(Agraph_t *graph, char *fileName)
Definition viewport.c:459
void switch_graph(int graphId)
Definition viewport.c:448
static colordata palette[]
Definition viewport.c:606
static char * magma[]
Definition viewport.c:595
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:549
static Agraph_t * loadGraph(char *filename)
Definition viewport.c:334
void init_viewport(ViewInfo *vi)
Definition viewport.c:190
static void activate(int id)
Definition viewport.c:424
static void get_data_dir(void)
Definition viewport.c:179
#define NUM_SCHEMES
Definition viewport.c:612
static void update_graph_params(Agraph_t *graph)
Definition viewport.c:328
char * get_attribute_value(char *attr, ViewInfo *vi, Agraph_t *g)
Definition viewport.c:77
void updateRecord(Agraph_t *g)
Definition viewport.c:373
int add_graph_to_viewport_from_file(char *fileName)
Definition viewport.c:363
#define CSZ(x)
Definition viewport.c:601
int save_as_graph(void)
Definition viewport.c:509
void refreshViewport(void)
Definition viewport.c:410
int add_graph_to_viewport(Agraph_t *graph, char *id)
Definition viewport.c:430
static void clear_viewport(ViewInfo *vi)
Definition viewport.c:39
void glexpose(void)
Definition viewport.c:539
static void graphRecord(Agraph_t *g)
Definition viewport.c:395
static char * pastel[]
Definition viewport.c:592
int save_graph(void)
Definition viewport.c:489