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

Merge remote branch 'origin/master' into HEAD

* origin/master: (325 commits)
  BUG #13118. Fix segfault due to dangling pointers.
  COMP: Fix python wrapping of GUISupport/Qt classes in release.
  Eliminated a (shadowed declaration) warning from HT grid
  Do not build (but yet retain) a currently problematic test.
  Restored header file of vtk hyper tree source that got lost
  Fix for MFC compatibility issue with bad_alloc
  BUG 12810: Fix for int overflows in volume rendering module
  replace deprecated cmake remove command
  Remove vtkHyperTreeFractalSource.cxx from build
  Refactor VTK version handling
  Re-enable a unit test that was disabled by the modular changes.
  Enable Parallel Stream Tracer test
  Tab fix  asdfasdfasdf
  Add support for polygonal selection for charts
  KWSys Nightly Date Stamp
  Geometry fitler and changes in vtkHyperTreeGrid to support it.
  Created a new type of data set for hyper tree grids
  Running the tests with a hyper tree grid SOURCE now
  Had included a debug test by error
  Removed debug Print() statement
  ...

Conflicts:
	IO/vtkSTLReader.cxx

Change-Id: Ie6f1ee8ef057a10ea6e7eb5da171865206ebdfea
parents 54832f74 72c80292
......@@ -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 )
set(Module_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
vtkAMRUtilities.cxx
)
set_source_files_properties(
vtkAMRBaseReader
vtkAMRBaseParticlesReader
ABSTRACT
)
set_source_files_properties(
vtkAMREnzoReaderInternal
vtkAMRFlashReaderInternal
vtkAMRUtilities
WRAP_EXCLUDE
)
vtk_module_library(vtkAMRCore ${Module_SRCS})
## List all test sources
set(MyTests
TestFlashReader.cxx
TestEnzoReader.cxx
)
## Create test source list
create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
${MyTests}
EXTRA_INCLUDE vtkTestDriver.h
)
vtk_module_test_executable(${vtk-module}CxxTests ${Tests})
set(TestsToRun ${Tests})
remove(TestsToRun ${vtk-module}CxxTests.cxx)
## Add all executables
foreach(test ${TestsToRun})
get_filename_component(t ${test} NAME_WE)
add_test(NAME ${vtk-module}Cxx-${t}
COMMAND ${vtk-module}CxxTests ${t} -D ${VTK_DATA_ROOT})
endforeach()
vtk_module(vtkAMRCore
GROUPS
StandAlone
DEPENDS
vtkParallelCore
vtkFiltersGeneral
vtkhdf5
vtkIOXML
TEST_DEPENDS
vtkTestingCore
vtkTestingRendering
)
......@@ -83,11 +83,11 @@ void vtkAMRBaseParticlesReader::SetParticleArrayStatus(
if( status )
{
this->ParticleDataArraySelection->EnableArray( name );
this->ParticleDataArraySelection->EnableArray( name );
}
else
{
this->ParticleDataArraySelection->DisableArray( name );
this->ParticleDataArraySelection->DisableArray( name );
}
}
......@@ -113,7 +113,7 @@ void vtkAMRBaseParticlesReader::Initialize( )
for( int i=0; i < 3; ++i )
{
this->MinLocation[ i ] = this->MaxLocation[ i ] = 0.0;
this->MinLocation[ i ] = this->MaxLocation[ i ] = 0.0;
}
this->ParticleDataArraySelection = vtkDataArraySelection::New();
......@@ -129,7 +129,9 @@ void vtkAMRBaseParticlesReader::Initialize( )
void vtkAMRBaseParticlesReader::InitializeParticleDataSelections()
{
if( !this->InitialRequest )
{
return;
}
this->ParticleDataArraySelection->DisableAllArrays();
this->InitialRequest = false;
......@@ -141,17 +143,16 @@ void vtkAMRBaseParticlesReader::SetFileName( const char *fileName )
if( this->FileName != NULL )
{
if( strcmp(this->FileName,fileName) != 0 )
{
this->Initialized = false;
delete [] this->FileName;
this->FileName = NULL;
}
else
{
return;
}
if( strcmp(this->FileName,fileName) != 0 )
{
this->Initialized = false;
delete [] this->FileName;
this->FileName = NULL;
}
else
{
return;
}
}
this->FileName = new char[ strlen(fileName)+1 ];
......@@ -164,7 +165,9 @@ void vtkAMRBaseParticlesReader::SetFileName( const char *fileName )
bool vtkAMRBaseParticlesReader::IsParallel()
{
if( this->Controller != NULL && this->Controller->GetNumberOfProcesses() > 1 )
{
return true;
}
return false;
}
......@@ -172,11 +175,15 @@ bool vtkAMRBaseParticlesReader::IsParallel()
bool vtkAMRBaseParticlesReader::IsBlockMine( const int blkIdx )
{
if( !this->IsParallel() )
{
return true;
}
int myRank = this->Controller->GetLocalProcessId();
if( myRank == this->GetBlockProcessId( blkIdx ) )
{
return true;
}
return false;
}
......@@ -184,7 +191,9 @@ bool vtkAMRBaseParticlesReader::IsBlockMine( const int blkIdx )
int vtkAMRBaseParticlesReader::GetBlockProcessId( const int blkIdx )
{
if( !this->IsParallel() )
{
return 0;
}
int N = this->Controller->GetNumberOfProcesses();
return( blkIdx%N );
......@@ -195,7 +204,9 @@ bool vtkAMRBaseParticlesReader::CheckLocation(
const double x, const double y, const double z )
{
if( !this->FilterLocation )
{
return true;
}
double coords[3];
coords[0] = x;
......@@ -204,8 +215,10 @@ bool vtkAMRBaseParticlesReader::CheckLocation(
for( int i=0; i < 3; ++i )
{
if( this->MinLocation[i] > coords[i] || coords[i] > this->MaxLocation[i] )
return false;
if( this->MinLocation[i] > coords[i] || coords[i] > this->MaxLocation[i] )
{
return false;
}
} // END for all dimensions
return true;
......
......@@ -21,6 +21,7 @@
#ifndef VTKAMRBASEPARTICLESREADER_H_
#define VTKAMRBASEPARTICLESREADER_H_
#include "vtkAMRCoreModule.h" // For export macro
#include "vtkMultiBlockDataSetAlgorithm.h"
class vtkInformation;
......@@ -31,76 +32,76 @@ class vtkPolyData;
class vtkDataArraySelection;
class vtkCallbackCommand;
class VTK_AMR_EXPORT vtkAMRBaseParticlesReader :
class VTKAMRCORE_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;
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();
......
......@@ -20,6 +20,7 @@
#ifndef VTKAMRBASEREADER_H_
#define VTKAMRBASEREADER_H_
#include "vtkAMRCoreModule.h" // For export macro
#include "vtkOverlappingAMRAlgorithm.h"
#include <vector> // STL vector header
#include <map> // STL map header
......@@ -35,24 +36,24 @@ class vtkAMRDataSetCache;
class vtkUniformGrid;
class vtkDataArray;
class VTK_AMR_EXPORT vtkAMRBaseReader :
class VTKAMRCORE_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
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);
};
......@@ -84,13 +85,13 @@ class VTK_AMR_EXPORT vtkAMRBaseReader :
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:
// 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
......
......@@ -15,31 +15,34 @@
// .NAME vtkAMRCutPlane.h -- Cuts an AMR dataset
//
// .SECTION Description
// TODO: Enter documentation here!
// 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 "vtkAMRCoreModule.h" // For export macro
#include "vtkMultiBlockDataSetAlgorithm.h"
#include <vector> // For STL vector
#include <map> // For STL map
class vtkMultiBlockDataSet;
class vtkHierarchicalBoxDataSet;
class vtkOverlappingAMR;
class vtkMultiProcessController;
class vtkInformation;
class vtkInformationVector;
class vtkIndent;
class vtkPlane;
class vtkPointLocator;
class vtkContourValues;
class vtkUniformGrid;
class vtkCell;
class vtkPoints;
class vtkLocator;
class vtkCellArray;
class vtkPointData;
class vtkCellData;
class VTK_AMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
class VTKAMRCORE_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
{
public:
static vtkAMRCutPlane *New();
......@@ -66,10 +69,10 @@ class VTK_AMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
vtkBooleanMacro(UseNativeCutter,int);
// Description:
// Set/Get a multiprocess controller for paralle processing.
// Set/Get a multiprocess controller for parallel processing.
// By default this parameter is set to NULL by the constructor.
vtkSetMacro( Controller, vtkMultiProcessController* );
vtkGetMacro( Controller, vtkMultiProcessController* );
vtkSetMacro(Controller, vtkMultiProcessController*);
vtkGetMacro(Controller, vtkMultiProcessController*);
// Standard pipeline routines
......@@ -99,21 +102,39 @@ class VTK_AMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
// Description:
// Returns the cut-plane defined by a vtkCutPlane instance based on the
// user-supplied center and normal.
vtkPlane* GetCutPlane( vtkHierarchicalBoxDataSet *metadata );
vtkPlane* GetCutPlane( vtkOverlappingAMR *metadata );
// Description:
// Extracts cell
void ExtractCellFromGrid(
vtkUniformGrid *grid, vtkCell* cell,
std::map<vtkIdType,vtkIdType>& gridPntMapping,
vtkPoints *nodes,
vtkCellArray *cells );
// Description:
// Given the grid and a subset ID pair, grid IDs mapping to the extracted
// grid IDs, extract the point data.
void ExtractPointDataFromGrid(
vtkUniformGrid *grid,
std::map<vtkIdType,vtkIdType>& gridPntMapping,
vtkIdType NumNodes,
vtkPointData *PD );
// Description:
// Given the grid and the list of cells that are extracted, extract the
// corresponding cell data.
void ExtractCellDataFromGrid(
vtkUniformGrid *grid,
vtkCell* cell, vtkLocator *loc,
vtkPoints *pts, vtkCellArray *cells );
std::vector<vtkIdType>& cellIdxList,
vtkCellData *CD);
// Description:
// Given a cut-plane, p, and the metadata, m, this method computes which
// blocks need to be loaded. The corresponding block IDs are stored in
// the internal STL vector, blocksToLoad, which is then propagated upstream
// in the RequestUpdateExtent.
void ComputeAMRBlocksToLoad( vtkPlane* p, vtkHierarchicalBoxDataSet* m);
void ComputeAMRBlocksToLoad( vtkPlane* p, vtkOverlappingAMR* m);
// Descriription:
// Initializes the cut-plane center given the min/max bounds.
......@@ -121,20 +142,23 @@ class VTK_AMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
// Description:
// Determines if a plane intersects with an AMR box
bool PlaneIntersectsAMRBox( double bounds[6] );
bool PlaneIntersectsAMRBox( vtkPlane* pl, double bounds[6] );
bool PlaneIntersectsAMRBox( double plane[4], double bounds[6] );
// Description:
// Determines if a plane intersects with a grid cell
bool PlaneIntersectsCell( vtkCell *cell );
bool PlaneIntersectsCell( vtkPlane *pl, vtkCell *cell );
// Description:
// A utility function that checks if the input AMR data is 2-D.
bool IsAMRData2D( vtkHierarchicalBoxDataSet *input );
bool IsAMRData2D( vtkOverlappingAMR *input );
// Description:
// Applies cutting to an AMR block
void CutAMRBlock( vtkUniformGrid *grid, vtkMultiBlockDataSet *dataSet );
void CutAMRBlock(
vtkPlane *cutPlane,
unsigned int blockIdx,
vtkUniformGrid *grid, vtkMultiBlockDataSet *dataSet );
int LevelOfResolution;
double Center[3];
......@@ -142,8 +166,6 @@ class VTK_AMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
bool initialRequest;
bool UseNativeCutter;
vtkMultiProcessController *Controller;
vtkPlane *Plane;
vtkContourValues *contourValues;
// BTX
std::vector<int> blocksToLoad;
......
......@@ -23,13 +23,14 @@
#ifndef VTKAMRDATASETCACHE_H_
#define VTKAMRDATASETCACHE_H_
#include "vtkAMRCoreModule.h" // For export macro
#include "vtkObject.h"
#include <map> // For STL map used as the data-structure for the cache.
class vtkUniformGrid;
class vtkDataArray;
class VTK_AMR_EXPORT vtkAMRDataSetCache : public vtkObject
class VTKAMRCORE_EXPORT vtkAMRDataSetCache : public vtkObject
{
public:
static vtkAMRDataSetCache* New();
......