Commit a405b882 authored by Philippe Pébay's avatar Philippe Pébay
Browse files

Ensure that HT geometry filter restores original dual grid API

Change-Id: Idaa67529ee12cb7ac85f9489f2931d8db627974f
parent eba27009
......@@ -98,10 +98,10 @@ int TestHyperTreeGrid( int argc, char* argv[] )
axisCut->SetInputConnection( fractal->GetOutputPort() );
axisCut->SetPlaneNormalAxis( 2 );
axisCut->SetPlanePosition( .1 );
vtkNew<vtkPolyDataWriter> writer3;
writer3->SetFileName( "./hyperTreeGridAxisCut.vtk" );
writer3->SetInputConnection( axisCut->GetOutputPort() );
writer3->Write();
vtkNew<vtkPolyDataWriter> writer2;
writer2->SetFileName( "./hyperTreeGridAxisCut.vtk" );
writer2->SetInputConnection( axisCut->GetOutputPort() );
writer2->Write();
}
cerr << "# Cut" << endl;
......@@ -111,10 +111,10 @@ int TestHyperTreeGrid( int argc, char* argv[] )
plane->SetNormal( 0, 0, 1 );
cut->SetInputData( htGrid );
cut->SetCutFunction( plane.GetPointer() );
vtkNew<vtkPolyDataWriter> writer2;
writer2->SetFileName( "./hyperTreeGridCut.vtk" );
writer2->SetInputConnection( cut->GetOutputPort() );
writer2->Write();
vtkNew<vtkPolyDataWriter> writer3;
writer3->SetFileName( "./hyperTreeGridCut.vtk" );
writer3->SetInputConnection( cut->GetOutputPort() );
writer3->Write();
vtkNew<vtkHyperTreeGridGeometry> geometry;
geometry->SetInputConnection( fractal->GetOutputPort() );
......
......@@ -192,6 +192,7 @@ int vtkHyperTreeGridAxisCut::RequestData( vtkInformation*,
vtkCellData *inCD = this->Input->GetCellData();
outCD->CopyAllocate( inCD );
// Cut through hyper tree grid
this->ProcessTrees();
// Return duality flag of input to its original state
......
......@@ -202,7 +202,11 @@ int vtkHyperTreeGridGeometry::RequestData( vtkInformation*,
this->Output= vtkPolyData::SafeDownCast( outInfo->Get(vtkDataObject::DATA_OBJECT()) );
// Ensure that primal grid API is used for hyper trees
this->Input->SetDualGridFlag( false );
bool inputDualFlagIsOn = this->Input->GetDualGridFlag();
if ( inputDualFlagIsOn )
{
this->Input->SetDualGridFlag( false );
}
// Initialize output cell data
vtkCellData* inCD = this->Input->GetCellData();
......@@ -212,6 +216,13 @@ int vtkHyperTreeGridGeometry::RequestData( vtkInformation*,
// Extract geometry from hyper tree grid
this->ProcessTrees();
// Return duality flag of input to its original state
if ( inputDualFlagIsOn )
{
this->Input->SetDualGridFlag( true );
}
// Clean up
this->Input = 0;
this->Output = 0;
......
Supports Markdown
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