File Coverage

blib/lib/Algorithm/SpatialIndex/Strategy/3D.pm
Criterion Covered Total %
statement 19 25 76.0
branch 1 2 50.0
condition 1 3 33.3
subroutine 6 9 66.6
pod 5 5 100.0
total 32 44 72.7


line stmt bran cond sub pod time code
1             package Algorithm::SpatialIndex::Strategy::3D;
2 7     7   9533 use 5.008001;
  7         25  
  7         270  
3 7     7   38 use strict;
  7         12  
  7         213  
4 7     7   120 use warnings;
  7         15  
  7         234  
5              
6 7     7   2387 use parent 'Algorithm::SpatialIndex::Strategy';
  7         927  
  7         48  
7              
8 0     0 1 0 sub no_of_dimensions { 3 }
9 2     2 1 1325 sub no_of_subnodes { 8 }
10 0     0 1 0 sub coord_types { qw(double double double double double double) }
11 0     0 1 0 sub item_coord_types { qw(double double double) }
12              
13             sub filter_items_in_rect {
14 2     2 1 28 my ($self, $xl, $yl, $zl, $xu, $yu, $zu, @nodes) = @_;
15 2         7 my $storage = $self->storage;
16 2 50       41 if ($storage->bucket_class->can('items_in_rect')) {
17 0         0 return map { @{ $storage->fetch_bucket($_->id)->items_in_rect($xl, $yl, $zl, $xu, $yu, $zu) } }
  0         0  
  0         0  
18             @nodes;
19             }
20 352         989 return grep $_->[1] >= $xl && $_->[1] <= $xu &&
21             $_->[2] >= $yl && $_->[2] <= $yu &&
22             $_->[3] >= $zl && $_->[3] <= $zu,
23 2   33     7 map { @{ $storage->fetch_bucket($_->id)->items } }
  352         413  
24             @nodes;
25             }
26              
27             1;
28             __END__