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

Method NeedToExecuteData

Common/ExecutionModel/vtkStreamingDemandDrivenPipeline.cxx:1176–1313  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1174
1175//------------------------------------------------------------------------------
1176int vtkStreamingDemandDrivenPipeline ::NeedToExecuteData(
1177 int outputPort, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec)
1178{
1179 // Has the algorithm asked to be executed again?
1180 if (this->ContinueExecuting)
1181 {
1182 return 1;
1183 }
1184
1185 // If no port is specified, check all ports. This behavior is
1186 // implemented by the superclass.
1187 if (outputPort < 0)
1188 {
1189 return this->Superclass::NeedToExecuteData(outputPort, inInfoVec, outInfoVec);
1190 }
1191
1192 vtkInformation* outInfo = outInfoVec->GetInformationObject(outputPort);
1193 int updateNumberOfPieces = outInfo->Get(UPDATE_NUMBER_OF_PIECES());
1194 int updatePiece = outInfo->Get(UPDATE_PIECE_NUMBER());
1195
1196 if (updateNumberOfPieces > 1 && updatePiece > 0)
1197 {
1198 // This is a source.
1199 if (this->Algorithm->GetNumberOfInputPorts() == 0)
1200 {
1201 // And cannot handle piece request (i.e. not parallel)
1202 // and is not a structured source that can produce sub-extents.
1203 if (!outInfo->Get(vtkAlgorithm::CAN_HANDLE_PIECE_REQUEST()) &&
1204 !outInfo->Get(vtkAlgorithm::CAN_PRODUCE_SUB_EXTENT()))
1205 {
1206 // Then don't execute it.
1207 return 0;
1208 }
1209 }
1210 }
1211
1212 // Does the superclass want to execute?
1213 if (this->Superclass::NeedToExecuteData(outputPort, inInfoVec, outInfoVec))
1214 {
1215 return 1;
1216 }
1217
1218 // We need to check the requested update extent. Get the output
1219 // port information and data information. We do not need to check
1220 // existence of values because it has already been verified by
1221 // VerifyOutputInformation.
1222 vtkDataObject* dataObject = outInfo->Get(vtkDataObject::DATA_OBJECT());
1223 vtkInformation* dataInfo = dataObject->GetInformation();
1224
1225 // Check the unstructured extent. If we do not have the requested
1226 // piece, we need to execute.
1227 int dataNumberOfPieces = dataInfo->Get(vtkDataObject::DATA_NUMBER_OF_PIECES());
1228 if (dataNumberOfPieces != updateNumberOfPieces)
1229 {
1230 return 1;
1231 }
1232
1233 // Check if more ghost levels are needed

Callers 1

ProcessRequestMethod · 0.95

Calls 13

GetInformationObjectMethod · 0.80
SetInformationWeakMethod · 0.80
GetCurrentKeyMethod · 0.80
NeedToExecuteMethod · 0.80
GetMethod · 0.45
GetNumberOfInputPortsMethod · 0.45
GetInformationMethod · 0.45
SupportsGhostArrayMethod · 0.45
HasMethod · 0.45
InitTraversalMethod · 0.45
IsDoneWithTraversalMethod · 0.45

Tested by

no test coverage detected