Skip to content

Commit 12bedef

Browse files
authored
Merge pull request #42 from thewtex/shadow-variables
shadow variables
2 parents 1e594b7 + 13be4a0 commit 12bedef

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

include/itkPolyDataToMeshFilter.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ PolyDataToMeshFilter<TInputPolyData>::GenerateData()
193193
typename CellContainerType::ConstIterator inputCellItr;
194194
typename CellContainerType::ConstIterator inputCellEnd;
195195

196-
IdentifierType numPoints = 0, cellId = 0;
196+
IdentifierType cellId = 0;
197197

198198
// Set vertex cells
199199
using VertexCellType = itk::VertexCell<CellType>;

test/itkMeshToPolyDataFilterTest.cxx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
*=========================================================================*/
1818

1919
#include "itkMeshToPolyDataFilter.h"
20+
#include "itkPolyDataToMeshFilter.h"
2021

2122
#include "itkCommand.h"
2223
#include "itkMeshFileReader.h"
24+
#include "itkMeshFileWriter.h"
2325
#include "itkMesh.h"
2426
#include "itkTestingMacros.h"
2527
#include "itkMath.h"
@@ -110,5 +112,15 @@ int itkMeshToPolyDataFilterTest( int argc, char * argv[] )
110112
ITK_TEST_EXPECT_EQUAL( polyData->GetPolygons()->GetElement( 5 ), 4 );
111113
ITK_TEST_EXPECT_EQUAL( polyData->GetPolygons()->GetElement( 6 ), 252 );
112114

115+
using PolyDataToMeshFilterType = itk::PolyDataToMeshFilter<PolyDataType>;
116+
auto polyDataToMeshFilter = PolyDataToMeshFilterType::New();
117+
polyDataToMeshFilter->SetInput( polyData );
118+
119+
using MeshWriterType = itk::MeshFileWriter<MeshType>;
120+
auto meshWriter = MeshWriterType::New();
121+
meshWriter->SetFileName( outputPolyDataFileName );
122+
meshWriter->SetInput( polyDataToMeshFilter->GetOutput() );
123+
ITK_TRY_EXPECT_NO_EXCEPTION( meshWriter->Update() );
124+
113125
return EXIT_SUCCESS;
114126
}

0 commit comments

Comments
 (0)