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

Method BuildUseSets

Rendering/Volume/vtkUnstructuredGridVolumeZSweepMapper.cxx:2853–2927  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2851
2852//------------------------------------------------------------------------------
2853void vtkUnstructuredGridVolumeZSweepMapper::BuildUseSets()
2854{
2855 int needsUpdate = 0;
2856
2857 // If we have never created the list, we need updating
2858 if (this->UseSet == nullptr)
2859 {
2860 needsUpdate = 1;
2861 }
2862
2863 // If the data has changed in some way then we need to update
2864 vtkUnstructuredGridBase* input = this->GetInput();
2865 if (input->GetMTime() > this->SavedTriangleListMTime.GetMTime())
2866 {
2867 needsUpdate = 1;
2868 }
2869
2870 if (this->CellScalars && this->GetMTime() > this->SavedTriangleListMTime.GetMTime())
2871 {
2872 needsUpdate = 1;
2873 }
2874
2875 // If we don't need updating, return
2876 if (!needsUpdate)
2877 {
2878 return;
2879 }
2880
2881 vtkIdType numberOfPoints = input->GetNumberOfPoints();
2882
2883 vtkIdList* cellNeighbors = vtkIdList::New();
2884
2885 // init the use set of each vertex
2886 this->AllocateUseSet(numberOfPoints);
2887
2888 this->UseSet->SetCellScalars(this->CellScalars);
2889 if (this->CellScalars)
2890 {
2891 this->UseSet->SetNumberOfComponents(this->Scalars->GetNumberOfComponents());
2892 }
2893 // for each cell
2894 vtkSmartPointer<vtkCellIterator> cellIter =
2895 vtkSmartPointer<vtkCellIterator>::Take(input->NewCellIterator());
2896 for (cellIter->InitTraversal(); !cellIter->IsDoneWithTraversal(); cellIter->GoToNextCell())
2897 {
2898 cellIter->GetCell(this->Cell);
2899 vtkIdType faces = this->Cell->GetNumberOfFaces();
2900 if (faces > 0)
2901 {
2902 vtkIdType faceidx = 0;
2903 vtkCell* face;
2904 vtkIdType faceIds[3];
2905 vtkIdType orderedFaceIds[3];
2906 // for each face
2907 while (faceidx < faces)
2908 {
2909 face = this->Cell->GetFace(faceidx);
2910 faceIds[0] = face->GetPointId(0);

Callers 1

RenderMethod · 0.95

Calls 15

AllocateUseSetMethod · 0.95
ReorderTriangleMethod · 0.95
TakeFunction · 0.85
SetCellScalarsMethod · 0.80
GoToNextCellMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetInputMethod · 0.45
GetMTimeMethod · 0.45
GetNumberOfPointsMethod · 0.45
SetNumberOfComponentsMethod · 0.45
GetNumberOfComponentsMethod · 0.45

Tested by

no test coverage detected