aboutsummaryrefslogtreecommitdiff
path: root/src/MTools/Comp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MTools/Comp')
-rw-r--r--src/MTools/Comp/MWritable.pm14
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;