Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxCoordinateSystemHelpers.cpp
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 
13 
14 #include "cxDefinitionStrings.h"
15 
16 namespace cx
17 {
18 
20 {
21  return enum2string(mId) + (mRefObject.isEmpty() ? "" : ("/"+mRefObject));
22 }
23 
25 {
26  QStringList raw = text.split("/");
27  CoordinateSystem retval(csCOUNT);
28  if (raw.size()<1)
29  return retval;
30  retval.mId = string2enum<COORDINATE_SYSTEM>(raw[0]);
31  if (raw.size()<2)
32  return retval;
33  retval.mRefObject = raw[1];
34  return retval;
35 }
36 
38 {
39  return mId!=csCOUNT;
40 }
41 
42 bool operator==(const CoordinateSystem& lhs, const CoordinateSystem& rhs)
43 {
44  return ( lhs.mId==rhs.mId )&&( lhs.mRefObject==rhs.mRefObject );
45 }
46 
47 // --------------------------------------------------------
48 
49 
50 
51 } //namespace cx
COORDINATE_SYSTEM mId
the type of coordinate system
Identification of a Coordinate system.
QString mRefObject
for tool, sensor and data we need a object uid to define the coordinate system
bool operator==(const RegistrationTransform &lhs, const RegistrationTransform &rhs)
QString enum2string(const ENUM &val)
static CoordinateSystem fromString(QString text)
Namespace for all CustusX production code.