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

Method IsEdge

Common/DataModel/vtkPolyData.cxx:1343–1421  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1341
1342//------------------------------------------------------------------------------
1343int vtkPolyData::IsEdge(vtkIdType p1, vtkIdType p2)
1344{
1345 vtkIdType ncells;
1346 vtkIdType cellType;
1347 vtkIdType npts;
1348 vtkIdType i, j;
1349 vtkIdType* cells;
1350 const vtkIdType* pts;
1351
1352 vtkIdType nbPoints = this->GetNumberOfPoints();
1353 if (p1 >= nbPoints || p2 >= nbPoints)
1354 {
1355 return 0;
1356 }
1357
1358 this->GetPointCells(p1, ncells, cells);
1359 for (i = 0; i < ncells; i++)
1360 {
1361 cellType = this->GetCellType(cells[i]);
1362 switch (cellType)
1363 {
1364 case VTK_EMPTY_CELL:
1365 case VTK_VERTEX:
1366 case VTK_POLY_VERTEX:
1367 case VTK_LINE:
1368 case VTK_POLY_LINE:
1369 break;
1370 case VTK_TRIANGLE:
1371 if (this->IsPointUsedByCell(p2, cells[i]))
1372 {
1373 return 1;
1374 }
1375 break;
1376 case VTK_QUAD:
1377 this->GetCellPoints(cells[i], npts, pts);
1378 for (j = 0; j < npts - 1; j++)
1379 {
1380 if (((pts[j] == p1) && (pts[j + 1] == p2)) || ((pts[j] == p2) && (pts[j + 1] == p1)))
1381 {
1382 return 1;
1383 }
1384 }
1385 if (((pts[0] == p1) && (pts[npts - 1] == p2)) || ((pts[0] == p2) && (pts[npts - 1] == p1)))
1386 {
1387 return 1;
1388 }
1389 break;
1390 case VTK_TRIANGLE_STRIP:
1391 this->GetCellPoints(cells[i], npts, pts);
1392 for (j = 0; j < npts - 2; j++)
1393 {
1394 if ((((pts[j] == p1) && (pts[j + 1] == p2)) || ((pts[j] == p2) && (pts[j + 1] == p1))) ||
1395 (((pts[j] == p1) && (pts[j + 2] == p2)) || ((pts[j] == p2) && (pts[j + 2] == p1))))
1396 {
1397 return 1;
1398 }
1399 }
1400 if (((pts[npts - 2] == p1) && (pts[npts - 1] == p2)) ||

Callers 15

updateFlippedEdgesFunction · 0.45
GenerateEdgesMethod · 0.45
TriangulateMethod · 0.45
BuildEdgesMethod · 0.45
operator()Method · 0.45
SamplePolygonMethod · 0.45
SamplePolygonMethod · 0.45
RequestDataMethod · 0.45
IsInteriorFragmentMethod · 0.45

Calls 5

GetPointCellsMethod · 0.95
GetCellTypeMethod · 0.95
IsPointUsedByCellMethod · 0.95
GetCellPointsMethod · 0.95
GetNumberOfPointsMethod · 0.45

Tested by

no test coverage detected