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

Method PolyDataExecute

IO/Parallel/vtkPDataSetReader.cxx:753–815  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

751
752//------------------------------------------------------------------------------
753int vtkPDataSetReader::PolyDataExecute(
754 vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector)
755{
756 vtkInformation* info = outputVector->GetInformationObject(0);
757 vtkPolyData* output = vtkPolyData::SafeDownCast(info->Get(vtkDataObject::DATA_OBJECT()));
758 int updatePiece, updateNumberOfPieces;
759 int startPiece, endPiece;
760 int idx;
761
762 updatePiece = info->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());
763 updateNumberOfPieces = info->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
764
765 // Only the first N pieces have anything in them.
766 updateNumberOfPieces = std::min(updateNumberOfPieces, this->NumberOfPieces);
767 if (updatePiece >= updateNumberOfPieces)
768 { // This duplicates functionality of the pipeline super classes ...
769 return 1;
770 }
771
772 startPiece = updatePiece * this->NumberOfPieces / updateNumberOfPieces;
773 endPiece = ((updatePiece + 1) * this->NumberOfPieces / updateNumberOfPieces) - 1;
774
775 if (endPiece < startPiece)
776 {
777 return 1;
778 }
779
780 vtkDataSetReader* reader;
781 vtkAppendPolyData* append = vtkAppendPolyData::New();
782 for (idx = startPiece; idx <= endPiece; ++idx)
783 {
784 vtkPolyData* tmp;
785 reader = vtkDataSetReader::New();
786 reader->ReadAllScalarsOn();
787 reader->ReadAllVectorsOn();
788 reader->ReadAllNormalsOn();
789 reader->ReadAllTensorsOn();
790 reader->ReadAllColorScalarsOn();
791 reader->ReadAllTCoordsOn();
792 reader->ReadAllFieldsOn();
793 reader->SetFileName(this->PieceFileNames[idx]);
794 tmp = reader->GetPolyDataOutput();
795 if (tmp && tmp->GetDataObjectType() != VTK_POLY_DATA)
796 {
797 vtkWarningMacro("Expecting PolyData in file: " << this->PieceFileNames[idx]);
798 }
799 else
800 {
801 append->AddInputConnection(reader->GetOutputPort());
802 }
803 reader->Delete();
804 }
805
806 append->Update();
807 output->CopyStructure(append->GetOutput());
808 output->GetFieldData()->PassData(append->GetOutput()->GetFieldData());
809 output->GetCellData()->PassData(append->GetOutput()->GetCellData());
810 output->GetPointData()->PassData(append->GetOutput()->GetPointData());

Callers 1

RequestDataMethod · 0.95

Calls 15

GetInformationObjectMethod · 0.80
GetDataObjectTypeMethod · 0.80
DeleteMethod · 0.65
minFunction · 0.50
NewFunction · 0.50
GetMethod · 0.45
SetFileNameMethod · 0.45
GetPolyDataOutputMethod · 0.45
AddInputConnectionMethod · 0.45
GetOutputPortMethod · 0.45
UpdateMethod · 0.45
CopyStructureMethod · 0.45

Tested by

no test coverage detected