From 3d5bc14297fe0f902056d1fc1ca3b099f50b6fb5 Mon Sep 17 00:00:00 2001 From: etienne Date: Mon, 26 May 2003 09:07:42 +0000 Subject: Les contours multiples sont reproduits quand on reg�n�re le code. --- Perl/Zinc/Debug.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Perl/Zinc/Debug.pm b/Perl/Zinc/Debug.pm index 09d0ae9..5bc7caa 100644 --- a/Perl/Zinc/Debug.pm +++ b/Perl/Zinc/Debug.pm @@ -514,6 +514,7 @@ sub buildItem { my $type = $zinc->type($item); my @code; my $numfields = 0; + my $numcontours = 0; # type group and initargs my $initstring = '$items{'.$item.'}=$zinc->add('.$type.', '.$group.', '; if ($type eq 'tabular' or $type eq 'track' or $type eq 'waypoint') { @@ -538,6 +539,7 @@ sub buildItem { $initstring .= join(', ', @coords); } $initstring .= " ], "; + $numcontours = $zinc->contour($item); } push(@code, $initstring); # options @@ -549,6 +551,22 @@ sub buildItem { push(@code, &buildField($zinc, $item, $i)); } } + if ($numcontours > 1) { + for (my $i=1; $i < $numcontours; $i++) { + my (@coords) = $zinc->coords($item); + my @coords2; + for my $c (@coords) { + if (@$c > 2) { + push(@coords2, '['.$c->[0].', '.$c->[1].', "'.$c->[2].'"]'); + } else { + push(@coords2, '['.$c->[0].', '.$c->[1].']'); + } + } + my $coordstr = '[ '.join(', ', @coords2).' ]'; + push(@code, '$zinc->contour($items{'.$item.'}, "add", 0, '); + push(@code, ' '.$coordstr.');'); + } + } return @code; } # end buildItem -- cgit v1.1