------------------------------------------------------------------------------
| 361 | |
| 362 | //------------------------------------------------------------------------------ |
| 363 | int vtkQuad::CellBoundary(int vtkNotUsed(subId), const double pcoords[3], vtkIdList* pts) |
| 364 | { |
| 365 | double t1 = pcoords[0] - pcoords[1]; |
| 366 | double t2 = 1.0 - pcoords[0] - pcoords[1]; |
| 367 | |
| 368 | pts->SetNumberOfIds(2); |
| 369 | |
| 370 | // compare against two lines in parametric space that divide element |
| 371 | // into four pieces. |
| 372 | if (t1 >= 0.0 && t2 >= 0.0) |
| 373 | { |
| 374 | pts->SetId(0, this->PointIds->GetId(0)); |
| 375 | pts->SetId(1, this->PointIds->GetId(1)); |
| 376 | } |
| 377 | |
| 378 | else if (t1 >= 0.0 && t2 < 0.0) |
| 379 | { |
| 380 | pts->SetId(0, this->PointIds->GetId(1)); |
| 381 | pts->SetId(1, this->PointIds->GetId(2)); |
| 382 | } |
| 383 | |
| 384 | else if (t1 < 0.0 && t2 < 0.0) |
| 385 | { |
| 386 | pts->SetId(0, this->PointIds->GetId(2)); |
| 387 | pts->SetId(1, this->PointIds->GetId(3)); |
| 388 | } |
| 389 | |
| 390 | else //( t1 < 0.0 && t2 >= 0.0 ) |
| 391 | { |
| 392 | pts->SetId(0, this->PointIds->GetId(3)); |
| 393 | pts->SetId(1, this->PointIds->GetId(0)); |
| 394 | } |
| 395 | |
| 396 | if (pcoords[0] < 0.0 || pcoords[0] > 1.0 || pcoords[1] < 0.0 || pcoords[1] > 1.0) |
| 397 | { |
| 398 | return 0; |
| 399 | } |
| 400 | else |
| 401 | { |
| 402 | return 1; |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | //------------------------------------------------------------------------------ |
| 407 | // Marching (convex) quadrilaterals |