RMF
CoordinateTransformer.h
Go to the documentation of this file.
1 /**
2  * \file RMF/CoordinateTransformer.h
3  * \brief Declare the RMF::CoordinateTransformer class.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef RMF_COORDINATE_TRANSFORMER_H
10 #define RMF_COORDINATE_TRANSFORMER_H
11 
12 #include <vector>
13 
14 #include "RMF/Vector.h"
15 #include "RMF/compiler_macros.h"
16 #include "RMF/config.h"
17 #include "RMF/internal/Transform.h"
18 #include "infrastructure_macros.h"
19 
20 RMF_ENABLE_WARNINGS
21 namespace RMF {
22 namespace decorator {
24 }
25 
26 //! Transform coordinates into the global reference frame
27 /** Transform coordinates into the global reference frame from
28  a nested one.
29  */
30 class RMFEXPORT CoordinateTransformer {
31  internal::Transform transform_;
32 
33  public:
34  /** Create one with the default reference frame, so the points aren't
35  transformed at all.*/
37  /** Compose an outer CoordinateTransformer with the nested ReferenceFrame.*/
40  RMF_SHOWABLE(CoordinateTransformer, transform_);
41  /** Return the global coordinates for a given set of internal coordinates.
42  */
43  Vector3 get_global_coordinates(const Vector3& internal) const {
44  return transform_.get_transformed(internal);
45  }
46 
47  /** Return the translational component of the transformation.*/
48  const Vector3& get_translation() const {
49  return transform_.get_translation();
50  }
51  /** Return the rotational component of the transformation as a quaternion.*/
52  const Vector4& get_rotation() const { return transform_.get_rotation(); }
53 };
54 
55 //! A list of them
56 typedef std::vector<CoordinateTransformer> CoordinateTransformers;
57 
58 } /* namespace RMF */
59 
60 RMF_DISABLE_WARNINGS
61 
62 #endif /* RMF_COORDINATE_TRANSFORMER_H */
const Vector4 & get_rotation() const
Transform coordinates into the global reference frame.
const Vector3 & get_translation() const
std::vector< CoordinateTransformer > CoordinateTransformers
A list of them.
Vector3 get_global_coordinates(const Vector3 &internal) const
Represent coordinates.
Various compiler workarounds.
Various general useful macros for IMP.