MCPcopy Create free account
hub / github.com/Kitware/VTK / CellBoundary

Method CellBoundary

Common/DataModel/vtkQuad.cxx:363–404  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

361
362//------------------------------------------------------------------------------
363int 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

Callers 7

FindCellWalkFunction · 0.45
TestOneCellFunction · 0.45
TestOCBFunction · 0.45
TestCellFunction · 0.45
TestOECFunction · 0.45
FindClosestBoundaryMethod · 0.45

Calls 3

SetNumberOfIdsMethod · 0.80
SetIdMethod · 0.45
GetIdMethod · 0.45

Tested by 4

TestOneCellFunction · 0.36
TestOCBFunction · 0.36
TestCellFunction · 0.36
TestOECFunction · 0.36