IMP logo
IMP Reference Guide  2.10.0
The Integrative Modeling Platform
SlabWithCylindricalPore.h
Go to the documentation of this file.
1 /**
2  * \file IMP/npctransport/SlabWithCylindricalPore.h
3  * \brief A decorator for a particle that's a slab with a cylindrical pore.
4  *
5  * Copyright 2007-2018 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPNPCTRANSPORT_SLAB_WITH_CYLINDRICAL_PORE_H
10 #define IMPNPCTRANSPORT_SLAB_WITH_CYLINDRICAL_PORE_H
11 
12 #include "npctransport_config.h"
13 #include "SlabWithPore.h"
14 #include <IMP/Decorator.h>
15 #include <IMP/decorator_macros.h>
16 
17 IMPNPCTRANSPORT_BEGIN_NAMESPACE
18 
19 //! A decorator for a particle that represents a slab containing
20 //! a cylindrical pore
21 /** \ingroup helper
22  \ingroup decorators
23  */
24 class IMPNPCTRANSPORTEXPORT SlabWithCylindricalPore
25 : public SlabWithPore
26 {
27  /** Decorate a particle that represents a slab (e.g. nuclear
28  envelope) with specified thickness and a cylindrical pore of
29  specified radius. Note that the radius is controlled by set_radius()
30  as any other XYZR particle, but the XYZ coordinates are ignored for now
31  (assumed to be 0,0,0).
32 
33  The slab is parallel to the x,y plain from z=-0.5*thickness to
34  z=0.5*thickness, and the central axis of the pore lies on the
35  origin.
36 
37  @param m the model
38  @param pi the particle index
39  @param thickness slab thickness
40  @param radius pore radius
41  */
42  static void do_setup_particle(IMP::Model* m,
43  ParticleIndex pi,
44  double thickness,
45  double radius);
46 
47 
48  public:
50 
51 
52  /** Decorate a particle that represents a slab (e.g. nuclear
53  envelope) with specified thickness and a cylindrical pore of
54  specified radius.
55 
56  The slab is parallel to the x,y plain from z=-0.5*thickness to
57  z=0.5*thickness, and the central axis of the pore lies on the
58  origin.
59 
60  @param m the model
61  @param pi the particle index
62  @param thickness slab thickness
63  @param radius pore radius
64  */
66  double, thickness,
67  double, radius);
68 
69  //! Return true if the particle is an instance of SlabWithCylindricalPore
70  static bool get_is_setup(Model *m, ParticleIndex pi) {
71  return SlabWithPore::get_is_setup(m, pi) &&
72  m->get_has_attribute(get_cylindrical_pore_key(), pi);
73  }
74 
75  //! Get the decorator key indicating a cylindrical pore
76  static IntKey get_cylindrical_pore_key();
77 };
78 
79 
80 
81 IMP_DECORATORS(SlabWithCylindricalPore, SlabsWithCylindricalPores, IMP::SlabsWithPores);
82 
83 IMPNPCTRANSPORT_END_NAMESPACE
84 
85 #endif /* IMPNPCTRANSPORT_SLAB_WITH_CYLINDRICAL_PORE_H */
The base class for decorators.
static bool get_is_setup(Model *m, ParticleIndex pi)
Return true if the particle is an instance of SlabWithCylindricalPore.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Various general useful macros for IMP.
#define IMP_DECORATOR_SETUP_2(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name)
#define IMP_DECORATOR_METHODS(Name, Parent)
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
A decorator for a particle that's a slab with a cylindrical pore.
bool get_has_attribute(TypeKey attribute_key, ParticleIndex particle) const
return true if particle has attribute with the specified key