IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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>
14#include <cereal/access.hpp>
15#include <cereal/types/base_class.hpp>
16
17IMPCORE_BEGIN_NAMESPACE
18
19//! Apply a transformation to a passed particle
20/**
21 \see algebra::Transformation3D
22 */
23class 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
57IMPCORE_END_NAMESPACE
58#endif /* IMPCORE_TRANSFORM_H */
A Modifier on ParticlesTemp.
Simple 3D transformation class.
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Simple 3D transformation class.
Apply a transformation to a passed particle.
Definition Transform.h:23
Transform(const algebra::Transformation3D &t, bool ignore_non_xyz=false)
Initialize.
virtual void apply_index(Model *m, ParticleIndex p) const override
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
virtual ModelObjectsTemp do_get_outputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the outputs.
Index< ParticleIndexTag > ParticleIndex
Definition base_types.h:196
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Macros for various classes.
#define IMP_SINGLETON_MODIFIER_METHODS(Name)