----------------------------------------------------------------------------
| 78 | |
| 79 | //---------------------------------------------------------------------------- |
| 80 | int vtkGhostCellsGenerator::Execute(vtkDataObject* inputDO, vtkInformationVector* outputVector) |
| 81 | { |
| 82 | vtkDataObject* outputDO = vtkDataObject::GetData(outputVector, 0); |
| 83 | |
| 84 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 85 | |
| 86 | int retVal = 1; |
| 87 | |
| 88 | vtkSmartPointer<vtkDataObject> modifInputDO = |
| 89 | vtkSmartPointer<vtkDataObject>::Take(inputDO->NewInstance()); |
| 90 | modifInputDO->ShallowCopy(inputDO); |
| 91 | if (this->GenerateProcessIds) |
| 92 | { |
| 93 | vtkNew<vtkGenerateProcessIds> pidGenerator; |
| 94 | pidGenerator->SetInputData(modifInputDO); |
| 95 | pidGenerator->GenerateCellDataOn(); |
| 96 | pidGenerator->GeneratePointDataOn(); |
| 97 | pidGenerator->Update(); |
| 98 | modifInputDO->ShallowCopy(pidGenerator->GetOutputDataObject(0)); |
| 99 | } |
| 100 | if (this->GenerateGlobalIds) |
| 101 | { |
| 102 | vtkNew<vtkGenerateGlobalIds> gidGenerator; |
| 103 | gidGenerator->SetInputData(modifInputDO); |
| 104 | gidGenerator->Update(); |
| 105 | modifInputDO->ShallowCopy(gidGenerator->GetOutputDataObject(0)); |
| 106 | } |
| 107 | |
| 108 | int reqGhostLayers = |
| 109 | outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()); |
| 110 | |
| 111 | if (this->UseStaticMeshCache) |
| 112 | { |
| 113 | if (this->UseCacheIfPossible(modifInputDO, outputDO)) |
| 114 | { |
| 115 | // Cache copied to output, we still need to sync |
| 116 | retVal &= this->GenerateGhostCells(modifInputDO, outputDO, reqGhostLayers, true); |
| 117 | return retVal; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | retVal &= this->GenerateGhostCells(modifInputDO, outputDO, reqGhostLayers, this->SynchronizeOnly); |
| 122 | |
| 123 | if (this->UseStaticMeshCache) |
| 124 | { |
| 125 | this->UpdateCache(outputDO); |
| 126 | } |
| 127 | return retVal; |
| 128 | } |
| 129 | |
| 130 | //---------------------------------------------------------------------------- |
| 131 | int vtkGhostCellsGenerator::GenerateGhostCells( |
no test coverage detected