COPASI API  4.16.103
Public Member Functions | Private Types | Private Attributes | List of all members
CCopasiXMLParser::MetaboliteReferenceGlyphElement Class Reference
Inheritance diagram for CCopasiXMLParser::MetaboliteReferenceGlyphElement:
Inheritance graph
[legend]
Collaboration diagram for CCopasiXMLParser::MetaboliteReferenceGlyphElement:
Collaboration graph
[legend]

Public Member Functions

virtual void end (const XML_Char *pszName)
 
 MetaboliteReferenceGlyphElement (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void start (const XML_Char *pszName, const XML_Char **papszAttrs)
 
virtual ~MetaboliteReferenceGlyphElement ()
 
- Public Member Functions inherited from CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon >
 CXMLElementHandler (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void end (const XML_Char *C_UNUSED(pszName))
 
virtual void reset ()
 
virtual void start (const XML_Char *C_UNUSED(pszName), const XML_Char **C_UNUSED(papszAttrs))
 
virtual ~CXMLElementHandler ()
 

Private Types

enum  Element {
  MetaboliteReferenceGlyph = 0, BoundingBox, Position, Dimensions,
  Curve
}
 

Private Attributes

size_t mLineNumber
 

Additional Inherited Members

- Protected Member Functions inherited from CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon >
void addFix (const std::string &key, CCopasiObject *pObject)
 
void deleteCurrentHandler ()
 
- Protected Attributes inherited from CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon >
SCopasiXMLParserCommonmCommon
 
C_INT32 mCurrentElement
 
C_INT32 mLastKnownElement
 
CCopasiXMLParsermParser
 
CXMLElementHandlermpCurrentHandler
 

Detailed Description

Definition at line 3408 of file CCopasiXMLParser.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

CCopasiXMLParser::MetaboliteReferenceGlyphElement::MetaboliteReferenceGlyphElement ( CCopasiXMLParser parser,
SCopasiXMLParserCommon common 
)
CCopasiXMLParser::MetaboliteReferenceGlyphElement::~MetaboliteReferenceGlyphElement ( )
virtual

Definition at line 6992 of file CCopasiXMLParser.cpp.

6993 {}

Member Function Documentation

void CCopasiXMLParser::MetaboliteReferenceGlyphElement::end ( const XML_Char *  pszName)
virtual

Definition at line 7114 of file CCopasiXMLParser.cpp.

References CCopasiMessage::EXCEPTION, MCXML, CExpatTemplate< CExpat >::mParser, START_ELEMENT, and UNKNOWN_ELEMENT.

7115 {
7116  if (!strcmp(pszName, "MetaboliteReferenceGlyph"))
7117  {
7120 
7121  /* Tell the parent element we are done. */
7122  mParser.onEndElement(pszName);
7123  }
7124  else
7125  {
7126  switch (mCurrentElement)
7127  {
7128  case BoundingBox:
7129  break;
7130 
7131  case Position:
7132  break;
7133 
7134  case Dimensions:
7135  //tell the handler where to continue
7137  break;
7138 
7139  case Curve:
7140  break;
7141 
7142  case UNKNOWN_ELEMENT:
7144  break;
7145 
7146  default:
7148  pszName, "???", mParser.getCurrentLineNumber());
7149  break;
7150  }
7151  }
7152 
7153  return;
7154 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::MetaboliteReferenceGlyphElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Definition at line 6995 of file CCopasiXMLParser.cpp.

References CLReactionGlyph::addMetabReferenceGlyph(), C_INT32, CCopasiMessage::EXCEPTION, CKeyFactory::get(), CLGlyphWithCurve::getCurve(), CLGraphicalObject::getKey(), SCopasiXMLParserCommon::KeyMap, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurve, SCopasiXMLParserCommon::pMetaboliteReferenceGlyph, SCopasiXMLParserCommon::pReactionGlyph, CLGraphicalObject::setHeight(), CLMetabReferenceGlyph::setMetabGlyphKey(), CLGraphicalObject::setObjectRole(), CLMetabReferenceGlyph::setRole(), CLGraphicalObject::setWidth(), CLGraphicalObject::setX(), CLGraphicalObject::setY(), CLMetabReferenceGlyph::UNDEFINED, UNKNOWN_ELEMENT, and CLMetabReferenceGlyph::XMLRole.

6996 {
6997  mCurrentElement++; /* We should always be on hte next element */
6998  mpCurrentHandler = NULL;
6999  mLineNumber = (size_t) - 1;
7000 
7001  switch (mCurrentElement)
7002  {
7004 
7005  if (strcmp(pszName, "MetaboliteReferenceGlyph"))
7007  pszName, "MetaboliteReferenceGlyph", mParser.getCurrentLineNumber());
7008 
7009  {
7010  //workload
7011  const char * key;
7012  const char * name;
7013  const char * metaboliteGlyph;
7014  const char * role;
7015  key = mParser.getAttributeValue("key", papszAttrs);
7016  name = mParser.getAttributeValue("name", papszAttrs);
7017  metaboliteGlyph = mParser.getAttributeValue("metaboliteGlyph", papszAttrs);
7018  role = mParser.getAttributeValue("role", papszAttrs);
7019 
7021  const char * objectRole = mParser.getAttributeValue("objectRole", papszAttrs, false);
7022 
7023  if (objectRole != NULL && objectRole[0] != 0)
7024  {
7026  }
7027 
7028  CLMetabGlyph * pMetabGlyph = dynamic_cast< CLMetabGlyph * >(mCommon.KeyMap.get(metaboliteGlyph));
7029 
7030  //if (!pMetabGlyph) fatalError();
7031 
7032  if (pMetabGlyph)
7034 
7035  //interpret role string
7036  C_INT32 i;
7037 
7038  for (i = 0; (CLMetabReferenceGlyph::XMLRole[i] != "") && (CLMetabReferenceGlyph::XMLRole[i] != role); ++i) {};
7039 
7040  if (CLMetabReferenceGlyph::XMLRole[i] == "")
7042  else
7044 
7047  }
7048  return;
7049  break;
7050 
7051  case BoundingBox:
7052 
7053  if (!strcmp(pszName, "BoundingBox"))
7054  return;
7055 
7056  break;
7057 
7058  case Position:
7059 
7060  if (!strcmp(pszName, "Position"))
7061  {
7062  //workload
7063  const char * attr;
7064  attr = mParser.getAttributeValue("x", papszAttrs);
7066  attr = mParser.getAttributeValue("y", papszAttrs);
7068  return;
7069  }
7070 
7071  break;
7072 
7073  case Dimensions:
7074 
7075  if (!strcmp(pszName, "Dimensions"))
7076  {
7077  //workload
7078  const char * attr;
7079  attr = mParser.getAttributeValue("width", papszAttrs);
7081  attr = mParser.getAttributeValue("height", papszAttrs);
7083  return;
7084  }
7085 
7086  break;
7087 
7088  case Curve:
7089 
7090  if (!strcmp(pszName, "Curve"))
7091  {
7092  mpCurrentHandler = new CurveElement(mParser, mCommon);
7093 
7096  }
7097 
7098  break;
7099 
7100  default:
7103  break;
7104  }
7105 
7106  if (mpCurrentHandler)
7108 
7109  mParser.onStartElement(pszName, papszAttrs);
7110 
7111  return;
7112 }
UnknownElement mUnknownElement
CCopasiObject * get(const std::string &key)
void setY(const C_FLOAT64 &y)
void addMetabReferenceGlyph(CLMetabReferenceGlyph *glyph)
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
#define C_INT32
Definition: copasi.h:90
virtual const std::string & getKey() const
void addFix(const std::string &key, CCopasiObject *pObject)
Definition: CXMLHandler.h:119
#define UNKNOWN_ELEMENT
virtual void onStartElement(const XML_Char *pszName, const XML_Char **papszAttrs)
CLMetabReferenceGlyph * pMetaboliteReferenceGlyph
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
void setHeight(const C_FLOAT64 &h)
void setMetabGlyphKey(const std::string &k)
void setObjectRole(const std::string &role)
int getCurrentLineNumber() const
Definition: CExpat.h:470
static const std::string XMLRole[]
CLReactionGlyph * pReactionGlyph
void setWidth(const C_FLOAT64 &w)
const CLCurve & getCurve() const
void setX(const C_FLOAT64 &x)

Member Data Documentation

size_t CCopasiXMLParser::MetaboliteReferenceGlyphElement::mLineNumber
private

Definition at line 3420 of file CCopasiXMLParser.h.


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