~ubuntu-branches/ubuntu/precise/insighttoolkit/precise

« back to all changes in this revision

Viewing changes to Testing/Code/Review/itkRegularSphereQuadEdgeMeshSourceTest.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2008-12-19 20:16:49 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081219201649-drt97guwl2ryt0cn

* New upstream version.
  - patches/nifti-versioning.patch: Remove.  Applied upstream.
  - control:
  - rules: Update version numbers, package names.

* control: Build-depend on uuid-dev (gdcm uses it).

* copyright: Update download URL.

* rules: Adhere to parallel=N in DEB_BUILD_OPTIONS by setting MAKEFLAGS.

* compat: Set to 7.
* control: Update build-dep on debhelper to version >= 7.

* CMakeCache.txt.debian: Set CMAKE_BUILD_TYPE to "RELEASE" so that we
  build with -O3 (not -O2), necessary to optimize the templated code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*=========================================================================
 
2
 
 
3
  Program:   Insight Segmentation & Registration Toolkit
 
4
  Module:    $RCSfile: itkRegularSphereQuadEdgeMeshSourceTest.cxx,v $
 
5
  Language:  C++
 
6
  Date:      $Date: 2007-09-06 17:44:24 $
 
7
  Version:   $Revision: 1.3 $
 
8
 
 
9
  Copyright (c) Insight Software Consortium. All rights reserved.
 
10
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
 
11
 
 
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.
 
15
 
 
16
=========================================================================*/
 
17
 
 
18
#ifdef _MSC_VER
 
19
#pragma warning ( disable : 4786 )
 
20
#endif
 
21
 
 
22
 
 
23
#include "itkQuadEdgeMesh.h"
 
24
#include "itkRegularSphereMeshSource.h"
 
25
#include "itkDefaultStaticMeshTraits.h"
 
26
 
 
27
#include <iostream>
 
28
 
 
29
int itkRegularSphereQuadEdgeMeshSourceTest(int, char* [] )
 
30
{
 
31
 
 
32
  typedef itk::QuadEdgeMesh<float, 3>   MeshType;
 
33
 
 
34
  typedef itk::RegularSphereMeshSource< MeshType >  SphereMeshSourceType;
 
35
 
 
36
  SphereMeshSourceType::Pointer  mySphereMeshSource = SphereMeshSourceType::New();
 
37
 
 
38
  typedef SphereMeshSourceType::PointType   PointType;
 
39
  typedef SphereMeshSourceType::VectorType  VectorType;
 
40
 
 
41
  PointType center; 
 
42
  center.Fill( 0.0 );
 
43
 
 
44
  VectorType scale;
 
45
  scale.Fill( 1.0 );
 
46
  
 
47
  mySphereMeshSource->SetCenter( center );
 
48
  mySphereMeshSource->SetResolution( 1 );
 
49
  mySphereMeshSource->SetScale( scale );
 
50
 
 
51
  mySphereMeshSource->Modified();
 
52
 
 
53
  try
 
54
    {
 
55
    mySphereMeshSource->Update();
 
56
    }
 
57
  catch( itk::ExceptionObject & excp )
 
58
    {
 
59
    std::cerr << "Error during Update() " << std::endl;
 
60
    std::cerr << excp << std::endl;
 
61
    }
 
62
 
 
63
  std::cout << "mySphereMeshSource: " << mySphereMeshSource;
 
64
  
 
65
  MeshType::Pointer myMesh = mySphereMeshSource->GetOutput();
 
66
 
 
67
  PointType  pt;
 
68
 
 
69
  std::cout << "Testing itk::RegularSphereMeshSource "<< std::endl;
 
70
 
 
71
  for(unsigned int i=0; i<myMesh->GetNumberOfPoints(); i++) 
 
72
    {
 
73
    myMesh->GetPoint(i, &pt);
 
74
    std::cout << "Point[" << i << "]: " << pt << std::endl;
 
75
    }
 
76
 
 
77
  std::cout << "Test End "<< std::endl;
 
78
 
 
79
  return EXIT_SUCCESS;
 
80
 
 
81
}