COPASI API  4.16.103
CPlotItem.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/plot/CPlotItem.h,v $
3  $Revision: 1.18 $
4  $Name: $
5  $Author: ssahle $
6  $Date: 2012/05/02 23:41:49 $
7  End CVS Header */
8 
9 // Copyright (C) 2012 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 /**
19  *
20  */
21 
22 #ifndef COPASI_PLOT_ITEM
23 #define COPASI_PLOT_ITEM
24 
25 #include <string>
26 #include <vector>
27 #include "copasi.h"
28 
32 
33 #undef min
34 #undef max
35 
37 {
38 public:
39  /**
40  * Minimum value of the data in this channel
41  */
43 
44  /**
45  * Maximum value of the data in this channel
46  */
48 
49  /**
50  * Should autoscaling be attempted?
51  */
54 
57  min(0.0),
58  max(0.0),
59  minAutoscale(true),
60  maxAutoscale(true)
61  {}
62 
64  : CRegisteredObjectName(obj),
65  min(0.0),
66  max(0.0),
67  minAutoscale(true),
68  maxAutoscale(true)
69  {}
70 
72  : CRegisteredObjectName(obj),
73  min(minimum),
74  max(maximum),
75  minAutoscale(false),
76  maxAutoscale(false)
77  {}};
78 
79 //****************************************************************************************
80 
82 {
83 public:
84  /**
85  * Enumeration of the sub types of methods known to COPASI.
86  */
87  enum Type
88  {
89  unset = 0, curve2d, histoItem1d, //for plot items
92  plot2d, simWiz //for plot specifications
93  };
94 
95  /**
96  * String literals for the GUI to display plot item names of methods known
97  * to COPASI.
98  */
99  static const std::string TypeName[];
100 
101  /**
102  * XML sub type names of methods known to COPASI.
103  */
104  static const char * XMLType[];
105 
106  /**
107  * String literals for the GUI to display recording activity names of plots known
108  * to COPASI.
109  */
110  static const std::string RecordingActivityName[];
111 
112  /**
113  * XML recording activity names of plots known to COPASI.
114  */
115  static const char* XMLRecordingActivity[];
116 
117  // Attributes
118 private:
119 
120  /**
121  * The type of the method
122  */
124 
125  /**
126  * The recording activity for items of type curve2d and histoItem1d
127  */
129 
130  /**
131  * A pointer to the string containing the XML representation of the activity
132  */
133  std::string * mpXMLActivity;
134 
135  std::vector<CPlotDataChannelSpec> channels;
136 
137  /**
138  * Initialize the contained CCopasiObjects
139  */
140  void initObjects();
141 
142 public:
143  CPlotItem(const std::string & name = "NoName",
144  const CCopasiContainer * pParent = NULL,
145  const Type & type = curve2d);
146 
147  CPlotItem(const CPlotItem & src,
148  const CCopasiContainer * pParent = NULL);
149 
150  /**
151  * Destructor
152  */
153  virtual ~CPlotItem();
154 
155  void cleanup();
156 
157  /**
158  * Retrieve the type of the method
159  */
160  const CPlotItem::Type & getType() const;
161 
162  void setType(CPlotItem::Type type);
163 
164  void setActivity(const COutputInterface::Activity & activity);
165 
166  const COutputInterface::Activity & getActivity() const;
167 
168  const std::string & getTitle() const; //TODO later replace with something more generic
169  void setTitle(const std::string & title);
170 
171  std::vector<CPlotDataChannelSpec> & getChannels();
172  const std::vector<CPlotDataChannelSpec> & getChannels() const;
173  size_t getNumChannels() const;
174  void addChannel(const CPlotDataChannelSpec & channel);
175 };
176 
177 #endif
CPlotItem(const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const Type &type=curve2d)
Definition: CPlotItem.cpp:75
std::string * mpXMLActivity
Definition: CPlotItem.h:133
std::vector< CPlotDataChannelSpec > channels
Definition: CPlotItem.h:135
virtual ~CPlotItem()
Definition: CPlotItem.cpp:147
void addChannel(const CPlotDataChannelSpec &channel)
Definition: CPlotItem.cpp:223
std::vector< CPlotDataChannelSpec > & getChannels()
Definition: CPlotItem.cpp:214
size_t getNumChannels() const
Definition: CPlotItem.cpp:220
void setActivity(const COutputInterface::Activity &activity)
Definition: CPlotItem.cpp:161
void initObjects()
Definition: CPlotItem.cpp:155
Type mType
Definition: CPlotItem.h:123
CPlotDataChannelSpec(const CCopasiObjectName &obj)
Definition: CPlotItem.h:63
static const char * XMLType[]
Definition: CPlotItem.h:104
void setType(CPlotItem::Type type)
Definition: CPlotItem.cpp:99
COutputInterface::Activity mActivity
Definition: CPlotItem.h:128
static const std::string RecordingActivityName[]
Definition: CPlotItem.h:110
const CPlotItem::Type & getType() const
Definition: CPlotItem.cpp:158
const COutputInterface::Activity & getActivity() const
Definition: CPlotItem.cpp:179
void cleanup()
Definition: CPlotItem.cpp:150
#define C_FLOAT64
Definition: copasi.h:92
static const char * XMLRecordingActivity[]
Definition: CPlotItem.h:115
CPlotDataChannelSpec(const CCopasiObjectName &obj, C_FLOAT64 minimum, C_FLOAT64 maximum)
Definition: CPlotItem.h:71
const std::string & getTitle() const
Definition: CPlotItem.cpp:228
void setTitle(const std::string &title)
Definition: CPlotItem.cpp:233
static const std::string TypeName[]
Definition: CPlotItem.h:99