COPASI API  4.16.103
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
CLText Class Reference

#include <CLText.h>

Inheritance diagram for CLText:
Inheritance graph
[legend]
Collaboration diagram for CLText:
Collaboration graph
[legend]

Public Types

enum  FONT_STYLE { STYLE_UNSET, STYLE_NORMAL, STYLE_ITALIC }
 
enum  FONT_WEIGHT { WEIGHT_UNSET, WEIGHT_NORMAL, WEIGHT_BOLD }
 
enum  TEXT_ANCHOR {
  ANCHOR_UNSET = 0, ANCHOR_START = 1, ANCHOR_MIDDLE = 2, ANCHOR_END = 3,
  ANCHOR_TOP = 1, ANCHOR_BOTTOM = 3
}
 
- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 

Public Member Functions

 CLText (CCopasiContainer *pParent)
 
 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)
 
 CLText (const CLText &source, CCopasiContainer *pParent=NULL)
 
 CLText (const Text &source, CCopasiContainer *pParent=NULL)
 
const std::string & getFontFamily () const
 
const CLRelAbsVectorgetFontSize () const
 
CLRelAbsVectorgetFontSize ()
 
FONT_STYLE getFontStyle () const
 
FONT_WEIGHT getFontWeight () const
 
const std::string & getKey () const
 
const std::string & getText () const
 
TEXT_ANCHOR getTextAnchor () const
 
TEXT_ANCHOR getVTextAnchor () const
 
const CLRelAbsVectorgetX () const
 
CLRelAbsVectorgetX ()
 
const CLRelAbsVectorgetY () const
 
CLRelAbsVectorgetY ()
 
const CLRelAbsVectorgetZ () const
 
CLRelAbsVectorgetZ ()
 
bool isSetFontFamily () const
 
bool isSetFontSize () const
 
bool isSetFontStyle () const
 
bool isSetFontWeight () const
 
bool isSetText () const
 
bool isSetTextAnchor () const
 
bool isSetVTextAnchor () const
 
void setCoordinates (const CLRelAbsVector &x, const CLRelAbsVector &y, const CLRelAbsVector &z=CLRelAbsVector(0.0, 0.0))
 
void setFontFamily (const std::string &family)
 
void setFontSize (const CLRelAbsVector &size)
 
void setFontStyle (CLText::FONT_STYLE style)
 
void setFontWeight (CLText::FONT_WEIGHT weight)
 
void setText (const std::string &text)
 
void setTextAnchor (CLText::TEXT_ANCHOR anchor)
 
void setVTextAnchor (CLText::TEXT_ANCHOR anchor)
 
void setX (const CLRelAbsVector &coord)
 
void setY (const CLRelAbsVector &coord)
 
void setZ (const CLRelAbsVector &coord)
 
Text * toSBML (unsigned int level, unsigned int version) const
 
 ~CLText ()
 
- Public Member Functions inherited from CLGraphicalPrimitive1D
virtual void addSBMLAttributes (GraphicalPrimitive1D *pPrimitive) const
 
 CLGraphicalPrimitive1D ()
 
 CLGraphicalPrimitive1D (const GraphicalPrimitive1D &source)
 
const std::vector< unsigned int > & getDashArray () const
 
const std::string & getStroke () const
 
double getStrokeWidth () const
 
bool isSetDashArray () const
 
bool isSetStroke () const
 
bool isSetStrokeWidth () const
 
void parseDashArray (const std::string &s)
 
void setDashArray (const std::vector< unsigned int > &array)
 
void setStroke (const std::string &key)
 
void setStrokeWidth (double width)
 
- Public Member Functions inherited from CLTransformation2D
 CLTransformation2D ()
 
 CLTransformation2D (const double m[6])
 
 CLTransformation2D (const Transformation2D &source)
 
std::string get2DTransformationString () const
 
const double * getMatrix2D () const
 
virtual void parseTransformation (const std::string &transformationString)
 
void setMatrix (const double m[12])
 
void setMatrix2D (const double m[6])
 
- Public Member Functions inherited from CLTransformation
 CLTransformation ()
 
 CLTransformation (const double matrix[12])
 
std::string get3DTransformationString () const
 
virtual const double * getMatrix () const
 
bool is2DTransformation () const
 
bool isIdentityMatrix () const
 
bool isSetMatrix () const
 
void setMatrix (const double m[12])
 
- Public Member Functions inherited from CLBase
 CLBase ()
 
 CLBase (const CLBase &b)
 
 CLBase (const SBase &)
 
const std::string & getTag () const
 
bool hasTag () const
 
virtual void moveBy (const CLPoint &)
 
void setTag (const std::string &tag)
 
virtual ~CLBase ()
 
- Public Member Functions inherited from CCopasiObject
void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual CCopasiObjectName getCN () const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
virtual std::string getUnits () const
 
UpdateMethodgetUpdateMethod () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual voidgetValuePointer () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
virtual void print (std::ostream *ostream) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const bool &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Protected Attributes

std::string mFontFamily
 
CLRelAbsVector mFontSize
 
FONT_STYLE mFontStyle
 
FONT_WEIGHT mFontWeight
 
std::string mKey
 
std::string mText
 
TEXT_ANCHOR mTextAnchor
 
TEXT_ANCHOR mVTextAnchor
 
CLRelAbsVector mX
 
CLRelAbsVector mY
 
CLRelAbsVector mZ
 
- Protected Attributes inherited from CLGraphicalPrimitive1D
std::string mStroke
 
std::vector< unsigned int > mStrokeDashArray
 
double mStrokeWidth
 
- Protected Attributes inherited from CLTransformation2D
double mMatrix2D [6]
 
- Protected Attributes inherited from CLTransformation
double mMatrix [12]
 
- Protected Attributes inherited from CLBase
std::string mTag
 

Private Member Functions

CLTextoperator= (const CLText &source)
 

Additional Inherited Members

- Static Public Member Functions inherited from CLTransformation2D
static const double * getIdentityMatrix2D ()
 
- Static Public Member Functions inherited from CLTransformation
static const double * getIdentityMatrix ()
 
- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 
- Static Public Attributes inherited from CLTransformation2D
static const double IDENTITY2D [6] = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}
 
- Static Public Attributes inherited from CLTransformation
static const double IDENTITY3D [12] = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}
 
- Protected Types inherited from CCopasiObject
enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 
- Protected Member Functions inherited from CLTransformation2D
virtual void addSBMLAttributes (Transformation2D *pTransformation) const
 
void updateMatrix2D ()
 
void updateMatrix3D ()
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

Definition at line 27 of file CLText.h.

Member Enumeration Documentation

Enumerator
STYLE_UNSET 
STYLE_NORMAL 
STYLE_ITALIC 

Definition at line 41 of file CLText.h.

Enumerator
WEIGHT_UNSET 
WEIGHT_NORMAL 
WEIGHT_BOLD 

Definition at line 34 of file CLText.h.

Enumerator
ANCHOR_UNSET 
ANCHOR_START 
ANCHOR_MIDDLE 
ANCHOR_END 
ANCHOR_TOP 
ANCHOR_BOTTOM 

Definition at line 48 of file CLText.h.

Constructor & Destructor Documentation

CLText::CLText ( CCopasiContainer pParent)

Definition at line 16 of file CLText.cpp.

References CKeyFactory::add(), CCopasiRootContainer::getKeyFactory(), and mKey.

16  :
18  CCopasiObject("RenderText", pParent),
19  mX(CLRelAbsVector(0.0, 0.0)),
20  mY(CLRelAbsVector(0.0, 0.0)),
21  mZ(CLRelAbsVector(0.0, 0.0)),
22  mFontFamily(""),
23  mFontSize(CLRelAbsVector(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN())),
28  mText(""),
29  mKey("")
30 {
31  this->mKey = CCopasiRootContainer::getKeyFactory()->add("RenderText", this);
32 }
FONT_STYLE mFontStyle
Definition: CLText.h:65
FONT_WEIGHT mFontWeight
Definition: CLText.h:64
std::string mText
Definition: CLText.h:68
CLRelAbsVector mZ
Definition: CLText.h:61
CLRelAbsVector mY
Definition: CLText.h:60
std::string mKey
Definition: CLText.h:73
std::string mFontFamily
Definition: CLText.h:62
std::string add(const std::string &prefix, CCopasiObject *pObject)
CLRelAbsVector mX
Definition: CLText.h:59
static CKeyFactory * getKeyFactory()
TEXT_ANCHOR mVTextAnchor
Definition: CLText.h:67
TEXT_ANCHOR mTextAnchor
Definition: CLText.h:66
CLRelAbsVector mFontSize
Definition: CLText.h:63
CLText::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 
)

Constructor with optional coordinates.

Definition at line 37 of file CLText.cpp.

References CKeyFactory::add(), CCopasiRootContainer::getKeyFactory(), and mKey.

37  :
39  CCopasiObject("RenderText", pParent),
40  mX(x),
41  mY(y),
42  mZ(z),
43  mFontFamily(""),
44  mFontSize(CLRelAbsVector(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN())),
49  mText(""),
50  mKey("")
51 {
52  this->mKey = CCopasiRootContainer::getKeyFactory()->add("RenderText", this);
53 }
FONT_STYLE mFontStyle
Definition: CLText.h:65
FONT_WEIGHT mFontWeight
Definition: CLText.h:64
std::string mText
Definition: CLText.h:68
CLRelAbsVector mZ
Definition: CLText.h:61
CLRelAbsVector mY
Definition: CLText.h:60
std::string mKey
Definition: CLText.h:73
std::string mFontFamily
Definition: CLText.h:62
std::string add(const std::string &prefix, CCopasiObject *pObject)
CLRelAbsVector mX
Definition: CLText.h:59
static CKeyFactory * getKeyFactory()
TEXT_ANCHOR mVTextAnchor
Definition: CLText.h:67
TEXT_ANCHOR mTextAnchor
Definition: CLText.h:66
CLRelAbsVector mFontSize
Definition: CLText.h:63
CLText::CLText ( const CLText source,
CCopasiContainer pParent = NULL 
)

Copy constructor.

Definition at line 58 of file CLText.cpp.

References CKeyFactory::add(), CCopasiRootContainer::getKeyFactory(), and mKey.

58  :
59  CLGraphicalPrimitive1D(source),
60  CCopasiObject(source, pParent),
61  mX(source.mX),
62  mY(source.mY),
63  mZ(source.mZ),
64  mFontFamily(source.mFontFamily),
65  mFontSize(source.mFontSize),
66  mFontWeight(source.mFontWeight),
67  mFontStyle(source.mFontStyle),
68  mTextAnchor(source.mTextAnchor),
69  mVTextAnchor(source.mVTextAnchor),
70  mText(source.mText),
71  mKey("")
72 {
73  this->mKey = CCopasiRootContainer::getKeyFactory()->add("RenderText", this);
74 }
FONT_STYLE mFontStyle
Definition: CLText.h:65
FONT_WEIGHT mFontWeight
Definition: CLText.h:64
std::string mText
Definition: CLText.h:68
CLRelAbsVector mZ
Definition: CLText.h:61
CLRelAbsVector mY
Definition: CLText.h:60
std::string mKey
Definition: CLText.h:73
std::string mFontFamily
Definition: CLText.h:62
std::string add(const std::string &prefix, CCopasiObject *pObject)
CLRelAbsVector mX
Definition: CLText.h:59
static CKeyFactory * getKeyFactory()
TEXT_ANCHOR mVTextAnchor
Definition: CLText.h:67
TEXT_ANCHOR mTextAnchor
Definition: CLText.h:66
CLRelAbsVector mFontSize
Definition: CLText.h:63
CLText::CLText ( const Text &  source,
CCopasiContainer pParent = NULL 
)

Constructor to generate object from the corresponding SBML object.

Definition at line 79 of file CLText.cpp.

References CKeyFactory::add(), ANCHOR_BOTTOM, ANCHOR_END, ANCHOR_MIDDLE, ANCHOR_START, ANCHOR_TOP, ANCHOR_UNSET, CCopasiRootContainer::getKeyFactory(), mKey, setFontStyle(), setFontWeight(), setTextAnchor(), setVTextAnchor(), STYLE_ITALIC, STYLE_NORMAL, STYLE_UNSET, WEIGHT_BOLD, WEIGHT_NORMAL, and WEIGHT_UNSET.

79  :
80  CLGraphicalPrimitive1D(source),
81  CCopasiObject("RenderText", pParent),
82  mX(source.getX()),
83  mY(source.getY()),
84  mZ(source.getZ()),
85  mFontFamily(source.getFontFamily()),
86  mFontSize(source.getFontSize()),
87  mText(source.getText()),
88  mKey("")
89 {
90  this->mKey = CCopasiRootContainer::getKeyFactory()->add("RenderText", this);
91 
92  switch (source.getFontWeight())
93  {
94  case Text::WEIGHT_UNSET:
96  break;
97 
98  case Text::WEIGHT_BOLD:
100  break;
101 
102  default:
104  break;
105  }
106 
107  switch (source.getFontStyle())
108  {
109  case Text::STYLE_UNSET:
111  break;
112 
113  case Text::STYLE_ITALIC:
115  break;
116 
117  default:
119  break;
120  }
121 
122  switch (source.getTextAnchor())
123  {
124  case Text::ANCHOR_UNSET:
126  break;
127 
128  case Text::ANCHOR_END:
130  break;
131 
132  case Text::ANCHOR_MIDDLE:
134  break;
135 
136  default:
138  break;
139  }
140 
141  switch (source.getVTextAnchor())
142  {
143  case Text::ANCHOR_UNSET:
145  break;
146 
147  case Text::ANCHOR_BOTTOM:
149  break;
150 
151  case Text::ANCHOR_MIDDLE:
153  break;
154 
155  default:
157  break;
158  }
159 }
std::string mText
Definition: CLText.h:68
void setVTextAnchor(CLText::TEXT_ANCHOR anchor)
Definition: CLText.cpp:294
void setTextAnchor(CLText::TEXT_ANCHOR anchor)
Definition: CLText.cpp:286
CLRelAbsVector mZ
Definition: CLText.h:61
CLRelAbsVector mY
Definition: CLText.h:60
std::string mKey
Definition: CLText.h:73
void setFontWeight(CLText::FONT_WEIGHT weight)
Definition: CLText.cpp:270
std::string mFontFamily
Definition: CLText.h:62
std::string add(const std::string &prefix, CCopasiObject *pObject)
CLRelAbsVector mX
Definition: CLText.h:59
static CKeyFactory * getKeyFactory()
CLRelAbsVector mFontSize
Definition: CLText.h:63
void setFontStyle(CLText::FONT_STYLE style)
Definition: CLText.cpp:278
CLText::~CLText ( )

Destructor.

Destructor

Definition at line 164 of file CLText.cpp.

References CCopasiRootContainer::getKeyFactory(), mKey, and CKeyFactory::remove().

165 {
167 }
bool remove(const std::string &key)
std::string mKey
Definition: CLText.h:73
static CKeyFactory * getKeyFactory()

Member Function Documentation

const std::string & CLText::getFontFamily ( ) const

Returns the font family.

Definition at line 302 of file CLText.cpp.

References mFontFamily.

Referenced by getFont(), CLLayoutRenderer::getFontSpec(), and toSBML().

303 {
304  return this->mFontFamily;
305 }
std::string mFontFamily
Definition: CLText.h:62
const CLRelAbsVector & CLText::getFontSize ( ) const

Returns the font size.

Definition at line 318 of file CLText.cpp.

References mFontSize.

Referenced by getFont(), and CLLayoutRenderer::getFontSpec().

319 {
320  return this->mFontSize;
321 }
CLRelAbsVector mFontSize
Definition: CLText.h:63
CLRelAbsVector & CLText::getFontSize ( )

Returns the font size.

Definition at line 310 of file CLText.cpp.

References mFontSize.

311 {
312  return this->mFontSize;
313 }
CLRelAbsVector mFontSize
Definition: CLText.h:63
CLText::FONT_STYLE CLText::getFontStyle ( ) const

Returns the font style.

Definition at line 334 of file CLText.cpp.

References mFontStyle.

Referenced by getFont(), CLLayoutRenderer::getFontSpec(), and toSBML().

335 {
336  return this->mFontStyle;
337 }
FONT_STYLE mFontStyle
Definition: CLText.h:65
CLText::FONT_WEIGHT CLText::getFontWeight ( ) const

Returns the font weight.

Definition at line 326 of file CLText.cpp.

References mFontWeight.

Referenced by getFont(), CLLayoutRenderer::getFontSpec(), and toSBML().

327 {
328  return this->mFontWeight;
329 }
FONT_WEIGHT mFontWeight
Definition: CLText.h:64
const std::string & CLText::getKey ( ) const
virtual

Returns the key string of the object.

Returns the key of the text element

Reimplemented from CCopasiObject.

Definition at line 430 of file CLText.cpp.

References mKey.

431 {
432  return this->mKey;
433 }
std::string mKey
Definition: CLText.h:73
const std::string & CLText::getText ( ) const

Returns the text for the text element.

Definition at line 358 of file CLText.cpp.

References mText.

Referenced by fillItemFromText(), toSBML(), and CLLayoutRenderer::update_textures_and_colors().

359 {
360  return this->mText;
361 }
std::string mText
Definition: CLText.h:68
CLText::TEXT_ANCHOR CLText::getTextAnchor ( ) const

Returns the text anchor.

Definition at line 342 of file CLText.cpp.

References mTextAnchor.

Referenced by adjustPosition(), and toSBML().

343 {
344  return this->mTextAnchor;
345 }
TEXT_ANCHOR mTextAnchor
Definition: CLText.h:66
CLText::TEXT_ANCHOR CLText::getVTextAnchor ( ) const

Returns the vertical text anchor.

Definition at line 350 of file CLText.cpp.

References mVTextAnchor.

Referenced by adjustPosition(), and toSBML().

351 {
352  return this->mVTextAnchor;
353 }
TEXT_ANCHOR mVTextAnchor
Definition: CLText.h:67
const CLRelAbsVector & CLText::getX ( ) const

Returns the x coordinate.

Definition at line 206 of file CLText.cpp.

References mX.

Referenced by CLLayoutRenderer::draw_text(), fillItemFromText(), and CCopasiXML::saveRenderTextElement().

207 {
208  return this->mX;
209 }
CLRelAbsVector mX
Definition: CLText.h:59
CLRelAbsVector & CLText::getX ( )

Returns the x coordinate.

Definition at line 230 of file CLText.cpp.

References mX.

231 {
232  return this->mX;
233 }
CLRelAbsVector mX
Definition: CLText.h:59
const CLRelAbsVector & CLText::getY ( ) const

Returns the y coordinate.

Definition at line 214 of file CLText.cpp.

References mY.

Referenced by CLLayoutRenderer::draw_text(), fillItemFromText(), and CCopasiXML::saveRenderTextElement().

215 {
216  return this->mY;
217 }
CLRelAbsVector mY
Definition: CLText.h:60
CLRelAbsVector & CLText::getY ( )

Returns the y coordinate.

Definition at line 238 of file CLText.cpp.

References mY.

239 {
240  return this->mY;
241 }
CLRelAbsVector mY
Definition: CLText.h:60
const CLRelAbsVector & CLText::getZ ( ) const

Returns the z coordinate.

Definition at line 222 of file CLText.cpp.

References mZ.

Referenced by CLLayoutRenderer::draw_text(), and CCopasiXML::saveRenderTextElement().

223 {
224  return this->mZ;
225 }
CLRelAbsVector mZ
Definition: CLText.h:61
CLRelAbsVector & CLText::getZ ( )

Returns the z coordinate.

Definition at line 246 of file CLText.cpp.

References mZ.

247 {
248  return this->mZ;
249 }
CLRelAbsVector mZ
Definition: CLText.h:61
bool CLText::isSetFontFamily ( ) const

Returns true if the font family has been set or false otherwise.

Definition at line 382 of file CLText.cpp.

References mFontFamily.

Referenced by getFont(), and CLLayoutRenderer::getFontSpec().

383 {
384  return !this->mFontFamily.empty();
385 }
std::string mFontFamily
Definition: CLText.h:62
bool CLText::isSetFontSize ( ) const

Returns true if the font size has been set or false otherwise.

Definition at line 390 of file CLText.cpp.

References CLRelAbsVector::getAbsoluteValue(), CLRelAbsVector::getRelativeValue(), and mFontSize.

Referenced by getFont(), and CLLayoutRenderer::getFontSpec().

391 {
393 }
double getRelativeValue() const
double getAbsoluteValue() const
CLRelAbsVector mFontSize
Definition: CLText.h:63
bool CLText::isSetFontStyle ( ) const

Returns true if the font style has been set or false otherwise.

Definition at line 406 of file CLText.cpp.

References mFontStyle, and STYLE_UNSET.

Referenced by getFont(), and CLLayoutRenderer::getFontSpec().

407 {
408  return (this->mFontStyle != CLText::STYLE_UNSET);
409 }
FONT_STYLE mFontStyle
Definition: CLText.h:65
bool CLText::isSetFontWeight ( ) const

Returns true if the font weight has been set or false otherwise.

Definition at line 398 of file CLText.cpp.

References mFontWeight, and WEIGHT_UNSET.

Referenced by getFont(), and CLLayoutRenderer::getFontSpec().

399 {
400  return (this->mFontWeight != CLText::WEIGHT_UNSET);
401 }
FONT_WEIGHT mFontWeight
Definition: CLText.h:64
bool CLText::isSetText ( ) const

Returns true if the text is set to something else than the empty string.

Definition at line 374 of file CLText.cpp.

References mText.

Referenced by CLLayoutRenderer::draw_text().

375 {
376  return !this->mText.empty();
377 }
std::string mText
Definition: CLText.h:68
bool CLText::isSetTextAnchor ( ) const

Returns true if the horizonal alignment attribute has been set.

Definition at line 414 of file CLText.cpp.

References ANCHOR_UNSET, and mTextAnchor.

Referenced by adjustPosition().

415 {
416  return this->mTextAnchor != CLText::ANCHOR_UNSET;
417 }
TEXT_ANCHOR mTextAnchor
Definition: CLText.h:66
bool CLText::isSetVTextAnchor ( ) const

Returns true if the vertical alignment attribute has been set.

Definition at line 422 of file CLText.cpp.

References ANCHOR_UNSET, and mVTextAnchor.

Referenced by adjustPosition().

423 {
424  return this->mVTextAnchor != CLText::ANCHOR_UNSET;
425 }
TEXT_ANCHOR mVTextAnchor
Definition: CLText.h:67
CLText& CLText::operator= ( const CLText source)
private
void CLText::setCoordinates ( const CLRelAbsVector x,
const CLRelAbsVector y,
const CLRelAbsVector z = CLRelAbsVector(0.0, 0.0) 
)

Sets the coordinates.

Definition at line 172 of file CLText.cpp.

References mX, mY, and mZ.

Referenced by CCopasiXMLParser::TextElement::start().

173 {
174  this->mX = x;
175  this->mY = y;
176  this->mZ = z;
177 }
CLRelAbsVector mZ
Definition: CLText.h:61
CLRelAbsVector mY
Definition: CLText.h:60
CLRelAbsVector mX
Definition: CLText.h:59
void CLText::setFontFamily ( const std::string &  family)

Sets the font family.

Definition at line 254 of file CLText.cpp.

References mFontFamily.

Referenced by CCopasiXMLParser::TextElement::start().

255 {
256  this->mFontFamily = family;
257 }
std::string mFontFamily
Definition: CLText.h:62
void CLText::setFontSize ( const CLRelAbsVector size)

Sets the font size.

Definition at line 262 of file CLText.cpp.

References mFontSize.

Referenced by CCopasiXMLParser::TextElement::start().

263 {
264  this->mFontSize = size;
265 }
CLRelAbsVector mFontSize
Definition: CLText.h:63
void CLText::setFontStyle ( CLText::FONT_STYLE  style)

Sets the font style.

Definition at line 278 of file CLText.cpp.

References mFontStyle.

Referenced by CLText(), and CCopasiXMLParser::TextElement::start().

279 {
280  this->mFontStyle = style;
281 }
FONT_STYLE mFontStyle
Definition: CLText.h:65
void CLText::setFontWeight ( CLText::FONT_WEIGHT  weight)

Sets the font weight.

Definition at line 270 of file CLText.cpp.

References mFontWeight.

Referenced by CLText(), and CCopasiXMLParser::TextElement::start().

271 {
272  this->mFontWeight = weight;
273 }
FONT_WEIGHT mFontWeight
Definition: CLText.h:64
void CLText::setText ( const std::string &  text)

Sets the text for the text element.

Definition at line 366 of file CLText.cpp.

References mText.

Referenced by CCopasiXMLParser::TextElement::end().

367 {
368  this->mText = text;
369 }
std::string mText
Definition: CLText.h:68
void CLText::setTextAnchor ( CLText::TEXT_ANCHOR  anchor)

Sets the font anchor.

Sets the text anchor.

Definition at line 286 of file CLText.cpp.

References mTextAnchor.

Referenced by CLText(), and CCopasiXMLParser::TextElement::start().

287 {
288  this->mTextAnchor = anchor;
289 }
TEXT_ANCHOR mTextAnchor
Definition: CLText.h:66
void CLText::setVTextAnchor ( CLText::TEXT_ANCHOR  anchor)

Sets the font anchor.

Sets the vertical text anchor.

Definition at line 294 of file CLText.cpp.

References mVTextAnchor.

Referenced by CLText(), and CCopasiXMLParser::TextElement::start().

295 {
296  this->mVTextAnchor = anchor;
297 }
TEXT_ANCHOR mVTextAnchor
Definition: CLText.h:67
void CLText::setX ( const CLRelAbsVector coord)

Sets the x coordinate.

Definition at line 182 of file CLText.cpp.

References mX.

183 {
184  this->mX = coord;
185 }
CLRelAbsVector mX
Definition: CLText.h:59
void CLText::setY ( const CLRelAbsVector coord)

Sets the y coordinate.

Definition at line 190 of file CLText.cpp.

References mY.

191 {
192  this->mY = coord;
193 }
CLRelAbsVector mY
Definition: CLText.h:60
void CLText::setZ ( const CLRelAbsVector coord)

Sets the z coordinate.

Definition at line 198 of file CLText.cpp.

References mZ.

199 {
200  this->mZ = coord;
201 }
CLRelAbsVector mZ
Definition: CLText.h:61
Text * CLText::toSBML ( unsigned int  level,
unsigned int  version 
) const

Converts this object to the corresponding SBML object.

Definition at line 438 of file CLText.cpp.

References CLGraphicalPrimitive1D::addSBMLAttributes(), ANCHOR_BOTTOM, ANCHOR_END, ANCHOR_MIDDLE, ANCHOR_UNSET, getFontFamily(), getFontStyle(), getFontWeight(), getText(), getTextAnchor(), getVTextAnchor(), mFontSize, mX, mY, mZ, STYLE_ITALIC, STYLE_UNSET, CLRelAbsVector::toSBML(), WEIGHT_BOLD, and WEIGHT_UNSET.

439 {
440  Text* pText = new Text(level, version);
441  this->addSBMLAttributes(pText);
442  RelAbsVector* pV1 = this->mX.toSBML();
443  RelAbsVector* pV2 = this->mY.toSBML();
444  RelAbsVector* pV3 = this->mZ.toSBML();
445  pText->setCoordinates(*pV1, *pV2, *pV3);
446  delete pV1;
447  delete pV2;
448  delete pV3;
449  pV1 = this->mFontSize.toSBML();
450  pText->setFontSize(*pV1);
451  delete pV1;
452  pText->setFontFamily(this->getFontFamily());
453  pText->setText(this->getText());
454 
455  switch (this->getFontWeight())
456  {
458  pText->setFontWeight(Text::WEIGHT_UNSET);
459  break;
460 
461  case CLText::WEIGHT_BOLD:
462  pText->setFontWeight(Text::WEIGHT_BOLD);
463  break;
464 
465  default:
466  pText->setFontWeight(Text::WEIGHT_NORMAL);
467  break;
468  }
469 
470  switch (this->getFontStyle())
471  {
472  case CLText::STYLE_UNSET:
473  pText->setFontStyle(Text::STYLE_UNSET);
474  break;
475 
477  pText->setFontStyle(Text::STYLE_ITALIC);
478  break;
479 
480  default:
481  pText->setFontStyle(Text::STYLE_NORMAL);
482  break;
483  }
484 
485  switch (this->getTextAnchor())
486  {
488  pText->setTextAnchor(Text::ANCHOR_UNSET);
489  break;
490 
491  case CLText::ANCHOR_END:
492  pText->setTextAnchor(Text::ANCHOR_END);
493  break;
494 
496  pText->setTextAnchor(Text::ANCHOR_MIDDLE);
497  break;
498 
499  default:
500  pText->setTextAnchor(Text::ANCHOR_START);
501  break;
502  }
503 
504  switch (this->getVTextAnchor())
505  {
507  pText->setVTextAnchor(Text::ANCHOR_UNSET);
508  break;
509 
511  pText->setVTextAnchor(Text::ANCHOR_BOTTOM);
512  break;
513 
515  pText->setVTextAnchor(Text::ANCHOR_MIDDLE);
516  break;
517 
518  default:
519  pText->setVTextAnchor(Text::ANCHOR_TOP);
520  break;
521  }
522 
523  return pText;
524 }
CLRelAbsVector mZ
Definition: CLText.h:61
FONT_STYLE getFontStyle() const
Definition: CLText.cpp:334
CLRelAbsVector mY
Definition: CLText.h:60
RelAbsVector * toSBML() const
CLRelAbsVector mX
Definition: CLText.h:59
const std::string & getFontFamily() const
Definition: CLText.cpp:302
TEXT_ANCHOR getVTextAnchor() const
Definition: CLText.cpp:350
const std::string & getText() const
Definition: CLText.cpp:358
CLRelAbsVector mFontSize
Definition: CLText.h:63
TEXT_ANCHOR getTextAnchor() const
Definition: CLText.cpp:342
virtual void addSBMLAttributes(GraphicalPrimitive1D *pPrimitive) const
FONT_WEIGHT getFontWeight() const
Definition: CLText.cpp:326

Member Data Documentation

std::string CLText::mFontFamily
protected

Definition at line 62 of file CLText.h.

Referenced by getFontFamily(), isSetFontFamily(), and setFontFamily().

CLRelAbsVector CLText::mFontSize
protected

Definition at line 63 of file CLText.h.

Referenced by getFontSize(), isSetFontSize(), setFontSize(), and toSBML().

FONT_STYLE CLText::mFontStyle
protected

Definition at line 65 of file CLText.h.

Referenced by getFontStyle(), isSetFontStyle(), and setFontStyle().

FONT_WEIGHT CLText::mFontWeight
protected

Definition at line 64 of file CLText.h.

Referenced by getFontWeight(), isSetFontWeight(), and setFontWeight().

std::string CLText::mKey
protected

key for the object.

Definition at line 73 of file CLText.h.

Referenced by CLText(), getKey(), and ~CLText().

std::string CLText::mText
protected

Definition at line 68 of file CLText.h.

Referenced by getText(), isSetText(), and setText().

TEXT_ANCHOR CLText::mTextAnchor
protected

Definition at line 66 of file CLText.h.

Referenced by getTextAnchor(), isSetTextAnchor(), and setTextAnchor().

TEXT_ANCHOR CLText::mVTextAnchor
protected

Definition at line 67 of file CLText.h.

Referenced by getVTextAnchor(), isSetVTextAnchor(), and setVTextAnchor().

CLRelAbsVector CLText::mX
protected

Definition at line 59 of file CLText.h.

Referenced by getX(), setCoordinates(), setX(), and toSBML().

CLRelAbsVector CLText::mY
protected

Definition at line 60 of file CLText.h.

Referenced by getY(), setCoordinates(), setY(), and toSBML().

CLRelAbsVector CLText::mZ
protected

Definition at line 61 of file CLText.h.

Referenced by getZ(), setCoordinates(), setZ(), and toSBML().


The documentation for this class was generated from the following files: