140 edgePositions_.resize(this->edgeNumber_);
141 edgeCoords_.resize(this->edgeNumber_);
143 if(this->dimensionality_ == 3) {
144#ifdef TTK_ENABLE_OPENMP
145#pragma omp parallel for num_threads(this->threadNumber_)
147 for(
SimplexId i = 0; i < this->edgeNumber_; ++i) {
148 auto &p = edgeCoords_[i];
150 if(i < this->esetshift_[0]) {
151 this->edgeToPosition(i, 0, p.data());
152 if(p[1] > 0 and p[1] < this->nbvoxels_[1]) {
153 if(p[2] > 0 and p[2] < this->nbvoxels_[2])
154 edgePositions_[i] = EdgePosition::L_xnn_3D;
156 edgePositions_[i] = EdgePosition::L_xn0_3D;
158 edgePositions_[i] = EdgePosition::L_xnN_3D;
159 }
else if(p[1] == 0) {
160 if(p[2] > 0 and p[2] < this->nbvoxels_[2])
161 edgePositions_[i] = EdgePosition::L_x0n_3D;
163 edgePositions_[i] = EdgePosition::L_x00_3D;
165 edgePositions_[i] = EdgePosition::L_x0N_3D;
167 if(p[2] > 0 and p[2] < this->nbvoxels_[2])
168 edgePositions_[i] = EdgePosition::L_xNn_3D;
170 edgePositions_[i] = EdgePosition::L_xN0_3D;
172 edgePositions_[i] = EdgePosition::L_xNN_3D;
175 }
else if(i < this->esetshift_[1]) {
176 this->edgeToPosition(i, 1, p.data());
177 if(p[0] > 0 and p[0] < this->nbvoxels_[0]) {
178 if(p[2] > 0 and p[2] < this->nbvoxels_[2])
179 edgePositions_[i] = EdgePosition::H_nyn_3D;
181 edgePositions_[i] = EdgePosition::H_ny0_3D;
183 edgePositions_[i] = EdgePosition::H_nyN_3D;
184 }
else if(p[0] == 0) {
185 if(p[2] > 0 and p[2] < this->nbvoxels_[2])
186 edgePositions_[i] = EdgePosition::H_0yn_3D;
188 edgePositions_[i] = EdgePosition::H_0y0_3D;
190 edgePositions_[i] = EdgePosition::H_0yN_3D;
192 if(p[2] > 0 and p[2] < this->nbvoxels_[2])
193 edgePositions_[i] = EdgePosition::H_Nyn_3D;
195 edgePositions_[i] = EdgePosition::H_Ny0_3D;
197 edgePositions_[i] = EdgePosition::H_NyN_3D;
200 }
else if(i < this->esetshift_[2]) {
201 this->edgeToPosition(i, 2, p.data());
202 if(p[0] > 0 and p[0] < this->nbvoxels_[0]) {
203 if(p[1] > 0 and p[1] < this->nbvoxels_[1])
204 edgePositions_[i] = EdgePosition::P_nnz_3D;
206 edgePositions_[i] = EdgePosition::P_n0z_3D;
208 edgePositions_[i] = EdgePosition::P_nNz_3D;
209 }
else if(p[0] == 0) {
210 if(p[1] > 0 and p[1] < this->nbvoxels_[1])
211 edgePositions_[i] = EdgePosition::P_0nz_3D;
213 edgePositions_[i] = EdgePosition::P_00z_3D;
215 edgePositions_[i] = EdgePosition::P_0Nz_3D;
217 if(p[1] > 0 and p[1] < this->nbvoxels_[1])
218 edgePositions_[i] = EdgePosition::P_Nnz_3D;
220 edgePositions_[i] = EdgePosition::P_N0z_3D;
222 edgePositions_[i] = EdgePosition::P_NNz_3D;
225 }
else if(i < this->esetshift_[3]) {
226 this->edgeToPosition(i, 3, p.data());
227 if(p[2] > 0 and p[2] < this->nbvoxels_[2])
228 edgePositions_[i] = EdgePosition::D1_xyn_3D;
230 edgePositions_[i] = EdgePosition::D1_xy0_3D;
232 edgePositions_[i] = EdgePosition::D1_xyN_3D;
234 }
else if(i < this->esetshift_[4]) {
235 this->edgeToPosition(i, 4, p.data());
236 if(p[0] > 0 and p[0] < this->nbvoxels_[0])
237 edgePositions_[i] = EdgePosition::D2_nyz_3D;
239 edgePositions_[i] = EdgePosition::D2_0yz_3D;
241 edgePositions_[i] = EdgePosition::D2_Nyz_3D;
243 }
else if(i < this->esetshift_[5]) {
244 this->edgeToPosition(i, 5, p.data());
245 if(p[1] > 0 and p[1] < this->nbvoxels_[1])
246 edgePositions_[i] = EdgePosition::D3_xnz_3D;
248 edgePositions_[i] = EdgePosition::D3_x0z_3D;
250 edgePositions_[i] = EdgePosition::D3_xNz_3D;
252 }
else if(i < this->esetshift_[6]) {
253 this->edgeToPosition(i, 6, p.data());
254 edgePositions_[i] = EdgePosition::D4_3D;
258 }
else if(this->dimensionality_ == 2) {
259#ifdef TTK_ENABLE_OPENMP
260#pragma omp parallel for num_threads(this->threadNumber_)
262 for(
SimplexId i = 0; i < this->edgeNumber_; ++i) {
263 auto &p = edgeCoords_[i];
265 if(i < this->esetshift_[0]) {
266 this->edgeToPosition2d(i, 0, p.data());
267 if(p[1] > 0 and p[1] < this->nbvoxels_[this->Dj_])
268 edgePositions_[i] = EdgePosition::L_xn_2D;
270 edgePositions_[i] = EdgePosition::L_x0_2D;
272 edgePositions_[i] = EdgePosition::L_xN_2D;
274 }
else if(i < this->esetshift_[1]) {
275 this->edgeToPosition2d(i, 1, p.data());
276 if(p[0] > 0 and p[0] < this->nbvoxels_[this->Di_])
277 edgePositions_[i] = EdgePosition::H_ny_2D;
279 edgePositions_[i] = EdgePosition::H_0y_2D;
281 edgePositions_[i] = EdgePosition::H_Ny_2D;
283 }
else if(i < this->esetshift_[2]) {
284 this->edgeToPosition2d(i, 2, p.data());
285 edgePositions_[i] = EdgePosition::D1_2D;
289 }
else if(this->dimensionality_ == 1) {
290 edgePositions_[0] = EdgePosition::FIRST_EDGE_1D;
291#ifdef TTK_ENABLE_OPENMP
292#pragma omp parallel for num_threads(this->threadNumber_)
294 for(
SimplexId i = 1; i < this->edgeNumber_ - 1; ++i) {
295 edgePositions_[i] = EdgePosition::CENTER_1D;
297 edgePositions_[this->edgeNumber_ - 1] = EdgePosition::LAST_EDGE_1D;
305 trianglePositions_.resize(this->triangleNumber_);
306 triangleCoords_.resize(this->triangleNumber_);
307 if(this->dimensionality_ == 3) {
308#ifdef TTK_ENABLE_OPENMP
309#pragma omp parallel for num_threads(this->threadNumber_)
311 for(
SimplexId i = 0; i < this->triangleNumber_; ++i) {
312 if(i < this->tsetshift_[0]) {
313 this->triangleToPosition(i, 0, triangleCoords_[i].data());
314 trianglePositions_[i] = TrianglePosition::F_3D;
315 }
else if(i < this->tsetshift_[1]) {
316 this->triangleToPosition(i, 1, triangleCoords_[i].data());
317 trianglePositions_[i] = TrianglePosition::H_3D;
318 }
else if(i < this->tsetshift_[2]) {
319 this->triangleToPosition(i, 2, triangleCoords_[i].data());
320 trianglePositions_[i] = TrianglePosition::C_3D;
321 }
else if(i < this->tsetshift_[3]) {
322 this->triangleToPosition(i, 3, triangleCoords_[i].data());
323 trianglePositions_[i] = TrianglePosition::D1_3D;
324 }
else if(i < this->tsetshift_[4]) {
325 this->triangleToPosition(i, 4, triangleCoords_[i].data());
326 trianglePositions_[i] = TrianglePosition::D2_3D;
327 }
else if(i < this->tsetshift_[5]) {
328 this->triangleToPosition(i, 5, triangleCoords_[i].data());
329 trianglePositions_[i] = TrianglePosition::D3_3D;
333 }
else if(this->dimensionality_ == 2) {
334#ifdef TTK_ENABLE_OPENMP
335#pragma omp parallel for num_threads(this->threadNumber_)
337 for(
SimplexId i = 0; i < this->triangleNumber_; ++i) {
338 this->triangleToPosition2d(i, triangleCoords_[i].data());
340 trianglePositions_[i] = TrianglePosition::TOP_2D;
342 trianglePositions_[i] = TrianglePosition::BOTTOM_2D;