diff options
Diffstat (limited to 'src/MTools')
-rw-r--r-- | src/MTools/Comp/MWritable.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/MTools/Comp/MWritable.pm b/src/MTools/Comp/MWritable.pm index 461468c..764e384 100644 --- a/src/MTools/Comp/MWritable.pm +++ b/src/MTools/Comp/MWritable.pm @@ -271,4 +271,18 @@ sub mdist { return (($x1 - $x2) ** 2 + ($y1 - $y2) ** 2 <= ($k) ** 2); } + +# from a reference to an array, this method clones the curves from this +# referenced array to the self array of curves, changing by the way +# the curves' group. +sub addCurves { + my ($self, $curves) = @_; + my $clone = undef; + foreach (@{$curves}) { + $clone = $zinc->clone($_); + $zinc -> chggroup ( $clone , minstance($self) ); + push( @{$self -> {__curves}} , $clone ); + } +} + 1; |