COPASI API  4.16.103
CLRenderInformationBase.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layout/CLRenderInformationBase.h,v $
3 // $Revision: 1.4 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/09/30 16:35:20 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 - 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 #ifndef CLRenderInformationBase_H__
15 #define CLRenderInformationBase_H__
16 
17 #include <string>
18 
19 #include "copasi/layout/CLBase.h"
25 
27 
28 class RenderInformationBase;
29 
31 {
32 private:
33  // prevent the compiler from generating the assignment operator
35 
36 protected:
37  // id is inherited from SBase
39  std::string mBackgroundColor;
43 
44  /**
45  * key string for the render information.
46  */
47  std::string mKey;
48 
49  /**
50  * The name of the render information, which is more informative
51  * than the key.
52  */
53  std::string mName;
54 
55 public:
56  /**
57  * Constructor.
58  */
59  CLRenderInformationBase(const std::string& name, CCopasiContainer* pParent = NULL);
60 
61  /**
62  * Copy constructor.
63  */
65 
66  /**
67  * Constructor to generate object from the corresponding SBML object.
68  */
69  CLRenderInformationBase(const RenderInformationBase& source,
70  const std::string& name,
71  /*
72  std::map<std::string,std::string>& colorIdToKeyMap,
73  std::map<std::string,std::string>& gradientIdToKeyMap,
74  std::map<std::string,std::string>& lineEndingIdToKeyMap,
75  */
76  CCopasiContainer* pParent = NULL);
77 
78  /**
79  * Destructor
80  */
82 
83  /**
84  * Returns the key of the referenced render information object..
85  */
86  const std::string& getReferenceRenderInformationKey() const;
87 
88  /**
89  * Sets the key of the referenced render information object.
90  */
91  void setReferenceRenderInformationKey(const std::string& key);
92 
93  /**
94  * Returns the number of color definitions.
95  */
96  size_t getNumColorDefinitions() const;
97 
98  /**
99  * Returns a pointer to the list of color definitions.
100  */
102 
103  /**
104  * Returns a const pointer to the list of color definitions.
105  */
107 
108  /**
109  * Returns a pointer to the color definition with the given index, or NULL
110  *if the index is invalid.
111  */
112  CLColorDefinition* getColorDefinition(size_t index);
113 
114  /**
115  * Returns a const pointer to the color definition with the given index, or NULL
116  *if the index is invalid.
117  */
118  const CLColorDefinition* getColorDefinition(size_t index) const;
119 
120  /**
121  * Creates a new color definition.
122  */
124 
125  /**
126  * Removes the color definition with the given index.
127  */
128  void removeColorDefinition(size_t index);
129 
130  /**
131  * Adds a copy of the given color definition to the end of the list of
132  * color definitions.
133  */
134  void addColorDefinition(const CLColorDefinition* cd);
135 
136  /**
137  * Returns the number of gradient definitions.
138  */
139  size_t getNumGradientDefinitions() const;
140 
141  /**
142  * Returns a pointer to the list of gradient definitions.
143  */
145 
146  /**
147  * Returns a const pointer to the list of gradient definitions.
148  */
150 
151  /**
152  * Returns a pointer to the gradient definition with the given index, or NULL
153  *if the index is invalid.
154  */
155  CLGradientBase* getGradientDefinition(size_t index);
156 
157  /**
158  * Returns a const pointer to the gradient definition with the given index, or NULL
159  *if the index is invalid.
160  */
161  const CLGradientBase* getGradientDefinition(size_t index) const;
162 
163  /**
164  * Creates a new linear gradient definition.
165  */
167 
168  /**
169  * Creates a new radial gradient definition.
170  */
172 
173  /**
174  * Removes the gradient definition with the given index.
175  */
176  void removeGradientDefinition(size_t index);
177 
178  /**
179  * Adds a copy of the given gradient definition to the end of the list of
180  * gradient definitions.
181  */
182  void addGradientDefinition(const CLGradientBase* gradient);
183 
184  /**
185  * Returns the number of line endings.
186  */
187  size_t getNumLineEndings() const;
188 
189  /**
190  * Returns a pointer to the list of line endings.
191  */
193 
194  /**
195  * Returns a const pointer to the list of line endings.
196  */
198 
199  /**
200  * Returns a pointer to the line ending with the given index, or NULL
201  *if the index is invalid.
202  */
203  CLLineEnding* getLineEnding(size_t index);
204 
205  /**
206  * Returns a const pointer to the line ending with the given index, or NULL
207  *if the index is invalid.
208  */
209  const CLLineEnding* getLineEnding(size_t index) const;
210 
211  /**
212  * Creates a new line ending.
213  */
215 
216  /**
217  * Removes the line ending with the given index.
218  */
219  void removeLineEnding(size_t index);
220 
221  /**
222  * Adds a copy of the given line ending to the end of the list of line
223  *endings.
224  */
225  void addLineEnding(const CLLineEnding* le);
226 
227  /**
228  * Returns the background color which is either the id of a color in the
229  * list of color definitions, or a color value.
230  */
231  const std::string& getBackgroundColor() const;
232 
233  /**
234  * Sets the background color to either the id of a color in the list of
235  * color definitions, or a color value.
236  */
237  void setBackgroundColor(const std::string& bg);
238 
239  /**
240  * Returns the key of the render infomation object
241  */
242  const std::string& getKey() const;
243 
244  /**
245  * Returns the id of the object.
246  */
247  const std::string& getName() const;
248 
249  /**
250  * Sets the id of the object.
251  */
252  void setName(const std::string& name);
253 
254  /**
255  * Adds the attributes for a graphical primitive 1D object to the passed in.
256  * object.
257  */
258  void addSBMLAttributes(RenderInformationBase* pBase
259  /*
260  ,std::map<std::string,std::string>& colorKeyToIdMap
261  ,std::map<std::string,std::string>& gradientKeyToIdMap
262  ,std::map<std::string,std::string>& lineEndingKeyToIdMap
263  */
264  ) const;
265 };
266 
267 #endif /* CLRenderInformationBase_H__ */
void addLineEnding(const CLLineEnding *le)
void removeGradientDefinition(size_t index)
CCopasiVector< CLColorDefinition > mListOfColorDefinitions
void addSBMLAttributes(RenderInformationBase *pBase) const
CCopasiVector< CLLineEnding > * getListOfLineEndings()
const std::string & getBackgroundColor() const
CLRadialGradient * createRadialGradientDefinition()
void addGradientDefinition(const CLGradientBase *gradient)
void setBackgroundColor(const std::string &bg)
CCopasiVector< CLLineEnding > mListOfLineEndings
CLColorDefinition * getColorDefinition(size_t index)
const std::string & getReferenceRenderInformationKey() const
CLRenderInformationBase(const std::string &name, CCopasiContainer *pParent=NULL)
void removeColorDefinition(size_t index)
CLLineEnding * getLineEnding(size_t index)
Definition: CLBase.h:33
void setName(const std::string &name)
CCopasiVector< CLGradientBase > mListOfGradientDefinitions
CLColorDefinition * createColorDefinition()
void setReferenceRenderInformationKey(const std::string &key)
Header file of class CCopasiContainer.
CLRenderInformationBase & operator=(const CLRenderInformationBase &source)
void addColorDefinition(const CLColorDefinition *cd)
const std::string & getKey() const
const std::string & getName() const
CLLinearGradient * createLinearGradientDefinition()
CCopasiVector< CLGradientBase > * getListOfGradientDefinitions()
CLGradientBase * getGradientDefinition(size_t index)
CCopasiVector< CLColorDefinition > * getListOfColorDefinitions()