Commit 1cae6ed4 authored by David E. DeMarle's avatar David E. DeMarle Committed by Kitware Robot
Browse files

Merge topic 'fix-HTG-missing-interfaces' into release

a8ef4b05 Fixed an initialized-yet-unused-variable warning on Windows
62cf7516 Modified non-regression test for interface reconstruction.
a4cc7836

 Fixed issues with the computation of material interfaces in HTG

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3609
parents 497e5ca6 a8ef4b05
...@@ -720,8 +720,8 @@ protected: ...@@ -720,8 +720,8 @@ protected:
bool InitPureMaterialMask; bool InitPureMaterialMask;
bool HasInterface; bool HasInterface;
char *InterfaceNormalsName; char* InterfaceNormalsName;
char *InterfaceInterceptsName; char* InterfaceInterceptsName;
vtkDataArray* XCoordinates; vtkDataArray* XCoordinates;
vtkDataArray* YCoordinates; vtkDataArray* YCoordinates;
......
...@@ -20,6 +20,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests ...@@ -20,6 +20,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
TestHyperTreeGridBinary2DContourMaterial.cxx TestHyperTreeGridBinary2DContourMaterial.cxx
TestHyperTreeGridBinary2DDepthLimiter.cxx TestHyperTreeGridBinary2DDepthLimiter.cxx
TestHyperTreeGridBinary2DDepthLimiterMaterial.cxx TestHyperTreeGridBinary2DDepthLimiterMaterial.cxx
TestHyperTreeGridBinary2DInterfaceMaterial.cxx
TestHyperTreeGridBinary2DMaterial.cxx TestHyperTreeGridBinary2DMaterial.cxx
TestHyperTreeGridBinary2DMaterialIJK.cxx TestHyperTreeGridBinary2DMaterialIJK.cxx
TestHyperTreeGridBinary2DThreshold.cxx TestHyperTreeGridBinary2DThreshold.cxx
......
/*==================================================================
Program: Visualization Toolkit
Module: TestHyperTreeGridBinary2DInterfaceMaterial.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, NexGen Analytics 2017
// This work was supported by Commissariat a l'Energie Atomique (CEA/DIF)
#include "vtkHyperTreeGrid.h"
#include "vtkHyperTreeGridGeometry.h"
#include "vtkHyperTreeGridSource.h"
#include "vtkCamera.h"
#include "vtkCellData.h"
#include "vtkNew.h"
#include "vtkPointData.h"
#include "vtkPolyData.h"
#include "vtkPolyDataMapper.h"
#include "vtkProperty.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
int TestHyperTreeGridBinary2DInterfaceMaterial( int argc, char* argv[] )
{
// Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid;
htGrid->SetMaximumLevel( 6 );
htGrid->SetDimension( 2 );
htGrid->SetOrientation( 2 ); // in xy plane
htGrid->SetGridSize( 2, 3, 1 );
htGrid->SetGridScale( 1.5, 1., 10. ); // this is to test that orientation fixes scale
htGrid->SetBranchFactor( 2 );
htGrid->SetDescriptor( "RRRRR.|.... .R.. RRRR R... R...|.R.. ...R ..RR .R.. R... .... ....|.... ...R ..R. .... .R.. R...|.... .... .R.. ....|...." );
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" );
htGrid->GenerateInterfaceFieldsOn();
htGrid->Update();
vtkHyperTreeGrid* H = vtkHyperTreeGrid::SafeDownCast( htGrid->GetOutput() );
H->SetHasInterface( 1 );
char normalsName[] = "Normals";
H->SetInterfaceNormalsName( normalsName );
char interceptsName[] = "Intercepts";
H->SetInterfaceInterceptsName( interceptsName );
// Modify intercepts array
vtkDataArray* interArray = vtkDataSet::SafeDownCast( htGrid->GetOutput() )->GetPointData()->GetArray( "Intercepts" );
for ( vtkIdType i = 0; i < interArray->GetNumberOfTuples(); ++ i )
{
interArray->SetTuple3( i, -.25, -.5, -1. );
}
// Geometries
vtkNew<vtkHyperTreeGridGeometry> geometry1;
geometry1->SetInputConnection( htGrid->GetOutputPort() );
geometry1->Update();
vtkPolyData* pd = geometry1->GetPolyDataOutput();
vtkNew<vtkHyperTreeGridGeometry> geometry2;
geometry2->SetInputConnection( htGrid->GetOutputPort() );
// Mappers
vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
vtkNew<vtkPolyDataMapper> mapper1;
mapper1->SetInputConnection( geometry1->GetOutputPort() );
mapper1->ScalarVisibilityOff();
vtkNew<vtkPolyDataMapper> mapper2;
mapper2->SetInputConnection( geometry2->GetOutputPort() );
mapper2->SetScalarRange( pd->GetCellData()->GetScalars()->GetRange() );
// Actors
vtkNew<vtkActor> actor1;
actor1->SetMapper( mapper1 );
actor1->GetProperty()->SetRepresentationToWireframe();
actor1->GetProperty()->SetColor( .7, .7, .7 );
vtkNew<vtkActor> actor2;
actor2->SetMapper( mapper2 );
// 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 );
renderer->SetBackground( 1., 1., 1. );
renderer->AddActor( actor1 );
renderer->AddActor( actor2 );
// Render window
vtkNew<vtkRenderWindow> renWin;
renWin->AddRenderer( renderer );
renWin->SetSize( 400, 400 );
renWin->SetMultiSamples( 0 );
// Interactor
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow( renWin );
// Render and test
renWin->Render();
int retVal = vtkRegressionTestImageThreshold( renWin, 70 );
if ( retVal == vtkRegressionTester::DO_INTERACTOR )
{
iren->Start();
}
return !retVal;
}
...@@ -38,10 +38,10 @@ int TestHyperTreeGridBinary2DMaterial( int argc, char* argv[] ) ...@@ -38,10 +38,10 @@ int TestHyperTreeGridBinary2DMaterial( int argc, char* argv[] )
vtkNew<vtkHyperTreeGridSource> htGrid; vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 6; int maxLevel = 6;
htGrid->SetMaximumLevel( maxLevel ); htGrid->SetMaximumLevel( maxLevel );
htGrid->SetGridSize( 2, 3, 1 );
htGrid->SetGridScale( 1.5, 1., 10. ); // this is to test that orientation fixes scale
htGrid->SetDimension( 2 ); htGrid->SetDimension( 2 );
htGrid->SetOrientation( 2 ); // in xy plane htGrid->SetOrientation( 2 ); // in xy plane
htGrid->SetGridSize( 2, 3, 1 );
htGrid->SetGridScale( 1.5, 1., 10. ); // this is to test that orientation fixes scale
htGrid->SetBranchFactor( 2 ); htGrid->SetBranchFactor( 2 );
htGrid->UseMaterialMaskOn(); htGrid->UseMaterialMaskOn();
htGrid->SetDescriptor( "RRRRR.|.... .R.. RRRR R... R...|.R.. ...R ..RR .R.. R... .... ....|.... ...R ..R. .... .R.. R...|.... .... .R.. ....|...." ); htGrid->SetDescriptor( "RRRRR.|.... .R.. RRRR R... R...|.R.. ...R ..RR .R.. R... .... ....|.... ...R ..R. .... .R.. R...|.... .... .R.. ....|...." );
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
===================================================================*/ ===================================================================*/
// .SECTION Thanks // .SECTION Thanks
// This test was written by Philippe Pebay, 2016 // This test was written by Philippe Pebay, 2016
// This test was modified by Philippe Pebay, NexGen Analytics 2017
// This work was supported by Commissariat a l'Energie Atomique (CEA/DIF) // This work was supported by Commissariat a l'Energie Atomique (CEA/DIF)
#include "vtkHyperTreeGrid.h" #include "vtkHyperTreeGrid.h"
...@@ -38,21 +39,20 @@ int TestHyperTreeGridBinary2DVector( int argc, char* argv[] ) ...@@ -38,21 +39,20 @@ int TestHyperTreeGridBinary2DVector( int argc, char* argv[] )
{ {
// Hyper tree grid // Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid; vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 6; htGrid->SetMaximumLevel( 6 );
htGrid->SetMaximumLevel( maxLevel ); htGrid->SetOrientation( 2 ); // in xy plane
htGrid->SetBranchFactor( 2 );
htGrid->SetGridSize( 2, 3, 1 ); htGrid->SetGridSize( 2, 3, 1 );
htGrid->SetGridScale( 1.5, 1., 10. ); // this is to test that orientation fixes scale htGrid->SetGridScale( 1.5, 1., 10. ); // this is to test that orientation fixes scale
htGrid->SetDimension( 2 ); htGrid->SetDimension( 2 );
htGrid->SetOrientation( 2 ); // in xy plane
htGrid->SetBranchFactor( 2 );
htGrid->SetDescriptor( "RRRRR.|.... .R.. RRRR R... R...|.R.. ...R ..RR .R.. R... .... ....|.... ...R ..R. .... .R.. R...|.... .... .R.. ....|...." ); htGrid->SetDescriptor( "RRRRR.|.... .R.. RRRR R... R...|.R.. ...R ..RR .R.. R... .... ....|.... ...R ..R. .... .R.. R...|.... .... .R.. ....|...." );
htGrid->GenerateVectorFieldOn(); htGrid->GenerateInterfaceFieldsOn();
htGrid->Update(); htGrid->Update();
vtkHyperTreeGrid* H = vtkHyperTreeGrid::SafeDownCast( htGrid->GetOutput() ); vtkHyperTreeGrid* H = vtkHyperTreeGrid::SafeDownCast( htGrid->GetOutput() );
H->SetHasInterface( 1 ); H->SetHasInterface( 1 );
char normalsName[] = "Vector"; char normalsName[] = "Normals";
H->SetInterfaceNormalsName( normalsName ); H->SetInterfaceNormalsName( normalsName );
char interceptsName[] = "Depth"; char interceptsName[] = "Intercepts";
H->SetInterfaceInterceptsName( interceptsName ); H->SetInterfaceInterceptsName( interceptsName );
// Cell centers // Cell centers
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
===================================================================*/ ===================================================================*/
// .SECTION Thanks // .SECTION Thanks
// This test was written by Philippe Pebay, 2016 // This test was written by Philippe Pebay, 2016
// This test was modified by Philippe Pebay, NexGen Analytics 2017
// This work was supported by Commissariat a l'Energie Atomique (CEA/DIF) // This work was supported by Commissariat a l'Energie Atomique (CEA/DIF)
#include "vtkHyperTreeGrid.h" #include "vtkHyperTreeGrid.h"
...@@ -39,20 +40,21 @@ int TestHyperTreeGridBinary2DVectorAxisReflectionXCenter( int argc, char* argv[] ...@@ -39,20 +40,21 @@ int TestHyperTreeGridBinary2DVectorAxisReflectionXCenter( int argc, char* argv[]
{ {
// Hyper tree grid // Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid; vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 6; htGrid->SetMaximumLevel( 6 );
htGrid->SetMaximumLevel( maxLevel );
htGrid->SetGridSize( 2, 3, 1 );
htGrid->SetGridScale( 1.5, 1., 10. ); // this is to test that orientation fixes scale
htGrid->SetDimension( 2 ); htGrid->SetDimension( 2 );
htGrid->SetOrientation( 2 ); // in xy plane htGrid->SetOrientation( 2 ); // in xy plane
htGrid->SetGridSize( 2, 3, 1 );
htGrid->SetGridScale( 1.5, 1., 10. ); // this is to test that orientation fixes scale
htGrid->SetBranchFactor( 2 ); htGrid->SetBranchFactor( 2 );
htGrid->SetDescriptor( "RRRRR.|.... .R.. RRRR R... R...|.R.. ...R ..RR .R.. R... .... ....|.... ...R ..R. .... .R.. R...|.... .... .R.. ....|...." ); htGrid->SetDescriptor( "RRRRR.|.... .R.. RRRR R... R...|.R.. ...R ..RR .R.. R... .... ....|.... ...R ..R. .... .R.. R...|.... .... .R.. ....|...." );
htGrid->GenerateVectorFieldOn(); htGrid->GenerateInterfaceFieldsOn();
htGrid->Update(); htGrid->Update();
vtkHyperTreeGrid* H = vtkHyperTreeGrid::SafeDownCast( htGrid->GetOutput() ); vtkHyperTreeGrid* H = vtkHyperTreeGrid::SafeDownCast( htGrid->GetOutput() );
H->SetHasInterface( 1 ); H->SetHasInterface( 1 );
H->SetInterfaceNormalsName( "Vector" ); char normalsName[] = "Normals";
H->SetInterfaceInterceptsName( "Depth" ); H->SetInterfaceNormalsName( normalsName );
char interceptsName[] = "Intercepts";
H->SetInterfaceInterceptsName( interceptsName );
// Axis reflection // Axis reflection
vtkNew<vtkHyperTreeGridAxisReflection> reflection; vtkNew<vtkHyperTreeGridAxisReflection> reflection;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
===================================================================*/ ===================================================================*/
// .SECTION Thanks // .SECTION Thanks
// This test was written by Philippe Pebay, 2016 // This test was written by Philippe Pebay, 2016
// This test was modified by Philippe Pebay, NexGen Analytics 2017
// This work was supported by Commissariat a l'Energie Atomique (CEA/DIF) // This work was supported by Commissariat a l'Energie Atomique (CEA/DIF)
#include "vtkHyperTreeGrid.h" #include "vtkHyperTreeGrid.h"
...@@ -39,21 +40,20 @@ int TestHyperTreeGridBinary2DVectorAxisReflectionYCenter( int argc, char* argv[] ...@@ -39,21 +40,20 @@ int TestHyperTreeGridBinary2DVectorAxisReflectionYCenter( int argc, char* argv[]
{ {
// Hyper tree grid // Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid; vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 6; htGrid->SetMaximumLevel( 6 );
htGrid->SetMaximumLevel( maxLevel );
htGrid->SetGridSize( 2, 3, 1 );
htGrid->SetGridScale( 1.5, 1., 10. ); // this is to test that orientation fixes scale
htGrid->SetDimension( 2 ); htGrid->SetDimension( 2 );
htGrid->SetOrientation( 2 ); // in xy plane htGrid->SetOrientation( 2 ); // in xy plane
htGrid->SetGridSize( 2, 3, 1 );
htGrid->SetGridScale( 1.5, 1., 10. ); // this is to test that orientation fixes scale
htGrid->SetBranchFactor( 2 ); htGrid->SetBranchFactor( 2 );
htGrid->SetDescriptor( "RRRRR.|.... .R.. RRRR R... R...|.R.. ...R ..RR .R.. R... .... ....|.... ...R ..R. .... .R.. R...|.... .... .R.. ....|...." ); htGrid->SetDescriptor( "RRRRR.|.... .R.. RRRR R... R...|.R.. ...R ..RR .R.. R... .... ....|.... ...R ..R. .... .R.. R...|.... .... .R.. ....|...." );
htGrid->GenerateVectorFieldOn(); htGrid->GenerateInterfaceFieldsOn();
htGrid->Update(); htGrid->Update();
vtkHyperTreeGrid* H = vtkHyperTreeGrid::SafeDownCast( htGrid->GetOutput() ); vtkHyperTreeGrid* H = vtkHyperTreeGrid::SafeDownCast( htGrid->GetOutput() );
H->SetHasInterface( 1 ); H->SetHasInterface( 1 );
char normalsName[] = "Vector"; char normalsName[] = "Normals";
H->SetInterfaceNormalsName( normalsName ); H->SetInterfaceNormalsName( normalsName );
char interceptsName[] = "Depth"; char interceptsName[] = "Intercepts";
H->SetInterfaceInterceptsName( interceptsName ); H->SetInterfaceInterceptsName( interceptsName );
// Axis reflection // Axis reflection
......
...@@ -144,19 +144,6 @@ int vtkHyperTreeGridAxisReflection::ProcessTrees( vtkHyperTreeGrid* input, ...@@ -144,19 +144,6 @@ int vtkHyperTreeGridAxisReflection::ProcessTrees( vtkHyperTreeGrid* input,
vtkDoubleArray* outCoords = vtkDoubleArray::New(); vtkDoubleArray* outCoords = vtkDoubleArray::New();
outCoords->SetNumberOfTuples( size ); outCoords->SetNumberOfTuples( size );
// Create arrays for reflected interface if present
vtkDoubleArray* outNormals = 0;
vtkDoubleArray* outIntercepts = 0;
if ( hasInterface )
{
vtkIdType nTuples = inNormals->GetNumberOfTuples();
outNormals = vtkDoubleArray::New();
outNormals->SetNumberOfComponents( 3 );
outNormals->SetNumberOfTuples( nTuples );
outIntercepts = vtkDoubleArray::New();
outIntercepts->SetNumberOfTuples( nTuples );
}
// Reflect point coordinate // Reflect point coordinate
double coord; double coord;
for ( unsigned int i = 0; i < size; ++ i ) for ( unsigned int i = 0; i < size; ++ i )
...@@ -186,29 +173,19 @@ int vtkHyperTreeGridAxisReflection::ProcessTrees( vtkHyperTreeGrid* input, ...@@ -186,29 +173,19 @@ int vtkHyperTreeGridAxisReflection::ProcessTrees( vtkHyperTreeGrid* input,
for ( vtkIdType i = 0; i < nTuples; ++ i ) for ( vtkIdType i = 0; i < nTuples; ++ i )
{ {
// Compute and stored reflected normal // Compute and stored reflected normal
double norm[3]; double* norm = inNormals->GetTuple3( i );
memcpy( norm, inNormals->GetTuple3( i ) , 3 * sizeof( double ) );
norm[direction] = - norm[direction]; norm[direction] = - norm[direction];
outNormals->SetTuple3( i, norm[0], norm[1], norm[2] ); inNormals->SetTuple3( i, norm[0], norm[1], norm[2] );
// Compute and store reflected intercept // Compute and store reflected intercept
double inter = inIntercepts->GetTuple1( i ); double* inter = inIntercepts->GetTuple3( i );
inter -= 2. * offset * norm[direction]; inter[0] -= 2. * offset * norm[direction];
outIntercepts->SetTuple1( i, inter ); inIntercepts->SetTuple3( i, inter[0], inter[1], inter[2] );
} // i } // i
// Assign new interface arrays if available
this->OutData->SetVectors( outNormals );
this->OutData->AddArray( outIntercepts );
} // if ( hasInterface ) } // if ( hasInterface )
// Clean up // Clean up
outCoords->Delete(); outCoords->Delete();
if ( hasInterface )
{
outNormals->Delete();
outIntercepts->Delete();
}
return 1; return 1;
} }
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
* vtkHyperTreeGrid vtkHyperTreeGridAlgorithm vtkReflectionFilter * vtkHyperTreeGrid vtkHyperTreeGridAlgorithm vtkReflectionFilter
* *
* @par Thanks: * @par Thanks:
* This class was written by Philippe Pebay on a idea of Guénolé Harel and Jacques-Bernard Lekien, 2016 * This class was written by Philippe Pebay based on a idea of Guenole
* Harel and Jacques-Bernard Lekien, 2016
* This work was supported by Commissariat a l'Energie Atomique (CEA/DIF) * This work was supported by Commissariat a l'Energie Atomique (CEA/DIF)
*/ */
...@@ -115,5 +116,4 @@ private: ...@@ -115,5 +116,4 @@ private:
void operator=(const vtkHyperTreeGridAxisReflection&) = delete; void operator=(const vtkHyperTreeGridAxisReflection&) = delete;
}; };
#endif /* vtkHyperTreeGridAxisReflection */ #endif /* vtkHyperTreeGridAxisReflection */
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
* vtkHyperTreeGrid vtkHyperTreeGridAlgorithm * vtkHyperTreeGrid vtkHyperTreeGridAlgorithm
* *
* @par Thanks: * @par Thanks:
* This class was written by Philippe Pebay, Joachim Pouderoux, and Charles Law, Kitware 2013 * This class was written by Philippe Pebay, Joachim Pouderoux,
* This class was modified by Guénolé Harel and Jacques-Bernard Lekien, 2014 * and Charles Law, Kitware 2013
* This class was rewritten by Philippe Pebay, 2016 * This class was modified by Guenole Harel and Jacques-Bernard Lekien, 2014
* This class was rewritten by Philippe Pebay, NexGen Analytics 2017
* This work was supported by Commissariat a l'Energie Atomique (CEA/DIF) * This work was supported by Commissariat a l'Energie Atomique (CEA/DIF)
*/ */
...@@ -34,8 +35,11 @@ ...@@ -34,8 +35,11 @@
class vtkBitArray; class vtkBitArray;
class vtkCellArray; class vtkCellArray;
class vtkDoubleArray;
class vtkHyperTreeGrid; class vtkHyperTreeGrid;
class vtkHyperTreeGridCursor; class vtkHyperTreeGridCursor;
class vtkIdList;
class vtkIdTypeArray;
class vtkPoints; class vtkPoints;
class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridGeometry : public vtkHyperTreeGridAlgorithm class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridGeometry : public vtkHyperTreeGridAlgorithm
...@@ -82,7 +86,7 @@ protected: ...@@ -82,7 +86,7 @@ protected:
/** /**
* Helper method to generate a face based on its normal and offset from cursor origin * Helper method to generate a face based on its normal and offset from cursor origin
*/ */
void AddFace( vtkIdType, double*, double*, int, unsigned int ); void AddFace( vtkIdType, double*, double*, int, unsigned int, bool create = true );
/** /**
* Dimension of input grid * Dimension of input grid
...@@ -104,6 +108,47 @@ protected: ...@@ -104,6 +108,47 @@ protected:
*/ */
vtkCellArray* Cells; vtkCellArray* Cells;
//@{
/**
* Keep track of input interface parameters
*/
bool HasInterface;
vtkDoubleArray* Normals;
vtkDoubleArray* Intercepts;
//@}
//@{
/**
* Storage for interface points
*/
vtkPoints* FacePoints;
vtkIdList* FaceIDs;
//@}
//@{
/**
* Storage for interface edges
*/
vtkIdType EdgesA[12];
vtkIdType EdgesB[12];
//@}
//@{
/**
* Storage for interface faces
*/
vtkIdTypeArray* FacesA;
vtkIdTypeArray* FacesB;
//@}
//@{
/**
* Storage for interface scalars
*/
vtkDoubleArray* FaceScalarsA;
vtkDoubleArray* FaceScalarsB;
//@}
private: private:
vtkHyperTreeGridGeometry(const vtkHyperTreeGridGeometry&) = delete; vtkHyperTreeGridGeometry(const vtkHyperTreeGridGeometry&) = delete;
void operator=(const vtkHyperTreeGridGeometry&) = delete; void operator=(const vtkHyperTreeGridGeometry&) = delete;
......
...@@ -83,8 +83,8 @@ vtkHyperTreeGridSource::vtkHyperTreeGridSource() ...@@ -83,8 +83,8 @@ vtkHyperTreeGridSource::vtkHyperTreeGridSource()
// By default do not use the material mask // By default do not use the material mask
this->UseMaterialMask = false; this->UseMaterialMask = false;
// By default do not generate a vector field // By default do not generate interface vector fields
this->GenerateVectorField = false; this->GenerateInterfaceFields = false;
// Grid description & material mask as strings // Grid description & material mask as strings
this->Descriptor = new char[2]; this->Descriptor = new char[2];
...@@ -204,7 +204,7 @@ void vtkHyperTreeGridSource::PrintSelf( ostream& os, vtkIndent indent ) ...@@ -204,7 +204,7 @@ void vtkHyperTreeGridSource::PrintSelf( ostream& os, vtkIndent indent )
os << indent << "UseDescriptor: " << this->UseDescriptor << endl; os << indent << "UseDescriptor: " << this->UseDescriptor << endl;
os << indent << "UseMaterialMask: " << this->UseMaterialMask << endl; os << indent << "UseMaterialMask: " << this->UseMaterialMask << endl;
os << indent << "GenerateVectorField:" << this->GenerateVectorField << endl; os << indent << "GenerateInterfaceFields:" << this->GenerateInterfaceFields << endl;
os << indent << "LevelZeroMaterialIndex: " << this->LevelZeroMaterialIndex << endl; os << indent << "LevelZeroMaterialIndex: " << this->LevelZeroMaterialIndex << endl;
os << indent << "Descriptor: " << this->Descriptor << endl; os << indent << "Descriptor: " << this->Descriptor << endl;
...@@ -527,13 +527,18 @@ int vtkHyperTreeGridSource::RequestData( vtkInformation*, ...@@ -527,13 +527,18 @@ int vtkHyperTreeGridSource::RequestData( vtkInformation*,
depthArray->SetNumberOfComponents( 1 ); depthArray->SetNumberOfComponents( 1 );
outData->SetScalars( depthArray ); outData->SetScalars( depthArray );
if ( this->GenerateVectorField ) if ( this->GenerateInterfaceFields )
{ {
// Prepare array of triples of doubles for vector field // Prepare arrays of triples for interface surrogates
vtkNew<vtkDoubleArray> vectorArray; vtkNew<vtkDoubleArray> normalsArray;
vectorArray->SetName( "Vector" ); normalsArray->SetName( "Normals" );
vectorArray->SetNumberOfComponents( 3 ); normalsArray->SetNumberOfComponents( 3 );
outData->SetVectors( vectorArray ); outData->SetVectors( normalsArray );
vtkNew<vtkDoubleArray> interceptsArray;
interceptsArray->SetName( "Intercepts" );
interceptsArray->SetNumberOfComponents( 3 );
outData->AddArray( interceptsArray );
}