2013-06-23 17:07:12 +02:00
|
|
|
ZTable* O_OBJECT
|
2013-06-24 19:35:49 +02:00
|
|
|
TriangleMesh* O_OBJECT
|
2013-07-06 15:26:32 +02:00
|
|
|
Point* O_OBJECT
|
2013-07-15 22:57:22 +02:00
|
|
|
Line* O_OBJECT
|
2013-07-15 12:14:22 +02:00
|
|
|
Polyline* O_OBJECT
|
2013-08-30 00:06:10 +02:00
|
|
|
PolylineCollection* O_OBJECT
|
2013-07-15 12:14:22 +02:00
|
|
|
Polygon* O_OBJECT
|
2013-07-06 16:33:49 +02:00
|
|
|
ExPolygon* O_OBJECT
|
2013-07-14 00:38:01 +02:00
|
|
|
ExPolygonCollection* O_OBJECT
|
2013-07-18 19:09:07 +02:00
|
|
|
ExtrusionEntityCollection* O_OBJECT
|
2013-07-15 12:14:22 +02:00
|
|
|
ExtrusionPath* O_OBJECT
|
|
|
|
ExtrusionLoop* O_OBJECT
|
2013-07-14 13:05:55 +02:00
|
|
|
Surface* O_OBJECT
|
2013-07-14 14:56:43 +02:00
|
|
|
SurfaceCollection* O_OBJECT
|
2013-07-15 12:14:22 +02:00
|
|
|
|
|
|
|
ExtrusionRole T_UV
|
|
|
|
SurfaceType T_UV
|
2013-07-16 20:09:53 +02:00
|
|
|
ClipperLib::JoinType T_UV
|
2013-07-17 00:29:09 +02:00
|
|
|
ClipperLib::PolyFillType T_UV
|
2013-07-15 23:12:13 +02:00
|
|
|
|
2013-09-09 22:27:58 +02:00
|
|
|
# we return these types whenever we want the items to be cloned
|
2013-08-27 00:52:20 +02:00
|
|
|
Points T_ARRAYREF
|
2013-07-16 20:09:53 +02:00
|
|
|
Lines T_ARRAYREF
|
|
|
|
Polygons T_ARRAYREF
|
|
|
|
ExPolygons T_ARRAYREF
|
2013-07-15 23:12:13 +02:00
|
|
|
|
2013-09-09 22:27:58 +02:00
|
|
|
# we return these types whenever we want the items to be returned
|
|
|
|
# by reference and marked ::Ref because they're contained in another
|
|
|
|
# Perl object
|
2013-09-09 21:43:28 +02:00
|
|
|
Polygons* T_ARRAYREF_PTR
|
2013-09-02 20:22:20 +02:00
|
|
|
|
2013-09-09 22:27:58 +02:00
|
|
|
# we return these types whenever we want the items to be returned
|
|
|
|
# by reference and not marked ::Ref because they're newly allocated
|
|
|
|
# and not referenced by any Perl object
|
|
|
|
TriangleMeshPtrs T_PTR_ARRAYREF
|
|
|
|
|
2013-07-15 23:12:13 +02:00
|
|
|
INPUT
|
|
|
|
|
2013-07-16 20:09:53 +02:00
|
|
|
T_ARRAYREF
|
|
|
|
if (SvROK($arg) && SvTYPE(SvRV($arg)) == SVt_PVAV) {
|
|
|
|
AV* av = (AV*)SvRV($arg);
|
|
|
|
const unsigned int len = av_len(av)+1;
|
|
|
|
$type* tmp = new $type(len);
|
|
|
|
for (unsigned int i = 0; i < len; i++) {
|
|
|
|
SV** elem = av_fetch(av, i, 0);
|
|
|
|
(*tmp)[i].from_SV_check(*elem);
|
|
|
|
}
|
|
|
|
$var = *tmp;
|
|
|
|
delete tmp;
|
|
|
|
} else
|
|
|
|
Perl_croak(aTHX_ \"%s: %s is not an array reference\",
|
|
|
|
${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
|
|
|
|
\"$var\");
|
|
|
|
|
2013-07-15 23:12:13 +02:00
|
|
|
OUTPUT
|
|
|
|
|
2013-07-16 20:09:53 +02:00
|
|
|
T_ARRAYREF
|
2013-07-15 23:23:35 +02:00
|
|
|
AV* av = newAV();
|
|
|
|
$arg = newRV_noinc((SV*)av);
|
2013-09-03 19:26:58 +02:00
|
|
|
sv_2mortal($arg);
|
2013-08-08 02:10:34 +02:00
|
|
|
av_extend(av, $var.size()-1);
|
|
|
|
int i = 0;
|
2013-09-03 19:26:58 +02:00
|
|
|
for (${type}::const_iterator it = $var.begin(); it != $var.end(); ++it) {
|
2013-09-09 22:27:58 +02:00
|
|
|
av_store(av, i++, it->to_SV_clone_ref());
|
2013-08-08 02:10:34 +02:00
|
|
|
}
|
|
|
|
$var.clear();
|
2013-09-02 20:22:20 +02:00
|
|
|
|
2013-09-09 21:43:28 +02:00
|
|
|
T_ARRAYREF_PTR
|
2013-09-02 20:22:20 +02:00
|
|
|
AV* av = newAV();
|
|
|
|
$arg = newRV_noinc((SV*)av);
|
2013-09-03 19:26:58 +02:00
|
|
|
sv_2mortal($arg);
|
2013-09-02 20:22:20 +02:00
|
|
|
av_extend(av, $var->size()-1);
|
|
|
|
int i = 0;
|
2013-09-09 21:43:28 +02:00
|
|
|
for (${ my $t = $type; $t =~ s/\*$//; \$t }::iterator it = $var->begin(); it != $var->end(); ++it) {
|
2013-09-09 22:27:58 +02:00
|
|
|
av_store(av, i++, it->to_SV_ref());
|
|
|
|
}
|
|
|
|
|
|
|
|
T_PTR_ARRAYREF
|
|
|
|
AV* av = newAV();
|
|
|
|
$arg = newRV_noinc((SV*)av);
|
|
|
|
sv_2mortal($arg);
|
|
|
|
av_extend(av, $var.size()-1);
|
|
|
|
int i = 0;
|
|
|
|
for (${type}::iterator it = $var.begin(); it != $var.end(); ++it) {
|
|
|
|
av_store(av, i++, (*it)->to_SV());
|
2013-09-02 20:22:20 +02:00
|
|
|
}
|