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

Function MarkPDBoundary

Filters/Geometry/vtkAttributeSmoothingFilter.cxx:352–376  ·  view source on GitHub ↗

Mark vtkPolyData boundary points. This is a little faster than using vtkMarkBoundaryFilter.

Source from the content-addressed store, hash-verified

350// Mark vtkPolyData boundary points. This is a little faster than using
351// vtkMarkBoundaryFilter.
352void MarkPDBoundary(vtkPolyData* extractedEdges, vtkPolyData* inPolyData, unsigned char* smooth)
353{
354 // Needed for topological edge neighbor) operations.
355 inPolyData->BuildLinks();
356
357 vtkCellArray* lines = extractedEdges->GetLines();
358 vtkIdType numLines = lines->GetNumberOfCells();
359 auto iter = vtk::TakeSmartPointer(lines->NewIterator());
360 vtkIdType npts;
361 const vtkIdType* pts;
362 vtkNew<vtkIdList> neis;
363
364 // Traverse all edges in the dataset and determine if they
365 // are boundary edges.
366 for (auto lineId = 0; lineId < numLines; ++lineId)
367 {
368 iter->GetCellAtId(lineId, npts, pts);
369 inPolyData->GetCellEdgeNeighbors((-1), pts[0], pts[1], neis);
370 if (neis->GetNumberOfIds() == 1)
371 { // it's a boundary edge
372 smooth[pts[0]] = Boundary;
373 smooth[pts[1]] = Boundary;
374 }
375 }
376} // MarkPDBoundary
377
378// Mark boundary points for a general dataset. Boundary points are those that
379// are used by boundary faces. Boundary faces are determined by executing the

Callers 1

RequestDataMethod · 0.85

Calls 7

GetCellEdgeNeighborsMethod · 0.80
BuildLinksMethod · 0.45
GetLinesMethod · 0.45
GetNumberOfCellsMethod · 0.45
NewIteratorMethod · 0.45
GetCellAtIdMethod · 0.45
GetNumberOfIdsMethod · 0.45

Tested by

no test coverage detected