2
#include <X11/Intrinsic.h>
10
extern void CenterDraw();
11
extern void GetDrawGeometry();
12
extern void UnhiliteAll();
21
mylink *p; node *nod, *nod1;
22
char *label = "Give an internal number or a name";
27
if (theGraph->node_number == 0) return;
31
description[0]="Node internal number";
32
description[1]="Node name";
33
if ((result[0] = (char*)malloc((unsigned)MAXNAM * sizeof(char))) == NULL) {
34
fprintf(stderr,"Running out of memory\n");
37
if ((result[1] = (char*)malloc((unsigned)MAXNAM * sizeof(char))) == NULL) {
38
fprintf(stderr,"Running out of memory\n");
42
if (MetanetDialogs(2,init,result,description,label)) {
43
sscanf(result[0],"%d",&n);
45
if (n <= 0 || n > theGraph->node_number) {
46
sprintf(Description,"%d is not an internal node number",n);
47
MetanetAlert(Description);
50
p = theGraph->nodes->first;
53
if (((node*)(p->element))->number == n) {
54
nod = (node*)(p->element);
60
sprintf(Description,"%s is not an internal node number",strn);
61
MetanetAlert(Description);
65
strcpy(strn,result[1]);
66
p = theGraph->nodes->first;
69
nod1 = (node*)(p->element);
70
if (nod1->name != 0 && !strcmp(nod1->name,strn)) {
77
sprintf(Description,"%s is not a node name",strn);
78
MetanetAlert(Description);
83
if (!NodeVisible(nod))
84
CenterDraw(nod->x + NodeDiam(nod)/2,nod->y + NodeDiam(nod)/2);
96
GetDrawGeometry(&dx,&dy,&w,&h);
98
if ((int)(metaScale*n->x) >= dx &&
99
(int)(metaScale*(n->x + NodeDiam(n))) <= dx + w &&
100
(int)(metaScale*n->y) >= dy &&
101
(int)(metaScale*(n->y + NodeDiam(n))) <= dy + h)
110
mylink *p; arc *a,*a1;
111
char *label = "Give an internal number or a name";
114
char *description[2];
116
if (theGraph->arc_number == 0) return;
120
description[0]="Arc internal number";
121
description[1]="Arc name";
122
if ((result[0] = (char*)malloc((unsigned)MAXNAM * sizeof(char))) == NULL) {
123
fprintf(stderr,"Running out of memory\n");
126
if ((result[1] = (char*)malloc((unsigned)MAXNAM * sizeof(char))) == NULL) {
127
fprintf(stderr,"Running out of memory\n");
131
if (MetanetDialogs(2,init,result,description,label)) {
132
sscanf(result[0],"%d",&n);
134
if (n <= 0 || n > theGraph->arc_number) {
135
sprintf(Description,"%d is not an internal arc number",n);
136
MetanetAlert(Description);
139
p = theGraph->arcs->first;
142
a1 = (arc*)(p->element);
143
if (a1->number == n) {
150
sprintf(Description,"%s is not an internal arc number",strn);
151
MetanetAlert(Description);
156
strcpy(strn,result[1]);
157
p = theGraph->arcs->first;
160
a1 = (arc*)(p->element);
161
if (a1->name != 0 && !strcmp(a1->name,strn)) {
168
sprintf(Description,"%s is not an arc name",strn);
169
MetanetAlert(Description);
175
CenterDraw(a->xmax,a->ymax);
187
GetDrawGeometry(&dx,&dy,&w,&h);
189
if (NodeVisible(a->tail) && NodeVisible(a->head) &&
190
(int)(metaScale*a->xmax) >= dx && (int)(metaScale*a->xmax) <= dx + w &&
191
(int)(metaScale*a->ymax) >= dy && (int)(metaScale*a->ymax) <= dy + h)