1
/*=========================================================================
3
Program: Insight Segmentation & Registration Toolkit
4
Module: $RCSfile: itkRegularSphereQuadEdgeMeshSourceTest.cxx,v $
6
Date: $Date: 2007-09-06 17:44:24 $
7
Version: $Revision: 1.3 $
9
Copyright (c) Insight Software Consortium. All rights reserved.
10
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12
This software is distributed WITHOUT ANY WARRANTY; without even
13
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
PURPOSE. See the above copyright notices for more information.
16
=========================================================================*/
19
#pragma warning ( disable : 4786 )
23
#include "itkQuadEdgeMesh.h"
24
#include "itkRegularSphereMeshSource.h"
25
#include "itkDefaultStaticMeshTraits.h"
29
int itkRegularSphereQuadEdgeMeshSourceTest(int, char* [] )
32
typedef itk::QuadEdgeMesh<float, 3> MeshType;
34
typedef itk::RegularSphereMeshSource< MeshType > SphereMeshSourceType;
36
SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New();
38
typedef SphereMeshSourceType::PointType PointType;
39
typedef SphereMeshSourceType::VectorType VectorType;
47
mySphereMeshSource->SetCenter( center );
48
mySphereMeshSource->SetResolution( 1 );
49
mySphereMeshSource->SetScale( scale );
51
mySphereMeshSource->Modified();
55
mySphereMeshSource->Update();
57
catch( itk::ExceptionObject & excp )
59
std::cerr << "Error during Update() " << std::endl;
60
std::cerr << excp << std::endl;
63
std::cout << "mySphereMeshSource: " << mySphereMeshSource;
65
MeshType::Pointer myMesh = mySphereMeshSource->GetOutput();
69
std::cout << "Testing itk::RegularSphereMeshSource "<< std::endl;
71
for(unsigned int i=0; i<myMesh->GetNumberOfPoints(); i++)
73
myMesh->GetPoint(i, &pt);
74
std::cout << "Point[" << i << "]: " << pt << std::endl;
77
std::cout << "Test End "<< std::endl;