RMF
Toggle main menu visibility
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
{
23
class
ReferenceFrameConst
;
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.*/
36
CoordinateTransformer
() {};
37
/** Compose an outer CoordinateTransformer with the nested ReferenceFrame.*/
38
CoordinateTransformer
(
CoordinateTransformer
base,
39
decorator::ReferenceFrameConst
rb);
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 */
Vector.h
Represent coordinates.
RMF::CoordinateTransformer::get_translation
const Vector3 & get_translation() const
Definition
CoordinateTransformer.h:48
RMF::CoordinateTransformer::get_rotation
const Vector4 & get_rotation() const
Definition
CoordinateTransformer.h:52
RMF::CoordinateTransformer::CoordinateTransformer
CoordinateTransformer(CoordinateTransformer base, decorator::ReferenceFrameConst rb)
RMF::CoordinateTransformer::get_global_coordinates
Vector3 get_global_coordinates(const Vector3 &internal) const
Definition
CoordinateTransformer.h:43
RMF::CoordinateTransformer::CoordinateTransformer
CoordinateTransformer()
Definition
CoordinateTransformer.h:36
RMF::decorator::ReferenceFrameConst
Definition
physics.h:1071
compiler_macros.h
Various compiler workarounds.
infrastructure_macros.h
Various general useful macros for IMP.
RMF::decorator
See Decorators and Attributes for more information.
Definition
CoordinateTransformer.h:22
RMF
The namespace for all functionality in the library.
Definition
BufferConstHandle.h:21
RMF::Vector4
Vector< 4U > Vector4
Definition
types.h:50
RMF::Vector3
Vector< 3U > Vector3
Definition
types.h:48
RMF::CoordinateTransformers
std::vector< CoordinateTransformer > CoordinateTransformers
A list of them.
Definition
CoordinateTransformer.h:56