COPASI API  4.16.103
CLTransformation2D.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layout/CLTransformation2D.h,v $
3 // $Revision: 1.3 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/09/30 16:35:20 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 #ifndef CLTransformation2D_H__
15 #define CLTransformation2D_H__
16 
18 
19 class Transformation2D;
20 
22 {
23 public:
24  static const double IDENTITY2D[6];
25 
26  /**
27  * Returns a 2D identity matrix.
28  * The matrix contains 6 values.
29  */
30  static const double* getIdentityMatrix2D();
31 
32  /**
33  * Constructor.
34  */
36 
37  /**
38  * Constructor with a matrix.
39  */
40  CLTransformation2D(const double m[6]);
41 
42  /**
43  * Constructor to generate object from the corresponding SBML object.
44  */
45  CLTransformation2D(const Transformation2D& source);
46 
47  /**
48  * Sets the 2D matrix.
49  * The 3D matrix is updated accordingly.
50  */
51  void setMatrix2D(const double m[6]);
52 
53  /**
54  * Sets the 3D matrix.
55  * The 2D matrix is updated accordingly.
56  */
57  void setMatrix(const double m[12]);
58 
59  /**
60  * Returns the matrix.
61  * The matrix contains 6 values.
62  */
63  const double* getMatrix2D() const;
64 
65  /**
66  * Returns a string to represent the 2D transformation.
67  */
68  std::string get2DTransformationString() const;
69 
70  /**
71  * Sets the transformation matrix from the given string.
72  * The string has to contain either 6 or 12 numerical values seperated by ",".
73  * Otherwise the matrix is set to the identity matrix.
74  */
75  virtual void parseTransformation(const std::string& transformationString);
76 
77 protected:
78 
79  /**
80  * Sets the 3D matrix from the 2D matrix.
81  */
82  void updateMatrix3D();
83 
84  /**
85  * Fills the 2D matrix with data from the 3D matrix.
86  */
87  void updateMatrix2D();
88 
89  /**
90  * the 2D matrix.
91  */
92  double mMatrix2D[6];
93 
94  /**
95  * Adds the attributes for a 2d transformation object to the passed in.
96  * object.
97  */
98  virtual void addSBMLAttributes(Transformation2D* pTransformation) const;
99 };
100 
101 #endif /* CLTransformation2D_H__ */
std::string get2DTransformationString() const
virtual void addSBMLAttributes(Transformation2D *pTransformation) const
void setMatrix2D(const double m[6])
static const double IDENTITY2D[6]
void setMatrix(const double m[12])
const double * getMatrix2D() const
static const double * getIdentityMatrix2D()
virtual void parseTransformation(const std::string &transformationString)