------------------------------------------------------------------------------
| 2851 | |
| 2852 | //------------------------------------------------------------------------------ |
| 2853 | void 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); |
no test coverage detected