COPASI API  4.16.103
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | Friends | List of all members
CLMetabReferenceGlyph Class Reference

#include <CLReactionGlyph.h>

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

Public Types

enum  Role {
  UNDEFINED, SUBSTRATE, PRODUCT, SIDESUBSTRATE,
  SIDEPRODUCT, MODIFIER, ACTIVATOR, INHIBITOR
}
 
- 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
 

Public Member Functions

 CLMetabReferenceGlyph (const std::string &name="MetabReferenceGlyph", const CCopasiContainer *pParent=NULL)
 
 CLMetabReferenceGlyph (const CLMetabReferenceGlyph &src, const CCopasiContainer *pParent=NULL)
 
 CLMetabReferenceGlyph (const SpeciesReferenceGlyph &sbml, const std::map< std::string, std::string > &modelmap, std::map< std::string, std::string > &layoutmap, const CCopasiContainer *pParent=NULL)
 
virtual CLGraphicalObjectclone () const
 
virtual void exportToSBML (SpeciesReferenceGlyph *g, const std::map< const CCopasiObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs, const std::map< const CLBase *, const SBase * > &layoutmap) const
 
CLMetabGlyphgetMetabGlyph () const
 
const std::string & getMetabGlyphKey () const
 
Role getRole () const
 
const std::string & getRoleDisplayName () const
 
CLMetabReferenceGlyphoperator= (const CLMetabReferenceGlyph &rhs)
 
void print (std::ostream *ostream) const
 
void setMetabGlyphKey (const std::string &k)
 
void setRole (Role r)
 
- Public Member Functions inherited from CLGlyphWithCurve
 CLGlyphWithCurve (const std::string &name="ReferenceGlyph", const CCopasiContainer *pParent=NULL)
 
 CLGlyphWithCurve (const CLGlyphWithCurve &src, const CCopasiContainer *pParent=NULL)
 
 CLGlyphWithCurve (const GraphicalObject &sbml, const std::map< std::string, std::string > &modelmap, std::map< std::string, std::string > &layoutmap, const CCopasiContainer *pParent=NULL)
 
const CLCurvegetCurve () const
 
CLCurvegetCurve ()
 
virtual void moveBy (const CLPoint &p)
 
CLGlyphWithCurveoperator= (const CLGlyphWithCurve &rhs)
 
void setCurve (const CLCurve &c)
 
- 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
 
CLGraphicalObjectoperator= (const CLGraphicalObject &rhs)
 
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 ()
 

Static Public Attributes

static const std::string RoleName []
 
static const std::string XMLRole []
 
- Static Public Attributes inherited from CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 

Private Attributes

std::string mMetabGlyphKey
 
Role mRole
 

Friends

std::ostream & operator<< (std::ostream &os, const CLMetabReferenceGlyph &g)
 

Additional Inherited Members

- 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)
 
- 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 CLGlyphWithCurve
CLCurve mCurve
 
- 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

Graphical representation of a CChemEqElement. This correspondents to the sbml SpeciesReferenceGlyph. The copasi equivalent is the CChemEqElement, however it has no key, so it cannot be referred to.

Definition at line 141 of file CLReactionGlyph.h.

Member Enumeration Documentation

Enum type for the role of the metab reference This enum must be synchronized with the corresponding enum in libsbml (sbml/layout/SpeciesReferenceRole.h)

Enumerator
UNDEFINED 
SUBSTRATE 
PRODUCT 
SIDESUBSTRATE 
SIDEPRODUCT 
MODIFIER 
ACTIVATOR 
INHIBITOR 

Definition at line 150 of file CLReactionGlyph.h.

Constructor & Destructor Documentation

CLMetabReferenceGlyph::CLMetabReferenceGlyph ( const std::string &  name = "MetabReferenceGlyph",
const CCopasiContainer pParent = NULL 
)

Definition at line 256 of file CLReactionGlyph.cpp.

Referenced by clone().

258  : CLGlyphWithCurve(name, pParent),
259  mMetabGlyphKey(),
261 {}
CLGlyphWithCurve(const std::string &name="ReferenceGlyph", const CCopasiContainer *pParent=NULL)
CLMetabReferenceGlyph::CLMetabReferenceGlyph ( const CLMetabReferenceGlyph src,
const CCopasiContainer pParent = NULL 
)

Definition at line 263 of file CLReactionGlyph.cpp.

265  : CLGlyphWithCurve(src, pParent),
267  mRole(src.mRole)
268 {}
CLGlyphWithCurve(const std::string &name="ReferenceGlyph", const CCopasiContainer *pParent=NULL)
CLMetabReferenceGlyph::CLMetabReferenceGlyph ( const SpeciesReferenceGlyph &  sbml,
const std::map< std::string, std::string > &  modelmap,
std::map< std::string, std::string > &  layoutmap,
const CCopasiContainer pParent = NULL 
)

constructor from libsbml object

Definition at line 270 of file CLReactionGlyph.cpp.

References CLGlyphWithCurve::mCurve, mMetabGlyphKey, and CLGraphicalObject::setModelObjectKey().

274  : CLGlyphWithCurve(sbml, modelmap, layoutmap, pParent),
275  mMetabGlyphKey(), //initialized in the body below
276  mRole((Role)sbml.getRole())
277 {
278  //get the copasi key corresponding to the sbml id for the species reference
279  if (sbml.getSpeciesReferenceId() != "")
280  {
281  std::map<std::string, std::string>::const_iterator it = modelmap.find(sbml.getSpeciesReferenceId());
282 
283  if (it != modelmap.end())
284  setModelObjectKey(it->second);
285  }
286 
287  //get the copasi key corresponding to the sbml id for the species glyph
288  if (sbml.getSpeciesGlyphId() != "")
289  {
290  std::map<std::string, std::string>::const_iterator it = layoutmap.find(sbml.getSpeciesGlyphId());
291 
292  if (it != layoutmap.end())
293  mMetabGlyphKey = it->second;
294  }
295 
296  //curve
297  if (sbml.getCurve())
298  {
299  CLCurve copy(*sbml.getCurve());
300  mCurve = copy;
301  }
302 }
void setModelObjectKey(const std::string &k)
CLGlyphWithCurve(const std::string &name="ReferenceGlyph", const CCopasiContainer *pParent=NULL)

Member Function Documentation

virtual CLGraphicalObject* CLMetabReferenceGlyph::clone ( ) const
inlinevirtual

Reimplemented from CLGraphicalObject.

Definition at line 212 of file CLReactionGlyph.h.

References CLMetabReferenceGlyph().

212 {return new CLMetabReferenceGlyph(*this, NULL);};
CLMetabReferenceGlyph(const std::string &name="MetabReferenceGlyph", const CCopasiContainer *pParent=NULL)
void CLMetabReferenceGlyph::exportToSBML ( SpeciesReferenceGlyph *  g,
const std::map< const CCopasiObject *, SBase * > &  copasimodelmap,
std::map< std::string, const SBase * > &  sbmlIDs,
const std::map< const CLBase *, const SBase * > &  layoutmap 
) const
virtual

This method writes the information of the COPASI layout object into the corresponding SBML object layoutmap contains a map from COPASI layout objects to libsbml layout objects. this is needed for resolving the reference to the metab glyph.

Definition at line 323 of file CLReactionGlyph.cpp.

References CLGraphicalObject::exportToSBML(), CLCurve::exportToSBML(), getMetabGlyph(), CLGlyphWithCurve::mCurve, and mRole.

Referenced by CLReactionGlyph::exportToSBML().

327 {
328  if (!g) return;
329 
330  //call the coresponding method of the base class
331  CLGraphicalObject::exportToSBML(g, copasimodelmap, sbmlIDs);
332 
333  //reference to species glyph
334  CLMetabGlyph* tmp = getMetabGlyph();
335 
336  if (tmp)
337  {
338  std::map<const CLBase*, const SBase*>::const_iterator it = layoutmap.find(tmp);
339 
340  if (it != layoutmap.end())
341  {
342  if (it->second)
343  {
344  //we need to cast here since layout objects in libsbml donĀ“t inherit the getId() method
345  //from SBase
346  const GraphicalObject* pGO = dynamic_cast<const GraphicalObject*>(it->second);
347 
348  if (pGO)
349  g->setSpeciesGlyphId(pGO->getId());
350  }
351  }
352  }
353 
354  //curve
355  mCurve.exportToSBML(g->getCurve(), copasimodelmap);
356 
357  //Role
358  g->setRole((SpeciesReferenceRole_t)mRole);
359  //this depends on the copasi role enum being synchronous to the sbml one
360 }
void exportToSBML(Curve *c, const std::map< const CCopasiObject *, SBase * > &copasimodelmap) const
Definition: CLCurve.cpp:148
virtual void exportToSBML(GraphicalObject *sbmlobject, const std::map< const CCopasiObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs) const
CLMetabGlyph * getMetabGlyph() const
CLMetabGlyph * CLMetabReferenceGlyph::getMetabGlyph ( ) const
const std::string& CLMetabReferenceGlyph::getMetabGlyphKey ( ) const
inline
Role CLMetabReferenceGlyph::getRole ( ) const
inline
const std::string& CLMetabReferenceGlyph::getRoleDisplayName ( ) const
inline

Definition at line 209 of file CLReactionGlyph.h.

References mRole, and RoleName.

210  {return RoleName[mRole];};
static const std::string RoleName[]
CLMetabReferenceGlyph & CLMetabReferenceGlyph::operator= ( const CLMetabReferenceGlyph rhs)

assignment operator.

Definition at line 304 of file CLReactionGlyph.cpp.

References mMetabGlyphKey, mRole, and CLGlyphWithCurve::operator=().

305 {
306  if (this == &rhs) return * this; //do nothing if lhs and rhs are the same
307 
309 
310  //handle the specific glyph stuff:
312  mRole = rhs.mRole;
313 
314  return *this;
315 }
CLGlyphWithCurve & operator=(const CLGlyphWithCurve &rhs)
void CLMetabReferenceGlyph::print ( std::ostream *  ostream) const
virtual

This is the output method for any object. The default implementation provided with CCopasiObject uses the ostream operator<< of the object to print the object.To override this default behavior one needs to reimplement the virtual print function.

Parameters
std::ostream* ostream

Reimplemented from CLGlyphWithCurve.

Definition at line 379 of file CLReactionGlyph.cpp.

380 {*ostream << *this;}
void CLMetabReferenceGlyph::setMetabGlyphKey ( const std::string &  k)
inline
void CLMetabReferenceGlyph::setRole ( Role  r)
inline

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CLMetabReferenceGlyph g 
)
friend

insert operator

Definition at line 362 of file CLReactionGlyph.cpp.

363 {
364  os << " MetabReferenceGlyph: " << dynamic_cast<const CLGraphicalObject&>(g);
365 
366  os << " Role: " << CLMetabReferenceGlyph::RoleName[g.getRole()] << "\n";
367 
368  const CLMetabGlyph* tmp = g.getMetabGlyph();
369 
370  if (tmp)
371  os << " refers to a MetabGlyph that refers to "
372  << tmp->getModelObjectDisplayName() << std::endl;
373 
374  os << g.mCurve;
375 
376  return os;
377 }
std::string getModelObjectDisplayName(bool regular=true, bool richtext=false) const
static const std::string RoleName[]
CLMetabGlyph * getMetabGlyph() const

Member Data Documentation

std::string CLMetabReferenceGlyph::mMetabGlyphKey
private
Role CLMetabReferenceGlyph::mRole
private

Definition at line 180 of file CLReactionGlyph.h.

Referenced by exportToSBML(), getRole(), getRoleDisplayName(), operator=(), and setRole().

const std::string CLMetabReferenceGlyph::RoleName
static
Initial value:
=
{
"undefined role",
"substrate",
"product",
"side substrate",
"side product",
"modifier",
"activator",
"inhibitor"
""
}

String literals for the GUI to display the role of a metab reference

Definition at line 166 of file CLReactionGlyph.h.

Referenced by getRoleDisplayName().

const std::string CLMetabReferenceGlyph::XMLRole
static
Initial value:
=
{
"undefinedRole",
"substrate",
"product",
"sideSubstrate",
"sideProduct",
"modifier",
"activator",
"inhibitor",
""
}

XML type names of the roles. This is used in the XML importer and exporter

Definition at line 172 of file CLReactionGlyph.h.

Referenced by CCopasiXML::saveLayoutList(), and CCopasiXMLParser::MetaboliteReferenceGlyphElement::start().


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