COPASI API  4.16.103
Static Public Member Functions | List of all members
CMathMl Class Reference

#include <copasimathml.h>

Static Public Member Functions

static std::string fixName (const std::string &name)
 
static std::string getMMLName (const CCopasiObject *obj)
 

Detailed Description

Definition at line 29 of file copasimathml.h.

Member Function Documentation

static std::string CMathMl::fixName ( const std::string &  name)
inlinestatic
static std::string CMathMl::getMMLName ( const CCopasiObject obj)
inlinestatic

Definition at line 45 of file copasimathml.h.

References fixName(), CCopasiObject::getObjectDisplayName(), CCopasiObject::getObjectName(), CCopasiObject::getObjectParent(), and CCopasiObject::getObjectType().

Referenced by CEvaluationNodeObject::getMMLString().

46  {
47  if (!obj) return "no object";
48 
49  //model value
50  const CModelValue* mv = dynamic_cast<const CModelValue*>(obj);
51 
52  if (mv) return "<mi>" + fixName(mv->getObjectName()) + "</mi>";
53 
54  //metabolite
55  //const CMetab* met = dynamic_cast<const CMetab*>(obj);
56  //if (met) return "<mi>[" + met->getObjectName() + "]</mi>";
57 
58  //compartment
59  const CCompartment* comp = dynamic_cast<const CCompartment*>(obj);
60 
61  if (comp) return "<msub><mi>V</mi><mi>" + fixName(comp->getObjectName())
62  + "</mi></msub>";
63 
64  //reference
65  if (obj->getObjectType() == "Reference")
66  {
67  //model value
68  if (obj->getObjectName() == "Value")
69  {
70  mv = dynamic_cast<const CModelValue*>(obj->getObjectParent());
71 
72  if (mv) return "<mi>" + fixName(mv->getObjectName()) + "</mi>";
73  }
74 
75  //compartment
76  if (obj->getObjectName() == "Volume")
77  {
78  comp = dynamic_cast<const CCompartment*>(obj->getObjectParent());
79 
80  if (comp) return "<msub><mi>V</mi><mi>" + fixName(comp->getObjectName())
81  + "</mi></msub>";
82  }
83  }
84 
85  return "<mi>" + fixName(obj->getObjectDisplayName()) + "</mi>";
86  }
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
const std::string & getObjectName() const
static std::string fixName(const std::string &name)
Definition: copasimathml.h:33
const std::string & getObjectType() const
CCopasiContainer * getObjectParent() const

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