IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
DecayModifier.h
Go to the documentation of this file.
1 /**
2  * \file IMP/bff/DecayModifier.h
3  * \brief Simple Accessible Volume decorator.
4  *
5  * \authors Thomas-Otavio Peulen
6  * Copyright 2007-2022 IMP Inventors. All rights reserved.
7  */
8 
9 #ifndef IMPBFF_DECAYMODIFIER_H
10 #define IMPBFF_DECAYMODIFIER_H
11 
12 #include <IMP/bff/bff_config.h>
13 #include <memory>
14 #include <limits>
15 #include <IMP/bff/DecayRange.h>
16 #include <IMP/bff/DecayCurve.h>
17 
18 IMPBFF_BEGIN_NAMESPACE
19 
20 /**
21  * \class DecayModifier
22  * \brief A decorator that modifies a DecayCurve within a specified range.
23  *
24  * The DecayModifier class is a decorator that modifies a DecayCurve object
25  * within a specified range. It is used to apply modifications to the decay
26  * behavior of a DecayCurve. The modifications are applied by the `add` method,
27  * which modifies the input DecayCurve object.
28  */
29 class IMPBFFEXPORT DecayModifier : public DecayRange {
30 
31 private:
32  bool _is_active = true;
33 
34 protected:
35  DecayCurve* data = nullptr;
36  DecayCurve* default_data = nullptr;
37 
38 public:
39  /**
40  * Set the DecayCurve object to be modified.
41  * \param v The DecayCurve object to be modified.
42  */
43  virtual void set_data(DecayCurve* v);
44 
45  /**
46  * Get the DecayCurve object being modified.
47  * \return The DecayCurve object being modified.
48  */
49  virtual DecayCurve* get_data();
50 
51  /**
52  * Check if the DecayModifier is active.
53  * \return True if the DecayModifier is active, false otherwise.
54  */
55  bool is_active() const;
56 
57  /**
58  * Set the activity status of the DecayModifier.
59  * \param v The activity status of the DecayModifier.
60  */
61  void set_active(bool v);
62 
63  /**
64  * Set the values of the DecayModifier.
65  * \param data The DecayModifier data.
66  * \param start The start of the DecayModifier.
67  * \param stop The stop of the DecayModifier.
68  * \param active If true, the DecayModifier modifies the input decay.
69  */
70  void set(DecayCurve* data, int start=0, int stop=-1, bool active = true);
71 
72  /**
73  * Resize the data of the DecayModifier.
74  * \param n The new size of the data.
75  * \param v The value of the data (if larger than the original size).
76  */
77  void resize(size_t n, double v = 0.0);
78 
79  /**
80  * Modify the DecayCurve object.
81  * \param out The DecayCurve object to be modified.
82  */
83  virtual void add(DecayCurve* out) = 0;
84 
85  /**
86  * Construct a DecayModifier object.
87  * \param data The DecayCurve object to be modified.
88  * \param start The start of the DecayModifier.
89  * \param stop The stop of the DecayModifier.
90  * \param active If true, the DecayModifier is active.
91  */
92  DecayModifier(DecayCurve *data = nullptr,
93  int start = 0, int stop = -1, bool active = true);
94 
95  /**
96  * Destructor.
97  */
99  delete default_data;
100  }
101 };
102 
104 
105 IMPBFF_END_NAMESPACE
106 
107 #endif // IMPBFF_DECAYMODIFIER_H
void set(int start=0, int stop=-1)
Set the start and stop indices of the decay range.
A decorator that modifies a DecayCurve within a specified range.
Definition: DecayModifier.h:29
A more IMP-like version of the std::vector.
Definition: Vector.h:50
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
Represents an inspected range of fluorescence decay.
Definition: DecayRange.h:33
Defines inspected range of fluorescence decay.
Class for fluorescence decay curves.
Class for fluorescence decay curves.
Definition: DecayCurve.h:38