diff options
Diffstat (limited to 'Perl')
-rw-r--r-- | Perl/demos/Tk/demos/zinc_lib/contours.pl | 31 | ||||
-rw-r--r-- | Perl/demos/Tk/demos/zinc_lib/window-contours.pl | 8 |
2 files changed, 18 insertions, 21 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/contours.pl b/Perl/demos/Tk/demos/zinc_lib/contours.pl index bfff197..b225d20 100644 --- a/Perl/demos/Tk/demos/zinc_lib/contours.pl +++ b/Perl/demos/Tk/demos/zinc_lib/contours.pl @@ -49,14 +49,14 @@ my $cercle100 = $zinc->add('arc', 1, [150,50, 250,150], # cloning curve0 as curve1 and moving it my $curve1 = $zinc->clone($curve0, -visible => 1, -fillcolor => "firebrick1"); # adding a 'difference' contour to the curve1 -$zinc->contour($curve1, 'diff', $cercle100); +$zinc->contour($curve1, 'addhole', $cercle100); # cloning curve0 as curve2 and moving it my $curve2 = $zinc->clone($curve0, -visible => 1, -fillcolor => "lightblue2"); $zinc->translate($curve2,100,90); # adding an 'intersection' contour to the curve2 -$zinc->contour($curve2, 'inter', $cercle100); +$zinc->contour($curve2, 'add', $cercle100); # ... translate to make it more visible $zinc->translate($curve2, -10,20); @@ -65,7 +65,7 @@ $zinc->translate($curve2, -10,20); my $curve3 = $zinc->clone($curve0, -visible => 1, -fillcolor => "yellow3"); $zinc->translate($curve3,0,290); # adding an 'union' contour to the curve3 -$zinc->contour($curve3, 'union', $cercle100); +$zinc->contour($curve3, 'add', $cercle100); # ... translate to make it more visible $zinc->translate($curve3, -50,-100); @@ -75,7 +75,7 @@ $zinc->translate($curve3, -50,-100); my $curve4 = $zinc->clone($curve0, -visible => 1, -fillcolor => "DarkGreen"); $zinc->translate($curve4,-20,-90); # adding an 'XOR' contour to the curve4 -$zinc->contour($curve4, 'xor', $cercle100); +$zinc->contour($curve4, 'addhole', $cercle100); # ... translate to make it more visible $zinc->translate($curve4, 230,130); @@ -94,26 +94,23 @@ my $handle = $zinc->add('rectangle', 1, [$x-5,$y-5,$x+5,$y+5], ); # adding a 'difference' contour to the curve5 -$zinc->contour($curve5, 'diff', $cercle100); +$zinc->contour($curve5, 'addhole', $cercle100); $zinc->translate('grouped',110,0); -$zinc->contour($curve5, 'diff', $cercle100); +$zinc->contour($curve5, 'addhole', $cercle100); $zinc->translate('grouped',-220,0); -$zinc->contour($curve5, 'diff', $cercle100); +$zinc->contour($curve5, 'add', $cercle100); $zinc->translate('grouped',110,80); -$zinc->contour($curve5, 'union', $cercle100); +$zinc->contour($curve5, 'add', $cercle100); $zinc->translate('grouped',0,-160); -$zinc->contour($curve5, 'union', $cercle100); +$zinc->contour($curve5, 'add', $cercle100); $zinc->translate('grouped',200,80); -$zinc->contour($curve5, 'xor', $cercle100); +$zinc->contour($curve5, 'addhole', $cercle100); $zinc->translate('grouped',-350,0); -$zinc->contour($curve5, 'union', $cercle100); +$zinc->contour($curve5, 'add', $cercle100); $zinc->translate('grouped',350,250); -#my @coords = $zinc->coords($curve5, 1); print "$#coords : @coords\n"; #seems buggy! -#my @coords2 = $zinc->coords($curve1, 1); print "$#coords2 : @coords2\n"; #seems buggy! - # Deleting no more usefull items: curve0 and cercle100: $zinc->remove($curve0, $cercle100); @@ -181,9 +178,9 @@ sub moveHandle { print "Translating of ", $x-$x_orig, ",", $y-$y_orig, "\n"; # LA LIGNE SUIVANTE EST OK LA 1ERE FOIS ET BUGGUE LES SUIVANTES! # NB: CELA MARCHOTTE POUR LE CONTOUR 0, MAIS CE N'EST PAS CORRECT! - my ($vertexX,$vertxY) = $zinc->coords($curve5,1,1); + my ($vertexX,$vertxY) = $zinc->coords($curve5,0,1); print "Vertex: $vertexX,$vertxY\n"; - $zinc->coords($curve5,1,1, [$x-$x_orig, $y-$y_orig]); + $zinc->coords($curve5,0,1, [$x-$x_orig, $y-$y_orig]); $x_orig = $x; $y_orig = $y; } @@ -194,7 +191,7 @@ sub release { $zinc->Tk::bind('<Motion>', ''); } - +print "1\n"; Tk::MainLoop(); diff --git a/Perl/demos/Tk/demos/zinc_lib/window-contours.pl b/Perl/demos/Tk/demos/zinc_lib/window-contours.pl index 0b2d91b..0cf4018 100644 --- a/Perl/demos/Tk/demos/zinc_lib/window-contours.pl +++ b/Perl/demos/Tk/demos/zinc_lib/window-contours.pl @@ -45,16 +45,16 @@ my $window = $zinc->add('curve', 1, [100,100 , 300,100, 300,400 , 100,400 ], ); my $aGlass= $zinc->add('rectangle', 1, [120,120 , 190,240]); -$zinc->contour($window, 'diff', $aGlass); +$zinc->contour($window, 'addhole', $aGlass); $zinc->translate($aGlass, 90,0); -$zinc->contour($window, 'diff', $aGlass); +$zinc->contour($window, 'addhole', $aGlass); $zinc->translate($aGlass, 0,140); -$zinc->contour($window, 'diff', $aGlass); +$zinc->contour($window, 'addhole', $aGlass); $zinc->translate($aGlass, -90,0); -$zinc->contour($window, 'diff', $aGlass); +$zinc->contour($window, 'addhole', $aGlass); # deleting $aGlass which is no more usefull $zinc->remove($aGlass); |