An update will be applied January 25th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit dec70ec6 authored by Philippe Pébay's avatar Philippe Pébay Committed by Code Review
Browse files

Merge topic 'hyper_tree_grid_dual_and_material' into master

a467ad24 Now testing with multiple isocontours + material
61ebc622 Modified 2D + material test so the dual grid is shown explicitly
916a5afb Modified 2D test so the dual grid is shown explicitly
1645ad3d Eliminated int/vtkIdType VS7 warnings
43224dae Implemented support for dual and hyper tree grids with material
6d235305 New tests for material + dual
d12e9e9f Better testing in the context of material for HTG
d949fca0 A much better implementation of the HTG geometry filter
parents 37c74735 a467ad24
This diff is collapsed.
......@@ -38,6 +38,7 @@
#include "vtkCommonDataModelModule.h" // For export macro
#include "vtkDataSet.h"
#include <map> // STL header for dual point coordinates ajustment
class vtkHyperTreeSimpleCursor;
//BTX
......@@ -356,6 +357,7 @@ protected:
vtkPoints* LeafCenters;
vtkIdTypeArray* LeafCenterIds;
std::map<vtkIdType,double> LeafCentersAdjustments[3];
vtkPoints* CornerPoints;
vtkIdTypeArray* LeafCornerIds;
......@@ -365,7 +367,7 @@ protected:
void DeleteInternalArrays();
//BTX
void TraverseDualRecursively( vtkHyperTreeGridSuperCursor*,
int );
int, double* );
void TraverseGridRecursively( vtkHyperTreeGridSuperCursor*,
unsigned char*);
......
......@@ -6,11 +6,13 @@ create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
TestHyperOctreeSurfaceFilter.cxx
TestHyperOctreeToUniformGrid.cxx
TestHyperTreeGridBinary2D.cxx
TestHyperTreeGridBinary2DMaterial.cxx
TestHyperTreeGridBinaryEllipseMaterial.cxx
TestHyperTreeGridBinaryHyperbolicParaboloidMaterial.cxx
TestHyperTreeGridTernary3DAxisCut.cxx
TestHyperTreeGridTernary3DAxisCutMaterial.cxx
TestHyperTreeGridTernary3DContour.cxx
TestHyperTreeGridTernary3DContourMaterial.cxx
TestHyperTreeGridTernary3DGeometry.cxx
TestHyperTreeGridTernary3DGeometryMaterial.cxx
TestHyperTreeGridTernary3DUnstructured.cxx
......
......@@ -22,6 +22,7 @@
#include "vtkCamera.h"
#include "vtkCellData.h"
#include "vtkContourFilter.h"
#include "vtkDataSetMapper.h"
#include "vtkNew.h"
#include "vtkPolyDataMapper.h"
#include "vtkProperty.h"
......@@ -77,6 +78,11 @@ int TestHyperTreeGridBinary2D( int argc, char* argv[] )
mapper3->ScalarVisibilityOff();
mapper3->SetResolveCoincidentTopologyToPolygonOffset();
mapper3->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 );
vtkNew<vtkDataSetMapper> mapper4;
mapper4->SetInputConnection( htGrid->GetOutputPort() );
mapper4->ScalarVisibilityOff();
mapper4->SetResolveCoincidentTopologyToPolygonOffset();
mapper4->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 );
// Actors
vtkNew<vtkActor> actor1;
......@@ -87,8 +93,12 @@ int TestHyperTreeGridBinary2D( int argc, char* argv[] )
actor2->GetProperty()->SetColor( .7, .7, .7 );
vtkNew<vtkActor> actor3;
actor3->SetMapper( mapper3.GetPointer() );
actor3->GetProperty()->SetColor( .8, .2, .3 );
actor3->GetProperty()->SetLineWidth( 2 );
actor3->GetProperty()->SetColor( .8, .4, .3 );
actor3->GetProperty()->SetLineWidth( 3 );
vtkNew<vtkActor> actor4;
actor4->SetMapper( mapper4.GetPointer() );
actor4->GetProperty()->SetRepresentationToWireframe();
actor4->GetProperty()->SetColor( .0, .0, .0 );
// Camera
double bd[6];
......@@ -105,6 +115,7 @@ int TestHyperTreeGridBinary2D( int argc, char* argv[] )
renderer->AddActor( actor1.GetPointer() );
renderer->AddActor( actor2.GetPointer() );
renderer->AddActor( actor3.GetPointer() );
renderer->AddActor( actor4.GetPointer() );
// Render window
vtkNew<vtkRenderWindow> renWin;
......
/*==================================================================
Program: Visualization Toolkit
Module: TestHyperTreeGridBinary2DMaterial.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.
===================================================================*/
// .SECTION Thanks
// This test was written by Philippe Pebay, Kitware 2012
// This work was supported in part by Commissariat a l'Energie Atomique (CEA/DIF)
#include "vtkHyperTreeGridGeometry.h"
#include "vtkHyperTreeGridSource.h"
#include "vtkCamera.h"
#include "vtkCellData.h"
#include "vtkContourFilter.h"
#include "vtkDataSetMapper.h"
#include "vtkNew.h"
#include "vtkPolyDataMapper.h"
#include "vtkProperty.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
int TestHyperTreeGridBinary2DMaterial( int argc, char* argv[] )
{
// Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 6;
htGrid->SetMaximumLevel( maxLevel );
htGrid->SetGridSize( 2, 3, 1 );
htGrid->SetGridScale( 1.5, 1., .7 );
htGrid->SetDimension( 2 );
htGrid->SetBranchFactor( 2 );
htGrid->DualOn();
htGrid->UseMaterialMaskOn();
htGrid->SetDescriptor( "RRRRR.|.... .R.. RRRR R... R...|.R.. ...R ..RR .R.. R... .... ....|.... ...R ..R. .... .R.. R...|.... .... .R.. ....|...." );
htGrid->SetMaterialMask( "111111|0000 1111 1111 1111 1111|1111 0001 0111 0101 1011 1111 0111|1111 0111 1111 1111 1111 1111|1111 1111 1111 1111|1111" );
// Geometry
vtkNew<vtkHyperTreeGridGeometry> geometry;
geometry->SetInputConnection( htGrid->GetOutputPort() );
geometry->Update();
vtkPolyData* pd = geometry->GetOutput();
// Contour
vtkNew<vtkContourFilter> contour;
int nContours = 3;
contour->SetNumberOfContours( nContours );
contour->SetInputConnection( htGrid->GetOutputPort() );
double resolution = ( maxLevel - 1 ) / ( nContours + 1. );
double isovalue = resolution;
for ( int i = 0; i < nContours; ++ i, isovalue += resolution )
{
contour->SetValue( i, isovalue );
}
// Mappers
vtkNew<vtkPolyDataMapper> mapper1;
mapper1->SetInputConnection( geometry->GetOutputPort() );
mapper1->SetScalarRange( pd->GetCellData()->GetScalars()->GetRange() );
mapper1->SetResolveCoincidentTopologyToPolygonOffset();
mapper1->SetResolveCoincidentTopologyPolygonOffsetParameters( 0, 1 );
vtkNew<vtkPolyDataMapper> mapper2;
mapper2->SetInputConnection( geometry->GetOutputPort() );
mapper2->ScalarVisibilityOff();
mapper2->SetResolveCoincidentTopologyToPolygonOffset();
mapper2->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 );
vtkNew<vtkPolyDataMapper> mapper3;
mapper3->SetInputConnection( contour->GetOutputPort() );
mapper3->ScalarVisibilityOff();
mapper3->SetResolveCoincidentTopologyToPolygonOffset();
mapper3->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 );
vtkNew<vtkDataSetMapper> mapper4;
mapper4->SetInputConnection( htGrid->GetOutputPort() );
mapper4->ScalarVisibilityOff();
mapper4->SetResolveCoincidentTopologyToPolygonOffset();
mapper4->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 );
// Actors
vtkNew<vtkActor> actor1;
actor1->SetMapper( mapper1.GetPointer() );
vtkNew<vtkActor> actor2;
actor2->SetMapper( mapper2.GetPointer() );
actor2->GetProperty()->SetRepresentationToWireframe();
actor2->GetProperty()->SetColor( .7, .7, .7 );
vtkNew<vtkActor> actor3;
actor3->SetMapper( mapper3.GetPointer() );
actor3->GetProperty()->SetColor( .8, .4, .3 );
actor3->GetProperty()->SetLineWidth( 3 );
vtkNew<vtkActor> actor4;
actor4->SetMapper( mapper4.GetPointer() );
actor4->GetProperty()->SetRepresentationToWireframe();
actor4->GetProperty()->SetColor( .0, .0, .0 );
// Camera
double bd[6];
pd->GetBounds( bd );
vtkNew<vtkCamera> camera;
camera->SetClippingRange( 1., 100. );
camera->SetFocalPoint( pd->GetCenter() );
camera->SetPosition( .5 * bd[1], .5 * bd[3], 6 );
// Renderer
vtkNew<vtkRenderer> renderer;
renderer->SetActiveCamera( camera.GetPointer() );
renderer->SetBackground( 1., 1., 1. );
renderer->AddActor( actor1.GetPointer() );
renderer->AddActor( actor2.GetPointer() );
renderer->AddActor( actor3.GetPointer() );
renderer->AddActor( actor4.GetPointer() );
// Render window
vtkNew<vtkRenderWindow> renWin;
renWin->AddRenderer( renderer.GetPointer() );
renWin->SetSize( 400, 400 );
renWin->SetMultiSamples( 0 );
// Interactor
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow( renWin.GetPointer() );
// Render and test
renWin->Render();
int retVal = vtkRegressionTestImage( renWin.GetPointer() );
if ( retVal == vtkRegressionTester::DO_INTERACTOR )
{
iren->Start();
}
return !retVal;
}
......@@ -39,8 +39,8 @@ int TestHyperTreeGridBinaryEllipseMaterial( int argc, char* argv[] )
// Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid;
htGrid->SetMaximumLevel( 8 );
htGrid->SetGridSize( 8, 12, 1 );
htGrid->SetGridScale( 1., .5, .7 );
htGrid->SetGridSize( 16, 24, 1 );
htGrid->SetGridScale( .5, .25, .7 );
htGrid->SetDimension( 2 );
htGrid->SetBranchFactor( 2 );
htGrid->DualOn();
......@@ -61,8 +61,13 @@ int TestHyperTreeGridBinaryEllipseMaterial( int argc, char* argv[] )
// Contour
vtkNew<vtkContourFilter> contour;
contour->SetInputConnection( htGrid->GetOutputPort() );
contour->SetNumberOfContours( 0 );
contour->SetValue( 0, 0 );
int nContours = 6;
contour->SetNumberOfContours( nContours );
double isovalue = -90.;
for ( int i = 0; i < nContours; ++ i, isovalue += 16. )
{
contour->SetValue( i, isovalue );
}
contour->SetInputArrayToProcess( 0, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_POINTS,
"Quadric" );
......@@ -98,8 +103,8 @@ int TestHyperTreeGridBinaryEllipseMaterial( int argc, char* argv[] )
actor2->GetProperty()->SetColor( .7, .7, .7 );
vtkNew<vtkActor> actor3;
actor3->SetMapper( mapper3.GetPointer() );
actor3->GetProperty()->SetColor( 0., 0., 0. );
actor3->GetProperty()->SetLineWidth( 2 );
actor3->GetProperty()->SetRepresentationToWireframe();
actor3->GetProperty()->SetColor( .2, .9, .2 );
// Camera
double bd[6];
......@@ -107,7 +112,7 @@ int TestHyperTreeGridBinaryEllipseMaterial( int argc, char* argv[] )
vtkNew<vtkCamera> camera;
camera->SetClippingRange( 1., 100. );
camera->SetFocalPoint( pd->GetCenter() );
camera->SetPosition( .5 * bd[1], .5 * bd[3], 14. );
camera->SetPosition( .5 * bd[1], .5 * bd[3], 15.5 );
// Scalar bar
vtkNew<vtkScalarBarActor> scalarBar;
......
......@@ -49,37 +49,17 @@ int TestHyperTreeGridTernary3DContour( int argc, char* argv[] )
// Contour
vtkNew<vtkContourFilter> contour;
int nContours = 3;
int nContours = 4;
contour->SetNumberOfContours( nContours );
contour->SetInputConnection( htGrid->GetOutputPort() );
contour->GenerateTrianglesOn();
double resolution = ( maxLevel - 1 ) / ( nContours + 1. );
double isovalue = resolution;
for ( int i = 0; i < nContours; ++ i, isovalue += resolution )
{
contour->SetValue( i, isovalue );
}
contour->GenerateTrianglesOff();
contour->Update();
if( contour->GetOutput()->GetNumberOfPoints() != 547 )
{
return 1;
}
if( contour->GetOutput()->GetNumberOfCells() != 463 )
{
return 1;
}
contour->GenerateTrianglesOn();
contour->Update();
if( contour->GetOutput()->GetNumberOfPoints() != 547 )
{
return 1;
}
if( contour->GetOutput()->GetNumberOfCells() != 917 )
{
return 1;
}
vtkPolyData* pd = contour->GetOutput();
// Mappers
......
/*==================================================================
Program: Visualization Toolkit
Module: TestHyperTreeGridTernary3DContourMaterial.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.
===================================================================*/
// .SECTION Thanks
// This test was written by Philippe Pebay, Kitware 2012
// This work was supported in part by Commissariat a l'Energie Atomique (CEA/DIF)
#include "vtkHyperTreeGridSource.h"
#include "vtkCamera.h"
#include "vtkPointData.h"
#include "vtkContourFilter.h"
#include "vtkNew.h"
#include "vtkOutlineFilter.h"
#include "vtkProperty.h"
#include "vtkPolyDataMapper.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
int TestHyperTreeGridTernary3DContourMaterial( int argc, char* argv[] )
{
// Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 5;
htGrid->SetMaximumLevel( maxLevel );
htGrid->SetGridSize( 3, 3, 2 );
htGrid->SetGridScale( 1.5, 1., .7 );
htGrid->SetDimension( 3 );
htGrid->SetBranchFactor( 3 );
htGrid->DualOn();
htGrid->UseMaterialMaskOn();
htGrid->SetDescriptor( "RRR .R. .RR ..R ..R .R.|R.......................... ........................... ........................... .............R............. ....RR.RR........R......... .....RRRR.....R.RR......... ........................... ........................... ...........................|........................... ........................... ........................... ...RR.RR.......RR.......... ........................... RR......................... ........................... ........................... ........................... ........................... ........................... ........................... ........................... ............RRR............|........................... ........................... .......RR.................. ........................... ........................... ........................... ........................... ........................... ........................... ........................... ...........................|........................... ..........................." );
htGrid->SetMaterialMask( "111 011 011 111 011 110|111111111111111111111111111 111111111111111111111111111 000000000100110111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 000110011100000100100010100|000001011011111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111001111111101111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111|000000000111100100111100100 000000000111001001111001001 000000111100100111111111111 000000111001001111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 110110110100111110111000000|111111111111111111111111111 11111111111111111111111111" );
// Outline
vtkNew<vtkOutlineFilter> outline;
outline->SetInputConnection( htGrid->GetOutputPort() );
// Contour
vtkNew<vtkContourFilter> contour;
int nContours = 4;
contour->SetNumberOfContours( nContours );
contour->SetInputConnection( htGrid->GetOutputPort() );
contour->GenerateTrianglesOn();
double resolution = ( maxLevel - 1 ) / ( nContours + 1. );
double isovalue = resolution;
for ( int i = 0; i < nContours; ++ i, isovalue += resolution )
{
contour->SetValue( i, isovalue );
}
contour->Update();
vtkPolyData* pd = contour->GetOutput();
// Mappers
vtkNew<vtkPolyDataMapper> mapper1;
mapper1->SetInputConnection( contour->GetOutputPort() );
mapper1->SetScalarRange( pd->GetPointData()->GetScalars()->GetRange() );
mapper1->SetResolveCoincidentTopologyToPolygonOffset();
mapper1->SetResolveCoincidentTopologyPolygonOffsetParameters( 0, 1 );
vtkNew<vtkPolyDataMapper> mapper2;
mapper2->SetInputConnection( contour->GetOutputPort() );
mapper2->ScalarVisibilityOff();
mapper2->SetResolveCoincidentTopologyToPolygonOffset();
mapper2->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 );
vtkNew<vtkPolyDataMapper> mapper3;
mapper3->SetInputConnection( outline->GetOutputPort() );
mapper3->ScalarVisibilityOff();
// Actors
vtkNew<vtkActor> actor1;
actor1->SetMapper( mapper1.GetPointer() );
vtkNew<vtkActor> actor2;
actor2->SetMapper( mapper2.GetPointer() );
actor2->GetProperty()->SetRepresentationToWireframe();
actor2->GetProperty()->SetColor( .7, .7, .7 );
vtkNew<vtkActor> actor3;
actor3->SetMapper( mapper3.GetPointer() );
actor3->GetProperty()->SetColor( .1, .1, .1 );
actor3->GetProperty()->SetLineWidth( 1 );
// Camera
double bd[6];
pd->GetBounds( bd );
vtkNew<vtkCamera> camera;
camera->SetClippingRange( 1., 100. );
camera->SetFocalPoint( pd->GetCenter() );
camera->SetPosition( -.8 * bd[1], 2.1 * bd[3], -4.8 * bd[5] );
// Renderer
vtkNew<vtkRenderer> renderer;
renderer->SetActiveCamera( camera.GetPointer() );
renderer->SetBackground( 1., 1., 1. );
renderer->AddActor( actor1.GetPointer() );
renderer->AddActor( actor2.GetPointer() );
renderer->AddActor( actor3.GetPointer() );
// Render window
vtkNew<vtkRenderWindow> renWin;
renWin->AddRenderer( renderer.GetPointer() );
renWin->SetSize( 400, 400 );
renWin->SetMultiSamples( 0 );
// Interactor
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow( renWin.GetPointer() );
// Render and test
renWin->Render();
int retVal = vtkRegressionTestImage( renWin.GetPointer() );
if ( retVal == vtkRegressionTester::DO_INTERACTOR )
{
iren->Start();
}
return !retVal;
}
......@@ -25,8 +25,6 @@
vtkStandardNewMacro(vtkHyperTreeGridGeometry);
static int vtkSuperCursorFaceIndices[] = { -1, 1, -3, 3, -9, 9 };
//-----------------------------------------------------------------------------
vtkHyperTreeGridGeometry::vtkHyperTreeGridGeometry()
{
......@@ -244,10 +242,10 @@ void vtkHyperTreeGridGeometry::AddFace( vtkIdType inId,
void vtkHyperTreeGridGeometry::RecursiveProcessTree( vtkHyperTreeGridSuperCursor* superCursor )
{
// Get cursor at super cursor center
vtkHyperTreeSimpleCursor* cursor = superCursor->GetCursor( 0 );
vtkHyperTreeSimpleCursor* cursor0 = superCursor->GetCursor( 0 );
// If cursor is not at leaf, recurse to all children
if ( ! cursor->IsLeaf() )
// If cursor 0 is not at leaf, recurse to all children
if ( ! cursor0->IsLeaf() )
{
int numChildren = this->Input->GetNumberOfChildren();
for ( int child = 0; child < numChildren; ++ child )
......@@ -257,10 +255,10 @@ void vtkHyperTreeGridGeometry::RecursiveProcessTree( vtkHyperTreeGridSuperCursor
this->RecursiveProcessTree( &newSuperCursor );
} // child
return;
} // if ( ! cursor->IsLeaf() )
} // if ( ! cursor0->IsLeaf() )
// Cell at cursor center is a leaf, retrieve its global index
vtkIdType inId = cursor->GetGlobalLeafIndex();
// Cell at cursor 0 is a leaf, retrieve its global index
vtkIdType id0 = cursor0->GetGlobalLeafIndex();
// Create the outer geometry, depending on the dimension of the grid
switch ( this->Input->GetDimension() )
......@@ -279,60 +277,66 @@ void vtkHyperTreeGridGeometry::RecursiveProcessTree( vtkHyperTreeGridSuperCursor
break; // case 1
case 2:
// In 2D all unmasked faces are generated
if ( ! this->Input->GetMaterialMask()->GetTuple1( inId ) )
if ( ! this->Input->GetMaterialMask()->GetTuple1( id0 ) )
{
this->AddFace( inId, superCursor->Origin, superCursor->Size, 0, 2 );
this->AddFace( id0, superCursor->Origin, superCursor->Size, 0, 2 );
}
break; // case 2
case 3:
// In 3D masked and unmasked cells are handles differently
if ( this->Input->GetMaterialMask()->GetTuple1( inId ) )
if ( this->Input->GetMaterialMask()->GetTuple1( id0 ) )
{
// Cell is masked, check if any of the face neighbors are unmasked
for ( int f = 0; f < 6; ++ f )
int neighborIdx = -1;
for ( unsigned int f = 0; f < 3; ++ f, neighborIdx *= 3 )
{
// Retrieve face neighbor cursor and break ties at same level
cursor = superCursor->GetCursor( vtkSuperCursorFaceIndices[f] );
if ( cursor->GetTree()
&& cursor->IsLeaf()
&& cursor->GetLevel() < superCursor->GetCursor( 0 )->GetLevel() )
// For each plane, check both orientations
for ( unsigned int o = 0; o < 2; ++ o, neighborIdx *= -1 )
{
// Retrieve neighbor leaf which exists
int id = cursor->GetGlobalLeafIndex();
// Retrieve face neighbor cursor
vtkHyperTreeSimpleCursor* cursor = superCursor->GetCursor( neighborIdx );
// Check if this correspond to an umasked cell
if ( ! this->Input->GetMaterialMask()->GetTuple1( id ) )
// Generate faces shared by an unmasked cell, break ties at same level
if ( cursor->GetTree()
&& cursor->IsLeaf()
&& cursor->GetLevel() < cursor0->GetLevel() )
{
// Neighbor cell is masked, generate boundary face
div_t d = div( f, 2 );
this->AddFace( id,
superCursor->Origin, superCursor->Size,
d.rem, d.quot );
int id = cursor->GetGlobalLeafIndex();
if ( ! this->Input->GetMaterialMask()->GetTuple1( id ) )
{
this->AddFace( id,
superCursor->Origin, superCursor->Size,
o, f );
}
}
}
} // o
} // f
return;
} // if ( this->Input->GetMaterialMask()->GetTuple1( inId ) )
} // if ( this->Input->GetMaterialMask()->GetTuple1( id0 ) )
// Cell is not masked, handle its boundary faces as needed
for ( int f = 0; f < 6; ++ f )
int neighborIdx = -1;
for ( unsigned int f = 0; f < 3; ++ f, neighborIdx *= 3 )
{
// Retrieve face neighbor cursor
cursor = superCursor->GetCursor( vtkSuperCursorFaceIndices[f] );
// Boundary faces, or faces shared by a masked cell, must be created
if ( ! cursor->GetTree()
||
( cursor->IsLeaf()
&& this->Input->GetMaterialMask()->GetTuple1( cursor->GetGlobalLeafIndex() ) ) )
// For each plane, check both orientations
for ( unsigned int o = 0; o < 2; ++ o, neighborIdx *= -1 )
{
div_t d = div( f, 2 );
this->AddFace( inId,
superCursor->Origin, superCursor->Size,
d.rem, d.quot );
}
// Retrieve face neighbor cursor
vtkHyperTreeSimpleCursor* cursor = superCursor->GetCursor( neighborIdx );
// Boundary faces, or faces shared by a masked cell, must be created
if ( ! cursor->GetTree()
||
( cursor->IsLeaf()
&& this->Input->GetMaterialMask()->GetTuple1( cursor->GetGlobalLeafIndex() ) ) )
{
this->AddFace( id0,
superCursor->Origin, superCursor->Size,
o, f );
}