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

#include <CLReactionGlyph.h>

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

Public Member Functions

void addReferenceGlyph (CLReferenceGlyph *glyph)
 
void addSubglyph (CLGraphicalObject *glyph)
 
 CLGeneralGlyph (const std::string &name="GeneralGlyph", const CCopasiContainer *pParent=NULL)
 
 CLGeneralGlyph (const CLGeneralGlyph &src, const CCopasiContainer *pParent=NULL)
 
 CLGeneralGlyph (const GraphicalObject &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 (GraphicalObject *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
< CLReferenceGlyph > & 
getListOfReferenceGlyphs () const
 
CCopasiVector< CLReferenceGlyph > & getListOfReferenceGlyphs ()
 
const CCopasiVector
< CLGraphicalObject > & 
getListOfSubglyphs () const
 
CCopasiVector
< CLGraphicalObject > & 
getListOfSubglyphs ()
 
virtual void moveBy (const CLPoint &p)
 
CLGeneralGlyphoperator= (const CLGeneralGlyph &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< CLReferenceGlyphmvReferences
 
CCopasiVector< CLGraphicalObjectmvSubglyphs
 
- 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 CLGeneralGlyph &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

general glyph

Definition at line 235 of file CLReactionGlyph.h.

Constructor & Destructor Documentation

CLGeneralGlyph::CLGeneralGlyph ( const std::string &  name = "GeneralGlyph",
const CCopasiContainer pParent = NULL 
)

Definition at line 384 of file CLReactionGlyph.cpp.

Referenced by CLGeneralGlyph(), and clone().

386  : CLGlyphWithCurve(name, pParent)
387  , mvReferences("ListOfReferenceGlyphs", this)
388  , mvSubglyphs("ListOfSubglyphs", this)
389 {}
CLGlyphWithCurve(const std::string &name="ReferenceGlyph", const CCopasiContainer *pParent=NULL)
CCopasiVector< CLReferenceGlyph > mvReferences
CCopasiVector< CLGraphicalObject > mvSubglyphs
CLGeneralGlyph::CLGeneralGlyph ( const CLGeneralGlyph src,
const CCopasiContainer pParent = NULL 
)

Definition at line 391 of file CLReactionGlyph.cpp.

References addSubglyph(), mvSubglyphs, and CCopasiVector< T >::size().

393  : CLGlyphWithCurve(src, pParent)
394  , mvReferences(src.mvReferences, this)
395  , mvSubglyphs("ListOfSubglyphs", this)
396 {
397  size_t i, imax = src.mvSubglyphs.size();
398 
399  for (i = 0; i < imax; ++i)
400  addSubglyph(src.mvSubglyphs[i]->clone());
401 }
virtual size_t size() const
void addSubglyph(CLGraphicalObject *glyph)
CLGlyphWithCurve(const std::string &name="ReferenceGlyph", const CCopasiContainer *pParent=NULL)
CCopasiVector< CLReferenceGlyph > mvReferences
CCopasiVector< CLGraphicalObject > mvSubglyphs
CLGeneralGlyph::CLGeneralGlyph ( const GraphicalObject &  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 404 of file CLReactionGlyph.cpp.

References addReferenceGlyph(), addSubglyph(), C_INT32, CLGeneralGlyph(), and CLGraphicalObject::setModelObjectKey().

408  : CLGlyphWithCurve(sbml, modelmap, layoutmap, pParent)
409  , mvReferences("ListOfReferenceGlyphs", this)
410  , mvSubglyphs("ListOfSubglyphs", this)
411 {
412 #if LIBSBML_VERSION >= 50800
413 
414  const GeneralGlyph* general = dynamic_cast<const GeneralGlyph *>(&sbml);
415 
416  if (!general)
417  return;
418 
419  //get the copasi key corresponding to the sbml id for the reaction
420  if (general->isSetReferenceId())
421  {
422  std::map<std::string, std::string>::const_iterator it = modelmap.find(general->getReferenceId());
423 
424  if (it != modelmap.end())
425  setModelObjectKey(it->second);
426 
427  it = layoutmap.find(general->getReferenceId());
428 
429  if (it != layoutmap.end())
430  setModelObjectKey(it->second);
431  }
432 
433  //species reference glyphs
434  C_INT32 i, imax = general->getListOfReferenceGlyphs()->size();
435 
436  for (i = 0; i < imax; ++i)
437  {
438  const ReferenceGlyph* tmp
439  = dynamic_cast<const ReferenceGlyph*>(general->getListOfReferenceGlyphs()->get(i));
440 
441  if (tmp)
442  addReferenceGlyph(new CLReferenceGlyph(*tmp, modelmap, layoutmap));
443  }
444 
445  imax = general->getListOfSubGlyphs()->size();
446 
447  for (i = 0; i < imax; ++i)
448  {
449  const GraphicalObject* graphical = general->getListOfSubGlyphs()->get(i);
450  const TextGlyph* text = dynamic_cast<const TextGlyph*>(graphical);
451  const SpeciesGlyph* species = dynamic_cast<const SpeciesGlyph*>(graphical);
452  const CompartmentGlyph* comp = dynamic_cast<const CompartmentGlyph*>(graphical);
453 
454  if (text)
455  addSubglyph(new CLTextGlyph(*text, modelmap, layoutmap));
456  else if (species)
457  addSubglyph(new CLMetabGlyph(*species, modelmap, layoutmap));
458  else if (comp)
459  addSubglyph(new CLCompartmentGlyph(*comp, modelmap, layoutmap));
460  else
461  addSubglyph(new CLGeneralGlyph(*graphical, modelmap, layoutmap));
462  }
463 
464 #endif // LIBSBML_VERSION >= 50800
465 }
void addReferenceGlyph(CLReferenceGlyph *glyph)
void addSubglyph(CLGraphicalObject *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< CLReferenceGlyph > mvReferences
CCopasiVector< CLGraphicalObject > mvSubglyphs
CLGeneralGlyph(const std::string &name="GeneralGlyph", const CCopasiContainer *pParent=NULL)

Member Function Documentation

void CLGeneralGlyph::addReferenceGlyph ( CLReferenceGlyph glyph)

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

Definition at line 497 of file CLReactionGlyph.cpp.

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

Referenced by CLGeneralGlyph(), CCopasiSpringLayout::createLayout(), and operator=().

498 {
499  if (glyph)
500  mvReferences.add(glyph, true); //true means vector takes ownership
501 }
virtual bool add(const CType &src)
CCopasiVector< CLReferenceGlyph > mvReferences
void CLGeneralGlyph::addSubglyph ( CLGraphicalObject glyph)

add sub glyph to general glyph. The general glyph takes ownership of the glyph.

Definition at line 491 of file CLReactionGlyph.cpp.

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

Referenced by CLGeneralGlyph(), and operator=().

492 {
493  if (glyph)
494  mvSubglyphs.add(glyph, true); //true means vector takes ownership
495 }
virtual bool add(const CType &src)
CCopasiVector< CLGraphicalObject > mvSubglyphs
virtual CLGraphicalObject* CLGeneralGlyph::clone ( ) const
inlinevirtual

Reimplemented from CLGraphicalObject.

Definition at line 291 of file CLReactionGlyph.h.

References CLGeneralGlyph().

291 {return new CLGeneralGlyph(*this, NULL);};
CLGeneralGlyph(const std::string &name="GeneralGlyph", const CCopasiContainer *pParent=NULL)
void CLGeneralGlyph::exportToSBML ( GraphicalObject *  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 exports the general glyph to a generic SBML GraphicalObject (throwing away most of the information) This should be removed once libsbml supports general glyphs.

Definition at line 518 of file CLReactionGlyph.cpp.

References CLMetabGlyph::exportToSBML(), CLCompartmentGlyph::exportToSBML(), CLGraphicalObject::exportToSBML(), CLTextGlyph::exportToSBML(), CLCurve::exportToSBML(), exportToSBML(), CLGraphicalObject::getModelObject(), CLGlyphWithCurve::mCurve, mvReferences, mvSubglyphs, and CCopasiVector< T >::size().

Referenced by CLayout::exportToSBML(), and exportToSBML().

522 {
523  if (!g) return;
524 
525  //call the coresponding method of the base class
526  CLGraphicalObject::exportToSBML(g, copasimodelmap, sbmlIDs);
527 
528 #if LIBSBML_VERSION >= 50800
529 
530  GeneralGlyph *general = dynamic_cast<GeneralGlyph *>(g);
531 
532  if (!general) return;
533 
534  //reference to model objects
535  CCopasiObject* tmp = getModelObject();
536 
537  if (tmp)
538  {
539  std::map<const CCopasiObject*, SBase*>::const_iterator it = copasimodelmap.find(tmp);
540 
541  if (it != copasimodelmap.end())
542  {
543  if (it->second)
544  general->setReferenceId(it->second->getId());
545  }
546 
547  const CLBase* base = dynamic_cast<const CLBase*>(tmp);
548 
549  if (base)
550  {
551  std::map<const CLBase*, const SBase*>::const_iterator it2 = layoutmap.find(base);
552 
553  if (it2 != layoutmap.end())
554  {
555  if (it2->second)
556  general->setReferenceId(it2->second->getId());
557  }
558  }
559  }
560 
561  //curve
562  mCurve.exportToSBML(general->getCurve(), copasimodelmap);
563 
564  //reference glyphs
565  size_t i, imax = mvReferences.size();
566 
567  for (i = 0; i < imax; ++i)
568  {
569  CLReferenceGlyph * tmp = mvReferences[i];
570 
571  //check if the glyph exists in the libsbml data
572  std::map<const CCopasiObject*, SBase*>::const_iterator it;
573  it = copasimodelmap.find(tmp);
574 
575  ReferenceGlyph * pG;
576 
577  if (it == copasimodelmap.end()) //not found
578  {
579  pG = general->createReferenceGlyph();
580  }
581  else
582  {
583  pG = dynamic_cast<ReferenceGlyph*>(it->second);
584  }
585 
586  layoutmap.insert(std::pair<const CLBase*, const SBase*>(tmp, pG));
587  tmp->exportToSBML(pG, copasimodelmap, sbmlIDs, layoutmap);
588  }
589 
590  imax = mvSubglyphs.size();
591 
592  for (i = 0; i < imax; ++i)
593  {
594  CLGraphicalObject * tmp = mvSubglyphs[i];
595  CLMetabGlyph * metab = dynamic_cast<CLMetabGlyph*>(tmp);
596  CLCompartmentGlyph* comp = dynamic_cast<CLCompartmentGlyph*>(tmp);
597  CLGeneralGlyph* gg = dynamic_cast<CLGeneralGlyph*>(tmp);
598  CLTextGlyph* text = dynamic_cast<CLTextGlyph*>(tmp);
599 
600  //check if the glyph exists in the libsbml data
601  std::map<const CCopasiObject*, SBase*>::const_iterator it;
602  it = copasimodelmap.find(tmp);
603 
604  GraphicalObject * pG;
605 
606  if (it == copasimodelmap.end()) //not found
607  {
608  if (metab)
609  pG = ((Layout*)g->getParentSBMLObject()->getParentSBMLObject())->createSpeciesGlyph();
610  else if (comp)
611  pG = ((Layout*)g->getParentSBMLObject()->getParentSBMLObject())->createCompartmentGlyph();
612  else if (gg)
613  pG = ((Layout*)g->getParentSBMLObject()->getParentSBMLObject())->createGeneralGlyph();
614  else if (text)
615  pG = ((Layout*)g->getParentSBMLObject()->getParentSBMLObject())->createTextGlyph();
616  else
617  pG = ((Layout*)g->getParentSBMLObject()->getParentSBMLObject())->createAdditionalGraphicalObject();
618  }
619  else
620  {
621  pG = dynamic_cast<GraphicalObject*>(it->second);
622  }
623 
624  layoutmap.insert(std::pair<const CLBase*, const SBase*>(tmp, pG));
625 
626  if (metab)
627  metab->exportToSBML(static_cast<SpeciesGlyph*>(pG), copasimodelmap, sbmlIDs);
628  else if (comp)
629  comp->exportToSBML(static_cast<CompartmentGlyph*>(pG), copasimodelmap, sbmlIDs);
630  else if (text)
631  text->exportToSBML(static_cast<TextGlyph*>(pG), copasimodelmap, sbmlIDs);
632  else if (gg)
633  gg->exportToSBML(pG, copasimodelmap, sbmlIDs, layoutmap);
634  else
635  tmp->exportToSBML(pG, copasimodelmap, sbmlIDs);
636  }
637 
638 #endif // LIBSBML_VERSION >= 50800
639 }
void exportToSBML(Curve *c, const std::map< const CCopasiObject *, SBase * > &copasimodelmap) const
Definition: CLCurve.cpp:148
virtual size_t size() const
virtual void exportToSBML(CompartmentGlyph *cg, const std::map< const CCopasiObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs) const
Definition: CLGlyphs.cpp:145
virtual void exportToSBML(GraphicalObject *sbmlobject, const std::map< const CCopasiObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs) const
virtual void exportToSBML(SpeciesGlyph *g, const std::map< const CCopasiObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs) const
Definition: CLGlyphs.cpp:73
Definition: CLBase.h:33
CCopasiVector< CLReferenceGlyph > mvReferences
CCopasiVector< CLGraphicalObject > mvSubglyphs
CCopasiObject * getModelObject() const
virtual void exportToSBML(TextGlyph *g, const std::map< const CCopasiObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs) const
Definition: CLGlyphs.cpp:267
virtual void exportToSBML(GraphicalObject *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<CLReferenceGlyph>& CLGeneralGlyph::getListOfReferenceGlyphs ( ) const
inline
CCopasiVector<CLReferenceGlyph>& CLGeneralGlyph::getListOfReferenceGlyphs ( )
inline

Definition at line 270 of file CLReactionGlyph.h.

References mvReferences.

271  {return mvReferences;};
CCopasiVector< CLReferenceGlyph > mvReferences
const CCopasiVector<CLGraphicalObject>& CLGeneralGlyph::getListOfSubglyphs ( ) const
inline

Definition at line 273 of file CLReactionGlyph.h.

References mvSubglyphs.

Referenced by CQLayoutScene::addGlyph(), CLayout::CLayout(), and CLLayoutRenderer::getObjectsInBoundingBox().

274  {return mvSubglyphs;};
CCopasiVector< CLGraphicalObject > mvSubglyphs
CCopasiVector<CLGraphicalObject>& CLGeneralGlyph::getListOfSubglyphs ( )
inline

Definition at line 276 of file CLReactionGlyph.h.

References mvSubglyphs.

277  {return mvSubglyphs;};
CCopasiVector< CLGraphicalObject > mvSubglyphs
void CLGeneralGlyph::moveBy ( const CLPoint p)
virtual

Reimplemented from CLGlyphWithCurve.

Definition at line 503 of file CLReactionGlyph.cpp.

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

504 {
506 
507  size_t i, imax = mvReferences.size();
508 
509  for (i = 0; i < imax; ++i)
510  mvReferences[i]->moveBy(p);
511 
512  imax = mvSubglyphs.size();
513 
514  for (i = 0; i < imax; ++i)
515  mvSubglyphs[i]->moveBy(p);
516 }
virtual void moveBy(const CLPoint &p)
virtual size_t size() const
CCopasiVector< CLReferenceGlyph > mvReferences
CCopasiVector< CLGraphicalObject > mvSubglyphs
virtual void moveBy(const CLPoint &p)
CLGeneralGlyph & CLGeneralGlyph::operator= ( const CLGeneralGlyph rhs)

assignment operator. makes a deep copy

Definition at line 467 of file CLReactionGlyph.cpp.

References addReferenceGlyph(), addSubglyph(), CCopasiVector< T >::clear(), mvReferences, mvSubglyphs, CLGlyphWithCurve::operator=(), and CCopasiVector< T >::size().

468 {
469  if (this == &rhs) return * this; //do nothing if lhs and rhs are the same
470 
472 
473  //handle the specific glyph stuff:
474 
475  size_t i, imax = rhs.mvReferences.size();
476 
478 
479  for (i = 0; i < imax; ++i)
481 
482  imax = rhs.mvSubglyphs.size();
483  mvSubglyphs.clear();
484 
485  for (i = 0; i < imax; ++i)
486  addSubglyph(rhs.mvSubglyphs[i]->clone());
487 
488  return *this;
489 }
CLGlyphWithCurve & operator=(const CLGlyphWithCurve &rhs)
void addReferenceGlyph(CLReferenceGlyph *glyph)
virtual size_t size() const
void addSubglyph(CLGraphicalObject *glyph)
CCopasiVector< CLReferenceGlyph > mvReferences
CCopasiVector< CLGraphicalObject > mvSubglyphs
virtual void clear()
void CLGeneralGlyph::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 669 of file CLReactionGlyph.cpp.

670 {*ostream << *this;}

Friends And Related Function Documentation

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

insert operator

Definition at line 641 of file CLReactionGlyph.cpp.

642 {
643  os << "GeneralGlyph: " << dynamic_cast<const CLGraphicalObject&>(g);
644  os << g.mCurve;
645 
646  size_t i, imax = g.mvReferences.size();
647 
648  if (imax)
649  {
650  os << " List of reference glyphs: \n";
651 
652  for (i = 0; i < imax; ++i)
653  os << *g.mvReferences[i];
654  }
655 
656  imax = g.mvSubglyphs.size();
657 
658  if (imax)
659  {
660  os << " List of reference glyphs: \n";
661 
662  for (i = 0; i < imax; ++i)
663  os << *g.mvSubglyphs[i];
664  }
665 
666  return os;
667 }
virtual size_t size() const
CCopasiVector< CLReferenceGlyph > mvReferences
CCopasiVector< CLGraphicalObject > mvSubglyphs

Member Data Documentation

CCopasiVector<CLReferenceGlyph> CLGeneralGlyph::mvReferences
protected
CCopasiVector<CLGraphicalObject> CLGeneralGlyph::mvSubglyphs
protected

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