COPASI API  4.16.103
CLText.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layout/CLText.h,v $
3 // $Revision: 1.5 $
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 CLText_H__
15 #define CLText_H__
16 
19 
21 
22 #include <string>
23 
24 class CCopasiContainer;
25 class Text;
26 
28 {
29 private:
30  // prevent the compiler from generating the assignment operator
31  CLText& operator=(const CLText& source);
32 
33 public:
35  {
39  };
40 
42  {
46  };
47 
49  {
56  };
57 
58 protected:
62  std::string mFontFamily;
68  std::string mText;
69 
70  /**
71  * key for the object.
72  */
73  std::string mKey;
74 
75 public:
76  // Ctor
77  CLText(CCopasiContainer* pParent);
78 
79  /**
80  * Constructor with optional coordinates.
81  */
82  CLText(const CLRelAbsVector& x = CLRelAbsVector(0.0, 0.0), const CLRelAbsVector& y = CLRelAbsVector(0.0, 0.0), const CLRelAbsVector& z = CLRelAbsVector(0.0, 0.0), CCopasiContainer* pParent = NULL);
83 
84  /**
85  * Copy constructor.
86  */
87  CLText(const CLText& source, CCopasiContainer* pParent = NULL);
88 
89  /**
90  * Constructor to generate object from the corresponding SBML object.
91  */
92  CLText(const Text& source, CCopasiContainer* pParent = NULL);
93 
94  /**
95  * Destructor.
96  */
97  ~CLText();
98 
99  /**
100  * Sets the coordinates.
101  */
102  void setCoordinates(const CLRelAbsVector& x, const CLRelAbsVector& y, const CLRelAbsVector& z = CLRelAbsVector(0.0, 0.0));
103 
104  /**
105  * Sets the x coordinate.
106  */
107  void setX(const CLRelAbsVector& coord);
108 
109  /**
110  * Sets the y coordinate.
111  */
112  void setY(const CLRelAbsVector& coord);
113 
114  /**
115  * Sets the z coordinate.
116  */
117  void setZ(const CLRelAbsVector& coord);
118 
119  /**
120  * Returns the x coordinate.
121  */
122  const CLRelAbsVector& getX() const;
123 
124  /**
125  * Returns the y coordinate.
126  */
127  const CLRelAbsVector& getY() const;
128 
129  /**
130  * Returns the z coordinate.
131  */
132  const CLRelAbsVector& getZ() const;
133 
134  /**
135  * Returns the x coordinate.
136  */
137  CLRelAbsVector& getX();
138 
139  /**
140  * Returns the y coordinate.
141  */
142  CLRelAbsVector& getY();
143 
144  /**
145  * Returns the z coordinate.
146  */
147  CLRelAbsVector& getZ();
148 
149  /**
150  * Sets the font family.
151  */
152  void setFontFamily(const std::string& family);
153 
154  /**
155  * Sets the font size.
156  */
157  void setFontSize(const CLRelAbsVector& size);
158 
159  /**
160  * Sets the font weight.
161  */
162  void setFontWeight(CLText::FONT_WEIGHT weight);
163 
164  /**
165  * Sets the font style.
166  */
167  void setFontStyle(CLText::FONT_STYLE style);
168 
169  /**
170  * Sets the font anchor.
171  */
172  void setTextAnchor(CLText::TEXT_ANCHOR anchor);
173 
174  /**
175  * Sets the font anchor.
176  */
177  void setVTextAnchor(CLText::TEXT_ANCHOR anchor);
178 
179  /**
180  * Returns the font family.
181  */
182  const std::string& getFontFamily() const;
183 
184  /**
185  * Returns the font size.
186  */
187  const CLRelAbsVector& getFontSize() const;
188 
189  /**
190  * Returns the font size.
191  */
193 
194  /**
195  * Returns the font weight.
196  */
197  FONT_WEIGHT getFontWeight() const;
198 
199  /**
200  * Returns the font style.
201  */
202  FONT_STYLE getFontStyle() const;
203 
204  /**
205  * Returns the text anchor.
206  */
207  TEXT_ANCHOR getTextAnchor() const;
208 
209  /**
210  * Returns the vertical text anchor.
211  */
212  TEXT_ANCHOR getVTextAnchor() const;
213 
214  /**
215  * Returns true if the horizonal alignment attribute has been set.
216  */
217  bool isSetTextAnchor() const;
218 
219  /**
220  * Returns true if the vertical alignment attribute has been set.
221  */
222  bool isSetVTextAnchor() const;
223 
224  /**
225  * Returns the text for the text element.
226  */
227  const std::string& getText() const;
228 
229  /**
230  * Sets the text for the text element.
231  */
232  void setText(const std::string& text);
233 
234  /**
235  * Returns true if the text is set to something else than the empty string.
236  */
237  bool isSetText() const;
238 
239  /**
240  * Returns true if the font family has been set or false otherwise.
241  */
242  bool isSetFontFamily() const;
243 
244  /**
245  * Returns true if the font size has been set or false otherwise.
246  */
247  bool isSetFontSize() const;
248 
249  /**
250  * Returns true if the font weight has been set or false otherwise.
251  */
252  bool isSetFontWeight() const;
253 
254  /**
255  * Returns true if the font style has been set or false otherwise.
256  */
257  bool isSetFontStyle() const;
258 
259  /**
260  * Returns the key string of the object.
261  */
262  const std::string& getKey() const;
263 
264  /**
265  * Converts this object to the corresponding SBML object.
266  */
267  Text* toSBML(unsigned int level, unsigned int version) const;
268 };
269 
270 #endif /* CLText_H__ */
void setText(const std::string &text)
Definition: CLText.cpp:366
Definition: CLText.h:27
FONT_STYLE mFontStyle
Definition: CLText.h:65
CLText & operator=(const CLText &source)
FONT_WEIGHT mFontWeight
Definition: CLText.h:64
const CLRelAbsVector & getZ() const
Definition: CLText.cpp:222
const CLRelAbsVector & getY() const
Definition: CLText.cpp:214
CLText(CCopasiContainer *pParent)
Definition: CLText.cpp:16
std::string mText
Definition: CLText.h:68
void setVTextAnchor(CLText::TEXT_ANCHOR anchor)
Definition: CLText.cpp:294
bool isSetFontStyle() const
Definition: CLText.cpp:406
void setTextAnchor(CLText::TEXT_ANCHOR anchor)
Definition: CLText.cpp:286
CLRelAbsVector mZ
Definition: CLText.h:61
const CLRelAbsVector & getFontSize() const
Definition: CLText.cpp:318
void setFontSize(const CLRelAbsVector &size)
Definition: CLText.cpp:262
bool isSetFontSize() const
Definition: CLText.cpp:390
bool isSetFontFamily() const
Definition: CLText.cpp:382
bool isSetVTextAnchor() const
Definition: CLText.cpp:422
FONT_STYLE getFontStyle() const
Definition: CLText.cpp:334
CLRelAbsVector mY
Definition: CLText.h:60
std::string mKey
Definition: CLText.h:73
FONT_STYLE
Definition: CLText.h:41
const std::string & getKey() const
Definition: CLText.cpp:430
void setFontWeight(CLText::FONT_WEIGHT weight)
Definition: CLText.cpp:270
std::string mFontFamily
Definition: CLText.h:62
void setCoordinates(const CLRelAbsVector &x, const CLRelAbsVector &y, const CLRelAbsVector &z=CLRelAbsVector(0.0, 0.0))
Definition: CLText.cpp:172
void setFontFamily(const std::string &family)
Definition: CLText.cpp:254
CLRelAbsVector mX
Definition: CLText.h:59
bool isSetText() const
Definition: CLText.cpp:374
~CLText()
Definition: CLText.cpp:164
TEXT_ANCHOR
Definition: CLText.h:48
void setX(const CLRelAbsVector &coord)
Definition: CLText.cpp:182
Text * toSBML(unsigned int level, unsigned int version) const
Definition: CLText.cpp:438
TEXT_ANCHOR mVTextAnchor
Definition: CLText.h:67
const std::string & getFontFamily() const
Definition: CLText.cpp:302
TEXT_ANCHOR mTextAnchor
Definition: CLText.h:66
bool isSetTextAnchor() const
Definition: CLText.cpp:414
TEXT_ANCHOR getVTextAnchor() const
Definition: CLText.cpp:350
const std::string & getText() const
Definition: CLText.cpp:358
void setY(const CLRelAbsVector &coord)
Definition: CLText.cpp:190
CLRelAbsVector mFontSize
Definition: CLText.h:63
const CLRelAbsVector & getX() const
Definition: CLText.cpp:206
void setZ(const CLRelAbsVector &coord)
Definition: CLText.cpp:198
bool isSetFontWeight() const
Definition: CLText.cpp:398
FONT_WEIGHT
Definition: CLText.h:34
TEXT_ANCHOR getTextAnchor() const
Definition: CLText.cpp:342
FONT_WEIGHT getFontWeight() const
Definition: CLText.cpp:326
void setFontStyle(CLText::FONT_STYLE style)
Definition: CLText.cpp:278