Fraxinus  16.5.0-fx-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxFrame3D.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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 #ifndef CXFRAME3D_H_
34 #define CXFRAME3D_H_
35 
36 #include "cxResourceExport.h"
37 #include "cxPrecompiledHeader.h"
38 
39 #include "cxTransform3D.h"
40 
41 // --------------------------------------------------------
42 namespace cx
43 {
44 
61 class cxResource_EXPORT DecomposedTransform3D
62 {
63 public:
66  void reset(Transform3D m);
67  void setAngles(Vector3D xyz);
68  void setPosition(Vector3D pos);
69  Vector3D getAngles() const;
70  Vector3D getPosition() const;
71  Transform3D getMatrix() const;
72 private:
73  Vector3D mAngle;
74  Vector3D mPos;
75  Transform3D m_R;
76 };
77 
90 class cxResource_EXPORT Frame3D
91 {
92 public:
93  static Frame3D create(const Transform3D& transform);
94  Transform3D transform() const;
95  Vector3D rotationAxis() const;
96  void setRotationAxis(const Vector3D& k);
97  void put(std::ostream& s) const;
98  void test();
99 
100  boost::array<double, 6> getCompactAxisAngleRep() const;
101  static Frame3D fromCompactAxisAngleRep(const boost::array<double, 6>& rep);
102 
103  Vector3D getEulerXYZ() const;
104  void setEulerXYZ(const Vector3D& xyz);
105 
106  Frame3D();
107  virtual ~Frame3D();
108 
109  Eigen::AngleAxisd mAngleAxis;
111 
112 private:
113 };
114 
115 cxResource_EXPORT std::ostream& operator<<(std::ostream& s, const Frame3D& t);
116 
121 } // namespace cx
122 // --------------------------------------------------------
123 
124 #endif /*CXFRAME3D_H_*/
DoubleBoundingBox3D transform(const Transform3D &m, const DoubleBoundingBox3D &bb)
Helper class for visualizing rotational angles to a human user.
Definition: cxFrame3D.h:61
std::ostream & put(const Eigen::Affine3d *self, std::ostream &s, int indent, char newline)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Defines an axis-angle representation of a position+orientation in 3D space.
Definition: cxFrame3D.h:90
Vector3D mPos
position
Definition: cxFrame3D.h:110
std::ostream & operator<<(std::ostream &s, const IntBoundingBox3D &data)
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:63
Eigen::AngleAxisd mAngleAxis
angle-axis representation of rotation
Definition: cxFrame3D.h:109