Differences From Artifact [b1555f0e30]:

To Artifact [754458c338]:


8
9
10
11
12
13
14



15
16
17
18
19
20
21
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24







+
+
+







# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.36  1999/11/19 04:00:26  peterg
## Changed a comment to be more accurate.
##
## Revision 1.35  1999/07/25 22:19:45  peterg
## Fixed bug with false objects when compound objects present.
## -- Reset object to 0 after processing text.
##
## Revision 1.34  1999/02/17 06:23:49  peterg
## Bugs arising from Fig 3.2 fixed
##
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431



























432
433
434
435
436
437
438
417
418
419
420
421
422
423











424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457







-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+








  arg_count++;
  if ( (arg_count-arrow)==1 ) 
    {

#Save up bond coords - no arrow and more segments than a stroke has.
# Allows for bent bonds - but just write out the relevant coordinates
      if ( (!arrow)&& (NF>2*stroke_coords+1) ) {
	i_bond++;
        a_end = arrow_end($2,$3,$4,$5,$(NF-3),$(NF-2),$(NF-1),$NF);
        if (a_end==1) {
	bonds[i_bond] = sprintf("%s %s %s %s %s %s", \
				$2, $3, $4, $5, $(NF-1), $(NF));
}
else {
	bonds[i_bond] = sprintf("%s %s %s %s %s %s", \
				$2, $3, $(NF-3),$(NF-2),$(NF-1),$NF);
}
	if ( (!arrow)&& (NF>2*stroke_coords+1) ) {
	    i_bond++;
	    a_end = arrow_end($2,$3,$4,$5,$(NF-3),$(NF-2),$(NF-1),$NF);
	    if (a_end==1) {
		arrow_end_vector_x = $6-$4; 
		arrow_end_vector_y = $7-$5; 
		other_end_vector_x = $(NF-1)-$(NF-3);
		other_end_vector_y = $(NF)-$(NF-2);
		bonds[i_bond] = sprintf("%s %s %s %s %s %s %s %s %s %s", \
					$2, $3, $4, $5, $(NF-1), $(NF),
					arrow_end_vector_x,
					arrow_end_vector_y,
					other_end_vector_x,
					other_end_vector_y);
	    }
	    else {
		other_end_vector_x = $4-$2; 
		other_end_vector_y = $5-$3; 
		arrow_end_vector_x = $(NF-3)-$(NF-5);
		arrow_end_vector_y = $(NF-2)-$(NF-4);
		bonds[i_bond] = sprintf("%s %s %s %s %s %s %s %s %s %s", \
					$2, $3, $(NF-3),$(NF-2),$(NF-1),$NF,
					arrow_end_vector_x,
					arrow_end_vector_y,
					other_end_vector_x,
					other_end_vector_y);
	    }
      }
      
#Save up arrow coords 
      if ( (arrow)&&(NF==(2*arrow_coords+1)) ) {
	i_arrow++;
	arrows[i_arrow] = sprintf("%s %s %s %s",  $2, $3, $4, $5);
      }

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]