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

Public Member Functions

virtual void end (const XML_Char *pszName)
 
 ReactionGlyphElement (CCopasiXMLParser &parser, SCopasiXMLParserCommon &common)
 
virtual void start (const XML_Char *pszName, const XML_Char **papszAttrs)
 
virtual ~ReactionGlyphElement ()
 
- 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 {
  ReactionGlyph = 0, BoundingBox, Position, Dimensions,
  Curve, ListOfMetaboliteReferenceGlyphs
}
 

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 3455 of file CCopasiXMLParser.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 7254 of file CCopasiXMLParser.cpp.

7255 {}

Member Function Documentation

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

Definition at line 7378 of file CCopasiXMLParser.cpp.

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

7379 {
7380  if (!strcmp(pszName, "ReactionGlyph"))
7381  {
7384 
7385  /* Tell the parent element we are done. */
7386  mParser.onEndElement(pszName);
7387  }
7388  else
7389  {
7390  switch (mCurrentElement)
7391  {
7392  case BoundingBox:
7393  break;
7394 
7395  case Position:
7396  break;
7397 
7398  case Dimensions:
7399  break;
7400 
7401  case Curve:
7402  break;
7403 
7405  break;
7406 
7407  case UNKNOWN_ELEMENT:
7409  break;
7410 
7411  default:
7413  pszName, "???", mParser.getCurrentLineNumber());
7414  break;
7415  }
7416  }
7417 
7418  return;
7419 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::ReactionGlyphElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Definition at line 7257 of file CCopasiXMLParser.cpp.

References CLayout::addReactionGlyph(), CCopasiMessage::EXCEPTION, CKeyFactory::get(), CLGlyphWithCurve::getCurve(), CReaction::getKey(), SCopasiXMLParserCommon::KeyMap, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCurrentLayout, SCopasiXMLParserCommon::pCurve, SCopasiXMLParserCommon::pReactionGlyph, CLGraphicalObject::setHeight(), CLGraphicalObject::setModelObjectKey(), CLGraphicalObject::setObjectRole(), CLGraphicalObject::setWidth(), CLGraphicalObject::setX(), CLGraphicalObject::setY(), UNKNOWN_ELEMENT, and CCopasiMessage::WARNING.

7258 {
7259  mCurrentElement++; /* We should always be on hte next element */
7260  mpCurrentHandler = NULL;
7261  mLineNumber = (size_t) - 1;
7262 
7263  switch (mCurrentElement)
7264  {
7265  case ReactionGlyph:
7266 
7267  if (strcmp(pszName, "ReactionGlyph"))
7269  pszName, "ReactionGlyph", mParser.getCurrentLineNumber());
7270 
7271  {
7272  //workload
7273  const char * key;
7274  const char * name;
7275  const char * reaction;
7276  key = mParser.getAttributeValue("key", papszAttrs);
7277  name = mParser.getAttributeValue("name", papszAttrs);
7278  reaction = mParser.getAttributeValue("reaction", papszAttrs);
7279 
7281  const char * objectRole = mParser.getAttributeValue("objectRole", papszAttrs, false);
7282 
7283  if (objectRole != NULL && objectRole[0] != 0)
7284  {
7285  mCommon.pReactionGlyph->setObjectRole(objectRole);
7286  }
7287 
7288  if (reaction && reaction[0])
7289  {
7290  CReaction * pReaction = dynamic_cast< CReaction * >(mCommon.KeyMap.get(reaction));
7291 
7292  if (!pReaction)
7293  {
7294  CCopasiMessage(CCopasiMessage::WARNING, MCXML + 19, "ReactionGlyph" , key);
7295  }
7296  else
7297  {
7299  }
7300  }
7301 
7304  }
7305  return;
7306  break;
7307 
7308  case BoundingBox:
7309 
7310  if (!strcmp(pszName, "BoundingBox"))
7311  return;
7312 
7313  break;
7314 
7315  case Position:
7316 
7317  if (!strcmp(pszName, "Position"))
7318  {
7319  //workload
7320  const char * attr;
7321  attr = mParser.getAttributeValue("x", papszAttrs);
7323  attr = mParser.getAttributeValue("y", papszAttrs);
7325  return;
7326  }
7327 
7328  break;
7329 
7330  case Dimensions:
7331 
7332  if (!strcmp(pszName, "Dimensions"))
7333  {
7334  //workload
7335  const char * attr;
7336  attr = mParser.getAttributeValue("width", papszAttrs);
7338  attr = mParser.getAttributeValue("height", papszAttrs);
7340  return;
7341  }
7342 
7343  break;
7344 
7345  case Curve:
7346 
7347  if (!strcmp(pszName, "Curve"))
7348  {
7349  mpCurrentHandler = new CurveElement(mParser, mCommon);
7350 
7351  if (mCommon.pReactionGlyph)
7353  }
7354 
7355  break;
7356 
7358 
7359  if (!strcmp(pszName, "ListOfMetaboliteReferenceGlyphs"))
7360  mpCurrentHandler = new ListOfMetaboliteReferenceGlyphsElement(mParser, mCommon);
7361 
7362  break;
7363 
7364  default:
7367  break;
7368  }
7369 
7370  if (mpCurrentHandler)
7372 
7373  mParser.onStartElement(pszName, papszAttrs);
7374 
7375  return;
7376 }
void addReactionGlyph(CLReactionGlyph *glyph)
Definition: CLayout.cpp:251
UnknownElement mUnknownElement
CCopasiObject * get(const std::string &key)
virtual const std::string & getKey() const
Definition: CReaction.cpp:190
void setY(const C_FLOAT64 &y)
const char * getAttributeValue(const std::string &name, const char **attributes, const bool &required=true) const
Definition: CExpat.h:685
#define MCXML
void setModelObjectKey(const std::string &k)
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)
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
void setHeight(const C_FLOAT64 &h)
void setObjectRole(const std::string &role)
int getCurrentLineNumber() const
Definition: CExpat.h:470
CLReactionGlyph * pReactionGlyph
void setWidth(const C_FLOAT64 &w)
const CLCurve & getCurve() const
void setX(const C_FLOAT64 &x)

Member Data Documentation

size_t CCopasiXMLParser::ReactionGlyphElement::mLineNumber
private

Definition at line 3468 of file CCopasiXMLParser.h.


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