COPASI API  4.16.103
CLPolygon.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layout/CLPolygon.h,v $
3 // $Revision: 1.6 $
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 CLPolygon_H__
15 #define CLPolygon_H__
16 
17 #include <string>
18 
21 
22 class CLRenderPoint;
24 class CCopasiContainer;
25 class sbmlPolygon;
26 
28 {
29 private:
30  // prevent the compiler from generating an assignment operator
31  CLPolygon& operator=(const CLPolygon& source);
32 
33 protected:
34  std::vector<CLRenderPoint*> mListOfElements;
35 
36  /**
37  * key for the object.
38  */
39  std::string mKey;
40 
41 public:
42  /**
43  * Constructor.
44  */
45  CLPolygon(CCopasiContainer* pParent = NULL);
46 
47  /**
48  * Copy constructor
49  */
50  CLPolygon(const CLPolygon& source, CCopasiContainer* pParent);
51 
52  /**
53  * Constructor to generate object from the corresponding SBML object.
54  */
55  CLPolygon(const sbmlPolygon& source, CCopasiContainer* pParent = NULL);
56 
57  /**
58  * Destructor.
59  */
60  ~CLPolygon();
61 
62  /**
63  * Returns the number of line segments.
64  */
65  size_t getNumElements() const;
66 
67  /**
68  * Returns a pointer to the list of curve segments.
69  */
70  std::vector<CLRenderPoint*>* getListOfElements();
71 
72  /**
73  * Returns a const pointer to the list of curve segments.
74  */
75  const std::vector<CLRenderPoint*>* getListOfElements() const;
76 
77  /**
78  * Creates a new point object and adds it to the list of
79  * elements.
80  */
82 
83  /**
84  * Creates a new cubicbezier object and adds it to the list of
85  * elements.
86  */
88 
89  /**
90  * Returns a pointer to the point with with the given index or
91  * NULL if the index is invalid.
92  */
93  CLRenderPoint* getElement(size_t index);
94 
95  /**
96  * Returns const a pointer to the line segement with with the given index or
97  * NULL if the index is invalid.
98  */
99  const CLRenderPoint* getElement(size_t index) const;
100 
101  /**
102  * Adds a copy of the given line segment to the list of line segements.
103  */
104  void addElement(const CLRenderPoint* ls);
105 
106  /**
107  * Removes the curve segment with the given index.
108  */
109  void removeElement(size_t i);
110 
111  /**
112  * Returns the key string of the object.
113  */
114  const std::string& getKey() const;
115 
116  /**
117  * Converts this object to the corresponding SBML object.
118  */
119  sbmlPolygon* toSBML(unsigned int level, unsigned int version) const;
120 };
121 
122 #endif /* CLPolygon_H__ */
CLPolygon(CCopasiContainer *pParent=NULL)
Definition: CLPolygon.cpp:23
#define sbmlPolygon
Definition: CLGroup.cpp:22
CLRenderPoint * getElement(size_t index)
Definition: CLPolygon.cpp:145
void removeElement(size_t i)
Definition: CLPolygon.cpp:177
CLRenderPoint * createPoint()
Definition: CLPolygon.cpp:125
size_t getNumElements() const
Definition: CLPolygon.cpp:100
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
const std::string & getKey() const
Definition: CLPolygon.cpp:191
CLPolygon & operator=(const CLPolygon &source)
std::string mKey
Definition: CLPolygon.h:39
std::vector< CLRenderPoint * > * getListOfElements()
Definition: CLPolygon.cpp:108
sbmlPolygon * toSBML(unsigned int level, unsigned int version) const
Definition: CLPolygon.cpp:199
CLRenderCubicBezier * createCubicBezier()
Definition: CLPolygon.cpp:135
void addElement(const CLRenderPoint *ls)
Definition: CLPolygon.cpp:162