COPASI API  4.16.103
CLGroup.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layout/CLGroup.h,v $
3 // $Revision: 1.6 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2012/04/23 15:44:51 $
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 #ifndef CLGroup_H__
15 #define CLGroup_H__
16 
18 #include "copasi/layout/CLText.h"
19 
22 
23 #include <string>
24 
25 class RenderGroup;
26 
27 class CLImage;
28 class CLRectangle;
29 class CLEllipse;
30 class CLPolygon;
31 class CLRenderCurve;
32 
34 {
35 private:
36  // prevent the compiler from generating the assignment operator
37  CLGroup& operator=(const CLGroup& source);
38 
39 protected:
40  std::string mFontFamily;
46  std::string mStartHead;
47  std::string mEndHead;
49 
50  /**
51  * key for the object.
52  */
53  std::string mKey;
54 
55 public:
56  /**
57  * Constructor.
58  */
59  CLGroup(CCopasiContainer* pParent = NULL);
60 
61  /**
62  * Copy constructor.
63  */
64  CLGroup(const CLGroup& source, CCopasiContainer* pParent = NULL);
65 
66  /**
67  * Constructor to generate object from the corresponding SBML object.
68  */
69  CLGroup(const RenderGroup& source, CCopasiContainer* pParent = NULL);
70 
71  /**
72  * Destructor.
73  */
74  ~CLGroup();
75 
76  /**
77  * Sets the font family.
78  */
79  void setFontFamily(const std::string& family);
80 
81  /**
82  * Sets the font size.
83  */
84  void setFontSize(const CLRelAbsVector& size);
85 
86  /**
87  * Sets the font weight.
88  */
90 
91  /**
92  * Sets the font style.
93  */
94  void setFontStyle(CLText::FONT_STYLE style);
95 
96  /**
97  * Sets the text anchor.
98  */
100 
101  /**
102  * Sets the vertical text anchor.
103  */
104  void setVTextAnchor(CLText::TEXT_ANCHOR anchor);
105 
106  /**
107  * Sets the start head id.
108  */
109  void setStartHead(const std::string& key);
110 
111  /**
112  * Sets the end head id.
113  */
114  void setEndHead(const std::string& key);
115 
116  /**
117  * Returns the font family.
118  */
119  const std::string& getFontFamily() const;
120 
121  /**
122  * Returns the font size.
123  */
125 
126  /**
127  * Returns the font size.
128  */
129  const CLRelAbsVector& getFontSize() const;
130 
131  /**
132  * Returns the font weight.
133  */
135 
136  /**
137  * Returns the font style.
138  */
140 
141  /**
142  * Returns the text anchor.
143  */
145 
146  /**
147  * Returns the vertical text anchor.
148  */
150 
151  /**
152  * Returns the start head id.
153  */
154  const std::string& getStartHead() const;
155 
156  /**
157  * Returns the end head id.
158  */
159  const std::string& getEndHead() const;
160 
161  /**
162  * Returns the number of elements in the group.
163  */
164  size_t getNumElements() const;
165 
166  /**
167  * Returns the list of elements.
168  */
170 
171  /**
172  * Returns the list of elements.
173  */
175 
176  /**
177  * Returns element with index n.
178  * If there is no such element, NULL is returned.
179  */
180  CCopasiObject* getElement(size_t n);
181 
182  /**
183  * Returns element with index n.
184  * If there is no such element, NULL is returned.
185  */
186  const CCopasiObject* getElement(size_t n) const;
187 
188  /**
189  * Returns true if the horizonal alignment attribute has been set.
190  */
191  bool isSetTextAnchor() const;
192 
193  /**
194  * Returns true if the vertical alignment attribute has been set.
195  */
196  bool isSetVTextAnchor() const;
197 
198  /**
199  * Creates an image object and adds it to the end of the list of child
200  * elements.
201  */
202  CLImage* createImage();
203 
204  /**
205  * Creates an image object and adds it to the end of the list of child
206  * elements.
207  */
208  CLGroup* createGroup();
209 
210  /**
211  * Creates a rectangle object and adds it to the end of the list of child
212  * elements.
213  */
215 
216  /**
217  * Creates an ellipse object and adds it to the end of the list of child
218  * elements.
219  */
221 
222  /**
223  * Creates a curve object and adds it to the end of the list of child
224  * elements.
225  */
227 
228  /**
229  * Creates a polygon object and adds it to the end of the list of child
230  * elements.
231  */
233 
234  /**
235  * Creates a text object and adds it to the end of the list of child
236  * elements.
237  */
238  CLText* createText();
239 
240  /**
241  * Adds a copy of the given element to the end of the list of children elements.
242  */
243  void addChildElement(const CLTransformation2D* pChild);
244 
245  /**
246  * Returns true if the start head is set or false otherwise.
247  */
248  bool isSetStartHead() const;
249 
250  /**
251  * Returns true if the start head is set or false otherwise.
252  */
253  bool isSetEndHead() const;
254 
255  /**
256  * Returns true if the font family has been set or false otherwise.
257  */
258  bool isSetFontFamily() const;
259 
260  /**
261  * Returns true if the font size has been set or false otherwise.
262  */
263  bool isSetFontSize() const;
264 
265  /**
266  * Returns true if the font weight has been set or false otherwise.
267  */
268  bool isSetFontWeight() const;
269 
270  /**
271  * Returns true if the font style has been set or false otherwise.
272  */
273  bool isSetFontStyle() const;
274 
275  /**
276  * Returns the key string of the object.
277  */
278  const std::string& getKey() const;
279 
280  /**
281  * Converts this object to the corresponding SBML object.
282  */
283  RenderGroup* toSBML(unsigned int level, unsigned int version) const;
284 };
285 
286 #endif /* CLGroup_H__ */
CLText::FONT_STYLE mFontStyle
Definition: CLGroup.h:43
void setTextAnchor(CLText::TEXT_ANCHOR anchor)
Definition: CLGroup.cpp:280
Definition: CLText.h:27
void setFontFamily(const std::string &family)
Definition: CLGroup.cpp:248
CCopasiVector< CCopasiObject > mElements
Definition: CLGroup.h:48
CLImage * createImage()
Definition: CLGroup.cpp:441
bool isSetFontWeight() const
Definition: CLGroup.cpp:584
CLText * createText()
Definition: CLGroup.cpp:507
bool isSetEndHead() const
Definition: CLGroup.cpp:560
bool isSetFontFamily() const
Definition: CLGroup.cpp:568
bool isSetStartHead() const
Definition: CLGroup.cpp:552
bool isSetFontSize() const
Definition: CLGroup.cpp:576
const std::string & getKey() const
Definition: CLGroup.cpp:791
std::string mFontFamily
Definition: CLGroup.h:40
const std::string & getFontFamily() const
Definition: CLGroup.cpp:312
CLText::TEXT_ANCHOR mTextAnchor
Definition: CLGroup.h:44
const CCopasiVector< CCopasiObject > * getListOfElements() const
Definition: CLGroup.cpp:392
CLRelAbsVector & getFontSize()
Definition: CLGroup.cpp:320
CLRelAbsVector mFontSize
Definition: CLGroup.h:41
void setFontWeight(CLText::FONT_WEIGHT weight)
Definition: CLGroup.cpp:264
FONT_STYLE
Definition: CLText.h:41
~CLGroup()
Definition: CLGroup.cpp:240
const std::string & getStartHead() const
Definition: CLGroup.cpp:368
void setVTextAnchor(CLText::TEXT_ANCHOR anchor)
Definition: CLGroup.cpp:288
CCopasiObject * getElement(size_t n)
Definition: CLGroup.cpp:409
std::string mStartHead
Definition: CLGroup.h:46
CLGroup * createGroup()
Definition: CLGroup.cpp:452
CLGroup(CCopasiContainer *pParent=NULL)
Definition: CLGroup.cpp:42
bool isSetTextAnchor() const
Definition: CLGroup.cpp:775
void setEndHead(const std::string &key)
Definition: CLGroup.cpp:304
void setFontSize(const CLRelAbsVector &size)
Definition: CLGroup.cpp:256
const std::string & getEndHead() const
Definition: CLGroup.cpp:376
Header file of class CCopasiContainer.
bool isSetFontStyle() const
Definition: CLGroup.cpp:592
CLText::FONT_STYLE getFontStyle() const
Definition: CLGroup.cpp:344
CLText::FONT_WEIGHT getFontWeight() const
Definition: CLGroup.cpp:336
CLText::TEXT_ANCHOR getVTextAnchor() const
Definition: CLGroup.cpp:360
TEXT_ANCHOR
Definition: CLText.h:48
CLRenderCurve * createCurve()
Definition: CLGroup.cpp:485
CLText::FONT_WEIGHT mFontWeight
Definition: CLGroup.h:42
std::string mKey
Definition: CLGroup.h:53
void setStartHead(const std::string &key)
Definition: CLGroup.cpp:296
CLText::TEXT_ANCHOR mVTextAnchor
Definition: CLGroup.h:45
CLRectangle * createRectangle()
Definition: CLGroup.cpp:463
void setFontStyle(CLText::FONT_STYLE style)
Definition: CLGroup.cpp:272
CLText::TEXT_ANCHOR getTextAnchor() const
Definition: CLGroup.cpp:352
std::string mEndHead
Definition: CLGroup.h:47
CLEllipse * createEllipse()
Definition: CLGroup.cpp:474
RenderGroup * toSBML(unsigned int level, unsigned int version) const
Definition: CLGroup.cpp:799
size_t getNumElements() const
Definition: CLGroup.cpp:384
FONT_WEIGHT
Definition: CLText.h:34
CLGroup & operator=(const CLGroup &source)
bool isSetVTextAnchor() const
Definition: CLGroup.cpp:783
void addChildElement(const CLTransformation2D *pChild)
Definition: CLGroup.cpp:517
CLPolygon * createPolygon()
Definition: CLGroup.cpp:496