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

Method SetBoundaryArrays

Filters/General/vtkLoopBooleanPolyDataFilter.cxx:692–739  ·  view source on GitHub ↗

Set the boundary arrays on the mesh

Source from the content-addressed store, hash-verified

690
691// Set the boundary arrays on the mesh
692void vtkLoopBooleanPolyDataFilter::Impl::SetBoundaryArrays()
693{
694 // Variables used in the function
695 // Point locator to find points on mesh that are the points on the boundary
696 // lines
697 vtkSmartPointer<vtkPointLocator> pointLocator1 = vtkSmartPointer<vtkPointLocator>::New();
698 vtkSmartPointer<vtkPointLocator> pointLocator2 = vtkSmartPointer<vtkPointLocator>::New();
699 pointLocator1->SetDataSet(this->Mesh[0]);
700 pointLocator1->BuildLocator();
701 pointLocator2->SetDataSet(this->Mesh[1]);
702 pointLocator2->BuildLocator();
703
704 int numPoints = this->IntersectionLines->GetNumberOfPoints();
705
706 for (vtkIdType pointId = 0; pointId < numPoints; pointId++)
707 {
708 double pt[3];
709 this->IntersectionLines->GetPoint(pointId, pt);
710 // Find point on mesh
711 vtkIdType bp1 = pointLocator1->FindClosestPoint(pt);
712 this->PointMapper[0][bp1] = pointId;
713 this->ReversePointMapper[0][pointId] = bp1;
714 this->BoundaryPointArray[0]->InsertValue(bp1, 1);
715 vtkSmartPointer<vtkIdList> bpCellIds1 = vtkSmartPointer<vtkIdList>::New();
716 this->Mesh[0]->GetPointCells(bp1, bpCellIds1);
717 // Set the point mapping array
718 // Assign each cell attached to this point as a boundary cell
719 for (int i = 0; i < bpCellIds1->GetNumberOfIds(); i++)
720 {
721 this->BoundaryCellArray[0]->InsertValue(bpCellIds1->GetId(i), 1);
722 this->Checked[0][bpCellIds1->GetId(i)] = 1;
723 }
724
725 vtkIdType bp2 = pointLocator2->FindClosestPoint(pt);
726 this->PointMapper[1][bp2] = pointId;
727 this->ReversePointMapper[1][pointId] = bp2;
728 this->BoundaryPointArray[1]->InsertValue(bp2, 1);
729 vtkSmartPointer<vtkIdList> bpCellIds2 = vtkSmartPointer<vtkIdList>::New();
730 this->Mesh[1]->GetPointCells(bp2, bpCellIds2);
731 // Set the point mapping array
732 // Assign each cell attached to this point as a boundary cell
733 for (int i = 0; i < bpCellIds2->GetNumberOfIds(); i++)
734 {
735 this->BoundaryCellArray[1]->InsertValue(bpCellIds2->GetId(i), 1);
736 this->Checked[1][bpCellIds2->GetId(i)] = 1;
737 }
738 }
739}
740
741// Set the original finding region check arrays
742void vtkLoopBooleanPolyDataFilter::Impl::SetCheckArrays()

Callers 1

RequestDataMethod · 0.80

Calls 10

NewFunction · 0.50
SetDataSetMethod · 0.45
BuildLocatorMethod · 0.45
GetNumberOfPointsMethod · 0.45
GetPointMethod · 0.45
FindClosestPointMethod · 0.45
InsertValueMethod · 0.45
GetPointCellsMethod · 0.45
GetNumberOfIdsMethod · 0.45
GetIdMethod · 0.45

Tested by

no test coverage detected