1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    TestAMRReadWrite.cxx
5 
6   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7   All rights reserved.
8   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notice for more information.
13 
14 =========================================================================*/
15 // .NAME Test of vtkSimplePointsReader and vtkSimplePointsWriter
16 // .SECTION Description
17 //
18 #include "vtkSmartPointer.h"
19 #include "vtkSetGet.h"
20 #include "vtkOverlappingAMR.h"
21 #include "vtkUniformGrid.h"
22 #include "vtkNew.h"
23 #include "vtkAMREnzoReader.h"
24 #include "vtkTestUtilities.h"
25 #include "vtkCompositeDataWriter.h"
26 
TestAMRReadWrite(int argc,char * argv[])27 int TestAMRReadWrite( int argc, char *argv[] )
28 {
29   char* fname = vtkTestUtilities::ExpandDataFileName(argc, argv,"Data/AMR/Enzo/DD0010/moving7_0010.hierarchy");
30 
31   vtkNew<vtkAMREnzoReader> reader;
32   reader->SetFileName(fname);
33   reader->SetMaxLevel(8);
34   reader->SetCellArrayStatus( "TotalEnergy",1);
35   reader->Update();
36 
37   vtkSmartPointer<vtkOverlappingAMR> amr;
38   amr = vtkOverlappingAMR::SafeDownCast(reader->GetOutputDataObject(0));
39   amr->Audit();
40 
41 
42   vtkNew<vtkCompositeDataWriter> writer;
43   writer->SetFileName();
44   writer->Write();
45 
46 
47   return EXIT_SUCCESS;
48 }
49