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

Public Member Functions

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

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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 6500 of file CCopasiXMLParser.cpp.

6501 {}

Member Function Documentation

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

Definition at line 6605 of file CCopasiXMLParser.cpp.

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

6606 {
6607  if (!strcmp(pszName, "CompartmentGlyph"))
6608  {
6611 
6612  /* Tell the parent element we are done. */
6613  mParser.onEndElement(pszName);
6614  }
6615  else
6616  {
6617  switch (mCurrentElement)
6618  {
6619  case BoundingBox:
6620  break;
6621 
6622  case Position:
6623  break;
6624 
6625  case Dimensions:
6626  //tell the handler where to continue
6628  break;
6629 
6630  case UNKNOWN_ELEMENT:
6632  break;
6633 
6634  default:
6636  pszName, "???", mParser.getCurrentLineNumber());
6637  break;
6638  }
6639  }
6640 
6641  return;
6642 }
#define START_ELEMENT
#define MCXML
virtual void onEndElement(const XML_Char *pszName)
#define UNKNOWN_ELEMENT
int getCurrentLineNumber() const
Definition: CExpat.h:470
void CCopasiXMLParser::CompartmentGlyphElement::start ( const XML_Char *  pszName,
const XML_Char **  papszAttrs 
)
virtual

Definition at line 6503 of file CCopasiXMLParser.cpp.

References CLayout::addCompartmentGlyph(), CCopasiMessage::EXCEPTION, CKeyFactory::get(), CModelEntity::getKey(), SCopasiXMLParserCommon::KeyMap, CCopasiXMLParser::mCommon, MCXML, CExpatTemplate< CExpat >::mParser, SCopasiXMLParserCommon::pCompartmentGlyph, SCopasiXMLParserCommon::pCurrentLayout, CLGraphicalObject::setHeight(), CLGraphicalObject::setModelObjectKey(), CLGraphicalObject::setObjectRole(), CLGraphicalObject::setWidth(), CLGraphicalObject::setX(), CLGraphicalObject::setY(), UNKNOWN_ELEMENT, and CCopasiMessage::WARNING.

6504 {
6505  mCurrentElement++; /* We should always be on hte next element */
6506  mpCurrentHandler = NULL;
6507  mLineNumber = (size_t) - 1;
6508 
6509  switch (mCurrentElement)
6510  {
6511  case CompartmentGlyph:
6512 
6513  if (strcmp(pszName, "CompartmentGlyph"))
6515  pszName, "CompartmentGlyph", mParser.getCurrentLineNumber());
6516 
6517  {
6518  //workload
6519  const char * key;
6520  const char * name;
6521  const char * compartment;
6522  key = mParser.getAttributeValue("key", papszAttrs);
6523  name = mParser.getAttributeValue("name", papszAttrs);
6524  compartment = mParser.getAttributeValue("compartment", papszAttrs);
6525 
6527  const char * objectRole = mParser.getAttributeValue("objectRole", papszAttrs, false);
6528 
6529  if (objectRole != NULL && objectRole[0] != 0)
6530  {
6532  }
6533 
6534  if (compartment && compartment[0])
6535  {
6536  CCompartment * pComp = dynamic_cast< CCompartment * >(mCommon.KeyMap.get(compartment));
6537 
6538  if (!pComp)
6539  {
6540  CCopasiMessage(CCopasiMessage::WARNING, MCXML + 19 , "CompartmentGlyph", key);
6541  }
6542  else
6543  {
6545  }
6546  }
6547 
6550  }
6551  return;
6552  break;
6553 
6554  case BoundingBox:
6555 
6556  if (!strcmp(pszName, "BoundingBox"))
6557  return;
6558 
6559  break;
6560 
6561  case Position:
6562 
6563  if (!strcmp(pszName, "Position"))
6564  {
6565  //workload
6566  const char * attr;
6567  attr = mParser.getAttributeValue("x", papszAttrs);
6569  attr = mParser.getAttributeValue("y", papszAttrs);
6571  return;
6572  }
6573 
6574  break;
6575 
6576  case Dimensions:
6577 
6578  if (!strcmp(pszName, "Dimensions"))
6579  {
6580  //workload
6581  const char * attr;
6582  attr = mParser.getAttributeValue("width", papszAttrs);
6584  attr = mParser.getAttributeValue("height", papszAttrs);
6586  return;
6587  }
6588 
6589  break;
6590 
6591  default:
6594  break;
6595  }
6596 
6597  if (mpCurrentHandler)
6599 
6600  mParser.onStartElement(pszName, papszAttrs);
6601 
6602  return;
6603 }
UnknownElement mUnknownElement
CCopasiObject * get(const std::string &key)
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
CLCompartmentGlyph * pCompartmentGlyph
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)
virtual const std::string & getKey() const
void pushElementHandler(CXMLElementHandler< CCopasiXMLParser, SCopasiXMLParserCommon > *elementHandler)
void setHeight(const C_FLOAT64 &h)
void addCompartmentGlyph(CLCompartmentGlyph *glyph)
Definition: CLayout.cpp:239
void setObjectRole(const std::string &role)
int getCurrentLineNumber() const
Definition: CExpat.h:470
void setWidth(const C_FLOAT64 &w)
void setX(const C_FLOAT64 &x)

Member Data Documentation

size_t CCopasiXMLParser::CompartmentGlyphElement::mLineNumber
private

Definition at line 3327 of file CCopasiXMLParser.h.


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