This wiki has been deprecated. You can find updated information from the main VTK website.

VTK/VTK 6 Migration/Removal of SetWholeExtent

From KitwarePublic
< VTK
Jump to navigationJump to search

Removal of SetWholeExtent() from vtkDataObject

VTK 6 introduces a number of backwards-incompatible changes. The reasons behind these changes are described in more detail here. One of these changes is the removal of all pipeline related methods from vtkDataObject. Among these methods is SetWholeExtent(). SetWholeExtent() was previously (correctly) used to set meta-data about the whole available extent of a structured dataset in RequestInformation() and (incorrectly) used to try to set the actual extent of a structured dataset. The first use case can be replaced with the setting of the WHOLE_EXTENT() in the output information and the second one can be safely removed.

Example 1

Replace

int vtkMyReader::RequestInformation(vtkInformation*, vtkInformationVector**, 
       vtkInformationVector* outInfoVec)
{
   vtkImageData* image = this->GetOutput();
   int wext[6] = {0, 10, 0, 10, 0, 10};
   image->SetWholeExtent(wext);
   return 1;
}

with

int vtkMyReader::RequestInformation(vtkInformation*, vtkInformationVector**, 
       vtkInformationVector* outInfoVec)
{
   vtkInformation* outInfo = outInfoVec->GetInformationObject(0);
   int wext[6] = {0, 10, 0, 10, 0, 10};
   outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wext, 6);
   return 1;
}

Example 2

If outside RequestInformation, replace

int wext[6] = {0, 10, 0, 10, 0, 10};
image->SetExtent(wext);
image->SetWholeExtent(wext);

with

int wext[6] = {0, 10, 0, 10, 0, 10};
image->SetExtent(wext);