Commit aa0820b4 authored by George Zagaris's avatar George Zagaris
Browse files

ENH:Make AMR slicer a vtkOverlappignAMRAlgorithm

Changed vtkAMRSliceFilter to be an instance of vtkOverlappingAMRAlgorithm

Change-Id: I8dd8f679354418288a9e97c732ba7a9a9d3405d3
parent e74f9a6b
......@@ -18,7 +18,7 @@
#include "vtkDataObject.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkHierarchicalBoxDataSet.h"
#include "vtkOverlappingAMR.h"
#include "vtkCell.h"
#include "vtkAMRUtilities.h"
#include "vtkPlane.h"
......@@ -69,7 +69,7 @@ int vtkAMRSliceFilter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation *info )
{
info->Set(
vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),"vtkHierarchicalBoxDataSet" );
vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),"vtkOverlappingAMR" );
return 1;
}
......@@ -78,12 +78,12 @@ int vtkAMRSliceFilter::FillOutputPortInformation(
int vtkNotUsed(port), vtkInformation *info )
{
info->Set(
vtkDataObject::DATA_TYPE_NAME(),"vtkHierarchicalBoxDataSet");
vtkDataObject::DATA_TYPE_NAME(),"vtkOverlappingAMR");
return 1;
}
//------------------------------------------------------------------------------
bool vtkAMRSliceFilter::IsAMRData2D( vtkHierarchicalBoxDataSet *input )
bool vtkAMRSliceFilter::IsAMRData2D( vtkOverlappingAMR *input )
{
assert( "pre: Input AMR dataset is NULL" && (input != NULL) );
......@@ -100,7 +100,7 @@ bool vtkAMRSliceFilter::IsAMRData2D( vtkHierarchicalBoxDataSet *input )
//------------------------------------------------------------------------------
void vtkAMRSliceFilter::InitializeOffSet(
vtkHierarchicalBoxDataSet *inp, double *minBounds, double *maxBounds )
vtkOverlappingAMR *inp, double *minBounds, double *maxBounds )
{
if( !this->initialRequest )
{
......@@ -132,7 +132,7 @@ void vtkAMRSliceFilter::InitializeOffSet(
}
//------------------------------------------------------------------------------
vtkPlane* vtkAMRSliceFilter::GetCutPlane( vtkHierarchicalBoxDataSet *inp )
vtkPlane* vtkAMRSliceFilter::GetCutPlane( vtkOverlappingAMR *inp )
{
assert( "pre: AMR dataset should not be NULL" && (inp != NULL) );
......@@ -296,7 +296,7 @@ bool vtkAMRSliceFilter::PlaneIntersectsAMRBox(double plane[4],double bounds[6])
//------------------------------------------------------------------------------
void vtkAMRSliceFilter::ComputeAMRBlocksToLoad(
vtkPlane *p, vtkHierarchicalBoxDataSet *metadata )
vtkPlane *p, vtkOverlappingAMR *metadata )
{
assert( "pre: plane object is NULL" && (p != NULL) );
assert( "pre: metadata object is NULL" && (metadata != NULL) );
......@@ -352,8 +352,8 @@ void vtkAMRSliceFilter::ComputeAMRBlocksToLoad(
//------------------------------------------------------------------------------
void vtkAMRSliceFilter::GetAMRSliceInPlane(
vtkPlane *p, vtkHierarchicalBoxDataSet *inp,
vtkHierarchicalBoxDataSet *out )
vtkPlane *p, vtkOverlappingAMR *inp,
vtkOverlappingAMR *out )
{
assert( "pre: input AMR dataset is NULL" && (inp != NULL) );
assert( "pre: output AMR dataset is NULL" && (out != NULL) );
......@@ -578,8 +578,8 @@ int vtkAMRSliceFilter::RequestInformation(
// Check if metadata are passed downstream
if( input->Has(vtkCompositeDataPipeline::COMPOSITE_DATA_META_DATA() ) )
{
vtkHierarchicalBoxDataSet *metadata =
vtkHierarchicalBoxDataSet::SafeDownCast(
vtkOverlappingAMR *metadata =
vtkOverlappingAMR::SafeDownCast(
input->Get(
vtkCompositeDataPipeline::COMPOSITE_DATA_META_DATA( ) ) );
......@@ -632,15 +632,15 @@ int vtkAMRSliceFilter::RequestData(
assert( "pre: input information object is NULL" && (input != NULL) );
vtkHierarchicalBoxDataSet *inputAMR=
vtkHierarchicalBoxDataSet::SafeDownCast(
vtkOverlappingAMR *inputAMR=
vtkOverlappingAMR::SafeDownCast(
input->Get(vtkDataObject::DATA_OBJECT() ) );
// STEP 1: Get output object
vtkInformation *output = outputVector->GetInformationObject( 0 );
assert( "pre: output information object is NULL" && (output != NULL) );
vtkHierarchicalBoxDataSet *outputAMR=
vtkHierarchicalBoxDataSet::SafeDownCast(
vtkOverlappingAMR *outputAMR=
vtkOverlappingAMR::SafeDownCast(
output->Get( vtkDataObject::DATA_OBJECT() ) );
if( this->IsAMRData2D( inputAMR ) )
......
......@@ -15,31 +15,31 @@
// .NAME vtkAMRSliceFilter.h -- Creates slices from AMR datasets
//
// .SECTION Description
// A concrete instance of vtkHierarchicalBoxDataSetAlgorithm which implements
// A concrete instance of vtkOverlappingAMRAlgorithm which implements
// functionality for extracting slices from AMR data. Unlike the conventional
// slice filter, the output of this filter is a 2-D AMR dataset itself.
#ifndef VTKAMRSLICEFILTER_H_
#define VTKAMRSLICEFILTER_H_
#include "vtkHierarchicalBoxDataSetAlgorithm.h"
#include "vtkOverlappingAMRAlgorithm.h"
#include <vtkstd/vector> // For STL vector
#include <vector> // For STL vector
class vtkInformation;
class vtkInformationVector;
class vtkHierarchicalBoxDataSet;
class vtkOverlappingAMR;
class vtkMultiProcessController;
class vtkPlane;
class vtkAMRBox;
class vtkUniformGrid;
class VTK_AMR_EXPORT vtkAMRSliceFilter :
public vtkHierarchicalBoxDataSetAlgorithm
public vtkOverlappingAMRAlgorithm
{
public:
static vtkAMRSliceFilter* New();
vtkTypeMacro( vtkAMRSliceFilter, vtkHierarchicalBoxDataSetAlgorithm );
vtkTypeMacro( vtkAMRSliceFilter, vtkOverlappingAMRAlgorithm );
void PrintSelf( std::ostream &os, vtkIndent indent );
// Inline Gettters & Setters
......@@ -127,26 +127,26 @@ class VTK_AMR_EXPORT vtkAMRSliceFilter :
// this method generates the list of linear AMR block indices that need
// to be loaded.
void ComputeAMRBlocksToLoad(
vtkPlane *p, vtkHierarchicalBoxDataSet *metadata );
vtkPlane *p, vtkOverlappingAMR *metadata );
// Description:
// Extracts a 2-D AMR slice from the dataset.
void GetAMRSliceInPlane(
vtkPlane *p, vtkHierarchicalBoxDataSet *inp,
vtkHierarchicalBoxDataSet *out );
vtkPlane *p, vtkOverlappingAMR *inp,
vtkOverlappingAMR *out );
// Description:
// A utility function that checks if the input AMR data is 2-D.
bool IsAMRData2D( vtkHierarchicalBoxDataSet *input );
bool IsAMRData2D( vtkOverlappingAMR *input );
// Description:
// Returns the axis-aligned cut plane.
vtkPlane* GetCutPlane( vtkHierarchicalBoxDataSet *input );
vtkPlane* GetCutPlane( vtkOverlappingAMR *input );
// Description:
// Initializes the off-set to be at the center of the input data-set.
void InitializeOffSet(
vtkHierarchicalBoxDataSet *inp, double *min, double *max );
vtkOverlappingAMR *inp, double *min, double *max );
double OffSetFromOrigin;
int Normal; // 1=>X-Normal, 2=>Y-Normal, 3=>Z-Normal
......@@ -157,7 +157,7 @@ class VTK_AMR_EXPORT vtkAMRSliceFilter :
int ForwardUpstream;
int EnablePrefetching;
// BTX
vtkstd::vector< int > blocksToLoad;
std::vector< int > blocksToLoad;
// ETX
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment