COPASI API  4.16.103
COutputAssistant.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 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) 2005 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #ifndef COPASI_COutputAssistant
16 #define COPASI_COutputAssistant
17 
18 #include <vector>
19 #include <string>
20 #include <map>
21 #include "copasi.h"
22 
23 #include "utilities/CCopasiTask.h"
24 
25 class CPlotSpecification;
26 class CReportDefinition;
27 class CCopasiObject;
28 class CCopasiDataModel;
29 
31 {
32 public:
33 
35  name(""),
36  description(""),
37  isPlot(true),
38  mTaskType(CCopasiTask::steadyState),
40  {}
41 
42  //C_INT32 id;
43  std::string name;
44  std::string description;
45  bool isPlot;
48 };
49 
51 {
52 public:
53 
54  /**
55  * get a list of indices of output definitions that are
56  * suitable for the problem.
57  * If problem=NULL (default) all indices in the map are returned.
58  */
59  static
60  std::vector<C_INT32> getListOfDefaultOutputDescriptions(const CCopasiTask * task = NULL);
61 
62  /**
63  * get an index of a default output report that is
64  * recommended for the given problem.
65  * If no such report exists, -1 is returned
66  */
67  static
69 
70  /**
71  * get an index of a default plot that is
72  * recommended for the given problem.
73  * If no such plot exists, -1 is returned
74  */
75  static
77 
78  /**
79  * get title of output definition with index id.
80  */
81  static
82  const std::string & getItemName(C_INT32 id);
83 
84  /**
85  * get complete description of output definition with index id.
86  */
87  static
89 
90  /**
91  * create a plot or report from template with index id.
92  * returns a pointer to the plot or report definition (or NULL)
93  * if activate==true and the ouput is a report the report is set as
94  * the current report for the task (possibly replacing an already set report)
95  */
96  static
97  CCopasiObject* createDefaultOutput(C_INT32 id, CCopasiTask * task, CCopasiDataModel* pDataModel, bool activate = true);
98 
99 private: //************************************
100 
101  typedef std::map<C_INT32, CDefaultOutputDescription> Map;
102 
103  static
105 
106  //this method creates the lists of output descriptions
107  static
108  bool initialize();
109 
110  static
111  CPlotSpecification* createPlot(const std::string & name,
112  const CCopasiObject* x,
113  bool logX,
114  const std::vector<const CCopasiObject*> & y,
115  bool logY,
116  const CCopasiTask::Type & taskType,
117  CCopasiDataModel* pDataModel,
118  CCopasiTask *task = NULL);
119 
120  static
121  CReportDefinition* createTable(const std::string & name,
122  const std::vector<const CCopasiObject*> & d,
123  const std::string & comment,
124  const CCopasiTask::Type & taskType,
125  CCopasiDataModel* pDataModel);
126 
127  static const std::string emptyString;
129 };
130 
131 #endif
static bool initialize()
static CReportDefinition * createTable(const std::string &name, const std::vector< const CCopasiObject * > &d, const std::string &comment, const CCopasiTask::Type &taskType, CCopasiDataModel *pDataModel)
static C_INT32 getDefaultReportIndex(const CCopasiProblem *problem)
static CPlotSpecification * createPlot(const std::string &name, const CCopasiObject *x, bool logX, const std::vector< const CCopasiObject * > &y, bool logY, const CCopasiTask::Type &taskType, CCopasiDataModel *pDataModel, CCopasiTask *task=NULL)
static C_INT32 getDefaultPlotIndex(const CCopasiProblem *problem)
static const std::string & getItemName(C_INT32 id)
std::map< C_INT32, CDefaultOutputDescription > Map
static CCopasiObject * createDefaultOutput(C_INT32 id, CCopasiTask *task, CCopasiDataModel *pDataModel, bool activate=true)
#define C_INT32
Definition: copasi.h:90
static std::vector< C_INT32 > getListOfDefaultOutputDescriptions(const CCopasiTask *task=NULL)
static const std::string emptyString
CCopasiTask::Type mSecondaryTask
CCopasiTask::Type mTaskType
static const CDefaultOutputDescription & getItem(C_INT32 id)
static const CDefaultOutputDescription emptyItem