CustusX  18.04
An IGT application
cxIGTLinkConversionPolyData.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 /*==========================================================================
13 
14  Portions (c) Copyright 2008-2014 Brigham and Women's Hospital (BWH) All Rights Reserved.
15 
16  See Doc/copyright/copyright.txt
17  or http://www.slicer.org/copyright/copyright.txt for details.
18 
19  Program: 3D Slicer
20  Module: vtkIGTLToMRMLPolyData.cxx
21 
22 ==========================================================================*/
23 
24 #ifndef CXIGTLINKCONVERSIONPOLYDATA_H
25 #define CXIGTLINKCONVERSIONPOLYDATA_H
26 
27 #include "igtlPolyDataMessage.h"
28 #include "cxMesh.h"
29 #include "cxOpenIGTLinkUtilitiesExport.h"
30 
31 
32 namespace cx
33 {
34 
46 class cxOpenIGTLinkUtilities_EXPORT IGTLinkConversionPolyData
47 {
48 public:
49  igtl::PolyDataMessage::Pointer encode(MeshPtr in, PATIENT_COORDINATE_SYSTEM externalSpace);
50  MeshPtr decode(igtl::PolyDataMessage *in, PATIENT_COORDINATE_SYSTEM externalSpace);
51 
52 private:
53  vtkPolyDataPtr decode_vtkPolyData(igtl::PolyDataMessage* msg);
54  void encode_vtkPolyData(vtkPolyDataPtr in, igtl::PolyDataMessage* outMsg);
55  vtkPolyDataPtr decodeCoordinateSystem(vtkPolyDataPtr polyData, PATIENT_COORDINATE_SYSTEM externalSpace);
56  vtkPolyDataPtr encodeCoordinateSystem(MeshPtr mesh, PATIENT_COORDINATE_SYSTEM externalSpace);
57 
58 private:
59  int VTKToIGTLCellArray(vtkCellArray* src, igtl::PolyDataCellArray* dest);
60  int VTKToIGTLAttribute(vtkDataSetAttributes* src, int i, igtl::PolyDataAttribute* dest);
61 
62 };
63 
64 } //namespace cx
65 
66 
67 #endif // CXIGTLINKCONVERSIONPOLYDATA_H
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
boost::shared_ptr< class Mesh > MeshPtr
Namespace for all CustusX production code.