Commit e9c2f595 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

Merge remote branch 'origin/master' into 12898_fix_text_bounding_box

* origin/master: (367 commits)
  Move Parallel specific methods from vtkExodusIIReaderPrivate
  COMP: Update Tracers AMR dependencies
  COMP: Update CMakeLists and AMR headers
  ENH: Move AMR under Filters/AMR
  Fix call to set VTK_MPIRUN_EXE
  Add additional HDF5 include directory
  Remove use of VTK_USE_MPI in vtkDistributedDataFilter
  CMAKE_XXX_OUTPUT_DIRECTORY should not be cache entries
  Test the variable MPIEXEC (not its value)
  Updated CMake to do MPI stuff in Parallel/MPI
  Let other projects set modules dir too
  Remove vtkPStreamTracer & vtkDistributedStreamTracer from wrap exclude
  Add code to module infrastruture to export module class information
  Add include directories to vtkxml2_INCLUDE_DIRS
  vtkContext2D needs to be wrapped for ParaView
  Exclude vtkCompositeRGBAPass from wrapping
  Move vtkAMRVolumeMapper to AMR/Core
  Remove automatic overrides taken from vtkParallelFactory
  BUGFIX: Fix Flash Reader TestSetGet HDF5 errors
  BUGFIX: Fix TestSetGet for AMR Enzo reader
  ...

Change-Id: I1665dd8abcf6aab8abb3422442d5233fa110d619
parents 24da3fc7 4ead86c8
......@@ -14,4 +14,4 @@ pre-commit crlf=input
*.txt whitespace=tab-in-indent,-blank-at-eol
*.cmake whitespace=tab-in-indent,-blank-at-eol
/Utilities/vtksqlite/vtk_sqlite3.c hooks.MaxObjectKiB=4096
/ThirdParty/sqlite/vtksqlite/vtk_sqlite3.c hooks.MaxObjectKiB=4096
## Set the Kit name
SET(KIT AMR)
SET(UKIT AMR)
SET(KIT_TCL_LIBS vtkCommonTCL vtkFilteringTCL vtkParallelTCL vtkGenericFilteringTCL )
SET(KIT_PYTHON_LIBS vtkCommonPythonD vtkFilteringPythonD vtkParallelPythonD vtkGenericFilteringPythonD )
SET(KIT_JAVA_LIBS vtkCommonJava vtkFilteringJava vtkParallelJava vtkGenericFilteringJava )
SET(KIT_INTERFACE_LIBRARIES vtkCommon vtkFiltering vtkParallel vtkGenericFiltering )
## Get the kit sources
SET(Kit_SRCS
vtkAMRBaseParticlesReader.cxx
vtkAMRBaseReader.cxx
vtkAMRCutPlane.cxx
vtkAMRDataSetCache.cxx
vtkAMREnzoParticlesReader.cxx
vtkAMREnzoReader.cxx
vtkAMREnzoReaderInternal.cxx
vtkAMRFlashParticlesReader.cxx
vtkAMRFlashReader.cxx
vtkAMRFlashReaderInternal.cxx
vtkAMRGaussianPulseSource.cxx
vtkAMRResampleFilter.cxx
vtkAMRSliceFilter.cxx
vtkAMRToMultiBlockFilter.cxx
)
## Set the libraries required by this kit
SET(KIT_LIBS vtkParallel vtkCommon vtkFiltering vtkGenericFiltering ${VTK_HDF5_LIBRARIES})
SET_SOURCE_FILES_PROPERTIES(
vtkAMRBaseReader
vtkAMRBaseParticlesReader
ABSTRACT
)
SET_SOURCE_FILES_PROPERTIES(
vtkAMREnzoReaderInternal
vtkAMRFlashReaderInternal
WRAP_EXCLUDE
)
## Include CMAKE code common to all kits
INCLUDE(${VTK_CMAKE_DIR}/KitCommonBlock.cmake )
ADD_SUBDIRECTORY(Cxx)
IF(PYTHON_EXECUTABLE)
ADD_TEST(HeaderTesting-AMR ${PYTHON_EXECUTABLE}
${VTK_SOURCE_DIR}/Common/Testing/HeaderTesting.py
"${VTK_SOURCE_DIR}/AMR"
VTK_AMR_EXPORT
vtkAMREnzoReaderInternal.h
vtkAMRFlashReaderInternal.h
)
ENDIF(PYTHON_EXECUTABLE)
\ No newline at end of file
## Set the name of the KIT being tested
SET(KIT AMR)
## List all test sources
SET(MyTests
TestFlashReader.cxx
TestEnzoReader.cxx
)
## Create test source list
CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx
${MyTests}
EXTRA_INCLUDE vtkTestDriver.h
)
ADD_EXECUTABLE( ${KIT}CxxTests ${Tests})
TARGET_LINK_LIBRARIES( ${KIT}CxxTests vtkAMR vtkFiltering vtkParallel )
## Add all executables
FOREACH(test ${MyTests})
GET_FILENAME_COMPONENT(t ${test} NAME_WE)
ADD_TEST(${t} ${CXX_TEST_PATH}/${KIT}CxxTests ${t} -D ${VTK_DATA_ROOT})
ENDFOREACH(test)
\ No newline at end of file
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAMRBaseParticlesReader.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 vtkAMRBaseParticlesReader.h -- Base class for all AMR particle readers
//
// .SECTION Description
// An abstract base class that implements all the common functionality for
// all particle readers.
#ifndef VTKAMRBASEPARTICLESREADER_H_
#define VTKAMRBASEPARTICLESREADER_H_
#include "vtkMultiBlockDataSetAlgorithm.h"
class vtkInformation;
class vtkInformationVector;
class vtkIndent;
class vtkMultiProcessController;
class vtkPolyData;
class vtkDataArraySelection;
class vtkCallbackCommand;
class VTK_AMR_EXPORT vtkAMRBaseParticlesReader :
public vtkMultiBlockDataSetAlgorithm
{
public:
vtkTypeMacro( vtkAMRBaseParticlesReader, vtkMultiBlockDataSetAlgorithm );
void PrintSelf(ostream &os, vtkIndent indent );
// Description:
// Set & Get the frequency.
vtkGetMacro(Frequency,int);
vtkSetMacro(Frequency,int);
// Description:
// Set & Get the multi-process controller.
vtkGetMacro(Controller, vtkMultiProcessController* );
vtkSetMacro(Controller, vtkMultiProcessController* );
// Description:
// Set & Get for filter location and boolean macro
vtkSetMacro(FilterLocation,int);
vtkGetMacro(FilterLocation,int);
vtkBooleanMacro(FilterLocation,int);
// Description:
// Get the data array selection tables used to configure which data
// arrays are loaded by the reader.
vtkGetObjectMacro(ParticleDataArraySelection,vtkDataArraySelection);
// Description:
// Get the number of particles arrays available in the input.
int GetNumberOfParticleArrays();
// Description:
// Get the particle array name of the array associated with the given
// index.
const char* GetParticleArrayName( int index );
// Description:
// Get/Set whether the particle array status.
int GetParticleArrayStatus( const char* name );
void SetParticleArrayStatus( const char* name, int status );
virtual void SetFileName( const char *fileName );
vtkGetStringMacro(FileName);
// Description:
// Sets the min location
inline void SetMinLocation(
const double minx, const double miny, const double minz )
{
this->MinLocation[ 0 ] = minx;
this->MinLocation[ 1 ] = miny;
this->MinLocation[ 2 ] = minz;
}
// Description:
// Sets the max location
inline void SetMaxLocation(
const double maxx, const double maxy, const double maxz )
{
this->MaxLocation[ 0 ] = maxx;
this->MaxLocation[ 1 ] = maxy;
this->MaxLocation[ 2 ] = maxz;
}
// Description:
// Returns the total number of particles
virtual int GetTotalNumberOfParticles() = 0;
protected:
vtkAMRBaseParticlesReader();
virtual ~vtkAMRBaseParticlesReader();
// Description:
// Reads the metadata, e.g., the number of blocks in the file.
// After the metadata is read, this->Initialized is set to true.
// Furthermore, to limit I/O, all concrete classes must make sure
// that this method returns immediately if this->Initialized is true.
virtual void ReadMetaData() = 0;
// Description:
// Reads the particles corresponding to the block associated with the
// given supplied block index.
virtual vtkPolyData* ReadParticles( const int blkIdx ) = 0;
// Description:
// Filters particles by their location. If FilterLocation is ON, this
// method returns whether or not the particle with the supplied xyz
// coordiantes flass within the bouning box spefixied by the user using
// the SetMinLocation & SetMaxLocation.
bool CheckLocation( const double x, const double y, const double z );
// Description:
// Determines whether this reader instance is running in parallel or not.
bool IsParallel( );
// Description:
// Determines if the block associated with the given block index belongs
// to the process that executes the current instance of the reader.
bool IsBlockMine( const int blkIdx );
// Description:
// Given the block index, this method determines the process Id.
// If the reader instance is serial this method always returns 0.
// Otherwise, static block-cyclic-distribution is assumed and each
// block is assigned to a process according to blkIdx%N, where N is
// the total number of processes.
int GetBlockProcessId( const int blkIdx );
// Description:
// Initializes the AMR Particles reader
// NOTE: must be called in the constructor of concrete classes.
void Initialize();
// Description:
// Standard Array selection variables & methods
vtkDataArraySelection *ParticleDataArraySelection;
vtkCallbackCommand *SelectionObserver;
// Description:
// Initializes the ParticleDataArraySelection object. This method
// only executes for an intial request in which case all arrays are
// deselected.
void InitializeParticleDataSelections();
// Description:
// Sets up the ParticleDataArraySelection. Implemented
// by concrete classes.
virtual void SetupParticleDataSelections() = 0;
// Description:
// Call-back registered with the SelectionObserver for selecting/deselecting
// particles
static void SelectionModifiedCallback(
vtkObject *caller,unsigned long eid,void *clientdata,void *calldata );
// Description:
// Standard pipeline operations
virtual int RequestData( vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector );
virtual int FillOutputPortInformation( int port, vtkInformation *info );
int NumberOfBlocks;
int FilterLocation;
double MinLocation[3];
double MaxLocation[3];
int Frequency;
vtkMultiProcessController *Controller;
bool InitialRequest;
bool Initialized;
char *FileName;
private:
vtkAMRBaseParticlesReader( const vtkAMRBaseParticlesReader& ); // Not implemented
void operator=(const vtkAMRBaseParticlesReader& ); // Not implemented
};
#endif /* VTKAMRBASEPARTICLESREADER_H_ */
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAMRBaseReader.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 vtkAMRBaseReader.h -- Base class for all AMR Readers
//
// .SECTION Description
// An abstract class that encapsulates common functionality for all AMR readers.
#ifndef VTKAMRBASEREADER_H_
#define VTKAMRBASEREADER_H_
#include "vtkOverlappingAMRAlgorithm.h"
#include <vector> // STL vector header
#include <map> // STL map header
#include <utility> // for STL pair
// Forward Declarations
class vtkOverlappingAMR;
class vtkMultiProcessController;
class vtkDataArraySelection;
class vtkCallbackCommand;
class vtkIndent;
class vtkAMRDataSetCache;
class vtkUniformGrid;
class vtkDataArray;
class VTK_AMR_EXPORT vtkAMRBaseReader :
public vtkOverlappingAMRAlgorithm
{
public:
vtkTypeMacro( vtkAMRBaseReader, vtkOverlappingAMRAlgorithm );
void PrintSelf(ostream &os, vtkIndent indent);
// Description:
// Initializes the AMR reader.
// All concrete instances must call this method in their constructor.
void Initialize();
// Description:
// Set/Get Reader caching property
vtkSetMacro( EnableCaching, int );
vtkGetMacro( EnableCaching, int );
vtkBooleanMacro( EnableCaching, int );
bool IsCachingEnabled() const
{
return( (this->EnableCaching)?true:false);
};
// Description:
// Set/Get a multiprocess-controller for reading in parallel.
// By default this parameter is set to NULL by the constructor.
vtkSetMacro( Controller, vtkMultiProcessController* );
vtkGetMacro( Controller, vtkMultiProcessController* );
// Description:
// Set the level, up to which the blocks are loaded.
vtkSetMacro( MaxLevel,int);
// Description:
// Get the data array selection tables used to configure which data
// arrays are loaded by the reader.
vtkGetObjectMacro(CellDataArraySelection, vtkDataArraySelection);
vtkGetObjectMacro(PointDataArraySelection, vtkDataArraySelection);
// Description:
// Get the number of point or cell arrays available in the input.
int GetNumberOfPointArrays();
int GetNumberOfCellArrays();
// Description:
// Get the name of the point or cell array with the given index in
// the input.
const char* GetPointArrayName(int index);
const char* GetCellArrayName(int index);
// Description:
// Get/Set whether the point or cell array with the given name is to
// be read.
int GetPointArrayStatus(const char* name);
int GetCellArrayStatus(const char* name);
void SetPointArrayStatus(const char* name, int status);
void SetCellArrayStatus(const char* name, int status);
// Description:
// Set/Get the filename. Concrete instances of this class must implement
// the SetFileName method accordingly.
vtkGetStringMacro( FileName );
virtual void SetFileName( const char *fileName ) = 0;
// Description:
// Returns the total number of blocks. Implemented by concrete instances.
virtual int GetNumberOfBlocks() = 0;
// Description:
// Returns the total number of levels. Implemented by concrete instances.
virtual int GetNumberOfLevels() = 0;
protected:
vtkAMRBaseReader();
virtual ~vtkAMRBaseReader();
// Desscription:
// Checks if this reader instance is attached to a communicator
// with more than one MPI processes.
bool IsParallel();
// Description:
// Determines if the block is owned by this process based on the
// the block index and total number of processes.
bool IsBlockMine( const int blockIdx );
// Description:
// Loads the AMR block corresponding to the given index. The block
// is either loaded from the file, or, from the cache if caching is
// enabled.
vtkUniformGrid* GetAMRBlock( const int blockIdx );
// Description:
// This method assigns blocks to processes using block-cyclic distribution.
// It is the method that is used to load distributed AMR data by default.
void AssignAndLoadBlocks( vtkOverlappingAMR *amrds );
// Description:
// This method loads all the blocks in the BlockMap for the given process.
// It assumes that the downstream module is doing an upstream request with
// the flag LOAD_REQUESTED_BLOCKS which indicates that the downstream filter
// has already assigned which blocks are needed for each process.
void LoadRequestedBlocks( vtkOverlappingAMR *amrds );
// Description:
// Loads the AMR data corresponding to the given field name.
// NOTE: Currently, only cell-data are supported.
void GetAMRData(
const int blockIdx, vtkUniformGrid *block, const char *fieldName );
// Description:
// A wrapper that loops over point arrays and load the point
// arrays that are enabled, i.e., selected for the given block.
// NOTE: This method is currently not implemented.
void LoadPointData( const int blockIdx, vtkUniformGrid *block );
// Description:
// A wrapper that loops over all cell arrays and loads the cell
// arrays that are enabled, i.e., selected for the given block.
// The data are either loaded from the file, or, from the cache if
// caching is enabled.
void LoadCellData( const int blockIdx, vtkUniformGrid *block );
// Description:
// Returns the block process ID for the block corresponding to the
// given block index. If this reader instance is serial, i.e., there
// is no controller associated, the method returns 0. Otherwise, static
// block-cyclic-distribution is assumed and each block is assigned to
// a process according to blockIdx%N, where N is the total number of
// processes.
int GetBlockProcessId( const int blockIdx );
// Description:
// Initializes the request of blocks to be loaded. This method checks
// if an upstream request has been issued from a downstream module which
// specifies which blocks are to be loaded, otherwise, it uses the max
// level associated with this reader instance to determine which blocks
// are to be loaded.
void SetupBlockRequest( vtkInformation *outputInfo );
// Description:
// Reads all the metadata from the file. Implemented by concrete classes.
virtual void ReadMetaData() = 0;
// Description:
// Generates a linear index for each block. Implemented by concrete
// instances.
//
// Note this method must create a block map for all blocks
// that are to be rendered according to the max level argument. For
// example, a sample implementation may look as follows:
//<code>
// for(int i=0;i < this->Internal->NumberOfBlocks;i++ )
// {
// if ( this->GetBlockLevel( i ) <= this->MaxLevel )
// {
// this->BlockMap.push_back( i );
// }
// }
//</code>
virtual void GenerateBlockMap() = 0;
// Description:
// Returns the block level for the given block
virtual int GetBlockLevel( const int blockIdx ) = 0;
// Description:
// Loads all the AMR metadata & constructs the LevelIdxPair12InternalIdx
// datastructure which maps (level,id) pairs to an internal linear index
// used to identify the corresponding block.
virtual int FillMetaData( ) = 0;
// Description:
// Loads the block according to the index w.r.t. the generated BlockMap.
virtual vtkUniformGrid* GetAMRGrid( const int blockIdx ) = 0;
// Description:
// Loads the block data
virtual void GetAMRGridData(
const int blockIdx, vtkUniformGrid *block, const char *field ) = 0;
// Description:
// Standard Pipeline methods, subclasses may override this method if needed.
virtual int RequestData(
vtkInformation* vtkNotUsed(request),
vtkInformationVector** vtkNotUsed(inputVector),
vtkInformationVector* outputVector );
virtual int RequestInformation(
vtkInformation* rqst,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector );
int FillOutputPortInformation(int port,vtkInformation *info);
// Array selection member variables and methods
vtkDataArraySelection *PointDataArraySelection;
vtkDataArraySelection *CellDataArraySelection;
vtkCallbackCommand *SelectionObserver;
// Description:
// Initializes the array selections. If this is an initial request,
// i.e., the first load from the file, all the arrays are deselected,
// and the IntialRequest ivar is set to false.
void InitializeArraySelections();
// Description:
// Initializes the PointDataArraySelection & CellDataArraySelection
virtual void SetUpDataArraySelections() = 0;
// Descriptions
// Call-back registered with the SelectionObserver.
static void SelectionModifiedCallback(
vtkObject *caller,unsigned long eid,void *clientdata,void *calldata );
bool InitialRequest;
int MaxLevel;
char *FileName;
vtkMultiProcessController *Controller;
int EnableCaching;
vtkAMRDataSetCache *Cache;
int NumBlocksFromFile;
int NumBlocksFromCache;
vtkOverlappingAMR *Metadata;
bool LoadedMetaData;
//BTX
std::vector<int> BlockMap;
//ETX
private:
vtkAMRBaseReader( const vtkAMRBaseReader& ); // Not implemented
void operator=( const vtkAMRBaseReader& ); // Not implemented
};
#endif /* VTKAMRBASEREADER_H_ */
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAMRCutPlane.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 vtkAMRCutPlane.h -- Cuts an AMR dataset
//
// .SECTION Description
// A concrete instance of vtkMultiBlockDataSet that provides functionality for
// cutting an AMR dataset (an instance of vtkOverlappingAMR) with user supplied
// implicit plane function defined by a normal and center.
#ifndef VTKAMRCUTPLANE_H_
#define VTKAMRCUTPLANE_H_
#include "vtkMultiBlockDataSetAlgorithm.h"
#include <vector> // For STL vector
#include <map> // For STL map
class vtkMultiBlockDataSet;
class vtkOverlappingAMR;
class vtkMultiProcessController;
class vtkInformation;
class vtkInformationVector;
class vtkIndent;
class vtkPlane;
class vtkUniformGrid;
class vtkCell;
class vtkPoints;
class vtkCellArray;
class vtkPointData;
class vtkCellData;
class VTK_AMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
{
public:
static vtkAMRCutPlane *New();
vtkTypeMacro(vtkAMRCutPlane, vtkMultiBlockDataSetAlgorithm);
void PrintSelf(ostream &oss, vtkIndent indent );
// Description:
// Sets the center
vtkSetVector3Macro(Center, double);
// Description:
// Sets the normal
vtkSetVector3Macro(Normal, double);
// Description:
// Sets the level of resolution
vtkSetMacro(LevelOfResolution, int);
vtkGetMacro(LevelOfResolution, int);
// Description:
//
vtkSetMacro(UseNativeCutter, int);
vtkGetMacro(UseNativeCutter, int);
vtkBooleanMacro(UseNativeCutter,int);