IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
Reflection3D.h
Go to the documentation of this file.
1/**
2 * \file IMP/algebra/Reflection3D.h \brief Reflect about a plane in 3D.
3 *
4 * Copyright 2007-2026 IMP Inventors. All rights reserved.
5 *
6 */
7
8#ifndef IMPALGEBRA_REFLECTION_3D_H
9#define IMPALGEBRA_REFLECTION_3D_H
10
11#include <IMP/algebra/algebra_config.h>
13#include "Plane3D.h"
14#include <cereal/access.hpp>
15
16IMPALGEBRA_BEGIN_NAMESPACE
17
18//! Reflect about a plane in 3D
19class Reflection3D : public GeometricPrimitiveD<3> {
20 Plane3D pl_;
21
22 friend class cereal::access;
23
24 template<class Archive> void serialize(Archive &ar) {
25 ar(pl_);
26 }
27
28 public:
29 Reflection3D() {}
30 Reflection3D(Plane3D pl) : pl_(pl) {}
31
32 Vector3D get_reflected(const Vector3D &v) const {
33 Vector3D p = pl_.get_projected(v);
34 return v + 2 * (p - v);
35 }
36 IMP_SHOWABLE_INLINE(Transformation3D, { out << pl_; });
37};
38
40
41IMPALGEBRA_END_NAMESPACE
42
43#endif /* IMPALGEBRA_REFLECTION_3D_H */
Base class for geometric types.
Simple 3D plane class.
Represent a plane in 3D.
Definition Plane3D.h:21
Reflect about a plane in 3D.
Simple 3D transformation class.
IMP::Vector< Reflection3D > Reflection3Ds
VectorD< 3 > Vector3D
Definition VectorD.h:407
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.