COPASI API  4.16.103
Expression2PresentationMMLUnits.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2008 - 2009 by Sven Sahle and University of Heidelberg
12 // All rights reserved.
13 
14 #ifndef EXPRESSION2PRESENTATIONMMLUNITS_H
15 #define EXPRESSION2PRESENTATIONMMLUNITS_H
16 
18 
19 class CSBMLunitInterface;
21 class UnitDefinition;
22 class Unit;
23 
25 {
26 public:
27  Expression2PresentationMMLUnits(const ASTNode* rootnode);
28 
29  /**
30  * sets the unit interface to the SBML model so that the units can be displayed.
31  * this implicitly also handles setting the model
32  */
33  void setUnitInterface(CSBMLunitInterface * unitInterface, CSBMLunitInterface * unitInterface2);
34 
35  std::string getMathML(const CSBMLunitInformation & ui) const;
36 
37 protected:
38 // virtual void writeMathMLFunction(std::ostream & out, const ASTNode* node, size_t l) const;
39  virtual void writeMathMLName(std::ostream & out, const ASTNode* node, size_t l) const;
40  virtual void writeMathMLNumber(std::ostream & out, const ASTNode* node, size_t l) const;
41 
42  /**
43  * write the mathML for a box that is used to display an object identifier + its unit information
44  * a and b are mathML strings
45  */
46  void writeMathMLBox(std::ostream & out, const std::string & a, const std::string & b,
47  const std::string & color, size_t l) const;
48 
49  void writeMathMLBox(std::ostream & out, const std::string & a, const std::string & b, const std::string & c,
50  const std::string & color, size_t l) const;
51 
52  std::string getMathML(const UnitDefinition & ud) const;
53  std::string getMathML(const Unit * u, bool absExp) const;
54 
57 };
58 
59 #endif // EXPRESSION2PRESENTATIONMMLUNITS_H
void setUnitInterface(CSBMLunitInterface *unitInterface, CSBMLunitInterface *unitInterface2)
Expression2PresentationMMLUnits(const ASTNode *rootnode)
virtual void writeMathMLNumber(std::ostream &out, const ASTNode *node, size_t l) const
void writeMathMLBox(std::ostream &out, const std::string &a, const std::string &b, const std::string &color, size_t l) const
std::string getMathML(const CSBMLunitInformation &ui) const
virtual void writeMathMLName(std::ostream &out, const ASTNode *node, size_t l) const