MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkIGTLMessageCommon.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 "mitkException.h"
15
19
20
24
25//bool mitk::IGTLMessageCommon::Clone(igtl::TransformMessage::Pointer clone,
26// igtl::TransformMessage::Pointer original)
27//{
28// bool copySuccess = false;
29
30// //copy all meta data
31// copySuccess = clone->Copy(original);
32
33// if ( !copySuccess )
34// return false;
35
36// //copy all data that is important for this class
37// //copy the matrix
38// igtl::Matrix4x4 mat;
39// original->GetMatrix(mat);
40// clone->SetMatrix(mat);
41
42// //copy the normals
43// float normals[3][3];
44// original->GetNormals(normals);
45// clone->SetNormals(normals);
46
47// //copy the position
48// float position[3];
49// original->GetPosition(position);
50// clone->SetPosition(position);
51
52// return true;
53//}
54
55//igtl::MessageBase::Pointer mitk::IGTLMessageCommon::Clone(igtl::TransformMessage::Pointer original)
56//{
57// bool copySuccess = false;
58// igtl::TransformMessage::Pointer clone_ = igtl::TransformMessage::New();
59
60// //initialize the clone
62
63// //copy all meta data
64// copySuccess = clone_->Copy(original);
65
66// if ( !copySuccess )
67// return false;
68
69// //copy all data that is important for this class
70// //copy the matrix
71// igtl::Matrix4x4 mat;
72// original->GetMatrix(mat);
73// clone_->SetMatrix(mat);
74
75// //copy the normals
76// float normals[3][3];
77// original->GetNormals(normals);
78// clone_->SetNormals(normals);
79
80// //copy the position
81// float position[3];
82// original->GetPosition(position);
83// clone_->SetPosition(position);
84
85// return igtl::MessageBase::Pointer(clone_.GetPointer());
86
88//}
IGTLMessageCommon()
Clones the input message and returns a igtl::MessageBase::Pointer to the clone.