------------------------------------------------------------------------------
| 299 | |
| 300 | //------------------------------------------------------------------------------ |
| 301 | void vtkHyperTreeGridGeometry3DImpl::GenerateOneCellFace(std::vector<HTG3DPoint>& cellPoints, |
| 302 | std::vector<std::pair<HTG3DPoint, HTG3DPoint>>& edgePoints, unsigned int faceId, vtkIdType cellId, |
| 303 | const double* cellOrigin, const double* cellSize, unsigned int offset, unsigned int orientation, |
| 304 | std::map<unsigned int, std::pair<HTG3DPoint*, unsigned int>>& internalFaceA, |
| 305 | std::map<unsigned int, std::pair<HTG3DPoint*, unsigned int>>& internalFaceB) |
| 306 | { |
| 307 | double pt[3] = { 0., 0., 0. }; |
| 308 | |
| 309 | // We compute the current cell points coordinates only if we didn't do it before |
| 310 | // (i.e. if IsValid == false for a given point) |
| 311 | // XXX: The code below can be reworked. We can think about computing all |
| 312 | // cell points once and for all before calling this function and remove all |
| 313 | // the logic below. |
| 314 | HTG3DPoint* currentPt = &cellPoints[::FACE_PTS_IDS[faceId][0]]; |
| 315 | if (currentPt->IsValid) |
| 316 | { |
| 317 | currentPt = &cellPoints[::FACE_PTS_IDS[faceId][1]]; |
| 318 | if (currentPt->IsValid) |
| 319 | { |
| 320 | currentPt = &cellPoints[::FACE_PTS_IDS[faceId][2]]; |
| 321 | if (currentPt->IsValid) |
| 322 | { |
| 323 | currentPt = &cellPoints[::FACE_PTS_IDS[faceId][3]]; |
| 324 | if (!currentPt->IsValid) |
| 325 | { |
| 326 | memcpy(pt, cellOrigin, 3 * sizeof(double)); |
| 327 | if (offset) |
| 328 | { |
| 329 | pt[orientation] += cellSize[orientation]; |
| 330 | } |
| 331 | unsigned int axis2 = (orientation + 2) % 3; |
| 332 | pt[axis2] += cellSize[axis2]; |
| 333 | this->SetXYZ(*currentPt, pt); |
| 334 | } |
| 335 | } |
| 336 | else |
| 337 | { |
| 338 | memcpy(pt, cellOrigin, 3 * sizeof(double)); |
| 339 | if (offset) |
| 340 | { |
| 341 | pt[orientation] += cellSize[orientation]; |
| 342 | } |
| 343 | unsigned int axis1 = (orientation + 1) % 3; |
| 344 | unsigned int axis2 = (orientation + 2) % 3; |
| 345 | pt[axis1] += cellSize[axis1]; |
| 346 | pt[axis2] += cellSize[axis2]; |
| 347 | this->SetXYZ(*currentPt, pt); |
| 348 | currentPt = &cellPoints[::FACE_PTS_IDS[faceId][3]]; |
| 349 | if (!currentPt->IsValid) |
| 350 | { |
| 351 | pt[axis1] = cellOrigin[axis1]; |
| 352 | this->SetXYZ(*currentPt, pt); |
| 353 | } |
| 354 | } |
| 355 | } |
| 356 | else |
| 357 | { |
| 358 | memcpy(pt, cellOrigin, 3 * sizeof(double)); |
no test coverage detected