IMP logo
IMP Reference Guide  2.20.2
The Integrative Modeling Platform
Transform.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/Transform.h \brief Transform a particle
3  *
4  * Copyright 2007-2022 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPCORE_TRANSFORM_H
9 #define IMPCORE_TRANSFORM_H
10 #include <IMP/core/core_config.h>
12 #include <IMP/SingletonModifier.h>
13 #include <IMP/singleton_macros.h>
14 #include <cereal/access.hpp>
15 #include <cereal/types/base_class.hpp>
16 
17 IMPCORE_BEGIN_NAMESPACE
18 
19 //! Apply a transformation to a passed particle
20 /**
21  \see algebra::Transformation3D
22  */
23 class IMPCOREEXPORT Transform : public SingletonModifier {
24  public:
25  //! Initialize
26  /**
27  \param[in] t a 3d transformation to be applied on a particle
28  \param[in] ignore_non_xyz if false then applying the transformation
29  on a non XYZ particle will result in an exception.
30  */
31  Transform(const algebra::Transformation3D &t, bool ignore_non_xyz = false);
32 
33  Transform() {}
34 
35  virtual void apply_index(Model *m, ParticleIndex p) const
36  override;
38  Model *m, const ParticleIndexes &pis) const override;
40  Model *m, const ParticleIndexes &pis) const override;
43  ;
44 
45  private:
47  bool ignore_non_xyz_;
48 
49  friend class cereal::access;
50  template<class Archive> void serialize(Archive &ar) {
51  ar(cereal::base_class<SingletonModifier>(this), t_, ignore_non_xyz_);
52  }
54 
55 };
56 
57 IMPCORE_END_NAMESPACE
58 #endif /* IMPCORE_TRANSFORM_H */
A base class for modifiers of ParticlesTemp.
A Modifier on ParticlesTemp.
Simple 3D transformation class.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Macros for various classes.
virtual ModelObjectsTemp do_get_outputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the outputs.
A more IMP-like version of the std::vector.
Definition: Vector.h:42
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
#define IMP_SINGLETON_MODIFIER_METHODS(Name)
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition: object_macros.h:95
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
Apply a transformation to a passed particle.
Definition: Transform.h:23
Simple 3D transformation class.
virtual void apply_index(Model *m, ParticleIndex v) const =0