Xmipp  v3.23.11-Nereus
metadata_generator.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: J.M. de la Rosa Trevin (jmdelarosa@cnb.csic.es)
4  * Jan Horacek (xhorace4@fi.muni.cz)
5  *
6  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21  * 02111-1307 USA
22  *
23  * All comments concerning this program package may be sent to the
24  * e-mail address 'xmipp@cnb.csic.es'
25  ***************************************************************************/
26 
27 #ifndef CORE_METADATA_GENERATOR_H
28 #define CORE_METADATA_GENERATOR_H
29 
30 #include "metadata_base.h"
31 
34 public:
35  MDLabel label; //label to which generate values
36 
37  /* Destructor*/
39  {}
40 
41  /* Method to be implemented in concrete generators */
42  virtual void fillValue(MetaData &md, size_t objId) = 0;
43  /* Fill whole metadata */
44  void fill(MetaData &md);
45 };//end of class MDValueGenerator
46 
49 
52 protected:
53  double op1, op2, op3;
55 
56  inline double getRandValue();
57 public:
58  MDRandGenerator(double op1, double op2, const String &mode, double op3=0.);
59  void fillValue(MetaData &md, size_t objId);
60 };//end of class MDRandGenerator
61 
64 public:
66 
67  MDConstGenerator(const String &value);
68  void fillValue(MetaData &md, size_t objId);
69 };//end of class MDConstGenerator
70 
71 #ifdef NEVERDEFINED
72 
73 class MDExpandGenerator: public MDValueGenerator {
74 public:
75  MetaData expMd;
76  FileName fn;
77  MDRow row;
78 
79  void fillValue(MetaData &md, size_t objId);
80 };//end of class MDExpandGenerator
81 #endif
82 
85 public:
86  double initValue, step;
87  size_t counter;
88 
89  MDLinealGenerator(double initial, double step);
90  void fillValue(MetaData &md, size_t objId);
91 };//end of class MDExpandGenerator
92 
93 
96 #endif
virtual void fillValue(MetaData &md, size_t objId)=0
std::string String
Definition: xmipp_strings.h:34
virtual ~MDValueGenerator()
MDLabel
void fill(MetaData &md)