COPASI API  4.16.103
Public Member Functions | Protected Attributes | Friends | List of all members
CLReactionGlyph Class Reference

#include <CLReactionGlyph.h>

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

Public Member Functions

void addMetabReferenceGlyph (CLMetabReferenceGlyph *glyph)
 
virtual CLGraphicalObjectclone () const
 
 CLReactionGlyph (const std::string &name="ReactionGlyph", const CCopasiContainer *pParent=NULL)
 
 CLReactionGlyph (const CLReactionGlyph &src, const CCopasiContainer *pParent=NULL)
 
 CLReactionGlyph (const ReactionGlyph &sbml, const std::map< std::string, std::string > &modelmap, std::map< std::string, std::string > &layoutmap, const CCopasiContainer *pParent=NULL)
 
virtual void exportToSBML (ReactionGlyph *g, const std::map< const CCopasiObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs, std::map< const CLBase *, const SBase * > &layoutmap) const
 
const CCopasiVector
< CLMetabReferenceGlyph > & 
getListOfMetabReferenceGlyphs () const
 
CCopasiVector
< CLMetabReferenceGlyph > & 
getListOfMetabReferenceGlyphs ()
 
virtual void moveBy (const CLPoint &p)
 
CLReactionGlyphoperator= (const CLReactionGlyph &rhs)
 
void print (std::ostream *ostream) const
 
- 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 ()
 
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 ()
 

Protected Attributes

CCopasiVector
< CLMetabReferenceGlyph
mvMetabReferences
 
- 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
 

Friends

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

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)
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

Graphical representation of a reaction

Definition at line 312 of file CLReactionGlyph.h.

Constructor & Destructor Documentation

CLReactionGlyph::CLReactionGlyph ( const std::string &  name = "ReactionGlyph",
const CCopasiContainer pParent = NULL 
)

Definition at line 674 of file CLReactionGlyph.cpp.

Referenced by clone().

676  : CLGlyphWithCurve(name, pParent),
677  mvMetabReferences("ListOfMetabReferenceGlyphs", this)
678 {}
CLGlyphWithCurve(const std::string &name="ReferenceGlyph", const CCopasiContainer *pParent=NULL)
CCopasiVector< CLMetabReferenceGlyph > mvMetabReferences
CLReactionGlyph::CLReactionGlyph ( const CLReactionGlyph src,
const CCopasiContainer pParent = NULL 
)

Definition at line 680 of file CLReactionGlyph.cpp.

682  : CLGlyphWithCurve(src, pParent),
684 {
685  //TODO
686 }
CLGlyphWithCurve(const std::string &name="ReferenceGlyph", const CCopasiContainer *pParent=NULL)
CCopasiVector< CLMetabReferenceGlyph > mvMetabReferences
CLReactionGlyph::CLReactionGlyph ( const ReactionGlyph &  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 688 of file CLReactionGlyph.cpp.

References addMetabReferenceGlyph(), C_INT32, CLGlyphWithCurve::mCurve, and CLGraphicalObject::setModelObjectKey().

692  : CLGlyphWithCurve(sbml, modelmap, layoutmap, pParent),
693  mvMetabReferences("ListOfMetabReferenceGlyphs", this)
694 {
695  //get the copasi key corresponding to the sbml id for the reaction
696  if (sbml.getReactionId() != "")
697  {
698  std::map<std::string, std::string>::const_iterator it = modelmap.find(sbml.getReactionId());
699 
700  if (it != modelmap.end())
701  setModelObjectKey(it->second);
702  }
703 
704  //species reference glyphs
705  C_INT32 i, imax = sbml.getListOfSpeciesReferenceGlyphs()->size();
706 
707  for (i = 0; i < imax; ++i)
708  {
709  const SpeciesReferenceGlyph* tmp
710  = dynamic_cast<const SpeciesReferenceGlyph*>(sbml.getListOfSpeciesReferenceGlyphs()->get(i));
711 
712  if (tmp)
713  addMetabReferenceGlyph(new CLMetabReferenceGlyph(*tmp, modelmap, layoutmap));
714  }
715 
716  //curve
717  if (sbml.getCurve())
718  {
719  CLCurve copy(*sbml.getCurve());
720  mCurve = copy;
721  }
722 }
void addMetabReferenceGlyph(CLMetabReferenceGlyph *glyph)
#define C_INT32
Definition: copasi.h:90
void setModelObjectKey(const std::string &k)
CLGlyphWithCurve(const std::string &name="ReferenceGlyph", const CCopasiContainer *pParent=NULL)
CCopasiVector< CLMetabReferenceGlyph > mvMetabReferences

Member Function Documentation

void CLReactionGlyph::addMetabReferenceGlyph ( CLMetabReferenceGlyph glyph)

add Glyph to reaction glyph. The reaction glyph takes ownership of the glyph.

Definition at line 753 of file CLReactionGlyph.cpp.

References CCopasiVector< T >::add(), and mvMetabReferences.

Referenced by CLReactionGlyph(), CCopasiSpringLayout::createLayout(), CLayoutInitializer::createReactionGlyph(), operator=(), and CCopasiXMLParser::MetaboliteReferenceGlyphElement::start().

754 {
755  if (glyph)
756  mvMetabReferences.add(glyph, true); //true means vector takes ownership
757 }
virtual bool add(const CType &src)
CCopasiVector< CLMetabReferenceGlyph > mvMetabReferences
virtual CLGraphicalObject* CLReactionGlyph::clone ( ) const
inlinevirtual

Reimplemented from CLGraphicalObject.

Definition at line 351 of file CLReactionGlyph.h.

References CLReactionGlyph().

351 {return new CLReactionGlyph(*this, NULL);};
CLReactionGlyph(const std::string &name="ReactionGlyph", const CCopasiContainer *pParent=NULL)
void CLReactionGlyph::exportToSBML ( ReactionGlyph *  g,
const std::map< const CCopasiObject *, SBase * > &  copasimodelmap,
std::map< std::string, const SBase * > &  sbmlIDs,
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. the exported metab reference glyphs will be added.

Definition at line 769 of file CLReactionGlyph.cpp.

References CLGraphicalObject::exportToSBML(), CLMetabReferenceGlyph::exportToSBML(), CLCurve::exportToSBML(), CLGraphicalObject::getModelObject(), CLGlyphWithCurve::mCurve, mvMetabReferences, and CCopasiVector< T >::size().

Referenced by CLayout::exportToSBML().

773 {
774  if (!g) return;
775 
776  //call the coresponding method of the base class
777  CLGraphicalObject::exportToSBML(g, copasimodelmap, sbmlIDs);
778 
779  //reference to model objects
780  CCopasiObject* tmp = getModelObject();
781 
782  if (tmp)
783  {
784  std::map<const CCopasiObject*, SBase*>::const_iterator it = copasimodelmap.find(tmp);
785 
786  if (it != copasimodelmap.end())
787  {
788  if (it->second)
789  g->setReactionId(it->second->getId());
790  }
791  }
792 
793  //curve
794  mCurve.exportToSBML(g->getCurve(), copasimodelmap);
795 
796  //Metab reference glyphs
797  size_t i, imax = mvMetabReferences.size();
798 
799  for (i = 0; i < imax; ++i)
800  {
802 
803  //check if the glyph exists in the libsbml data
804  std::map<const CCopasiObject*, SBase*>::const_iterator it;
805  it = copasimodelmap.find(tmp);
806 
807  SpeciesReferenceGlyph * pG;
808 
809  if (it == copasimodelmap.end()) //not found
810  {
811  pG = new SpeciesReferenceGlyph;
812  g->getListOfSpeciesReferenceGlyphs()->appendAndOwn(pG);
813  }
814  else
815  {
816  pG = dynamic_cast<SpeciesReferenceGlyph*>(it->second);
817  }
818 
819  layoutmap.insert(std::pair<const CLBase*, const SBase*>(tmp, pG));
820  tmp->exportToSBML(pG, copasimodelmap, sbmlIDs, layoutmap);
821  }
822 }
void exportToSBML(Curve *c, const std::map< const CCopasiObject *, SBase * > &copasimodelmap) const
Definition: CLCurve.cpp:148
virtual size_t size() 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
virtual void exportToSBML(GraphicalObject *sbmlobject, const std::map< const CCopasiObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs) const
CCopasiObject * getModelObject() const
CCopasiVector< CLMetabReferenceGlyph > mvMetabReferences
const CCopasiVector<CLMetabReferenceGlyph>& CLReactionGlyph::getListOfMetabReferenceGlyphs ( ) const
inline
CCopasiVector<CLMetabReferenceGlyph>& CLReactionGlyph::getListOfMetabReferenceGlyphs ( )
inline

Definition at line 341 of file CLReactionGlyph.h.

References mvMetabReferences.

342  {return mvMetabReferences;};
CCopasiVector< CLMetabReferenceGlyph > mvMetabReferences
void CLReactionGlyph::moveBy ( const CLPoint p)
virtual

Reimplemented from CLGlyphWithCurve.

Definition at line 759 of file CLReactionGlyph.cpp.

References CLGlyphWithCurve::moveBy(), mvMetabReferences, and CCopasiVector< T >::size().

760 {
762 
763  size_t i, imax = mvMetabReferences.size();
764 
765  for (i = 0; i < imax; ++i)
766  mvMetabReferences[i]->moveBy(p);
767 }
virtual void moveBy(const CLPoint &p)
virtual size_t size() const
CCopasiVector< CLMetabReferenceGlyph > mvMetabReferences
virtual void moveBy(const CLPoint &p)
CLReactionGlyph & CLReactionGlyph::operator= ( const CLReactionGlyph rhs)

assignment operator. makes a deep copy

Definition at line 724 of file CLReactionGlyph.cpp.

References addMetabReferenceGlyph(), mvMetabReferences, CLGlyphWithCurve::operator=(), and CCopasiVector< T >::size().

725 {
726  if (this == &rhs) return * this; //do nothing if lhs and rhs are the same
727 
729 
730  //handle the specific glyph stuff:
731  size_t i, imax = rhs.mvMetabReferences.size();
732 
733  for (i = 0; i < imax; ++i)
735 
736  return *this;
737 }
CLGlyphWithCurve & operator=(const CLGlyphWithCurve &rhs)
virtual size_t size() const
void addMetabReferenceGlyph(CLMetabReferenceGlyph *glyph)
CCopasiVector< CLMetabReferenceGlyph > mvMetabReferences
void CLReactionGlyph::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 842 of file CLReactionGlyph.cpp.

843 {*ostream << *this;}

Friends And Related Function Documentation

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

insert operator

Definition at line 824 of file CLReactionGlyph.cpp.

825 {
826  os << "ReactionGlyph: " << dynamic_cast<const CLGraphicalObject&>(g);
827  os << g.mCurve;
828 
829  size_t i, imax = g.mvMetabReferences.size();
830 
831  if (imax)
832  {
833  os << " List of metab reference glyphs: \n";
834 
835  for (i = 0; i < imax; ++i)
836  os << *g.mvMetabReferences[i];
837  }
838 
839  return os;
840 }
virtual size_t size() const
CCopasiVector< CLMetabReferenceGlyph > mvMetabReferences

Member Data Documentation

CCopasiVector<CLMetabReferenceGlyph> CLReactionGlyph::mvMetabReferences
protected

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