COPASI API  4.16.103
CLGradientBase.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layout/CLGradientBase.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 CLGradientBase_H__
15 #define CLGradientBase_H__
16 
17 #include <string>
18 
19 #include "copasi/layout/CLBase.h"
23 
24 class GradientBase;
25 
26 class CLGradientBase : public CLBase, public CCopasiContainer
27 {
28 public:
30  {
31  PAD,
34  };
35 
36 private:
37  // prevent the compiler from generating the assignment operator
38  CLGradientBase& operator=(const CLGradientBase& source);
39 
40 protected:
43 
44  /**
45  * key string for the gradient.
46  */
47  std::string mKey;
48 
49  /**
50  * The gradient base needs an id in addition to the key.
51  * The id corresponds to the id in the SBML render extension and it does not have to
52  * be globally unique. As a matter of fact, it is sometimes needed that gradient base of
53  * different render information have the same id.
54  */
55  std::string mId;
56 
57 public:
58  /**
59  * Constructor.
60  */
61  CLGradientBase(const std::string& name, CCopasiContainer* pParent = NULL);
62 
63  /**
64  * Copy Constructor.
65  */
66  CLGradientBase(const CLGradientBase& source, CCopasiContainer* pParent = NULL);
67 
68  /**
69  * Constructor to generate object from the corresponding SBML object.
70  */
71  CLGradientBase(const GradientBase& source, const std::string& name, CCopasiContainer* pParent = NULL);
72 
73  /**
74  * Destructor.
75  */
76  virtual ~CLGradientBase();
77 
78  /**
79  * Returns the spreadmethod of the gradient.
80  */
82 
83  /**
84  * Sets the spread method.
85  */
86  void setSpreadMethod(SPREADMETHOD method);
87 
88  /**
89  * Returns the number of gradient stops.
90  */
91  size_t getNumGradientStops() const;
92 
93  /**
94  * Returns a pointer to the gradient stop vector.
95  */
97 
98  /**
99  * Returns a const pointer to the gradient stop vector.
100  */
102 
103  /**
104  * Returns a pointer to the gradient stop with the given index or NULL
105  * if the index is invalid.
106  */
107  CLGradientStop* getGradientStop(size_t i);
108 
109  /**
110  * Returns a const pointer to the gradient stop with the given index or NULL
111  * if the index is invalid.
112  */
113  const CLGradientStop* getGradientStop(size_t i) const;
114 
115  /**
116  * Creates a new GradientStop.
117  */
119 
120  /**
121  * Adds a copy of the given GradientStop object.
122  */
123  void addGradientStop(const CLGradientStop* pStop);
124 
125  /**
126  * Returns the key of the color definition.
127  */
128  const std::string& getKey() const;
129 
130  /**
131  * Adds gradient base attributes to the gradient passed as the argument.
132  */
133  virtual void addSBMLAttributes(GradientBase* pBase) const;
134 
135  /**
136  * Returns the id of the object.
137  */
138  const std::string& getId() const;
139 
140  /**
141  * Sets the id of the object.
142  */
143  void setId(const std::string& id);
144 };
145 
146 #endif /* CLGradientBase_H__ */
virtual ~CLGradientBase()
void setSpreadMethod(SPREADMETHOD method)
CCopasiVector< CLGradientStop > mGradientStops
const std::string & getId() const
CLGradientStop * getGradientStop(size_t i)
CLGradientBase(const std::string &name, CCopasiContainer *pParent=NULL)
size_t getNumGradientStops() const
void addGradientStop(const CLGradientStop *pStop)
virtual void addSBMLAttributes(GradientBase *pBase) const
std::string mKey
const std::string & getKey() const
CCopasiVector< CLGradientStop > * getListOfGradientStops()
Definition: CLBase.h:33
Header file of class CCopasiContainer.
CLGradientBase & operator=(const CLGradientBase &source)
SPREADMETHOD mSpreadMethod
std::string mId
CLGradientStop * createGradientStop()
SPREADMETHOD getSpreadMethod() const
void setId(const std::string &id)