Ported is_solid() and is_bridge() to XS. Also ported (but not used yet) group() to SurfaceCollection::group()

This commit is contained in:
Alessandro Ranellucci 2013-11-23 00:07:04 +01:00
parent de9d5403e8
commit 878d587196
6 changed files with 68 additions and 22 deletions

View file

@ -7,12 +7,6 @@ our @ISA = qw(Exporter);
our @EXPORT_OK = qw(S_TYPE_TOP S_TYPE_BOTTOM S_TYPE_INTERNAL S_TYPE_INTERNALSOLID S_TYPE_INTERNALBRIDGE S_TYPE_INTERNALVOID);
our %EXPORT_TAGS = (types => \@EXPORT_OK);
# delegate handles
sub contains_point { $_[0]->expolygon->contains_point }
sub lines { $_[0]->expolygon->lines }
sub contour { $_[0]->expolygon->contour }
sub holes { $_[0]->expolygon->holes }
# static method to group surfaces having same surface_type, bridge_angle and thickness*
sub group {
my $class = shift;
@ -43,20 +37,4 @@ sub p {
return @{$self->polygons};
}
sub is_solid {
my $self = shift;
my $type = $self->surface_type;
# S_TYPE_INTERNALBRIDGE is not solid because we can't merge it with other solid types
return $type == S_TYPE_TOP
|| $type == S_TYPE_BOTTOM
|| $type == S_TYPE_INTERNALSOLID;
}
sub is_bridge {
my $self = shift;
my $type = $self->surface_type;
return $type == S_TYPE_BOTTOM
|| $type == S_TYPE_INTERNALBRIDGE;
}
1;