------------------------------------------------------------------------------
| 843 | |
| 844 | //------------------------------------------------------------------------------ |
| 845 | int vtkUnstructuredGridGeometryFilter::RequestData(vtkInformation* vtkNotUsed(request), |
| 846 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 847 | { |
| 848 | // get the info objects |
| 849 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 850 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 851 | |
| 852 | // get the input and output. Input may just have the UnstructuredGridBase |
| 853 | // interface, but output should be an unstructured grid. |
| 854 | vtkUnstructuredGridBase* input = |
| 855 | vtkUnstructuredGridBase::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 856 | vtkUnstructuredGrid* output = |
| 857 | vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 858 | |
| 859 | // this->DebugOn(); |
| 860 | |
| 861 | // Input |
| 862 | vtkIdType numCells = input->GetNumberOfCells(); |
| 863 | if (numCells == 0) |
| 864 | { |
| 865 | vtkDebugMacro(<< "Nothing to extract"); |
| 866 | return 1; |
| 867 | } |
| 868 | vtkPointData* pd = input->GetPointData(); |
| 869 | vtkCellData* cd = input->GetCellData(); |
| 870 | vtkIdType numPts = input->GetNumberOfPoints(); |
| 871 | vtkPoints* inPts = input->GetPoints(); |
| 872 | vtkSmartPointer<vtkCellIterator> cellIter = |
| 873 | vtkSmartPointer<vtkCellIterator>::Take(input->NewCellIterator()); |
| 874 | |
| 875 | // Output |
| 876 | vtkPointData* outputPD = output->GetPointData(); |
| 877 | vtkCellData* outputCD = output->GetCellData(); |
| 878 | // vtkUnsignedCharArray *types=vtkUnsignedCharArray::New(); |
| 879 | // types->Allocate(numCells); |
| 880 | // vtkIdTypeArray *locs=vtkIdTypeArray::New(); |
| 881 | // locs->Allocate(numCells); |
| 882 | // vtkCellArray *conn=vtkCellArray::New(); |
| 883 | // conn->Allocate(numCells); |
| 884 | |
| 885 | unsigned char* cellGhostLevels = nullptr; |
| 886 | vtkDataArray* temp = nullptr; |
| 887 | if (cd != nullptr) |
| 888 | { |
| 889 | temp = cd->GetArray(vtkDataSetAttributes::GhostArrayName()); |
| 890 | } |
| 891 | if (temp != nullptr && temp->GetDataType() == VTK_UNSIGNED_CHAR && |
| 892 | temp->GetNumberOfComponents() == 1) |
| 893 | { |
| 894 | cellGhostLevels = static_cast<vtkUnsignedCharArray*>(temp)->GetPointer(0); |
| 895 | } |
| 896 | else |
| 897 | { |
| 898 | vtkDebugMacro("No appropriate ghost levels field available."); |
| 899 | } |
| 900 | |
| 901 | // Visibility of cells. |
| 902 | char* cellVis; |
nothing calls this directly
no test coverage detected