COPASI API  4.16.103
CLRenderCubicBezier.cpp
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 #define USE_LAYOUT 1
7 #define USE_RENDER 1
8 
9 #include <sbml/packages/render/sbml/RenderCubicBezier.h>
10 
11 #include "CLRenderCubicBezier.h"
12 
13 /**
14  * Creates a CLRenderCubicBezier and returns the pointer.
15  */
17 {
24 }
25 
26 /**
27  * Creates a CubicBezier with the given points and returns the pointer.
28  */
29 CLRenderCubicBezier::CLRenderCubicBezier(const CLRelAbsVector& bp1_x, const CLRelAbsVector& bp1_y, const CLRelAbsVector& bp1_z, const CLRelAbsVector& bp2_x, const CLRelAbsVector& bp2_y, const CLRelAbsVector& bp2_z, const CLRelAbsVector& end_x, const CLRelAbsVector& end_y, const CLRelAbsVector& end_z): CLRenderPoint(end_x, end_y, end_z),
30  mBasePoint1_X(bp1_x),
31  mBasePoint1_Y(bp1_y),
32  mBasePoint1_Z(bp1_z),
33  mBasePoint2_X(bp2_x),
34  mBasePoint2_Y(bp2_y),
35  mBasePoint2_Z(bp2_z)
36 {
37 }
38 
39 /**
40  * Copy constructor.
41  */
43  CLRenderPoint(orig),
44  mBasePoint1_X(orig.mBasePoint1_X),
45  mBasePoint1_Y(orig.mBasePoint1_Y),
46  mBasePoint1_Z(orig.mBasePoint1_Z),
47  mBasePoint2_X(orig.mBasePoint2_X),
48  mBasePoint2_Y(orig.mBasePoint2_Y),
49  mBasePoint2_Z(orig.mBasePoint2_Z)
50 {
51 }
52 
53 /**
54  * Constructor to generate object from the corresponding SBML object.
55  */
56 CLRenderCubicBezier::CLRenderCubicBezier(const RenderCubicBezier& source):
57  CLRenderPoint(source),
58  mBasePoint1_X(source.basePoint1_X()),
59  mBasePoint1_Y(source.basePoint1_Y()),
60  mBasePoint1_Z(source.basePoint1_Z()),
61  mBasePoint2_X(source.basePoint2_X()),
62  mBasePoint2_Y(source.basePoint2_Y()),
63  mBasePoint2_Z(source.basePoint2_Z())
64 {
65 }
66 
67 /**
68  * Assignment operator.
69  */
71 {
72  if (&orig != this)
73  {
74  this->CLRenderPoint::operator=(orig);
81  }
82 
83  return *this;
84 }
85 
86 /**
87  * Destructor.
88  */
90 {
91 }
92 
93 /**
94  * Returns the x value of the first base point of the curve (the one closer to the
95  * starting point).
96  */
98 {
99  return this->mBasePoint1_X;
100 }
101 
102 /**
103  * Returns the y value of the first base point of the curve (the one closer to the
104  * starting point).
105  */
107 {
108  return this->mBasePoint1_Y;
109 }
110 
111 /**
112  * Returns the z value of the first base point of the curve (the one closer to the
113  * starting point).
114  */
116 {
117  return this->mBasePoint1_Z;
118 }
119 
120 /**
121  * Returns the x value of the second base point of the curve (the one closer to the
122  * end point).
123  */
125 {
126  return this->mBasePoint2_X;
127 }
128 
129 /**
130  * Returns the y value of the second base point of the curve (the one closer to the
131  * end point).
132  */
134 {
135  return this->mBasePoint2_Y;
136 }
137 
138 /**
139  * Returns the z value of the second base point of the curve (the one closer to the
140  * end point).
141  */
143 {
144  return this->mBasePoint2_Z;
145 }
146 
147 /**
148  * Returns the x value of the first base point of the curve (the one closer to the
149  * starting point).
150  */
152 {
153  return this->mBasePoint1_X;
154 }
155 
156 /**
157  * Returns the y value of the first base point of the curve (the one closer to the
158  * starting point).
159  */
161 {
162  return this->mBasePoint1_Y;
163 }
164 
165 /**
166  * Returns the z value of the first base point of the curve (the one closer to the
167  * starting point).
168  */
170 {
171  return this->mBasePoint1_Z;
172 }
173 
174 /**
175  * Returns the x value of the second base point of the curve (the one closer to the
176  * end point).
177  */
179 {
180  return this->mBasePoint2_X;
181 }
182 
183 /**
184  * Returns the y value of the second base point of the curve (the one closer to the
185  * end point).
186  */
188 {
189  return this->mBasePoint2_Y;
190 }
191 
192 /**
193  * Returns the z value of the second base point of the curve (the one closer to the
194  * end point).
195  */
197 {
198  return this->mBasePoint2_Z;
199 }
200 
201 /**
202  * Sets the x value of the first base point of the curve (the one closer to the
203  * starting point).
204  */
206 {
207  this->mBasePoint1_X = v;;
208 }
209 
210 /**
211  * Sets the y value of the first base point of the curve (the one closer to the
212  * starting point).
213  */
215 {
216  this->mBasePoint1_Y = v;
217 }
218 
219 /**
220  * Sets the z value of the first base point of the curve (the one closer to the
221  * starting point).
222  */
224 {
225  this->mBasePoint1_Z = v;
226 }
227 
228 /**
229  * Sets the x value of the second base point of the curve (the one closer to the
230  * end point).
231  */
233 {
234  this->mBasePoint2_X = v;
235 }
236 
237 /**
238  * Sets the y value of the second base point of the curve (the one closer to the
239  * end point).
240  */
242 {
243  this->mBasePoint2_Y = v;
244 }
245 
246 /**
247  * Sets the z value of the second base point of the curve (the one closer to the
248  * end point).
249  */
251 {
252  this->mBasePoint2_Z = v;
253 }
254 
255 /**
256  * Sets the first basepoint to the given values.
257  */
259 {
260  this->mBasePoint1_X = x;
261  this->mBasePoint1_Y = y;
262  this->mBasePoint1_Z = z;
263 }
264 
265 /**
266  * Sets the second basepoint to the given values.
267  */
269 {
270  this->mBasePoint2_X = x;
271  this->mBasePoint2_Y = y;
272  this->mBasePoint2_Z = z;
273 }
274 
275 /**
276  * Converts this object to the corresponding SBML object.
277  */
278 RenderPoint * CLRenderCubicBezier::toSBML(unsigned int level, unsigned int version) const
279 {
280  RenderCubicBezier* pCB = new RenderCubicBezier(level, version);
281  this->addSBMLAttributes(pCB);
282  RelAbsVector* pV1 = this->mBasePoint1_X.toSBML();
283  RelAbsVector* pV2 = this->mBasePoint1_Y.toSBML();
284  RelAbsVector* pV3 = this->mBasePoint1_Z.toSBML();
285  pCB->setBasePoint1(*pV1, *pV2, *pV3);
286  delete pV1;
287  delete pV2;
288  delete pV3;
289  pV1 = this->mBasePoint2_X.toSBML();
290  pV2 = this->mBasePoint2_Y.toSBML();
291  pV3 = this->mBasePoint2_Z.toSBML();
292  pCB->setBasePoint2(*pV1, *pV2, *pV3);
293  delete pV1;
294  delete pV2;
295  delete pV3;
296  return pCB;
297 }
CLRelAbsVector mBasePoint1_Z
CLRelAbsVector mXOffset
Definition: CLRenderPoint.h:26
const CLRelAbsVector & basePoint1_X() const
CLRelAbsVector mBasePoint2_Y
CLRelAbsVector mBasePoint2_X
CLRenderPoint & operator=(const CLRenderPoint &orig)
void setBasePoint1_Z(const CLRelAbsVector &v)
const CLRelAbsVector & basePoint2_Y() const
const CLRelAbsVector & z() const
const CLRelAbsVector & basePoint2_Z() const
const CLRelAbsVector & basePoint2_X() const
CLRelAbsVector mZOffset
Definition: CLRenderPoint.h:28
const CLRelAbsVector & y() const
virtual CLRenderCubicBezier & operator=(const CLRenderCubicBezier &orig)
void setBasePoint2_Z(const CLRelAbsVector &v)
void setBasePoint2_X(const CLRelAbsVector &v)
CLRelAbsVector mBasePoint2_Z
RelAbsVector * toSBML() const
void setBasePoint2_Y(const CLRelAbsVector &v)
void setBasePoint1(const CLRelAbsVector &x, const CLRelAbsVector &y, const CLRelAbsVector &z=CLRelAbsVector(0.0, 0.0))
void setBasePoint1_X(const CLRelAbsVector &v)
CLRelAbsVector mYOffset
Definition: CLRenderPoint.h:27
const CLRelAbsVector & basePoint1_Z() const
CLRelAbsVector mBasePoint1_X
virtual RenderPoint * toSBML(unsigned int level, unsigned int version) const
const CLRelAbsVector & x() const
const CLRelAbsVector & basePoint1_Y() const
CLRelAbsVector mBasePoint1_Y
virtual void addSBMLAttributes(RenderPoint *pPoint) const
void setBasePoint2(const CLRelAbsVector &x, const CLRelAbsVector &y, const CLRelAbsVector &z=CLRelAbsVector(0.0, 0.0))
void setBasePoint1_Y(const CLRelAbsVector &v)