Skip to content
Snippets Groups Projects
Commit 274c07be authored by Dave DeMarle's avatar Dave DeMarle
Browse files

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
No related branches found
No related tags found
No related merge requests found
Showing
with 128 additions and 0 deletions
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;
}
accade8c6ba5adbeb9188a1791821beb
......@@ -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
e50b9d252c69758083a6cb7c717c7198
0df19924c840699e65fca17bb5947910
6a137ebae54374b9eedadcc3f80cf46c
c01551f5382dc683a2785747c8f3a2fc
69fd4c2bfc683f7cff51b147f42617f0
8550f60cb717e22f6877175b199c610a
2b2c0d0022b345e3fc1f9012eae63a2c
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment