Commit d5c39876 authored by David Thompson's avatar David Thompson

Add a regression test for bug 14713.

Change-Id: Ieaac07aa6ad89fd964f2215be790ee2f05978c5e
parent e4061e5f
......@@ -3,10 +3,12 @@ if(VTK_USE_LARGE_DATA)
ExternalData_Expand_Arguments(VTKData _
"DATA{${VTK_TEST_INPUT_DIR}/LSDyna/foam/,REGEX:.*}"
"DATA{${VTK_TEST_INPUT_DIR}/LSDyna/hemi.draw/,REGEX:.*}"
"DATA{${VTK_TEST_INPUT_DIR}/LSDyna/bug_14713/,REGEX:.*}"
)
vtk_add_test_cxx(${vtk-module}CxxTests tests
TestLSDynaReader.cxx
TestLSDynaReaderNoDefl.cxx
TestLSDynaReaderSPH.cxx
)
endif()
......
/*=========================================================================
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 vtkLSDynaReader when the dataset has no deflection data
// .SECTION Description
// Tests the vtkLSDynaReader when nodal deflections are part of the
// simulation state but have not been saved (i.e., the IU flag is 0).
#include "vtkLSDynaReader.h"
#include "vtkDebugLeaks.h"
#include "vtkActor.h"
#include "vtkCompositeDataGeometryFilter.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 TestLSDynaReaderNoDefl( int argc, char *argv[] )
{
// Read file name.
char* fname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/LSDyna/bug_14713/bug_14713.d3plot");
// Create the reader.
vtkNew<vtkLSDynaReader> reader;
reader->SetFileName(fname);
reader->Update();
delete [] fname;
vtkNew<vtkCompositeDataGeometryFilter> geom1;
geom1->SetInputConnection(0, reader->GetOutputPort(0));
// Create a mapper.
vtkNew<vtkPolyDataMapper> mapper;
mapper->SetInputConnection(geom1->GetOutputPort());
mapper->SetScalarModeToUsePointFieldData();
// 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();
int retVal = vtkRegressionTestImage( renWin.GetPointer() );
if ( retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
}
return !retVal;
}
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