VTK/VTK 6 Migration/Removal of Methods for Manipulating Update Extent

From KitwarePublic
Jump to navigationJump to search

Removal of vtkDataObject Methods for Manipulating Update Extent

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 are those that manipulated the update extent. These are

  • SetUpdateExtent(int piece, int numPieces, int ghostLevel)
  • SetUpdateExtent(int piece, int numPieces)
  • SetUpdateExtent(int extent[6])
  • SetUpdateExtent(int x0, int x1, int y0, int y1, int z0, int z1)
  • int* GetUpdateExtent()
  • GetUpdateExtent(int& x0, int& x1, int& y0, int& y1,int& z0, int& z1)
  • GetUpdateExtent(int extent[6])
  • SetUpdateExtentToWholeExtent()

These were convenience functions that actually forwarded to the executives. For convenience, we added similar convenience functions to vtkAlgorithm. This should make it easy to transition to VTK 6. These functions are as follows.

  • SetUpdateExtent(int port, int connection, int piece,int numPieces, int ghostLevel);
  • SetUpdateExtent(int piece,int numPieces, int ghostLevel);
  • SetUpdateExtent(int port, int connection, int extent[6]);
  • SetUpdateExtent(int extent[6]);
  • SetUpdateExtentToWholeExtent(int port, int connection);
  • SetUpdateExtentToWholeExtent();

Example 1

Replace

<source lang="cpp"> vtkDataObject* dobj = aFilter->GetOutput(); dobj->UpdateInformation(); dobj->SetUpdateExtent(0 /*piece*/, 2 /*number of pieces*/); dobj->Update(); </source>

with

<source lang="cpp"> aFilter->UpdateInformation(); aFilter->SetUpdateExtent(0 /*piece*/, 2 /*number of pieces*/, 0 /*ghost levels*/); aFilter->Update(); </source>

Example 2

Replace

<source lang="cpp"> vtkDataObject* dobj = aFilter->GetOutput(); dobj->UpdateInformation(); int updateExtent[6] = {0, 10, 0, 10, 0, 10}; dobj->SetUpdateExtent(updateExtent); dobj->Update(); </source>

with

<source lang="cpp"> aFilter->UpdateInformation(); int updateExtent[6] = {0, 10, 0, 10, 0, 10}; aFilter->SetUpdateExtent(updateExtent); aFilter->Update(); </source>