File: igstkCoordinateSystemEventTest.cxx

package info (click to toggle)
igstk 4.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 38,980 kB
  • sloc: cpp: 86,267; xml: 96; makefile: 75; python: 38
file content (123 lines) | stat: -rwxr-xr-x 3,135 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*=========================================================================

  Program:   Image Guided Surgery Software Toolkit
  Module:    $RCSfile: igstkCoordinateSystemEventTest.cxx,v $
  Language:  C++
  Date:      $Date: 2009-06-18 16:44:24 $
  Version:   $Revision: 1.3 $

  Copyright (c) ISC  Insight Software Consortium.  All rights reserved.
  See IGSTKCopyright.txt or http://www.igstk.org/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 notices for more information.

=========================================================================*/

#if defined(_MSC_VER)
// Warning about: identifier was truncated to '255' characters
// in the debug information (MVC6.0 Debug)
#pragma warning( disable : 4786 )
#endif

#include <iostream>

#include "igstkCoordinateSystem.h"
#include "igstkCoordinateSystemTransformToResult.h"
#include "igstkCoordinateSystemTransformToErrorResult.h"
#include "igstkCoordinateSystemSetTransformResult.h"


int igstkCoordinateSystemEventTest( int, char * [] )
{
  /** This test is mainly for code coverage on the event results. */
  typedef igstk::CoordinateSystem              CoordinateSystemType;

  typedef igstk::CoordinateSystemTransformToResult         TransformToResult;
  typedef igstk::CoordinateSystemTransformToErrorResult    ErrorResult;
  typedef igstk::CoordinateSystemSetTransformResult        SetTransformResult;
  typedef igstk::Transform                                 TransformType;

  CoordinateSystemType::Pointer cs1 = CoordinateSystemType::New();
  CoordinateSystemType::Pointer cs2 = CoordinateSystemType::New();

  TransformType transform;

  TransformToResult transformToResult;

  // Test Initialize
  transformToResult.Initialize( transform, cs1, cs2 );

  // Copy ctor
  TransformToResult transformToResult2 = transformToResult;

  // Assignment operator
  transformToResult = transformToResult2;

  // GetTransform
  transformToResult.GetTransform();

  // GetSource
  transformToResult.GetSource();

  // GetDestination
  transformToResult.GetDestination();

  // Clear
  transformToResult.Clear();

  // Error result
  ErrorResult errorResult;

  // Test Initialize
  errorResult.Initialize( cs1, cs2 );

  // Copy ctor
  ErrorResult errorResult2 = errorResult;

  // Assignment operator
  errorResult = errorResult2;

  // GetSource
  errorResult.GetSource();

  // GetDestination
  errorResult.GetDestination();

  // Clear
  errorResult.Clear();

  // Set transform result
  SetTransformResult stResult;
  bool attaching = true;

  // Test Initialize
  stResult.Initialize( transform, cs1, cs2, attaching );

  // Copy ctor
  SetTransformResult stResult2 = stResult;

  // Assignment operator
  stResult = stResult2;

  // GetTransform
  stResult.GetTransform();

  // GetSource
  stResult.GetSource();

  // GetDestination
  stResult.GetDestination();

  // Is attaching?
  if (! stResult.IsAttach())
    {
    return EXIT_FAILURE;
    }

  // Clear
  stResult.Clear();

  return EXIT_SUCCESS;
}