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"
19
20RMF_ENABLE_WARNINGS
21namespace RMF {
22namespace 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 */
30class 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
56typedef std::vector<CoordinateTransformer> CoordinateTransformers;
57
58} /* namespace RMF */
59
60RMF_DISABLE_WARNINGS
61
62#endif /* RMF_COORDINATE_TRANSFORMER_H */
Represent coordinates.
const Vector3 & get_translation() const
const Vector4 & get_rotation() const
CoordinateTransformer(CoordinateTransformer base, decorator::ReferenceFrameConst rb)
Vector3 get_global_coordinates(const Vector3 &internal) const
Various compiler workarounds.
Various general useful macros for IMP.
See Decorators and Attributes for more information.
The namespace for all functionality in the library.
Vector< 4U > Vector4
Definition types.h:50
Vector< 3U > Vector3
Definition types.h:48
std::vector< CoordinateTransformer > CoordinateTransformers
A list of them.