From 19e691433731fb67b52b22ca751391746ca163de Mon Sep 17 00:00:00 2001 From: Berk Geveci <berk.geveci@kitware.com> Date: Thu, 6 Mar 2014 14:25:52 -0500 Subject: [PATCH] Cleaned up extent translators. - Removed unused extent translator subclasses - Removed unnecessary refereces to the extent translator - Moved extent translator into Common/ExecutionModel Change-Id: Idc53dd66891297b1f6a06ea3eb1baf394cb24b20 --- Common/DataModel/CMakeLists.txt | 1 - Common/DataModel/vtkDataSet.cxx | 1 - Common/DataModel/vtkDataSet.h | 1 - Common/ExecutionModel/CMakeLists.txt | 3 +- .../vtkExtentTranslator.cxx | 0 .../vtkExtentTranslator.h | 6 +- .../vtkOnePieceExtentTranslator.cxx | 47 --- .../vtkOnePieceExtentTranslator.h | 49 --- .../vtkTableExtentTranslator.cxx | 314 ------------------ .../ExecutionModel/vtkTableExtentTranslator.h | 110 ------ Filters/AMR/vtkImageToAMR.cxx | 1 - .../Core/vtkGridSynchronizedTemplates3D.cxx | 1 - .../vtkRectilinearSynchronizedTemplates.cxx | 1 - Filters/Core/vtkSynchronizedTemplates3D.cxx | 1 - .../Core/vtkSynchronizedTemplatesCutter3D.cxx | 1 - .../Extraction/vtkExtractArraysOverTime.cxx | 10 - .../Extraction/vtkExtractTemporalFieldData.h | 3 - .../General/vtkMultiBlockDataGroupFilter.cxx | 1 - Filters/General/vtkTableToStructuredGrid.cxx | 1 - IO/NetCDF/vtkMPASReader.cxx | 1 - IO/XML/vtkXMLPStructuredDataReader.cxx | 17 - IO/XML/vtkXMLPStructuredDataReader.h | 11 - Imaging/Core/vtkImageClip.cxx | 1 - Imaging/Core/vtkRTAnalyticSource.cxx | 1 - Rendering/LIC/CMakeLists.txt | 1 - .../LIC/vtkImageDataLIC2DExtentTranslator.cxx | 121 ------- .../LIC/vtkImageDataLIC2DExtentTranslator.h | 74 ----- 27 files changed, 3 insertions(+), 776 deletions(-) rename Common/{DataModel => ExecutionModel}/vtkExtentTranslator.cxx (100%) rename Common/{DataModel => ExecutionModel}/vtkExtentTranslator.h (95%) delete mode 100644 Common/ExecutionModel/vtkOnePieceExtentTranslator.cxx delete mode 100644 Common/ExecutionModel/vtkOnePieceExtentTranslator.h delete mode 100644 Common/ExecutionModel/vtkTableExtentTranslator.cxx delete mode 100644 Common/ExecutionModel/vtkTableExtentTranslator.h delete mode 100644 Rendering/LIC/vtkImageDataLIC2DExtentTranslator.cxx delete mode 100644 Rendering/LIC/vtkImageDataLIC2DExtentTranslator.h diff --git a/Common/DataModel/CMakeLists.txt b/Common/DataModel/CMakeLists.txt index 05ee164840c..20df9b27fd0 100644 --- a/Common/DataModel/CMakeLists.txt +++ b/Common/DataModel/CMakeLists.txt @@ -205,7 +205,6 @@ set(Module_SRCS vtkAMRDataInternals.cxx vtkUniformGridAMR.cxx vtkUniformGridAMRDataIterator.cxx - vtkExtentTranslator.cxx # needed by vtkDataSet ) set(${vtk-module}_HDRS diff --git a/Common/DataModel/vtkDataSet.cxx b/Common/DataModel/vtkDataSet.cxx index 3e6edb2c6d6..82dffddddfe 100644 --- a/Common/DataModel/vtkDataSet.cxx +++ b/Common/DataModel/vtkDataSet.cxx @@ -18,7 +18,6 @@ #include "vtkCellData.h" #include "vtkCellTypes.h" #include "vtkDataSetCellIterator.h" -#include "vtkExtentTranslator.h" #include "vtkGenericCell.h" #include "vtkIdList.h" #include "vtkInformation.h" diff --git a/Common/DataModel/vtkDataSet.h b/Common/DataModel/vtkDataSet.h index 9a0aed1e772..61c5800db6c 100644 --- a/Common/DataModel/vtkDataSet.h +++ b/Common/DataModel/vtkDataSet.h @@ -44,7 +44,6 @@ class vtkCell; class vtkCellData; class vtkCellIterator; class vtkCellTypes; -class vtkExtentTranslator; class vtkGenericCell; class vtkIdList; class vtkPointData; diff --git a/Common/ExecutionModel/CMakeLists.txt b/Common/ExecutionModel/CMakeLists.txt index dc05e2e6d3b..da6e9ab343c 100644 --- a/Common/ExecutionModel/CMakeLists.txt +++ b/Common/ExecutionModel/CMakeLists.txt @@ -13,6 +13,7 @@ SET(Module_SRCS vtkDirectedGraphAlgorithm.cxx vtkExecutive.cxx vtkExtentSplitter.cxx + vtkExtentTranslator.cxx vtkFilteringInformationKeyManager.cxx vtkGraphAlgorithm.cxx vtkHierarchicalBoxDataSetAlgorithm.cxx @@ -27,7 +28,6 @@ SET(Module_SRCS vtkInformationExecutivePortVectorKey.cxx vtkMultiBlockDataSetAlgorithm.cxx vtkMultiTimeStepAlgorithm.cxx - vtkOnePieceExtentTranslator.cxx vtkPassInputTypeAlgorithm.cxx vtkPiecewiseFunctionAlgorithm.cxx vtkPiecewiseFunctionShiftScale.cxx @@ -40,7 +40,6 @@ SET(Module_SRCS vtkStreamingDemandDrivenPipeline.cxx vtkStructuredGridAlgorithm.cxx vtkTableAlgorithm.cxx - vtkTableExtentTranslator.cxx vtkSMPProgressObserver.cxx vtkThreadedCompositeDataPipeline.cxx vtkThreadedImageAlgorithm.cxx diff --git a/Common/DataModel/vtkExtentTranslator.cxx b/Common/ExecutionModel/vtkExtentTranslator.cxx similarity index 100% rename from Common/DataModel/vtkExtentTranslator.cxx rename to Common/ExecutionModel/vtkExtentTranslator.cxx diff --git a/Common/DataModel/vtkExtentTranslator.h b/Common/ExecutionModel/vtkExtentTranslator.h similarity index 95% rename from Common/DataModel/vtkExtentTranslator.h rename to Common/ExecutionModel/vtkExtentTranslator.h index 3f519eb7d00..96a6088e66c 100644 --- a/Common/DataModel/vtkExtentTranslator.h +++ b/Common/ExecutionModel/vtkExtentTranslator.h @@ -19,17 +19,15 @@ // extent. It uses a recursive scheme that splits the largest axis. A hard // coded extent can be used for a starting point. -// .SECTION Caveats -// This object is still under development. #ifndef __vtkExtentTranslator_h #define __vtkExtentTranslator_h -#include "vtkCommonDataModelModule.h" // For export macro +#include "vtkCommonExecutionModelModule.h" // For export macro #include "vtkObject.h" -class VTKCOMMONDATAMODEL_EXPORT vtkExtentTranslator : public vtkObject +class VTKCOMMONEXECUTIONMODEL_EXPORT vtkExtentTranslator : public vtkObject { public: static vtkExtentTranslator *New(); diff --git a/Common/ExecutionModel/vtkOnePieceExtentTranslator.cxx b/Common/ExecutionModel/vtkOnePieceExtentTranslator.cxx deleted file mode 100644 index debf27c2318..00000000000 --- a/Common/ExecutionModel/vtkOnePieceExtentTranslator.cxx +++ /dev/null @@ -1,47 +0,0 @@ -/*========================================================================= - - Program: Visualization Toolkit - Module: vtkOnePieceExtentTranslator.cxx - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -#include "vtkOnePieceExtentTranslator.h" - -#include "vtkObjectFactory.h" - -vtkStandardNewMacro(vtkOnePieceExtentTranslator); -//----------------------------------------------------------------------------- -vtkOnePieceExtentTranslator::vtkOnePieceExtentTranslator() -{ -} - -//----------------------------------------------------------------------------- -vtkOnePieceExtentTranslator::~vtkOnePieceExtentTranslator() -{ -} - -//----------------------------------------------------------------------------- -int vtkOnePieceExtentTranslator::PieceToExtentThreadSafe( - int vtkNotUsed(piece), - int vtkNotUsed(numPieces), - int vtkNotUsed(ghostLevel), - int *wholeExtent, int *resultExtent, - int vtkNotUsed(splitMode), - int vtkNotUsed(byPoints)) -{ - memcpy(resultExtent, wholeExtent, sizeof(int)*6); - return 1; -} - -//----------------------------------------------------------------------------- -void vtkOnePieceExtentTranslator::PrintSelf(ostream& os, vtkIndent indent) -{ - this->Superclass::PrintSelf(os, indent); -} diff --git a/Common/ExecutionModel/vtkOnePieceExtentTranslator.h b/Common/ExecutionModel/vtkOnePieceExtentTranslator.h deleted file mode 100644 index 8a3e17e6974..00000000000 --- a/Common/ExecutionModel/vtkOnePieceExtentTranslator.h +++ /dev/null @@ -1,49 +0,0 @@ -/*========================================================================= - - Program: Visualization Toolkit - Module: vtkOnePieceExtentTranslator.h - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -// .NAME vtkOnePieceExtentTranslator - Returns the whole extent for any piece.. -// vtkOnePieceExtentTranslator returns the whole extent for any piece. - -#ifndef __vtkOnePieceExtentTranslator_h -#define __vtkOnePieceExtentTranslator_h - -#include "vtkCommonExecutionModelModule.h" // For export macro -#include "vtkExtentTranslator.h" - -class VTKCOMMONEXECUTIONMODEL_EXPORT vtkOnePieceExtentTranslator : public vtkExtentTranslator -{ -public: - static vtkOnePieceExtentTranslator* New(); - vtkTypeMacro(vtkOnePieceExtentTranslator, vtkExtentTranslator); - void PrintSelf(ostream& os, vtkIndent indent); - -protected: - vtkOnePieceExtentTranslator(); - ~vtkOnePieceExtentTranslator(); - - virtual int PieceToExtentThreadSafe(int vtkNotUsed(piece), - int vtkNotUsed(numPieces), - int vtkNotUsed(ghostLevel), - int *wholeExtent, int *resultExtent, - int vtkNotUsed(splitMode), - int vtkNotUsed(byPoints)); -private: - vtkOnePieceExtentTranslator(const vtkOnePieceExtentTranslator&); // Not implemented. - void operator=(const vtkOnePieceExtentTranslator&); // Not implemented. - -}; - -#endif - -// VTK-HeaderTest-Exclude: vtkOnePieceExtentTranslator.h diff --git a/Common/ExecutionModel/vtkTableExtentTranslator.cxx b/Common/ExecutionModel/vtkTableExtentTranslator.cxx deleted file mode 100644 index 7c215868e71..00000000000 --- a/Common/ExecutionModel/vtkTableExtentTranslator.cxx +++ /dev/null @@ -1,314 +0,0 @@ -/*========================================================================= - - Program: Visualization Toolkit - Module: vtkTableExtentTranslator.cxx - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -#include "vtkTableExtentTranslator.h" -#include "vtkObjectFactory.h" - -vtkStandardNewMacro(vtkTableExtentTranslator); - -//---------------------------------------------------------------------------- -vtkTableExtentTranslator::vtkTableExtentTranslator() -{ - this->ExtentTable = 0; - this->MaximumGhostLevel = 0; - this->PieceAvailable = 0; - this->NumberOfPiecesInTable = 0; -} - -//---------------------------------------------------------------------------- -vtkTableExtentTranslator::~vtkTableExtentTranslator() -{ - this->SetNumberOfPiecesInTable(0); -} - -//---------------------------------------------------------------------------- -void vtkTableExtentTranslator::PrintSelf(ostream& os, vtkIndent indent) -{ - this->Superclass::PrintSelf(os, indent); - if(this->ExtentTable) - { - vtkIndent nextIndent = indent.GetNextIndent(); - int* extent = this->ExtentTable; - int i; - - os << indent << "ExtentTable: 0: " - << extent[0] << " " << extent[1] << " " - << extent[2] << " " << extent[3] << " " - << extent[4] << " " << extent[5] << "\n"; - for(i=1;i < this->NumberOfPiecesInTable;++i) - { - extent += 6; - os << nextIndent << " " << i << ": " - << extent[0] << " " << extent[1] << " " - << extent[2] << " " << extent[3] << " " - << extent[4] << " " << extent[5] << "\n"; - } - } - else - { - os << indent << "ExtentTable: (none)\n"; - } - os << indent << "MaximumGhostLevel: " << this->MaximumGhostLevel << "\n"; - os << indent << "NumberOfPiecesInTable: " - << this->NumberOfPiecesInTable << "\n"; - if(this->PieceAvailable) - { - vtkIndent nextIndent = indent.GetNextIndent(); - int* available = this->PieceAvailable; - int i; - - os << indent << "PieceAvailable: 0: " << *available << "\n"; - for(i=1;i < this->NumberOfPiecesInTable;++i) - { - ++available; - os << nextIndent << " " << i << ": " - << *available << "\n"; - } - } - else - { - os << indent << "PieceAvailable: (none)\n"; - } -} - -//---------------------------------------------------------------------------- -void vtkTableExtentTranslator::SetNumberOfPieces(int pieces) -{ - // Allocate a table for this number of pieces. - if(this->NumberOfPiecesInTable == 0) - { - this->SetNumberOfPiecesInTable(pieces); - } - this->Superclass::SetNumberOfPieces(pieces); -} - -//---------------------------------------------------------------------------- -void vtkTableExtentTranslator::SetNumberOfPiecesInTable(int pieces) -{ - // Make sure we are really changing the number of pieces. - if(this->NumberOfPiecesInTable == pieces) - { - return; - } - - // The default number of pieces returned is the real number of - // pieces. - this->Superclass::SetNumberOfPieces(pieces); - this->NumberOfPiecesInTable = pieces; - - // Clean out any old extent table. - delete [] this->ExtentTable; - this->ExtentTable = 0; - delete [] this->PieceAvailable; - this->PieceAvailable = 0; - - // Create and initialize a new extent table if there are any pieces. - // Assume all pieces are available. - if(this->NumberOfPiecesInTable > 0) - { - this->ExtentTable = new int[this->NumberOfPiecesInTable*6]; - this->PieceAvailable = new int[this->NumberOfPiecesInTable]; - int i; - for(i=0;i < this->NumberOfPiecesInTable;++i) - { - int* extent = this->ExtentTable + i*6; - extent[0] = extent[2] = extent[4] = 0; - extent[1] = extent[3] = extent[5] = -1; - this->PieceAvailable[i] = 1; - } - } -} - -//---------------------------------------------------------------------------- -void vtkTableExtentTranslator::SetExtentForPiece(int piece, int* extent) -{ - if((!this->ExtentTable) || (piece < 0) || - (piece >= this->NumberOfPiecesInTable)) - { - vtkErrorMacro("Piece " << piece << " does not exist. " - "NumberOfPiecesInTable is " << this->NumberOfPiecesInTable); - return; - } - memcpy(this->ExtentTable+piece*6, extent, sizeof(int)*6); -} - -//---------------------------------------------------------------------------- -void vtkTableExtentTranslator::GetExtentForPiece(int piece, int* extent) -{ - if((!this->ExtentTable) || (piece < 0) || - (piece >= this->NumberOfPiecesInTable)) - { - vtkErrorMacro("Piece " << piece << " does not exist. " - "NumberOfPiecesInTable is " << this->NumberOfPiecesInTable); - extent[0] = extent[2] = extent[4] = 0; - extent[1] = extent[3] = extent[5] = -1; - return; - } - memcpy(extent, this->ExtentTable+piece*6, sizeof(int)*6); -} - -//---------------------------------------------------------------------------- -int* vtkTableExtentTranslator::GetExtentForPiece(int piece) -{ - static int emptyExtent[6] = {0,-1,0,-1,0,-1}; - if((!this->ExtentTable) || (piece < 0) || - (piece >= this->NumberOfPiecesInTable)) - { - vtkErrorMacro("Piece " << piece << " does not exist. " - "NumberOfPiecesInTable is " << this->NumberOfPiecesInTable); - return emptyExtent; - } - return this->ExtentTable+piece*6; -} - -//---------------------------------------------------------------------------- -void vtkTableExtentTranslator::SetPieceAvailable(int piece, int available) -{ - if((!this->ExtentTable) || (piece < 0) || - (piece >= this->NumberOfPiecesInTable)) - { - vtkErrorMacro("Piece " << piece << " does not exist. " - "NumberOfPiecesInTable is " << this->NumberOfPiecesInTable); - return; - } - this->PieceAvailable[piece] = available?1:0; -} - -//---------------------------------------------------------------------------- -int vtkTableExtentTranslator::GetPieceAvailable(int piece) -{ - if((!this->ExtentTable) || (piece < 0) || - (piece >= this->NumberOfPiecesInTable)) - { - vtkErrorMacro("Piece " << piece << " does not exist. " - "NumberOfPiecesInTable is " << this->NumberOfPiecesInTable); - return 0; - } - return this->PieceAvailable[piece]; -} - -//---------------------------------------------------------------------------- -int vtkTableExtentTranslator::PieceToExtentByPoints() -{ - vtkErrorMacro("PieceToExtentByPoints not supported."); - return 0; -} - -//---------------------------------------------------------------------------- -int -vtkTableExtentTranslator::PieceToExtentThreadSafe(int piece, int numPieces, - int ghostLevel, - int *wholeExtent, - int *resultExtent, - int vtkNotUsed(splitMode), - int byPoints) -{ - if (byPoints) - { - vtkErrorMacro("PieceToExtentByPoints not supported."); - return 0; - } - - if((!this->ExtentTable) || (piece < 0) || - (piece >= numPieces)) - { - vtkErrorMacro("Piece " << piece << " does not exist."); - return 0; - } - - if(ghostLevel > this->MaximumGhostLevel) - { - vtkWarningMacro("Ghost level " << ghostLevel - << " is larger than MaximumGhostLevel " - << this->MaximumGhostLevel << ". Using the maximum."); - ghostLevel = this->MaximumGhostLevel; - } - - if(numPieces == 1) - { - // The number of pieces requested is one. Return the whole extent. - memcpy(resultExtent, wholeExtent, sizeof(int)*6); - } - else if(piece < this->NumberOfPiecesInTable) - { - // Return the extent from the table entry. - memcpy(resultExtent, this->ExtentTable+piece*6, sizeof(int)*6); - } - else - { - // The requested piece is beyond the table. Return an empty extent. - resultExtent[0] = 0; - resultExtent[1] = -1; - resultExtent[2] = 0; - resultExtent[3] = -1; - resultExtent[4] = 0; - resultExtent[5] = -1; - } - - if(((resultExtent[1] - resultExtent[0] + 1)* - (resultExtent[3] - resultExtent[2] + 1)* - (resultExtent[5] - resultExtent[4] + 1)) == 0) - { - return 0; - } - - if(ghostLevel > 0) - { - resultExtent[0] -= this->GhostLevel; - resultExtent[1] += this->GhostLevel; - resultExtent[2] -= this->GhostLevel; - resultExtent[3] += this->GhostLevel; - resultExtent[4] -= this->GhostLevel; - resultExtent[5] += this->GhostLevel; - - if (resultExtent[0] < wholeExtent[0]) - { - resultExtent[0] = wholeExtent[0]; - } - if (resultExtent[1] > wholeExtent[1]) - { - resultExtent[1] = wholeExtent[1]; - } - if (resultExtent[2] < wholeExtent[2]) - { - resultExtent[2] = wholeExtent[2]; - } - if (resultExtent[3] > wholeExtent[3]) - { - resultExtent[3] = wholeExtent[3]; - } - if (resultExtent[4] < wholeExtent[4]) - { - resultExtent[4] = wholeExtent[4]; - } - if (resultExtent[5] > wholeExtent[5]) - { - resultExtent[5] = wholeExtent[5]; - } - } - - return 1; - -} - -//---------------------------------------------------------------------------- -int vtkTableExtentTranslator::PieceToExtent() -{ - return this->PieceToExtentThreadSafe(this->Piece, this->NumberOfPieces, - this->GhostLevel, - this->WholeExtent, - this->Extent, - this->SplitMode, - 0); -} diff --git a/Common/ExecutionModel/vtkTableExtentTranslator.h b/Common/ExecutionModel/vtkTableExtentTranslator.h deleted file mode 100644 index 644326b084f..00000000000 --- a/Common/ExecutionModel/vtkTableExtentTranslator.h +++ /dev/null @@ -1,110 +0,0 @@ -/*========================================================================= - - Program: Visualization Toolkit - Module: vtkTableExtentTranslator.h - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -// .NAME vtkTableExtentTranslator - Extent translation through lookup table. -// .SECTION Description -// vtkTableExtentTranslator provides a vtkExtentTranslator that is -// programmed with a specific extent corresponding to each piece -// number. Readers can provide this to an application to allow the -// pipeline to execute using the same piece breakdown that is provided -// in the input file. - -#ifndef __vtkTableExtentTranslator_h -#define __vtkTableExtentTranslator_h - -#include "vtkCommonExecutionModelModule.h" // For export macro -#include "vtkExtentTranslator.h" - -class VTKCOMMONEXECUTIONMODEL_EXPORT vtkTableExtentTranslator : public vtkExtentTranslator -{ -public: - vtkTypeMacro(vtkTableExtentTranslator,vtkExtentTranslator); - void PrintSelf(ostream& os, vtkIndent indent); - - static vtkTableExtentTranslator* New(); - - // Description: - - // Set the number of pieces into which the whole extent will be - // split. If this is 1 then the whole extent will be returned. If - // this is more than the number of pieces in the table then the - // extra pieces will be empty data. If this is more than one but - // less than the number of pieces in the table then only this many - // pieces will be returned (FIXME). - void SetNumberOfPieces(int pieces); - - // Description: - // Set the real number of pieces in the extent table. - void SetNumberOfPiecesInTable(int pieces); - vtkGetMacro(NumberOfPiecesInTable, int); - - // Description: - // Called to translate the current piece into an extent. This is - // not thread safe. - int PieceToExtent(); - - // Description: - // Not supported by this subclass of vtkExtentTranslator. - int PieceToExtentByPoints(); - - // Description: - // Not supported by this subclass of vtkExtentTranslator. - int PieceToExtentThreadSafe(int piece, int numPieces, - int ghostLevel, int *wholeExtent, - int *resultExtent, int splitMode, - int byPoints); - - // Description: - // Set the extent to be used for a piece. This sets the extent table - // entry for the piece. - virtual void SetExtentForPiece(int piece, int* extent); - - // Description: - // Get the extent table entry for the given piece. This is only for - // code that is setting up the table. Extent translation should - // always be done through the PieceToExtent method. - virtual void GetExtentForPiece(int piece, int* extent); - virtual int* GetExtentForPiece(int piece); - - // Description: - // Set the maximum ghost level that can be requested. This can be - // used by a reader to make sure an extent request does not go - // outside the boundaries of the piece's file. - vtkSetMacro(MaximumGhostLevel, int); - vtkGetMacro(MaximumGhostLevel, int); - - // Description: - // Get/Set whether the given piece is available. Requesting a piece - // that is not available will produce errors in the pipeline. - virtual void SetPieceAvailable(int piece, int available); - virtual int GetPieceAvailable(int piece); - -protected: - vtkTableExtentTranslator(); - ~vtkTableExtentTranslator(); - - // Store the extent table in a single array. Every 6 values form an extent. - int* ExtentTable; - int NumberOfPiecesInTable; - int MaximumGhostLevel; - - // Store a flag for the availability of each piece. - int* PieceAvailable; - -private: - vtkTableExtentTranslator(const vtkTableExtentTranslator&); // Not implemented. - void operator=(const vtkTableExtentTranslator&); // Not implemented. -}; - -#endif diff --git a/Filters/AMR/vtkImageToAMR.cxx b/Filters/AMR/vtkImageToAMR.cxx index 8411104b6b2..effb7147ab1 100644 --- a/Filters/AMR/vtkImageToAMR.cxx +++ b/Filters/AMR/vtkImageToAMR.cxx @@ -23,7 +23,6 @@ #include "vtkObjectFactory.h" #include "vtkOverlappingAMR.h" #include "vtkSmartPointer.h" -#include "vtkExtentTranslator.h" #include "vtkTuple.h" #include "vtkAMRBox.h" #include "vtkUniformGrid.h" diff --git a/Filters/Core/vtkGridSynchronizedTemplates3D.cxx b/Filters/Core/vtkGridSynchronizedTemplates3D.cxx index 0c26c3669ea..aca0e79c971 100644 --- a/Filters/Core/vtkGridSynchronizedTemplates3D.cxx +++ b/Filters/Core/vtkGridSynchronizedTemplates3D.cxx @@ -18,7 +18,6 @@ #include "vtkCellData.h" #include "vtkCharArray.h" #include "vtkDoubleArray.h" -#include "vtkExtentTranslator.h" #include "vtkFloatArray.h" #include "vtkGridSynchronizedTemplates3D.h" #include "vtkInformation.h" diff --git a/Filters/Core/vtkRectilinearSynchronizedTemplates.cxx b/Filters/Core/vtkRectilinearSynchronizedTemplates.cxx index 242303c5a7c..c4ad3d0302d 100644 --- a/Filters/Core/vtkRectilinearSynchronizedTemplates.cxx +++ b/Filters/Core/vtkRectilinearSynchronizedTemplates.cxx @@ -18,7 +18,6 @@ #include "vtkCellData.h" #include "vtkCharArray.h" #include "vtkDoubleArray.h" -#include "vtkExtentTranslator.h" #include "vtkFloatArray.h" #include "vtkInformation.h" #include "vtkInformationVector.h" diff --git a/Filters/Core/vtkSynchronizedTemplates3D.cxx b/Filters/Core/vtkSynchronizedTemplates3D.cxx index 1513c179bdd..2141685f68f 100644 --- a/Filters/Core/vtkSynchronizedTemplates3D.cxx +++ b/Filters/Core/vtkSynchronizedTemplates3D.cxx @@ -18,7 +18,6 @@ #include "vtkCellData.h" #include "vtkCharArray.h" #include "vtkDoubleArray.h" -#include "vtkExtentTranslator.h" #include "vtkFloatArray.h" #include "vtkInformation.h" #include "vtkInformationIntegerVectorKey.h" diff --git a/Filters/Core/vtkSynchronizedTemplatesCutter3D.cxx b/Filters/Core/vtkSynchronizedTemplatesCutter3D.cxx index 3df0710032d..158c53264b8 100644 --- a/Filters/Core/vtkSynchronizedTemplatesCutter3D.cxx +++ b/Filters/Core/vtkSynchronizedTemplatesCutter3D.cxx @@ -18,7 +18,6 @@ #include "vtkCellData.h" #include "vtkCharArray.h" #include "vtkDoubleArray.h" -#include "vtkExtentTranslator.h" #include "vtkFloatArray.h" #include "vtkImplicitFunction.h" #include "vtkInformation.h" diff --git a/Filters/Extraction/vtkExtractArraysOverTime.cxx b/Filters/Extraction/vtkExtractArraysOverTime.cxx index 7c424e56116..9cc8fd66925 100644 --- a/Filters/Extraction/vtkExtractArraysOverTime.cxx +++ b/Filters/Extraction/vtkExtractArraysOverTime.cxx @@ -30,7 +30,6 @@ #include "vtkNew.h" #include "vtkObjectFactory.h" #include "vtkOrderStatistics.h" -#include "vtkOnePieceExtentTranslator.h" #include "vtkPointData.h" #include "vtkTable.h" #include "vtkSelection.h" @@ -847,11 +846,6 @@ int vtkExtractArraysOverTime::RequestInformation( outInfo->Remove(vtkStreamingDemandDrivenPipeline::TIME_RANGE()); } - /* - * This filter is no longer producing rectilinear grid, instead it is - * producing a multiblock of rectilinear grids. That being the case, we do not - * need any specific extent translation - */ return 1; } @@ -872,10 +866,6 @@ int vtkExtractArraysOverTime::RequestUpdateExtent( inInfo1->Set(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP(), timeReq); } - /* Again, extent related stuff is no longer relevant since we are not - * producing rectilinear grid as the output, instead it is multiblock. - */ - return 1; } diff --git a/Filters/Extraction/vtkExtractTemporalFieldData.h b/Filters/Extraction/vtkExtractTemporalFieldData.h index a1d11132bf7..c81fb9c7680 100644 --- a/Filters/Extraction/vtkExtractTemporalFieldData.h +++ b/Filters/Extraction/vtkExtractTemporalFieldData.h @@ -23,9 +23,6 @@ // This algorithm does not produce a TIME_STEPS or TIME_RANGE information // because it works across time. // .Section Caveat -// vtkExtractTemporalFieldData puts a vtkOnePieceExtentTranslator in the -// output during RequestInformation(). As a result, the same whole -// extented is produced independent of the piece request. // This algorithm works only with source that produce TIME_STEPS(). // Continuous time range is not yet supported. diff --git a/Filters/General/vtkMultiBlockDataGroupFilter.cxx b/Filters/General/vtkMultiBlockDataGroupFilter.cxx index a90cd108135..1864520b5ac 100644 --- a/Filters/General/vtkMultiBlockDataGroupFilter.cxx +++ b/Filters/General/vtkMultiBlockDataGroupFilter.cxx @@ -20,7 +20,6 @@ #include "vtkInformationVector.h" #include "vtkMultiBlockDataSet.h" #include "vtkObjectFactory.h" -#include "vtkOnePieceExtentTranslator.h" #include "vtkStreamingDemandDrivenPipeline.h" vtkStandardNewMacro(vtkMultiBlockDataGroupFilter); diff --git a/Filters/General/vtkTableToStructuredGrid.cxx b/Filters/General/vtkTableToStructuredGrid.cxx index 0474797a1a0..ab284d3526d 100644 --- a/Filters/General/vtkTableToStructuredGrid.cxx +++ b/Filters/General/vtkTableToStructuredGrid.cxx @@ -18,7 +18,6 @@ #include "vtkInformation.h" #include "vtkInformationVector.h" #include "vtkObjectFactory.h" -#include "vtkOnePieceExtentTranslator.h" #include "vtkPointData.h" #include "vtkPoints.h" #include "vtkStreamingDemandDrivenPipeline.h" diff --git a/IO/NetCDF/vtkMPASReader.cxx b/IO/NetCDF/vtkMPASReader.cxx index bc337b627ba..d219c2a78b8 100644 --- a/IO/NetCDF/vtkMPASReader.cxx +++ b/IO/NetCDF/vtkMPASReader.cxx @@ -81,7 +81,6 @@ PURPOSE. See the above copyright notice for more information. #include "vtkSmartPointer.h" #include "vtkStreamingDemandDrivenPipeline.h" #include "vtkStringArray.h" -#include "vtkTableExtentTranslator.h" #include "vtkToolkits.h" #include "vtkUnstructuredGrid.h" diff --git a/IO/XML/vtkXMLPStructuredDataReader.cxx b/IO/XML/vtkXMLPStructuredDataReader.cxx index d8ff53abd14..106a2bb7ff5 100644 --- a/IO/XML/vtkXMLPStructuredDataReader.cxx +++ b/IO/XML/vtkXMLPStructuredDataReader.cxx @@ -20,7 +20,6 @@ #include "vtkInformation.h" #include "vtkInformationVector.h" #include "vtkStreamingDemandDrivenPipeline.h" -//#include "vtkTableExtentTranslator.h" #include "vtkXMLDataElement.h" #include "vtkXMLStructuredDataReader.h" @@ -30,7 +29,6 @@ //---------------------------------------------------------------------------- vtkXMLPStructuredDataReader::vtkXMLPStructuredDataReader() { - //this->ExtentTranslator = vtkTableExtentTranslator::New(); this->ExtentSplitter = vtkExtentSplitter::New(); this->PieceExtents = 0; memset(this->UpdateExtent, 0, sizeof(this->UpdateExtent)); @@ -53,7 +51,6 @@ vtkXMLPStructuredDataReader::~vtkXMLPStructuredDataReader() { if(this->NumberOfPieces) { this->DestroyPieces(); } this->ExtentSplitter->Delete(); - //this->ExtentTranslator->Delete(); } //---------------------------------------------------------------------------- @@ -62,13 +59,6 @@ void vtkXMLPStructuredDataReader::PrintSelf(ostream& os, vtkIndent indent) this->Superclass::PrintSelf(os, indent); } -//---------------------------------------------------------------------------- -vtkExtentTranslator* vtkXMLPStructuredDataReader::GetExtentTranslator() -{ - return 0; - //return this->ExtentTranslator; -} - //---------------------------------------------------------------------------- vtkIdType vtkXMLPStructuredDataReader::GetNumberOfPoints() { @@ -249,8 +239,6 @@ void vtkXMLPStructuredDataReader::SetupOutputData() void vtkXMLPStructuredDataReader::SetupPieces(int numPieces) { this->Superclass::SetupPieces(numPieces); - //this->ExtentTranslator->SetNumberOfPiecesInTable(this->NumberOfPieces); - //this->ExtentTranslator->SetMaximumGhostLevel(this->GhostLevel); this->PieceExtents = new int[6*this->NumberOfPieces]; int i; for(i=0;i < this->NumberOfPieces;++i) @@ -284,11 +272,6 @@ int vtkXMLPStructuredDataReader::ReadPiece(vtkXMLDataElement* ePiece) return 0; } - // Set this table entry in the extent translator. - //this->ExtentTranslator->SetExtentForPiece(this->Piece, pieceExtent); - //this->ExtentTranslator->SetPieceAvailable(this->Piece, - // this->CanReadPiece(this->Piece)); - return 1; } diff --git a/IO/XML/vtkXMLPStructuredDataReader.h b/IO/XML/vtkXMLPStructuredDataReader.h index 3f18bc779f8..9dbfca2eee8 100644 --- a/IO/XML/vtkXMLPStructuredDataReader.h +++ b/IO/XML/vtkXMLPStructuredDataReader.h @@ -28,8 +28,6 @@ #include "vtkXMLPDataReader.h" class vtkExtentSplitter; -class vtkExtentTranslator; -//class vtkTableExtentTranslator; class vtkXMLStructuredDataReader; class VTKIOXML_EXPORT vtkXMLPStructuredDataReader : public vtkXMLPDataReader @@ -38,14 +36,6 @@ public: vtkTypeMacro(vtkXMLPStructuredDataReader,vtkXMLPDataReader); void PrintSelf(ostream& os, vtkIndent indent); - // Description: - // Get an extent translator that will create pieces matching the - // input file's piece breakdown. This can be used further down the - // pipeline to prevent reading from outside this process's piece. - // The translator is only valid after an UpdateInformation has been - // called. - virtual vtkExtentTranslator* GetExtentTranslator(); - // For the specified port, copy the information this reader sets up in // SetupOutputInformation to outInfo virtual void CopyOutputInformation(vtkInformation *outInfo, int port); @@ -77,7 +67,6 @@ protected: vtkDataArray* inArray, vtkDataArray* outArray); int ComputePieceSubExtents(); - //vtkTableExtentTranslator* ExtentTranslator; vtkExtentSplitter* ExtentSplitter; // The extent to be updated in the output. diff --git a/Imaging/Core/vtkImageClip.cxx b/Imaging/Core/vtkImageClip.cxx index 93bd58fb532..11cedd38eb8 100644 --- a/Imaging/Core/vtkImageClip.cxx +++ b/Imaging/Core/vtkImageClip.cxx @@ -16,7 +16,6 @@ #include "vtkAlgorithmOutput.h" #include "vtkCellData.h" -#include "vtkExtentTranslator.h" #include "vtkImageData.h" #include "vtkInformation.h" #include "vtkInformationVector.h" diff --git a/Imaging/Core/vtkRTAnalyticSource.cxx b/Imaging/Core/vtkRTAnalyticSource.cxx index 46074ead2c0..eb61d3b0835 100644 --- a/Imaging/Core/vtkRTAnalyticSource.cxx +++ b/Imaging/Core/vtkRTAnalyticSource.cxx @@ -15,7 +15,6 @@ #include "vtkRTAnalyticSource.h" #include "vtkDataArray.h" -#include "vtkExtentTranslator.h" #include "vtkImageData.h" #include "vtkInformation.h" #include "vtkInformationVector.h" diff --git a/Rendering/LIC/CMakeLists.txt b/Rendering/LIC/CMakeLists.txt index 782a408b03b..3a5cc38eb34 100644 --- a/Rendering/LIC/CMakeLists.txt +++ b/Rendering/LIC/CMakeLists.txt @@ -1,6 +1,5 @@ set(Module_SRCS vtkImageDataLIC2D.cxx - vtkImageDataLIC2DExtentTranslator.cxx vtkLineIntegralConvolution2D.cxx vtkPixelTransfer.cxx vtkStructuredGridLIC2D.cxx diff --git a/Rendering/LIC/vtkImageDataLIC2DExtentTranslator.cxx b/Rendering/LIC/vtkImageDataLIC2DExtentTranslator.cxx deleted file mode 100644 index 2ba97a5d6a6..00000000000 --- a/Rendering/LIC/vtkImageDataLIC2DExtentTranslator.cxx +++ /dev/null @@ -1,121 +0,0 @@ -/*========================================================================= - - Program: Visualization Toolkit - Module: vtkImageDataLIC2DExtentTranslator.cxx - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -#include "vtkImageDataLIC2DExtentTranslator.h" - -#include "vtkObjectFactory.h" -#include "vtkImageDataLIC2D.h" - -//---------------------------------------------------------------------------- -vtkStandardNewMacro(vtkImageDataLIC2DExtentTranslator); - -//---------------------------------------------------------------------------- -vtkCxxSetObjectMacro( - vtkImageDataLIC2DExtentTranslator, - InputExtentTranslator, - vtkExtentTranslator); - -//---------------------------------------------------------------------------- -vtkImageDataLIC2DExtentTranslator::vtkImageDataLIC2DExtentTranslator() -{ - this->Algorithm = 0; - this->InputExtentTranslator = 0; - this->InputWholeExtent[0] = - this->InputWholeExtent[1] = - this->InputWholeExtent[2] = - this->InputWholeExtent[3] = - this->InputWholeExtent[4] = - this->InputWholeExtent[5] = 0; -} - -//---------------------------------------------------------------------------- -vtkImageDataLIC2DExtentTranslator::~vtkImageDataLIC2DExtentTranslator() -{ - this->SetInputExtentTranslator(0); -} - -//---------------------------------------------------------------------------- -void vtkImageDataLIC2DExtentTranslator::SetAlgorithm( - vtkImageDataLIC2D* alg) -{ - if (this->Algorithm.GetPointer() != alg) - { - this->Algorithm = alg; - this->Modified(); - } -} - -//---------------------------------------------------------------------------- -vtkImageDataLIC2D* vtkImageDataLIC2DExtentTranslator::GetAlgorithm() -{ - return this->Algorithm.GetPointer(); -} - -//---------------------------------------------------------------------------- -int vtkImageDataLIC2DExtentTranslator::PieceToExtentThreadSafe( - int piece, - int numPieces, - int ghostLevel, - int *wholeExtent, - int *resultExtent, - int splitMode, - int byPoints) -{ - if (!this->Algorithm) - { - return this->Superclass::PieceToExtentThreadSafe( - piece, - numPieces, - ghostLevel, - wholeExtent, - resultExtent, - splitMode, - byPoints); - } - - // Let the input extent translator do the translation. - int inExt[6]; - this->InputExtentTranslator->PieceToExtentThreadSafe( - piece, - numPieces, - ghostLevel, - this->InputWholeExtent, - inExt, - splitMode, - byPoints); - - this->Algorithm->TranslateInputExtent( - inExt, - this->InputWholeExtent, - resultExtent); - - return 1; -} - -//---------------------------------------------------------------------------- -void vtkImageDataLIC2DExtentTranslator::PrintSelf( ostream & os, vtkIndent indent ) -{ - this->Superclass::PrintSelf( os, indent ); - - os << indent << "Algorithm: " << this->Algorithm << endl; - os << indent << "InputWholeExtent: (" - << this->InputWholeExtent[0] << ", " - << this->InputWholeExtent[1] << ", " - << this->InputWholeExtent[2] << ", " - << this->InputWholeExtent[3] << ", " - << this->InputWholeExtent[4] << ", " - << this->InputWholeExtent[5] << ")" << endl; - os << indent << "InputExtentTranslator: " - << this->InputExtentTranslator << endl; -} diff --git a/Rendering/LIC/vtkImageDataLIC2DExtentTranslator.h b/Rendering/LIC/vtkImageDataLIC2DExtentTranslator.h deleted file mode 100644 index e869bb4499f..00000000000 --- a/Rendering/LIC/vtkImageDataLIC2DExtentTranslator.h +++ /dev/null @@ -1,74 +0,0 @@ -/*========================================================================= - - Program: Visualization Toolkit - Module: vtkImageDataLIC2DExtentTranslator.h - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -// .NAME vtkImageDataLIC2DExtentTranslator -// .SECTION Description -// This is needed because vtkImageDataLIC2D produces a larger output -// extents by setting a magnification factor. This class calls -// vtkImageLIC2D to do the translation. - -#ifndef __vtkImageDataLIC2DExtentTranslator_h -#define __vtkImageDataLIC2DExtentTranslator_h - -#include "vtkRenderingLICModule.h" // For export macro -#include "vtkExtentTranslator.h" -#include "vtkWeakPointer.h" // needed for vtkWeakPointer. - -class vtkImageDataLIC2D; - -class VTKRENDERINGLIC_EXPORT vtkImageDataLIC2DExtentTranslator - : public vtkExtentTranslator -{ -public: - static vtkImageDataLIC2DExtentTranslator* New(); - vtkTypeMacro(vtkImageDataLIC2DExtentTranslator, vtkExtentTranslator); - void PrintSelf(ostream& os, vtkIndent indent); - - // Description: - // Set the vtkImageDataLIC2D algorithm for which this extent translator is - // being used. vtkImageDataLIC2D will be called to make the translation - // which is dependant on the magnification factor. - void SetAlgorithm(vtkImageDataLIC2D*); - vtkImageDataLIC2D* GetAlgorithm(); - - void SetInputExtentTranslator(vtkExtentTranslator*); - vtkGetObjectMacro(InputExtentTranslator, vtkExtentTranslator); - - vtkSetVector6Macro(InputWholeExtent, int); - vtkGetVector6Macro(InputWholeExtent, int); - - virtual int PieceToExtentThreadSafe( - int piece, - int numPieces, - int ghostLevel, - int *wholeExtent, - int *resultExtent, - int splitMode, - int byPoints); - -//BTX -protected: - vtkImageDataLIC2DExtentTranslator(); - ~vtkImageDataLIC2DExtentTranslator(); - - int InputWholeExtent[6]; - vtkExtentTranslator* InputExtentTranslator; - vtkWeakPointer<vtkImageDataLIC2D> Algorithm; -private: - vtkImageDataLIC2DExtentTranslator(const vtkImageDataLIC2DExtentTranslator&); // Not implemented. - void operator=(const vtkImageDataLIC2DExtentTranslator&); // Not implemented. -//ETX -}; - -#endif -- GitLab