MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkPolhemusTrackingDeviceHardwareTest.cpp
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
14#include "mitkTestingMacros.h"
15#include "mitkStandardFileLocations.h"
16#include <mitkIGTConfig.h>
17
18// Testing
19#include "mitkTestingMacros.h"
20#include "mitkTestFixture.h"
21
22class mitkPolhemusTrackingDeviceHardwareTestSuite : public mitk::TestFixture
23{
25 // Test the append method
26 MITK_TEST(testInterface);
27 CPPUNIT_TEST_SUITE_END();
28
29
30public:
31 void setUp() override
32 {
33
34 }
35 void tearDown() override
36 {
37
38 }
39
41 {
42 mitk::PolhemusInterface::Pointer myInterface = mitk::PolhemusInterface::New();
43 CPPUNIT_ASSERT_MESSAGE("Testing connection.", myInterface->Connect());
44 CPPUNIT_ASSERT_MESSAGE("Start tracking.", myInterface->StartTracking());
45
46 CPPUNIT_ASSERT_MESSAGE("Tracking 20 frames ...", true);
47 for (int i = 0; i < 20; i++)
48 {
49 std::vector<mitk::PolhemusInterface::trackingData> lastFrame = myInterface->GetLastFrame();
50 MITK_INFO << "Frame " << i;
51 for (size_t j = 0; j < lastFrame.size(); j++)
52 {
53 MITK_INFO << "[" << j << "]" << " Pos: " << lastFrame.at(j).pos << " Rot: " << lastFrame.at(j).rot << " DistortionLevel: " << lastFrame.at(j).distortionLevel;
54 }
55 }
56
57 }
58
59};
60
61MITK_TEST_SUITE_REGISTRATION(mitkPolhemusTrackingDeviceHardware)