112 if ( p[0] < bounds_[0] || p[0] >= bounds_[1] || p[1] < bounds_[2] || p[1] >= bounds_[3] || p[2] < bounds_[4] || p[2] >= bounds_[5] )
115 const int x =
static_cast<int> ((p[0] - bounds_[0])/spacing_[0]);
116 const int y =
static_cast<int> ((p[1] - bounds_[2])/spacing_[1]);
117 const int z =
static_cast<int> ((p[2] - bounds_[4])/spacing_[2]);
119 const int x_m1 = x-1, x_p1 = x+1;
120 const int y_m1 = y-1, y_p1 = y+1;
121 const int z_m1 = z-1, z_p1 = z+1;
126 voxel = this->getVoxel (x_p1, y_p1, z_p1);
if ( voxel ) neighs[num_neighs++] = voxel;
127 voxel = this->getVoxel (x_p1, y_p1, z );
if ( voxel ) neighs[num_neighs++] = voxel;
128 voxel = this->getVoxel (x_p1, y_p1, z_m1);
if ( voxel ) neighs[num_neighs++] = voxel;
129 voxel = this->getVoxel (x_p1, y , z_p1);
if ( voxel ) neighs[num_neighs++] = voxel;
130 voxel = this->getVoxel (x_p1, y , z );
if ( voxel ) neighs[num_neighs++] = voxel;
131 voxel = this->getVoxel (x_p1, y , z_m1);
if ( voxel ) neighs[num_neighs++] = voxel;
132 voxel = this->getVoxel (x_p1, y_m1, z_p1);
if ( voxel ) neighs[num_neighs++] = voxel;
133 voxel = this->getVoxel (x_p1, y_m1, z );
if ( voxel ) neighs[num_neighs++] = voxel;
134 voxel = this->getVoxel (x_p1, y_m1, z_m1);
if ( voxel ) neighs[num_neighs++] = voxel;
136 voxel = this->getVoxel (x , y_p1, z_p1);
if ( voxel ) neighs[num_neighs++] = voxel;
137 voxel = this->getVoxel (x , y_p1, z );
if ( voxel ) neighs[num_neighs++] = voxel;
138 voxel = this->getVoxel (x , y_p1, z_m1);
if ( voxel ) neighs[num_neighs++] = voxel;
139 voxel = this->getVoxel (x , y , z_p1);
if ( voxel ) neighs[num_neighs++] = voxel;
140 voxel = this->getVoxel (x , y , z );
if ( voxel ) neighs[num_neighs++] = voxel;
141 voxel = this->getVoxel (x , y , z_m1);
if ( voxel ) neighs[num_neighs++] = voxel;
142 voxel = this->getVoxel (x , y_m1, z_p1);
if ( voxel ) neighs[num_neighs++] = voxel;
143 voxel = this->getVoxel (x , y_m1, z );
if ( voxel ) neighs[num_neighs++] = voxel;
144 voxel = this->getVoxel (x , y_m1, z_m1);
if ( voxel ) neighs[num_neighs++] = voxel;
146 voxel = this->getVoxel (x_m1, y_p1, z_p1);
if ( voxel ) neighs[num_neighs++] = voxel;
147 voxel = this->getVoxel (x_m1, y_p1, z );
if ( voxel ) neighs[num_neighs++] = voxel;
148 voxel = this->getVoxel (x_m1, y_p1, z_m1);
if ( voxel ) neighs[num_neighs++] = voxel;
149 voxel = this->getVoxel (x_m1, y , z_p1);
if ( voxel ) neighs[num_neighs++] = voxel;
150 voxel = this->getVoxel (x_m1, y , z );
if ( voxel ) neighs[num_neighs++] = voxel;
151 voxel = this->getVoxel (x_m1, y , z_m1);
if ( voxel ) neighs[num_neighs++] = voxel;
152 voxel = this->getVoxel (x_m1, y_m1, z_p1);
if ( voxel ) neighs[num_neighs++] = voxel;
153 voxel = this->getVoxel (x_m1, y_m1, z );
if ( voxel ) neighs[num_neighs++] = voxel;
154 voxel = this->getVoxel (x_m1, y_m1, z_m1);
if ( voxel ) neighs[num_neighs++] = voxel;