CustusX  22.04-rc5
An IGT application
cxMatrixBaseEigenAddons.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  * sscVector3DEigenAddons.h
14  *
15  * Plugin extension for the eigen::Vector3d type
16  *
17  * Usage:
18  * #define EIGEN_MATRIXBASE_PLUGIN "sscVector3DEigenAddons.h"
19  *
20  * Created on: Apr 10, 2011
21  * Author: christiana
22  */
23 
27 inline PlainObject normal() const
28 {
29  return this->normalized();
30 }
31 
35 inline RealScalar length() const
36 {
37  return this->norm();
38 }
39 
40 
44 static PlainObject fromString(const QString& text)
45 {
46  QStringList v = text.split(QRegExp("\\s+"), QString::SkipEmptyParts);
47  if (v.size() != 3)
48  return PlainObject(0, 0, 0);
49  return PlainObject(v[0].toDouble(), v[1].toDouble(), v[2].toDouble());
50 }
51 
PlainObject normal() const
RealScalar length() const