1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19 #include "itkQuadEdgeMesh.h"
20
21 #include "itkMeshFileTestHelper.h"
22
itkMeshFileReadWriteTest(int argc,char * argv[])23 int itkMeshFileReadWriteTest(int argc, char * argv[])
24 {
25 if(argc < 3)
26 {
27 std::cerr << "Invalid commands, You need input and output mesh file name " << std::endl;
28 return EXIT_FAILURE;
29 }
30
31 bool IsBinary = ( argc > 3 );
32
33 constexpr unsigned int dimension = 3;
34 using PixelType = float;
35
36 using MeshType = itk::Mesh<PixelType, dimension>;
37 using QEMeshType = itk::QuadEdgeMesh<PixelType, dimension>;
38
39 int result = EXIT_SUCCESS;
40
41 if( test< MeshType >( argv[1], argv[2], IsBinary ) )
42 {
43 std::cerr << "Failure for itk::Mesh" << std::endl;
44 result = EXIT_FAILURE;
45 }
46 if( test< QEMeshType >( argv[1], argv[2], IsBinary ) )
47 {
48 std::cerr << "Failure for itk::QuadEdgeMesh" << std::endl;
49 result = EXIT_FAILURE;
50 }
51
52 return result;
53 }
54