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

Merge topic 'add_quadric_value_field_to_HTG_source' into master

c9242cc3 Whitespace cleanup
c516ed78 A complete test for material+ternary+quadric
282b1992 Removed unnecessary test variables
bad79e6f This sphere has a Material in it -- say it!
d21e0c1e Renamed Material test files for better understanding
813fb53a A new test that is binary+quadric+material+2D
d918e3c0 Added a new test, ternary+quadric+2D+material
fd021a8c Build 0-isocontour of quadric field. Also fixed formatting issues.
d5668777 Renamed test for consistency
12454553 Fixed license headers
c6553d3f Whitespace clean up
14b16b8b Squeeze() data arrays associated with the HTG generated by source
e822f5b2 Added color transfer function, scalar bar, fixed module.cmake
fc913f82 whitespace cleanup
f062a8aa Implemente correct 0-set computation up to max depth. Also a test.
d468b828 Implemented new array of quadric values when quadric mode used
...
parents d7969c4e c9242cc3
......@@ -5,15 +5,18 @@ create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
TestHyperOctreeDual.cxx
TestHyperOctreeSurfaceFilter.cxx
TestHyperOctreeToUniformGrid.cxx
TestHyperTreeGridBinary2D.cxx
TestHyperTreeGridBinaryEllipseMaterial.cxx
TestHyperTreeGridBinaryHyperbolicParaboloidMaterial.cxx
TestHyperTreeGridTernary3DAxisCut.cxx
TestHyperTreeGridTernary3DAxisCutMaterial.cxx
TestHyperTreeGridTernary3DContour.cxx
TestHyperTreeGridTernary3DGeometry.cxx
TestHyperTreeGridTernary3DSphere.cxx
TestHyperTreeGridTernary3DGeometryMaterial.cxx
TestHyperTreeGridTernary3DUnstructured.cxx
TestHyperTreeGridTernary3DMaterialAxisCut.cxx
TestHyperTreeGridTernary3DMaterialGeometry.cxx
TestHyperTreeGridTernary3DMaterialUnstructured.cxx
TestHyperTreeGridBinary2D.cxx
TestHyperTreeGridTernary3DUnstructuredMaterial.cxx
TestHyperTreeGridTernaryHyperbola.cxx
TestHyperTreeGridTernarySphereMaterial.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
......
/*=========================================================================
/*==================================================================
Copyright (c) Kitware Inc.
Program: Visualization Toolkit
Module: TestHyperTreeGridBinary2D.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 and Charles Law, Kitware 2012
// 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"
......
/*==================================================================
Program: Visualization Toolkit
Module: TestHyperTreeGridBinaryEllipseMaterial.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 "vtkColorTransferFunction.h"
#include "vtkContourFilter.h"
#include "vtkNew.h"
#include "vtkPolyDataMapper.h"
#include "vtkProperty.h"
#include "vtkProperty2D.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkScalarBarActor.h"
#include "vtkTextProperty.h"
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->SetDimension( 2 );
htGrid->SetBranchFactor( 2 );
htGrid->DualOn();
htGrid->UseDescriptorOff();
htGrid->UseMaterialMaskOn();
htGrid->SetQuadricCoefficients( -4., -9., 0.,
0., 0., 0.,
32., 54., 0.,
-109. );
// Geometry
vtkNew<vtkHyperTreeGridGeometry> geometry;
geometry->SetInputConnection( htGrid->GetOutputPort() );
geometry->Update();
vtkPolyData* pd = geometry->GetOutput();
pd->GetCellData()->SetActiveScalars( "Quadric" );
// Contour
vtkNew<vtkContourFilter> contour;
contour->SetInputConnection( htGrid->GetOutputPort() );
contour->SetNumberOfContours( 0 );
contour->SetValue( 0, 0 );
contour->SetInputArrayToProcess( 0, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_POINTS,
"Quadric" );
// Color transfer function
vtkNew<vtkColorTransferFunction> colorFunction;
colorFunction->AddHSVSegment( -90., .667, 1., 1.,
0., 0., 1., 1. );
// Mappers
vtkNew<vtkPolyDataMapper> mapper1;
mapper1->SetInputConnection( geometry->GetOutputPort() );
mapper1->SetResolveCoincidentTopologyToPolygonOffset();
mapper1->SetResolveCoincidentTopologyPolygonOffsetParameters( 0, 1 );
mapper1->UseLookupTableScalarRangeOn();
mapper1->SetLookupTable( colorFunction.GetPointer() );
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 );
// 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( 0., 0., 0. );
actor3->GetProperty()->SetLineWidth( 2 );
// 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], 14. );
// Scalar bar
vtkNew<vtkScalarBarActor> scalarBar;
scalarBar->SetLookupTable( colorFunction.GetPointer() );
scalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
scalarBar->GetPositionCoordinate()->SetValue( .45, .3 );
scalarBar->SetTitle( "Quadric" );
scalarBar->SetNumberOfLabels( 4 );
scalarBar->SetWidth( 0.15 );
scalarBar->SetHeight( 0.4 );
scalarBar->SetMaximumWidthInPixels( 60 );
scalarBar->SetMaximumHeightInPixels( 200 );
scalarBar->SetTextPositionToPrecedeScalarBar();
scalarBar->GetTitleTextProperty()->SetColor( .4, .4, .4 );
scalarBar->GetLabelTextProperty()->SetColor( .4, .4, .4 );
scalarBar->SetDrawFrame( 1 );
scalarBar->GetFrameProperty()->SetColor( .4, .4, .4 );
scalarBar->SetDrawBackground( 1 );
scalarBar->GetBackgroundProperty()->SetColor( 1., 1., 1. );
// 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( scalarBar.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;
}
/*=========================================================================
/*==================================================================
Copyright (c) Kitware Inc.
Program: Visualization Toolkit
Module: TestHyperTreeGridBinaryHyperbolicParaboloidMaterial.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 and Charles Law, Kitware 2012
// 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"
......@@ -21,29 +29,26 @@
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
int TestHyperTreeGridTernary3DMaterialGeometry( int argc, char* argv[] )
int TestHyperTreeGridBinaryHyperbolicParaboloidMaterial( 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->SetMaximumLevel( 5 );
htGrid->SetGridSize( 8, 8, 8 );
htGrid->SetGridScale( 1., .5, .75 );
htGrid->SetDimension( 3 );
htGrid->SetBranchFactor( 3 );
htGrid->DualOn();
htGrid->UseDescriptorOff();
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" );
htGrid->Update();
vtkNew<vtkHyperTreeGrid> htgCopy;
htgCopy->ShallowCopy( htGrid->GetOutput() );
htGrid->SetQuadricCoefficients( 4., -16., 0.,
0., 0., 0.,
-32., 64., 16.,
-48. );
// Geometry
vtkNew<vtkHyperTreeGridGeometry> geometry;
// geometry->SetInputConnection( htGrid->GetOutputPort() );
geometry->SetInputData( htgCopy.GetPointer() );
geometry->SetInputConnection( htGrid->GetOutputPort() );
geometry->Update();
vtkPolyData* pd = geometry->GetOutput();
......@@ -73,7 +78,7 @@ int TestHyperTreeGridTernary3DMaterialGeometry( int argc, char* argv[] )
vtkNew<vtkCamera> camera;
camera->SetClippingRange( 1., 100. );
camera->SetFocalPoint( pd->GetCenter() );
camera->SetPosition( -.8 * bd[1], 2.1 * bd[3], -4.8 * bd[5] );
camera->SetPosition( -.7 * bd[1], .9 * bd[3], -2.5 * bd[5] );
// Renderer
vtkNew<vtkRenderer> renderer;
......
/*=========================================================================
Copyright (c) Kitware Inc.
/*==================================================================
Program: Visualization Toolkit
Module: TestHyperTreeGridTernary3DAxisCut.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 and Charles Law, Kitware 2012
// This test was written by Philippe Pebay, Kitware 2012
// This work was supported in part by Commissariat a l'Energie Atomique (CEA/DIF)
#include "vtkHyperTreeGrid.h"
......@@ -29,8 +38,7 @@ int TestHyperTreeGridTernary3DAxisCut( int argc, char* argv[] )
{
// Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 5;
htGrid->SetMaximumLevel( maxLevel );
htGrid->SetMaximumLevel( 5 );
htGrid->SetGridSize( 3, 3, 2 );
htGrid->SetGridScale( 1.5, 1., .7 );
htGrid->SetDimension( 3 );
......
/*=========================================================================
/*==================================================================
Copyright (c) Kitware Inc.
Program: Visualization Toolkit
Module: TestHyperTreeGridTernary3DAxisCutMaterial.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 and Charles Law, Kitware 2012
// This test was written by Philippe Pebay, Kitware 2012
// This work was supported in part by Commissariat a l'Energie Atomique (CEA/DIF)
#include "vtkHyperTreeGrid.h"
......@@ -25,12 +33,11 @@
#include "vtkRenderWindowInteractor.h"
#include "vtkShrinkFilter.h"
int TestHyperTreeGridTernary3DMaterialAxisCut( int argc, char* argv[] )
int TestHyperTreeGridTernary3DAxisCutMaterial( int argc, char* argv[] )
{
// Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 5;
htGrid->SetMaximumLevel( maxLevel );
htGrid->SetMaximumLevel( 5 );
htGrid->SetGridSize( 3, 3, 2 );
htGrid->SetGridScale( 1.5, 1., .7 );
htGrid->SetDimension( 3 );
......
/*=========================================================================
/*==================================================================
Copyright (c) Kitware Inc.
Program: Visualization Toolkit
Module: TestHyperTreeGridTernary3DContour.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 and Charles Law, Kitware 2012
// 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"
......@@ -53,21 +61,21 @@ int TestHyperTreeGridTernary3DContour( int argc, char* argv[] )
contour->GenerateTrianglesOff();
contour->Update();
if(contour->GetOutput()->GetNumberOfPoints()!=547)
if( contour->GetOutput()->GetNumberOfPoints() != 547 )
{
return 1;
}
if(contour->GetOutput()->GetNumberOfCells()!=463)
if( contour->GetOutput()->GetNumberOfCells() != 463 )
{
return 1;
}
contour->GenerateTrianglesOn();
contour->Update();
if(contour->GetOutput()->GetNumberOfPoints()!=547)
if( contour->GetOutput()->GetNumberOfPoints() != 547 )
{
return 1;
}
if(contour->GetOutput()->GetNumberOfCells()!=917)
if( contour->GetOutput()->GetNumberOfCells() != 917 )
{
return 1;
}
......
/*=========================================================================
/*==================================================================
Copyright (c) Kitware Inc.
Program: Visualization Toolkit
Module: TestHyperTreeGridTernary3DGeometry.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 and Charles Law, Kitware 2012
// 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"
......@@ -25,8 +33,7 @@ int TestHyperTreeGridTernary3DGeometry( int argc, char* argv[] )
{
// Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 5;
htGrid->SetMaximumLevel( maxLevel );
htGrid->SetMaximumLevel( 5 );
htGrid->SetGridSize( 3, 3, 2 );
htGrid->SetGridScale( 1.5, 1., .7 );
htGrid->SetDimension( 3 );
......@@ -34,14 +41,9 @@ int TestHyperTreeGridTernary3DGeometry( int argc, char* argv[] )
htGrid->DualOn();
htGrid->SetDescriptor( "RRR .R. .RR ..R ..R .R.|R.......................... ........................... ........................... .............R............. ....RR.RR........R......... .....RRRR.....R.RR......... ........................... ........................... ...........................|........................... ........................... ........................... ...RR.RR.......RR.......... ........................... RR......................... ........................... ........................... ........................... ........................... ........................... ........................... ........................... ............RRR............|........................... ........................... .......RR.................. ........................... ........................... ........................... ........................... ........................... ........................... ........................... ...........................|........................... ..........................." );
htGrid->Update();
vtkNew<vtkHyperTreeGrid> htgCopy;
htgCopy->ShallowCopy( htGrid->GetOutput() );
// Geometry
vtkNew<vtkHyperTreeGridGeometry> geometry;
// geometry->SetInputConnection( htGrid->GetOutputPort() );
geometry->SetInputData( htgCopy.GetPointer() );
geometry->SetInputConnection( htGrid->GetOutputPort() );
geometry->Update();
vtkPolyData* pd = geometry->GetOutput();
......
/*=========================================================================
/*==================================================================
Copyright (c) Kitware Inc.
Program: Visualization Toolkit
Module: TestHyperTreeGridTernary3DGeometryMaterial.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 and Charles Law, Kitware 2012
// 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"
......@@ -21,12 +29,11 @@
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
int TestHyperTreeGridTernary3DMaterialGeometry( int argc, char* argv[] )
int TestHyperTreeGridTernary3DGeometryMaterial( int argc, char* argv[] )
{
// Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 5;
htGrid->SetMaximumLevel( maxLevel );
htGrid->SetMaximumLevel( 5 );
htGrid->SetGridSize( 3, 3, 2 );
htGrid->SetGridScale( 1.5, 1., .7 );
htGrid->SetDimension( 3 );
......@@ -34,16 +41,11 @@ int TestHyperTreeGridTernary3DMaterialGeometry( int argc, char* argv[] )
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 111 111 011 001 110|111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 000110011100000100100010100|111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111|111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111 111111111111111111111111111|111111111111111111111111111 111111111111111111111111111" );
htGrid->Update();
vtkNew<vtkHyperTreeGrid> htgCopy;
htgCopy->ShallowCopy( htGrid->GetOutput() );
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" );
// Geometry
vtkNew<vtkHyperTreeGridGeometry> geometry;
// geometry->SetInputConnection( htGrid->GetOutputPort() );
geometry->SetInputData( htgCopy.GetPointer() );
geometry->SetInputConnection( htGrid->GetOutputPort() );
geometry->Update();
vtkPolyData* pd = geometry->GetOutput();
......
/*=========================================================================
/*==================================================================
Copyright (c) Kitware Inc.
Program: Visualization Toolkit
Module: TestHyperTreeGridTernary3DUnstructured.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 and Charles Law, Kitware 2012
// This test was written by Philippe Pebay, Kitware 2012
// This work was supported in part by Commissariat a l'Energie Atomique (CEA/DIF)
#include "vtkHyperTreeGrid.h"
......@@ -29,8 +37,7 @@ int TestHyperTreeGridTernary3DUnstructured( int argc, char* argv[] )
{
// Hyper tree grid
vtkNew<vtkHyperTreeGridSource> htGrid;
int maxLevel = 5;
htGrid->SetMaximumLevel( maxLevel );
htGrid->SetMaximumLevel( 5 );
htGrid->SetGridSize( 3, 3, 2 );
htGrid->SetGridScale( 1.5, 1., .7 );
htGrid->SetDimension( 3 );
......
/*=========================================================================
/*==================================================================
Copyright (c) Kitware Inc.
Program: Visualization Toolkit
Module: TestHyperTreeGridTernary3DUnstructuredMaterial.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 and Charles Law, Kitware 2012
// This test was written by Philippe Pebay, Kitware 2012
// This work was supported in part by Commissariat a l'Energie Atomique (CEA/DIF)
#include "vtkHyperTreeGrid.h"
......@@ -25,12 +33,11 @@
#include "vtkShrinkFilter.h"
#include "vtkUnstructuredGrid.h"
int TestHyperTreeGridTernary3DMaterialUnstructured( int argc, char* argv[] )
int TestHyperTreeGridTernary3DUnstructuredMaterial( int argc, char* argv[] )
{
// Hyper tree grid