Commit 274c07be authored by Dave DeMarle's avatar Dave DeMarle

Add a test for the VPIC reader

Thanks Vadim Roytershtey and Homa Karimabadi for the test data set.
Test only enabled with VTK_USE_LARGE_DATA = ON

Change-Id: Ic04681dbffcc57ed27377ca5f3cae015249a7308
parent 86d74be2
if(VTK_USE_LARGE_DATA)
# Tell ExternalData to fetch test input at build time.
ExternalData_Expand_Arguments(VTKData _
"DATA{${VTK_TEST_INPUT_DIR}/VPIC/global.vpc}"
"DATA{${VTK_TEST_INPUT_DIR}/VPIC/fields/T.0/,REGEX:.*}"
"DATA{${VTK_TEST_INPUT_DIR}/VPIC/fields/T.100/,REGEX:.*}"
"DATA{${VTK_TEST_INPUT_DIR}/VPIC/hydro/T.0/,REGEX:.*}"
"DATA{${VTK_TEST_INPUT_DIR}/VPIC/hydro/T.100/,REGEX:.*}"
)
vtk_add_test_cxx(
TestVPICReader.cxx
)
endif()
vtk_test_cxx_executable(${vtk-module}CxxTests)
/*=========================================================================
Program: Visualization Toolkit
Module: TestPLYReader.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.
=========================================================================*/
// .NAME Test of vtkVPICReader
// .SECTION Description
// Tests the vtkVPICReader.
#include "vtkVPICReader.h"
#include "vtkDebugLeaks.h"
#include "vtkActor.h"
#include "vtkCamera.h"
#include "vtkDataSetSurfaceFilter.h"
#include "vtkLookupTable.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRegressionTestImage.h"
#include "vtkTestUtilities.h"
#include "vtkWindowToImageFilter.h"
#include "vtkPNGWriter.h"
#include "vtkNew.h"
int TestVPICReader( int argc, char *argv[] )
{
// Read file name.
char* fname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/VPIC/global.vpc");
// Create the reader.
vtkNew<vtkVPICReader> reader;
reader->SetFileName(fname);
reader->EnableAllPointArrays();
reader->Update();
delete [] fname;
vtkNew<vtkDataSetSurfaceFilter> geom1;
geom1->SetInputConnection(0, reader->GetOutputPort(0));
// Create a mapper.
vtkNew<vtkPolyDataMapper> mapper;
mapper->SetInputConnection(geom1->GetOutputPort());
mapper->SetScalarModeToUsePointFieldData();
mapper->SelectColorArray("Charge Density(Hhydro)");
mapper->SetScalarRange(0.06743, 1.197);
// Create the actor.
vtkNew<vtkActor> actor;
actor->SetMapper(mapper.GetPointer());
// Basic visualisation.
vtkNew<vtkRenderWindow> renWin;
vtkNew<vtkRenderer> ren;
vtkNew<vtkRenderWindowInteractor> iren;
renWin->AddRenderer(ren.GetPointer());
iren->SetRenderWindow(renWin.GetPointer());
ren->AddActor(actor.GetPointer());
ren->SetBackground(0,0,0);
renWin->SetSize(300,300);
// interact with data
renWin->Render();
ren->GetActiveCamera()->Roll(45);
ren->GetActiveCamera()->Azimuth(45);
renWin->Render();
int retVal = vtkRegressionTestImage( renWin.GetPointer() );
if ( retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
}
return !retVal;
}
......@@ -3,4 +3,8 @@ vtk_module(vtkIOVPIC
vtkVPIC
vtkCommonExecutionModel
vtkParallelCore
TEST_DEPENDS
vtkRenderingOpenGL
vtkTestingRendering
vtkInteractionStyle
)
......@@ -93,6 +93,8 @@ vtkVPICReader::vtkVPICReader()
this->Rank = 0;
this->TotalRank = 1;
}
this->UsedRank = 0;
}
//----------------------------------------------------------------------------
......
cff029254bf2a0f066083f03cffa0bc1
71d6c99b999ab61860cfa30dd520f1c2
9879bbfc710cc02ce5dec3d6751255b0
43c2b33537e765ea1c9cfbf473d77e74
807714ea0cc7663721d1358aec6e7ecc
4dab2ad1b828f0d841f258098217033f
e73e71d58abb32c8f94745b99266b696
5e6790beeebb19d228354153a9d83b68
eec9a80bea5b00131c73f69fe0befc09
0a7451e4b21fc4b3f203cca0049892ba
a291bf1236ac3622d0ce235b2acfdf36
e74d6b1f7c927d3ad1e5bb65d184a9e1
f9b571234219148fcbeea6d682bf4908
7e29f53fdcf087016fd84d3870b1d32c
fbd25b7f0423754e6847e7b33f4d60eb
e66ca71544282a54b5918f152a6a4170
787a3264fbb218534f5a3c5ed5a5aaf3
9cace7266f3efe6bb77e449ffc3b860e
6c247202348553e60e4c3d18c5283efe
988be0177c741dfed25139a2105c8f5d
218fa43debf0bdc39247ee6b1ab76006
a3ed751e3d96786298262a9f1e31b4d4
0e5acb459422510f10561c73e2beedd6
8b532a928e675118e6dfcfe91fe740d4
f755500cd86db24d800a6d788e49601f
84abb7101a1f21f0bc27fb9d8ef7d5b8
3261fe2044c40f62941ca9bfab53aaf6
db79710b4b68fa3886386b433b33b756
524907f8b1ac5a1515df8c267697166a
0834f90dd542d7ace5e7c58255489347
29fee67d03700195b285af75da77f4c0
ca5e00377eb83c9afb90be1cfc11f8a4
e26bf2c2e039a8e4ad9a10889298b847
bd0c3efdf5aae6112dd4e49dadf6b697
2a8971dae9c585e993083ef38bcd3bb5
74ea187e3ace3343a42e10391fdc67e2
9a1a119c67d5b915fcbb96884365d39c
58473af39590452e1436d6b59ae1ccb9
85be77d65d5d23459dd2d1088a9d9e1e
e0b88165abd594bd80e93ecfa54e7e53
558476eed3350c8c45e153de8c8ec910
Markdown is supported
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