COPASI API  4.16.103
CConfigurationFile.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2015 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2006 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #ifndef COPASI_CConfigurationFile
16 #define COPASI_CConfigurationFile
17 
19 #include "MIRIAM/CMIRIAMResource.h"
21 
22 class CMIRIAMResources;
23 
25 {
26  // Operations
27 public:
28  /**
29  * Default constructor
30  * @param const std::string & name (default: Recent Files)
31  * @param const CCopasiContainer * pParent (default: NULL)
32  */
33  CRecentFiles(const std::string & name = "Recent Files",
34  const CCopasiContainer * pParent = NULL);
35 
36  /**
37  * Copy constructor
38  * @param const CRecentFiles & src
39  * @param const CCopasiContainer * pParent (default: NULL)
40  */
41  CRecentFiles(const CRecentFiles & src,
42  const CCopasiContainer * pParent = NULL);
43 
44  /**
45  * Specific constructor
46  * @param const CCopasiParameterGroup & group
47  * @param const CCopasiContainer * pParent (default: NULL)
48  */
49  CRecentFiles(const CCopasiParameterGroup & group,
50  const CCopasiContainer * pParent = NULL);
51 
52  /**
53  * Destructor
54  */
55  virtual ~CRecentFiles();
56 
57  /**
58  * Add a file to the list of recent files
59  * @param const std::string & file
60  */
61  void addFile(const std::string & file);
62 
63 private:
64  /**
65  * Allocates all group parameters and assures that they are
66  * properly initialized.
67  */
68  void initializeParameter();
69 
70  // Attributes
71 private:
72  /**
73  * A pinter to the maximal number of recent files
74  */
75  unsigned C_INT32 * mpMaxFiles;
76 
77  /**
78  * A pointer to the list of recent files.
79  */
81 };
82 
84 {
85  // Operations
86 public:
87  /**
88  * Default constructor
89  * @param const std::string & name (default: Configuration)
90  * @param const CCopasiContainer * pParent (default: NULL)
91  */
92  CConfigurationFile(const std::string & name = "Configuration",
93  const CCopasiContainer * pParent = NULL);
94 
95  /**
96  * Copy constructor
97  * @param const CConfigurationFile & src
98  * @param const CCopasiContainer * pParent (default: NULL)
99  */
101  const CCopasiContainer * pParent = NULL);
102 
103  /**
104  * Specific constructor
105  * @param const CCopasiParameterGroup & group
106  * @param const CCopasiContainer * pParent (default: NULL)
107  */
109  const CCopasiContainer * pParent = NULL);
110 
111  /**
112  * Destructor
113  */
114  virtual ~CConfigurationFile();
115 
116  /**
117  * This methods must be called to elevate subgroups to
118  * derived objects. The default implementation does nothing.
119  * @return bool success
120  */
121  virtual bool elevateChildren();
122 
123  /**
124  * Save the configuration file.
125  * @return bool success
126  */
127  virtual bool save();
128 
129  /**
130  * Load the configuration file.
131  * @return bool success
132  */
133  virtual bool load();
134 
135  /**
136  * Retrieve the list of recent files
137  * @return CRecentFiles & recentFiles
138  */
140 
141  /**
142  * Retrieve the list of recent SBML files
143  * @return CRecentFiles & recentSBMLFiles
144  */
146 
147  //TODO SEDML
148  /**
149  * Retrieve the list of recent SEDML files
150  * @return CRecentFiles & recentSEDMLFiles
151  */
153 
154  /**
155  * Retrieve the list of recent MIRIAM Resources
156  * @return CMIRIAMResources & recentMIRIAMResources
157  */
159 
160  void setRecentMIRIAMResources(const CMIRIAMResources & miriamResources);
161 
162  /**
163  * Retrieve the application font.
164  * @return const std::string & applicationFont
165  */
166  const std::string getApplicationFont() const;
167 
168  /**
169  * Set the applications font.
170  * @param const std::string & applicationFont
171  */
172  void setApplicationFont(const std::string & applicationFont);
173 
174  /**
175  * Always perform unit validation
176  * @return a flag indicating whether unit validation should always be performed
177  */
178  bool validateUnits() const;
179 
180  /**
181  * Set whether unit validation should always be performed or not.
182  * @param bool validateUnits
183  */
184  void setValidateUnits(bool validateUnits);
185 
186  /**
187  * @return a flag on whether to use the open GL based rendering, or the Qt based one
188  */
189  bool useOpenGL() const;
190 
191  /**
192  * Set whether the openGL based rendering is to be used (true), or the Qt based one.
193  */
194  void setUseOpenGL(bool useOpenGL);
195 
196  /**
197  * @return a flag on whether the sliders should react to keyboard input / mouse
198  * interaction.
199  */
200  bool useAdvancedSliders() const;
201 
202  /**
203  * Set whether the sliders should react to keyboard input / mouse
204  * interaction.
205  */
206  void setUseAdvancedSliders(bool useAdvancedSliders);
207 
208  /**
209  * @return a flag on whether to use the advanced expression editing (i.e manually entering copasiobjects)
210  */
211  bool useAdvancedEditing() const;
212 
213  /**
214  * Set whether the advanced expression editing (i.e manually entering copasiobjects) is to be used (true), or not
215  */
216  void setUseAdvancedEditing(bool useAdvancedEditing);
217 
218  /**
219  * @return a flag on whether weights in Parameter Estimation should be normalized per experiment
220  */
221  bool normalizePerExperiment() const;
222 
223  /**
224  * Set whether weights in Parameter Estimation should be normalized per experiment
225  */
226  void setNormalizePerExperiment(bool flag);
227 
228  /**
229  * Retrieve the web working directory
230  * @return const std::string & workingDirectory
231  */
232  const std::string getWorkingDirectory() const;
233 
234  /**
235  * Set the working directory.
236  * @param const std::string & workingDirectory
237  */
238  void setWorkingDirectory(const std::string & workingDirectory);
239 
240 private:
241  /**
242  * Allocates all group parameters and assures that they are
243  * properly initialized.
244  */
245  void initializeParameter();
246 
247  // Attributes
248 private:
249  /**
250  * Class dealing with the loading and writing of the XML configuration
251  * file.
252  */
253  class CXML : public CCopasiXMLInterface
254  {
255  // Operations
256  public:
257  /**
258  * Constructor
259  */
260  CXML();
261 
262  /**
263  * Destructor
264  */
265  ~CXML();
266 
267  /**
268  * Save information to a given ostream.
269  * @param std::ostream & os
270  * @param const std::string & relativeTo
271  * @return bool success
272  */
273  virtual bool save(std::ostream & os,
274  const std::string & relativeTo);
275 
276  /**
277  * Load information from a given istream.
278  * @param std::istream & is
279  * @param const std::string & relativeTo
280  * @return bool success
281  */
282  virtual bool load(std::istream & is,
283  const std::string & relativeTo);
284 
285  /**
286  * Set the configuration contents
287  * @param const CConfigurationFile & configuration
288  */
289  void setConfiguration(const CCopasiParameterGroup & configuration);
290 
291  /**
292  * Retrieve the configuration contents
293  * @return const CConfigurationFile & configuration
294  */
295  const CCopasiParameterGroup & getConfiguration() const;
296 
297  // Attributes
298  private:
299  /**
300  * A pointer to the CCopasiParameterGroup containing the information
301  */
303  };
304 
305  /**
306  * A pointer to the list of recent files
307  */
309 
310  /**
311  * A pointer to the list of recent files
312  */
314 
315  //TODO SEDML
316  /**
317  * A pointer to the list of recent files
318  */
320 
321  /**
322  * A pointer to the list of MIRIAM Resources
323  */
325 
326  /**
327  * A pointer to the application font
328  */
329  std::string * mpApplicationFont;
330 
331  /**
332  * A pointer indicating whether units will always be validated
333  */
335 
336  /**
337  * A pointer indicating whether to use the OpenGL rendering, or the Qt based one
338  */
339  bool *mpUseOpenGL;
340 
341  /**
342  * A pointer indicating whether the sliders should react to keyboard input / mouse
343  * interaction.
344  */
346 
347  /**
348  * A pointer indicating whether to use the advanced editing
349  */
351 
352  /**
353  * A pointer indicating whether to experiments should be normalized by default
354  */
356 
357  /**
358  * A pointer to the last used working directory of the GUI.
359  */
360  std::string * mpWorkingDirectory;
361 };
362 
363 #endif // COPASI_CConfigurationFile
CCopasiParameterGroup * mpRecentFiles
std::string * mpApplicationFont
unsigned C_INT32 * mpMaxFiles
const CCopasiParameterGroup & getConfiguration() const
const std::string getWorkingDirectory() const
void setUseAdvancedSliders(bool useAdvancedSliders)
virtual bool save(std::ostream &os, const std::string &relativeTo)
const std::string getApplicationFont() const
void setUseAdvancedEditing(bool useAdvancedEditing)
CRecentFiles & getRecentFiles()
std::string * mpWorkingDirectory
void setUseOpenGL(bool useOpenGL)
CRecentFiles * mpRecentSEDMLFiles
#define C_INT32
Definition: copasi.h:90
bool normalizePerExperiment() const
void setWorkingDirectory(const std::string &workingDirectory)
bool useAdvancedSliders() const
CMIRIAMResources & getRecentMIRIAMResources()
bool useAdvancedEditing() const
void addFile(const std::string &file)
CRecentFiles * mpRecentFiles
CRecentFiles & getRecentSBMLFiles()
void setValidateUnits(bool validateUnits)
CRecentFiles & getRecentSEDMLFiles()
void setApplicationFont(const std::string &applicationFont)
CCopasiParameterGroup mConfiguration
CRecentFiles(const std::string &name="Recent Files", const CCopasiContainer *pParent=NULL)
virtual bool load(std::istream &is, const std::string &relativeTo)
void setRecentMIRIAMResources(const CMIRIAMResources &miriamResources)
virtual bool elevateChildren()
long int flag
Definition: f2c.h:52
CMIRIAMResources * mpRecentMIRIAMResources
virtual ~CRecentFiles()
void setConfiguration(const CCopasiParameterGroup &configuration)
void setNormalizePerExperiment(bool flag)
CConfigurationFile(const std::string &name="Configuration", const CCopasiContainer *pParent=NULL)
CRecentFiles * mpRecentSBMLFiles