COPASI API  4.16.103
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CLabel Class Reference

#include <CLabel.h>

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

Public Member Functions

void adaptToHeight (const double &h)
 
 CLabel ()
 
 CLabel (const CLTextGlyph &tg)
 
 CLabel (const CLabel &l)
 
C_FLOAT64 getOrigHeight ()
 
C_FLOAT64 getOrigWidth ()
 
virtual std::string getText () const
 
virtual void scale (const double &scaleFactor)
 
void scalePosition (const double &hz)
 
- Public Member Functions inherited from CLTextGlyph
void clearText ()
 
virtual CLGraphicalObjectclone () const
 
 CLTextGlyph (const std::string &name="TextGlyph", const CCopasiContainer *pParent=NULL)
 
 CLTextGlyph (const CLTextGlyph &src, const CCopasiContainer *pParent=NULL)
 
 CLTextGlyph (const TextGlyph &sbml, const std::map< std::string, std::string > &modelmap, std::map< std::string, std::string > &layoutmap, const CCopasiContainer *pParent=NULL)
 
void exportReferenceToSBML (TextGlyph *g, const std::map< const CLBase *, const SBase * > &layoutmap) const
 
virtual void exportToSBML (TextGlyph *g, const std::map< const CCopasiObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs) const
 
CLGraphicalObjectgetGraphicalObject () const
 
const std::string & getGraphicalObjectKey () const
 
bool isTextSet () const
 
CLTextGlyphoperator= (const CLTextGlyph &rhs)
 
void print (std::ostream *ostream) const
 
void setGraphicalObjectKey (const std::string &k)
 
void setText (const std::string &t)
 
- Public Member Functions inherited from CLGraphicalObject
 CLGraphicalObject (const std::string &name="GraphicalObject", const CCopasiContainer *pParent=NULL)
 
 CLGraphicalObject (const CLGraphicalObject &src, const CCopasiContainer *pParent=NULL)
 
 CLGraphicalObject (const GraphicalObject &sbml, std::map< std::string, std::string > &layoutmap, const CCopasiContainer *pParent=NULL)
 
virtual void exportToSBML (GraphicalObject *sbmlobject, const std::map< const CCopasiObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs) const
 
const CLBoundingBoxgetBoundingBox () const
 
CLBoundingBoxgetBoundingBox ()
 
const CLDimensionsgetDimensions () const
 
const C_FLOAT64getHeight () const
 
virtual const std::string & getKey () const
 
CCopasiObjectgetModelObject () const
 
std::string getModelObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getModelObjectKey () const
 
std::string getModelObjectName () const
 
const std::string & getObjectRole () const
 
const CLPointgetPosition () const
 
const C_FLOAT64getWidth () const
 
const C_FLOAT64getX () const
 
const C_FLOAT64getY () const
 
bool hasValidModelReference () const
 
virtual void moveBy (const CLPoint &p)
 
CLGraphicalObjectoperator= (const CLGraphicalObject &rhs)
 
void print (std::ostream *ostream) const
 
void setBoundingBox (const CLBoundingBox &bb)
 
void setDimensions (const CLDimensions &d)
 
void setHeight (const C_FLOAT64 &h)
 
void setModelObjectKey (const std::string &k)
 
void setObjectRole (const std::string &role)
 
void setPosition (const CLPoint &p)
 
void setWidth (const C_FLOAT64 &w)
 
void setX (const C_FLOAT64 &x)
 
void setY (const C_FLOAT64 &y)
 
 ~CLGraphicalObject ()
 
- Public Member Functions inherited from CLBase
 CLBase ()
 
 CLBase (const CLBase &b)
 
 CLBase (const SBase &)
 
const std::string & getTag () const
 
bool hasTag () const
 
void setTag (const std::string &tag)
 
virtual ~CLBase ()
 
- Public Member Functions inherited from CCopasiContainer
virtual bool add (CCopasiObject *pObject, const bool &adopt=true)
 
 CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container)
 
 CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL)
 
virtual std::string getChildObjectUnits (const CCopasiObject *pObject) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
virtual const objectMapgetObjects () const
 
virtual std::string getUnits () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual bool remove (CCopasiObject *pObject)
 
virtual ~CCopasiContainer ()
 
- 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
 
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
 
UpdateMethodgetUpdateMethod () 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
 
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 ()
 

Private Member Functions

void initOrigValues ()
 

Private Attributes

C_FLOAT64 orig_height
 
C_FLOAT64 orig_width
 
C_FLOAT64 orig_x
 
C_FLOAT64 orig_y
 

Additional Inherited Members

- Public Types inherited from CCopasiContainer
typedef std::multimap
< std::string, CCopasiObject * > 
objectMap
 
- 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
 
- 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 CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 
- 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 CCopasiContainer
template<class CType >
CCopasiObjectaddMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
void initObjects ()
 
- 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)
 
- Protected Attributes inherited from CLTextGlyph
std::string mGraphicalObjectKey
 
bool mIsTextSet
 
std::string mText
 
- Protected Attributes inherited from CLGraphicalObject
CLBoundingBox mBBox
 
std::string mKey
 
std::string mModelObjectKey
 
std::string mObjectRole
 
- Protected Attributes inherited from CLBase
std::string mTag
 
- Protected Attributes inherited from CCopasiContainer
objectMap mObjects
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

Definition at line 27 of file CLabel.h.

Constructor & Destructor Documentation

CLabel::CLabel ( )

Definition at line 25 of file CLabel.cpp.

References initOrigValues().

26  : CLTextGlyph()
27 {
29 }
void initOrigValues()
Definition: CLabel.cpp:43
CLTextGlyph(const std::string &name="TextGlyph", const CCopasiContainer *pParent=NULL)
Definition: CLGlyphs.cpp:180
CLabel::CLabel ( const CLTextGlyph tg)

Definition at line 31 of file CLabel.cpp.

References initOrigValues().

32  : CLTextGlyph(tg)
33 {
35 }
void initOrigValues()
Definition: CLabel.cpp:43
CLTextGlyph(const std::string &name="TextGlyph", const CCopasiContainer *pParent=NULL)
Definition: CLGlyphs.cpp:180
CLabel::CLabel ( const CLabel l)

Definition at line 37 of file CLabel.cpp.

References initOrigValues().

38  : CLTextGlyph(l)
39 {
41 }
void initOrigValues()
Definition: CLabel.cpp:43
CLTextGlyph(const std::string &name="TextGlyph", const CCopasiContainer *pParent=NULL)
Definition: CLGlyphs.cpp:180

Member Function Documentation

void CLabel::adaptToHeight ( const double &  h)

Definition at line 62 of file CLabel.cpp.

References C_FLOAT64, CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLDimensions::getWidth(), CLGraphicalObject::mBBox, and CLBoundingBox::setDimensions().

63 {
64  C_FLOAT64 scaleFactor = h / mBBox.getDimensions().getHeight();
65  C_FLOAT64 w = mBBox.getDimensions().getWidth() * scaleFactor;
67 }
const C_FLOAT64 & getWidth() const
Definition: CLBase.h:211
const CLDimensions & getDimensions() const
Definition: CLBase.h:266
void setDimensions(const CLDimensions &d)
Definition: CLBase.h:273
CLBoundingBox mBBox
const C_FLOAT64 & getHeight() const
Definition: CLBase.h:212
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 CLabel::getOrigHeight ( )
inline

Definition at line 43 of file CLabel.h.

References orig_height.

43 {return this->orig_height;}
C_FLOAT64 orig_height
Definition: CLabel.h:33
C_FLOAT64 CLabel::getOrigWidth ( )
inline

Definition at line 44 of file CLabel.h.

References orig_width.

44 {return this->orig_width;}
C_FLOAT64 orig_width
Definition: CLabel.h:32
std::string CLabel::getText ( ) const
virtual

Since labels are not part of the model, we can't use the new method for getting the text but have to fall back to the old behavior. Hopefully I can get rid of this implementation sonner than later.

Reimplemented from CLTextGlyph.

Definition at line 80 of file CLabel.cpp.

References CKeyFactory::get(), CCopasiRootContainer::getKeyFactory(), CCopasiObject::getObjectName(), CLTextGlyph::mIsTextSet, CLGraphicalObject::mModelObjectKey, and CLTextGlyph::mText.

81 {
82  if (mIsTextSet)
83  {
84  return mText;
85  }
86  else
87  {
89 
90  if (pObject)
91  {
92  return pObject->getObjectName();
93  }
94  else
95  {
96  return "unset";
97  }
98  }
99 }
std::string mModelObjectKey
const std::string & getObjectName() const
CCopasiObject * get(const std::string &key)
bool mIsTextSet
Definition: CLGlyphs.h:126
static CKeyFactory * getKeyFactory()
std::string mText
Definition: CLGlyphs.h:127
void CLabel::initOrigValues ( )
private

Definition at line 43 of file CLabel.cpp.

References CLGraphicalObject::getHeight(), CLGraphicalObject::getWidth(), CLGraphicalObject::getX(), CLGraphicalObject::getY(), orig_height, orig_width, orig_x, and orig_y.

Referenced by CLabel().

44 {
45  orig_x = this->getX();
46  orig_y = this->getY();
47  orig_width = this->getWidth();
48  orig_height = this->getHeight();
49 }
C_FLOAT64 orig_width
Definition: CLabel.h:32
const C_FLOAT64 & getX() const
C_FLOAT64 orig_height
Definition: CLabel.h:33
const C_FLOAT64 & getWidth() const
const C_FLOAT64 & getY() const
C_FLOAT64 orig_y
Definition: CLabel.h:31
const C_FLOAT64 & getHeight() const
C_FLOAT64 orig_x
Definition: CLabel.h:30
void CLabel::scale ( const double &  scaleFactor)
virtual

Definition at line 52 of file CLabel.cpp.

References orig_height, orig_width, orig_x, orig_y, CLGraphicalObject::setHeight(), CLGraphicalObject::setWidth(), CLGraphicalObject::setX(), and CLGraphicalObject::setY().

53 {
54  this->setX(this->orig_x * scaleFactor);
55  this->setY(this->orig_y * scaleFactor);
56  this->setWidth(this->orig_width * scaleFactor);
57  this->setHeight(this->orig_height * scaleFactor);
58 }
C_FLOAT64 orig_width
Definition: CLabel.h:32
void setY(const C_FLOAT64 &y)
C_FLOAT64 orig_height
Definition: CLabel.h:33
void setHeight(const C_FLOAT64 &h)
C_FLOAT64 orig_y
Definition: CLabel.h:31
void setWidth(const C_FLOAT64 &w)
void setX(const C_FLOAT64 &x)
C_FLOAT64 orig_x
Definition: CLabel.h:30
void CLabel::scalePosition ( const double &  hz)

Definition at line 69 of file CLabel.cpp.

References CLBoundingBox::getPosition(), CLPoint::getX(), CLPoint::getY(), CLGraphicalObject::mBBox, CLPoint::setX(), and CLPoint::setY().

70 {
71  this->mBBox.getPosition().setX(this->mBBox.getPosition().getX() * z);
72  this->mBBox.getPosition().setY(this->mBBox.getPosition().getY() * z);
73 }
void setX(const C_FLOAT64 &x)
Definition: CLBase.h:91
void setY(const C_FLOAT64 &y)
Definition: CLBase.h:92
const C_FLOAT64 & getX() const
Definition: CLBase.h:83
CLBoundingBox mBBox
const CLPoint & getPosition() const
Definition: CLBase.h:265
const C_FLOAT64 & getY() const
Definition: CLBase.h:84

Member Data Documentation

C_FLOAT64 CLabel::orig_height
private

Definition at line 33 of file CLabel.h.

Referenced by getOrigHeight(), initOrigValues(), and scale().

C_FLOAT64 CLabel::orig_width
private

Definition at line 32 of file CLabel.h.

Referenced by getOrigWidth(), initOrigValues(), and scale().

C_FLOAT64 CLabel::orig_x
private

Definition at line 30 of file CLabel.h.

Referenced by initOrigValues(), and scale().

C_FLOAT64 CLabel::orig_y
private

Definition at line 31 of file CLabel.h.

Referenced by initOrigValues(), and scale().


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