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

Method RequestData

Filters/Geometry/vtkUnstructuredGridGeometryFilter.cxx:845–1399  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

843
844//------------------------------------------------------------------------------
845int 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;

Callers

nothing calls this directly

Calls 15

CreateDefaultLocatorMethod · 0.95
TakeFunction · 0.85
GhostArrayNameFunction · 0.85
GetInformationObjectMethod · 0.80
GoToNextCellMethod · 0.80
CheckAbortMethod · 0.80
InsertNextIdMethod · 0.80
InsertFaceMethod · 0.80
GetCurrentSurfelMethod · 0.80
GetHigherOrderDegreesMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50

Tested by

no test coverage detected