1 /**
2  * @file    RenderCubicBezier.cpp
3  * @brief Implementation of the RenderCubicBezier class.
4  * @author  Ralph Gauges
5  * @author  Frank T. Bergmann
6  *
7  * <!--------------------------------------------------------------------------
8  * This file is part of libSBML.  Please visit http://sbml.org for more
9  * information about SBML, and the latest version of libSBML.
10  *
11  * Copyright (C) 2020 jointly by the following organizations:
12  *     1. California Institute of Technology, Pasadena, CA, USA
13  *     2. University of Heidelberg, Heidelberg, Germany
14  *     3. University College London, London, UK
15  *
16  * Copyright (C) 2019 jointly by the following organizations:
17  *     1. California Institute of Technology, Pasadena, CA, USA
18  *     2. University of Heidelberg, Heidelberg, Germany
19  *
20  * Copyright (C) 2013-2018 jointly by the following organizations:
21  *     1. California Institute of Technology, Pasadena, CA, USA
22  *     2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
23  *     3. University of Heidelberg, Heidelberg, Germany
24  *
25  * Copyright (C) 2011-2013 jointly by the following organizations:
26  *     1. California Institute of Technology, Pasadena, CA, USA
27  *     2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
28  *
29  * Copyright 2010 Ralph Gauges
30  *     Group for the modeling of biological processes
31  *     University of Heidelberg
32  *     Im Neuenheimer Feld 267
33  *     69120 Heidelberg
34  *     Germany
35  *
36  * This library is free software; you can redistribute it and/or modify it
37  * under the terms of the GNU Lesser General Public License as published by
38  * the Free Software Foundation.  A copy of the license agreement is provided
39  * in the file named "LICENSE.txt" included with this software distribution
40  * and also available online as http://sbml.org/software/libsbml/license.html
41  * ---------------------------------------------------------------------- -->*/
42 
43 #include <sbml/packages/render/sbml/RenderCubicBezier.h>
44 #include <sbml/packages/render/validator/RenderSBMLError.h>
45 
46 #include <sbml/xml/XMLNode.h>
47 #ifndef OMIT_DEPRECATED
48 #ifdef DEPRECATION_WARNINGS
49 #include <iostream>
50 #endif // DEPRECATION_WARNINGS
51 #endif // OMIT_DEPRECATED
52 #include <sbml/packages/layout/util/LayoutAnnotation.h>
53 #include <sbml/packages/render/extension/RenderExtension.h>
54 
55 
56 
57 using namespace std;
58 
59 
60 
61 LIBSBML_CPP_NAMESPACE_BEGIN
62 
63 
64 
65 
66 #ifdef __cplusplus
67 
68 
69 /*
70  * Creates a new RenderCubicBezier using the given SBML Level, Version and
71  * &ldquo;render&rdquo; package version.
72  */
RenderCubicBezier(unsigned int level,unsigned int version,unsigned int pkgVersion)73 RenderCubicBezier::RenderCubicBezier(unsigned int level,
74                                      unsigned int version,
75                                      unsigned int pkgVersion)
76 :    RenderPoint(level,version,pkgVersion)
77       , mBasePoint1_X(RelAbsVector(0.0,0.0))
78       , mBasePoint1_Y(RelAbsVector(0.0,0.0))
79       , mBasePoint1_Z(RelAbsVector(0.0,0.0))
80       , mBasePoint2_X(RelAbsVector(0.0,0.0))
81       , mBasePoint2_Y(RelAbsVector(0.0,0.0))
82       , mBasePoint2_Z(RelAbsVector(0.0,0.0))
83 {
84   RenderPkgNamespaces* renderns = new RenderPkgNamespaces(level, version, pkgVersion);
85   setSBMLNamespacesAndOwn(renderns);
86 
87   connectToChild();
88 
89   loadPlugins(renderns);
90 }
91 
92 
93 /*
94  * Creates a new RenderCubicBezier object with the given SBMLNamespaces.
95  *
96  * @param sbmlns The SBML namespace for the object.
97  */
RenderCubicBezier(RenderPkgNamespaces * renderns)98 RenderCubicBezier::RenderCubicBezier (RenderPkgNamespaces* renderns):
99     RenderPoint(renderns)
100   , mBasePoint1_X(RelAbsVector(0.0, 0.0))
101   , mBasePoint1_Y(RelAbsVector(0.0, 0.0))
102   , mBasePoint1_Z(RelAbsVector(0.0, 0.0))
103   , mBasePoint2_X(RelAbsVector(0.0, 0.0))
104   , mBasePoint2_Y(RelAbsVector(0.0, 0.0))
105   , mBasePoint2_Z(RelAbsVector(0.0, 0.0))
106 {
107         // set the element namespace of this object
108   setElementNamespace(renderns->getURI());
109 
110   // connect child elements to this element.
111   connectToChild();
112 
113   // load package extensions bound with this object (if any)
114   loadPlugins(renderns);
115 }
116 
117 
118 /*
119  * Creates a CubicBezier with the given points.
120  *
121  * @param bp1_x x coordinate of the first base point.
122  * @param bp1_y y coordinate of the first base point.
123  * @param bp1_z z coordinate of the first base point.
124  * @param bp1_x x coordinate of the second base point.
125  * @param bp1_y y coordinate of the second base point.
126  * @param bp1_z z coordinate of the second base point.
127  * @param bp1_x x coordinate of the end point.
128  * @param bp1_y y coordinate of the end point.
129  * @param bp1_z z coordinate of the end point.
130  */
RenderCubicBezier(RenderPkgNamespaces * renderns,const RelAbsVector & bp1_x,const RelAbsVector & bp1_y,const RelAbsVector & bp1_z,const RelAbsVector & bp2_x,const RelAbsVector & bp2_y,const RelAbsVector & bp2_z,const RelAbsVector & end_x,const RelAbsVector & end_y,const RelAbsVector & end_z)131 RenderCubicBezier::RenderCubicBezier (RenderPkgNamespaces* renderns, const RelAbsVector& bp1_x,const RelAbsVector& bp1_y,const RelAbsVector& bp1_z,const RelAbsVector& bp2_x,const RelAbsVector& bp2_y,const RelAbsVector& bp2_z,const RelAbsVector& end_x,const RelAbsVector& end_y,const RelAbsVector& end_z):RenderPoint(renderns, end_x,end_y,end_z),
132     mBasePoint1_X(bp1_x),
133     mBasePoint1_Y(bp1_y),
134     mBasePoint1_Z(bp1_z),
135     mBasePoint2_X(bp2_x),
136     mBasePoint2_Y(bp2_y),
137     mBasePoint2_Z(bp2_z)
138 {
139       // set the element namespace of this object
140   setElementNamespace(renderns->getURI());
141 
142   // connect child elements to this element.
143   connectToChild();
144 
145   // load package extensions bound with this object (if any)
146   loadPlugins(renderns);
147 }
148 
149 
150 /*
151 * Creates a new RenderCubicBezier object from the given XMLNode object.
152 * The XMLNode object has to contain a valid XML representation of a
153 * RenderCubicBezier object as defined in the render extension specification.
154 * This method is normally called when render information is read from a file and
155 * should normally not have to be called explicitly.
156 *
157 * @param node the XMLNode object reference that describes the RenderCubicBezier
158 * object to be instantiated.
159 */
RenderCubicBezier(const XMLNode & node,unsigned int l2version)160 RenderCubicBezier::RenderCubicBezier(const XMLNode& node, unsigned int l2version)
161   :RenderPoint(node, l2version)
162 {
163   const XMLAttributes& attributes = node.getAttributes();
164   const XMLNode* child;
165   ExpectedAttributes ea;
166   addExpectedAttributes(ea);
167   this->readAttributes(attributes, ea);
168   unsigned int n = 0, nMax = node.getNumChildren();
169   while (n<nMax)
170   {
171     child = &node.getChild(n);
172     const std::string& childName = child->getName();
173     if (childName == "annotation")
174     {
175       this->mAnnotation = new XMLNode(node);
176     }
177     else if (childName == "notes")
178     {
179       this->mNotes = new XMLNode(node);
180     }
181     else
182     {
183       //throw;
184     }
185     ++n;
186   }
187 
188 
189   setSBMLNamespacesAndOwn(new RenderPkgNamespaces(2, l2version));
190 
191   connectToChild();
192 }
193 
194 
195 /*
196  * Copy constructor for RenderCubicBezier objects.
197  */
RenderCubicBezier(const RenderCubicBezier & orig)198 RenderCubicBezier::RenderCubicBezier(const RenderCubicBezier& orig)
199   :RenderPoint(orig)
200 {
201     mBasePoint1_X=orig.mBasePoint1_X;
202     mBasePoint1_Y=orig.mBasePoint1_Y;
203     mBasePoint1_Z=orig.mBasePoint1_Z;
204     mBasePoint2_X=orig.mBasePoint2_X;
205     mBasePoint2_Y=orig.mBasePoint2_Y;
206     mBasePoint2_Z=orig.mBasePoint2_Z;
207 }
208 
209 
210 
211 /*
212  * Assignment operator for RenderCubicBezier objects.
213  */
operator =(const RenderCubicBezier & orig)214 RenderCubicBezier& RenderCubicBezier::operator=(const RenderCubicBezier& orig)
215 {
216     if(&orig!=this)
217     {
218         this->RenderPoint::operator=(orig);
219         mBasePoint1_X=orig.mBasePoint1_X;
220         mBasePoint1_Y=orig.mBasePoint1_Y;
221         mBasePoint1_Z=orig.mBasePoint1_Z;
222         mBasePoint2_X=orig.mBasePoint2_X;
223         mBasePoint2_Y=orig.mBasePoint2_Y;
224         mBasePoint2_Z=orig.mBasePoint2_Z;
225     }
226     return *this;
227 }
228 
229 
230 /*
231  * Comparison operator for RenderCubicBezier objects.
232  */
operator ==(const RenderCubicBezier & left) const233 bool RenderCubicBezier::operator==(const RenderCubicBezier& left) const
234 {
235     return (this->RenderPoint::operator==(left) &&
236             this->mBasePoint1_X == left.mBasePoint1_X &&
237             this->mBasePoint1_Y == left.mBasePoint1_Y &&
238             this->mBasePoint1_Z == left.mBasePoint1_Z &&
239             this->mBasePoint2_X == left.mBasePoint2_X &&
240             this->mBasePoint2_Y == left.mBasePoint2_Y &&
241             this->mBasePoint2_Z == left.mBasePoint2_Z
242            );
243 }
244 
245 
246 /*
247 * Creates and returns a deep copy of the RenderCubicBezier object.
248 */
249 RenderCubicBezier*
clone() const250 RenderCubicBezier::clone() const
251 {
252   return new RenderCubicBezier(*this);
253 }
254 
255 
256 /*
257  * Destroys the RenderCubicBezier object.
258  */
~RenderCubicBezier()259 RenderCubicBezier::~RenderCubicBezier ()
260 {
261 }
262 
263 
264 /*
265  * Returns the x value of the first base point of the curve (the one closer to the
266  */
getBasePoint1_x() const267 const RelAbsVector& RenderCubicBezier::getBasePoint1_x() const
268 {
269   return this->mBasePoint1_X;
270 }
271 
272 
getBasePoint1_x()273 RelAbsVector& RenderCubicBezier::getBasePoint1_x()
274 {
275   return this->mBasePoint1_X;
276 }
277 
278 
basePoint1_X() const279 const RelAbsVector& RenderCubicBezier::basePoint1_X() const
280 {
281     return this->mBasePoint1_X;
282 }
283 
284 
basePoint1_X()285 RelAbsVector& RenderCubicBezier::basePoint1_X()
286 {
287   return this->mBasePoint1_X;
288 }
289 
290 
291 /*
292  * Returns the y value of the first base point of the curve (the one closer to the
293  */
getBasePoint1_y() const294 const RelAbsVector& RenderCubicBezier::getBasePoint1_y() const
295 {
296     return this->mBasePoint1_Y;
297 }
298 
299 
getBasePoint1_y()300 RelAbsVector& RenderCubicBezier::getBasePoint1_y()
301 {
302   return this->mBasePoint1_Y;
303 }
304 
305 
basePoint1_Y() const306 const RelAbsVector& RenderCubicBezier::basePoint1_Y() const
307 {
308   return this->mBasePoint1_Y;
309 }
310 
311 
basePoint1_Y()312 RelAbsVector& RenderCubicBezier::basePoint1_Y()
313 {
314   return this->mBasePoint1_Y;
315 }
316 
317 
318 /*
319  * Returns the z value of the first base point of the curve (the one closer to the
320  */
getBasePoint1_z() const321 const RelAbsVector& RenderCubicBezier::getBasePoint1_z() const
322 {
323     return this->mBasePoint1_Z;
324 }
325 
326 
getBasePoint1_z()327 RelAbsVector& RenderCubicBezier::getBasePoint1_z()
328 {
329   return this->mBasePoint1_Z;
330 }
331 
332 
basePoint1_Z() const333 const RelAbsVector& RenderCubicBezier::basePoint1_Z() const
334 {
335   return this->mBasePoint1_Z;
336 }
337 
338 
basePoint1_Z()339 RelAbsVector& RenderCubicBezier::basePoint1_Z()
340 {
341   return this->mBasePoint1_Z;
342 }
343 
344 
345 /*
346  * Returns the x value of the second base point of the curve (the one further from the
347  */
getBasePoint2_x() const348 const RelAbsVector& RenderCubicBezier::getBasePoint2_x() const
349 {
350     return this->mBasePoint2_X;
351 }
352 
353 
getBasePoint2_x()354 RelAbsVector& RenderCubicBezier::getBasePoint2_x()
355 {
356   return this->mBasePoint2_X;
357 }
358 
359 
basePoint2_X() const360 const RelAbsVector& RenderCubicBezier::basePoint2_X() const
361 {
362   return this->mBasePoint2_X;
363 }
364 
365 
basePoint2_X()366 RelAbsVector& RenderCubicBezier::basePoint2_X()
367 {
368   return this->mBasePoint2_X;
369 }
370 
371 
372 
373 /*
374  * Returns the y value of the second base point of the curve (the one further from the
375  * @return const reference to y value of second base point
376  */
getBasePoint2_y() const377 const RelAbsVector& RenderCubicBezier::getBasePoint2_y() const
378 {
379     return this->mBasePoint2_Y;
380 }
381 
382 
getBasePoint2_y()383 RelAbsVector& RenderCubicBezier::getBasePoint2_y()
384 {
385   return this->mBasePoint2_Y;
386 }
387 
388 
basePoint2_Y() const389 const RelAbsVector& RenderCubicBezier::basePoint2_Y() const
390 {
391   return this->mBasePoint2_Y;
392 }
393 
394 
basePoint2_Y()395 RelAbsVector& RenderCubicBezier::basePoint2_Y()
396 {
397   return this->mBasePoint2_Y;
398 }
399 
400 
401 /*
402  * Returns the z value of the second base point of the curve (the one further from the
403  */
getBasePoint2_z()404 RelAbsVector& RenderCubicBezier::getBasePoint2_z()
405 {
406     return this->mBasePoint2_Z;
407 }
408 
409 
getBasePoint2_z() const410 const RelAbsVector& RenderCubicBezier::getBasePoint2_z() const
411 {
412   return this->mBasePoint2_Z;
413 }
414 
415 
basePoint2_Z() const416 const RelAbsVector& RenderCubicBezier::basePoint2_Z() const
417 {
418   return this->mBasePoint2_Z;
419 }
420 
421 
basePoint2_Z()422 RelAbsVector& RenderCubicBezier::basePoint2_Z()
423 {
424   return this->mBasePoint2_Z;
425 }
426 
427 
428 
429 
430 /*
431  * Predicate returning @c true if this RenderCubicBezier's "basePoint1_x"
432  * element is set.
433  */
434 bool
isSetBasePoint1_x() const435 RenderCubicBezier::isSetBasePoint1_x() const
436 {
437   return mBasePoint1_X.isSetCoordinate();
438 }
439 
440 
441 /*
442  * Predicate returning @c true if this RenderCubicBezier's "basePoint1_y"
443  * element is set.
444  */
445 bool
isSetBasePoint1_y() const446 RenderCubicBezier::isSetBasePoint1_y() const
447 {
448   return mBasePoint1_Y.isSetCoordinate();
449 }
450 
451 
452 /*
453  * Predicate returning @c true if this RenderCubicBezier's "basePoint1_z"
454  * element is set.
455  */
456 bool
isSetBasePoint1_z() const457 RenderCubicBezier::isSetBasePoint1_z() const
458 {
459   return mBasePoint1_Z.isSetCoordinate();
460 }
461 
462 
463 /*
464  * Predicate returning @c true if this RenderCubicBezier's "basePoint2_x"
465  * element is set.
466  */
467 bool
isSetBasePoint2_x() const468 RenderCubicBezier::isSetBasePoint2_x() const
469 {
470   return mBasePoint2_X.isSetCoordinate();
471 }
472 
473 
474 /*
475  * Predicate returning @c true if this RenderCubicBezier's "basePoint2_y"
476  * element is set.
477  */
478 bool
isSetBasePoint2_y() const479 RenderCubicBezier::isSetBasePoint2_y() const
480 {
481   return mBasePoint2_Y.isSetCoordinate();
482 }
483 
484 
485 /*
486  * Predicate returning @c true if this RenderCubicBezier's "basePoint2_z"
487  * element is set.
488  */
489 bool
isSetBasePoint2_z() const490 RenderCubicBezier::isSetBasePoint2_z() const
491 {
492   return mBasePoint2_Z.isSetCoordinate();
493 }
494 
495 
496 /*
497  * Sets the x value of the first base point of the curve (the one closer to the
498  * starting point).
499  *
500  * @param x x coordinate of first base point.
501  */
setBasePoint1_X(const RelAbsVector & v)502 int RenderCubicBezier::setBasePoint1_X(const RelAbsVector& v)
503 {
504     this->mBasePoint1_X=v;;
505     return LIBSBML_OPERATION_SUCCESS;
506 }
507 
508 
setBasePoint1_x(const RelAbsVector & v)509 int RenderCubicBezier::setBasePoint1_x(const RelAbsVector& v)
510 {
511   this->mBasePoint1_X = v;;
512   return LIBSBML_OPERATION_SUCCESS;
513 }
514 
515 
516 /*
517  * Sets the y value of the first base point of the curve (the one closer to the
518  * starting point).
519  *
520  * @param y y coordinate of first base point.
521  */
setBasePoint1_Y(const RelAbsVector & v)522 int RenderCubicBezier::setBasePoint1_Y(const RelAbsVector& v)
523 {
524     this->mBasePoint1_Y=v;
525     return LIBSBML_OPERATION_SUCCESS;
526 }
527 
528 
setBasePoint1_y(const RelAbsVector & v)529 int RenderCubicBezier::setBasePoint1_y(const RelAbsVector& v)
530 {
531   this->mBasePoint1_Y = v;
532   return LIBSBML_OPERATION_SUCCESS;
533 }
534 
535 
536 /*
537  * Sets the z value of the first base point of the curve (the one closer to the
538  * starting point).
539  *
540  * @param z z coordinate of first base point.
541  */
setBasePoint1_Z(const RelAbsVector & v)542 int RenderCubicBezier::setBasePoint1_Z(const RelAbsVector& v)
543 {
544     this->mBasePoint1_Z=v;
545     return LIBSBML_OPERATION_SUCCESS;
546 }
547 
548 
setBasePoint1_z(const RelAbsVector & v)549 int RenderCubicBezier::setBasePoint1_z(const RelAbsVector& v)
550 {
551   this->mBasePoint1_Z = v;
552   return LIBSBML_OPERATION_SUCCESS;
553 }
554 
555 
556 /*
557  * Sets the x value of the second base point of the curve (the one further from the
558  * starting point).
559  *
560  * @param x value of second base point.
561  */
setBasePoint2_X(const RelAbsVector & v)562 int RenderCubicBezier::setBasePoint2_X(const RelAbsVector& v)
563 {
564     this->mBasePoint2_X=v;
565     return LIBSBML_OPERATION_SUCCESS;
566 }
567 
568 
setBasePoint2_x(const RelAbsVector & v)569 int RenderCubicBezier::setBasePoint2_x(const RelAbsVector& v)
570 {
571   this->mBasePoint2_X = v;
572   return LIBSBML_OPERATION_SUCCESS;
573 }
574 
575 
576 /*
577  * Sets the y value of the second base point of the curve (the one further from the
578  * starting point).
579  *
580  * @param y value of second base point.
581  */
setBasePoint2_Y(const RelAbsVector & v)582 int RenderCubicBezier::setBasePoint2_Y(const RelAbsVector& v)
583 {
584     this->mBasePoint2_Y=v;
585     return LIBSBML_OPERATION_SUCCESS;
586 }
587 
588 
setBasePoint2_y(const RelAbsVector & v)589 int RenderCubicBezier::setBasePoint2_y(const RelAbsVector& v)
590 {
591   this->mBasePoint2_Y = v;
592   return LIBSBML_OPERATION_SUCCESS;
593 }
594 
595 
596 /*
597  * Sets the z value of the second base point of the curve (the one further from the
598  * starting point).
599  *
600  * @param z value of second base point.
601  */
setBasePoint2_Z(const RelAbsVector & v)602 int RenderCubicBezier::setBasePoint2_Z(const RelAbsVector& v)
603 {
604     this->mBasePoint2_Z=v;
605     return LIBSBML_OPERATION_SUCCESS;
606 }
607 
608 
setBasePoint2_z(const RelAbsVector & v)609 int RenderCubicBezier::setBasePoint2_z(const RelAbsVector& v)
610 {
611   this->mBasePoint2_Z = v;
612   return LIBSBML_OPERATION_SUCCESS;
613 }
614 
615 
616 /*
617 * Sets the first basepoint to the given coordinatees.
618 *
619 * @param x coordinate of second base point.
620 * @param y coordinate of second base point.
621 * @param z coordinate of second base point.
622 * If the z coodinate is omitted, it is set to 0.
623 */
setBasePoint1(const RelAbsVector & x,const RelAbsVector & y,const RelAbsVector & z)624 void RenderCubicBezier::setBasePoint1(const RelAbsVector& x, const RelAbsVector& y, const RelAbsVector& z)
625 {
626   this->mBasePoint1_X = x;
627   this->mBasePoint1_Y = y;
628   this->mBasePoint1_Z = z;
629 }
630 
631 
632 /*
633 * Sets the second basepoint to the given coordinatees.
634 *
635 * @param x coordinate of second base point.
636 * @param y coordinate of second base point.
637 * @param z coordinate of second base point.
638 * If the z coodinate is omitted, it is set to 0.
639 */
setBasePoint2(const RelAbsVector & x,const RelAbsVector & y,const RelAbsVector & z)640 void RenderCubicBezier::setBasePoint2(const RelAbsVector& x, const RelAbsVector& y, const RelAbsVector& z)
641 {
642   this->mBasePoint2_X = x;
643   this->mBasePoint2_Y = y;
644   this->mBasePoint2_Z = z;
645 }
646 
647 
648 /*
649  * Unsets the value of the "basePoint1_x" element of this RenderCubicBezier.
650  */
651 int
unsetBasePoint1_x()652 RenderCubicBezier::unsetBasePoint1_x()
653 {
654   mBasePoint1_X.unsetCoordinate();
655   return LIBSBML_OPERATION_SUCCESS;
656 }
657 
658 
659 /*
660  * Unsets the value of the "basePoint1_y" element of this RenderCubicBezier.
661  */
662 int
unsetBasePoint1_y()663 RenderCubicBezier::unsetBasePoint1_y()
664 {
665   mBasePoint1_Y.unsetCoordinate();
666   return LIBSBML_OPERATION_SUCCESS;
667 }
668 
669 
670 /*
671  * Unsets the value of the "basePoint1_z" element of this RenderCubicBezier.
672  */
673 int
unsetBasePoint1_z()674 RenderCubicBezier::unsetBasePoint1_z()
675 {
676   mBasePoint1_Z.unsetCoordinate();
677   return LIBSBML_OPERATION_SUCCESS;
678 }
679 
680 
681 /*
682  * Unsets the value of the "basePoint2_x" element of this RenderCubicBezier.
683  */
684 int
unsetBasePoint2_x()685 RenderCubicBezier::unsetBasePoint2_x()
686 {
687   mBasePoint2_X.unsetCoordinate();
688   return LIBSBML_OPERATION_SUCCESS;
689 }
690 
691 
692 /*
693  * Unsets the value of the "basePoint2_y" element of this RenderCubicBezier.
694  */
695 int
unsetBasePoint2_y()696 RenderCubicBezier::unsetBasePoint2_y()
697 {
698   mBasePoint2_Y.unsetCoordinate();
699   return LIBSBML_OPERATION_SUCCESS;
700 }
701 
702 
703 /*
704  * Unsets the value of the "basePoint2_z" element of this RenderCubicBezier.
705  */
706 int
unsetBasePoint2_z()707 RenderCubicBezier::unsetBasePoint2_z()
708 {
709   mBasePoint2_Z.unsetCoordinate();
710   return LIBSBML_OPERATION_SUCCESS;
711 }
712 
713 
714 /*
715  * Returns the XML element name of this RenderCubicBezier object.
716  */
717 const std::string&
getElementName() const718 RenderCubicBezier::getElementName() const
719 {
720   static const string name = "element";
721   return name;
722 }
723 
724 
725 /*
726  * Returns the libSBML type code for this RenderCubicBezier object.
727  */
728 int
getTypeCode() const729 RenderCubicBezier::getTypeCode() const
730 {
731   return SBML_RENDER_CUBICBEZIER;
732 }
733 
734 
735 /*
736  * Predicate returning @c true if all the required attributes for this
737  * RenderCubicBezier object have been set.
738  */
739 bool
hasRequiredAttributes() const740 RenderCubicBezier::hasRequiredAttributes() const
741 {
742   bool result = this->RenderPoint::hasRequiredAttributes();
743   if (!isSetBasePoint1_x())
744   {
745     result = false;
746   }
747 
748   if (!isSetBasePoint1_y())
749   {
750     result = false;
751   }
752 
753   if (!isSetBasePoint2_x())
754   {
755     result = false;
756   }
757 
758   if (!isSetBasePoint2_y())
759   {
760     result = false;
761   }
762 
763   // z must not be nan
764   result = result &&
765     (this->mBasePoint1_Z.getAbsoluteValue() == this->mBasePoint1_Z.getAbsoluteValue()) &&
766     (this->mBasePoint1_Z.getRelativeValue() == this->mBasePoint1_Z.getRelativeValue());
767 
768   // z must not be nan
769   result = result &&
770     (this->mBasePoint2_Z.getAbsoluteValue() == this->mBasePoint2_Z.getAbsoluteValue()) &&
771     (this->mBasePoint2_Z.getRelativeValue() == this->mBasePoint2_Z.getRelativeValue());
772   return result;
773 }
774 
775 
776 /** @cond doxygenLibsbmlInternal */
777 /*
778 * Creates an XMLNode object from this RenderCubicBezier object.
779 *
780 * @return the XMLNode with the XML representation for the
781 * RenderCubicBezier object.
782 */
toXML(const std::string & name) const783 XMLNode RenderCubicBezier::toXML(const std::string& name) const
784 {
785   return getXmlNodeForSBase(this);
786 }
787 /** @endcond */
788 
789 
790 
791 /** @cond doxygenLibsbmlInternal */
792 void
addExpectedAttributes(ExpectedAttributes & attributes)793 RenderCubicBezier::addExpectedAttributes(ExpectedAttributes& attributes)
794 {
795   RenderPoint::addExpectedAttributes(attributes);
796 
797   attributes.add("basePoint1_x");
798   attributes.add("basePoint1_y");
799   attributes.add("basePoint1_z");
800   attributes.add("basePoint2_x");
801   attributes.add("basePoint2_y");
802   attributes.add("basePoint2_z");
803 }
804 /** @endcond */
805 
806 /** @cond doxygenLibsbmlInternal */
readAttributes(const XMLAttributes & attributes,const ExpectedAttributes & expectedAttributes)807 void RenderCubicBezier::readAttributes (const XMLAttributes& attributes, const ExpectedAttributes& expectedAttributes)
808 {
809   unsigned int level = getLevel();
810   unsigned int version = getVersion();
811   unsigned int pkgVersion = getPackageVersion();
812   unsigned int numErrs;
813   bool assigned = false;
814   SBMLErrorLog* log = getErrorLog();
815 
816   RenderPoint::readAttributes(attributes, expectedAttributes);
817 
818   if (log)
819   {
820     numErrs = log->getNumErrors();
821 
822     for (int n = numErrs - 1; n >= 0; n--)
823     {
824       if (log->getError(n)->getErrorId() == UnknownPackageAttribute)
825       {
826         const std::string details = log->getError(n)->getMessage();
827         log->remove(UnknownPackageAttribute);
828         log->logPackageError("render", RenderRenderCubicBezierAllowedAttributes,
829           pkgVersion, level, version, details, getLine(), getColumn());
830       }
831       else if (log->getError(n)->getErrorId() == UnknownCoreAttribute)
832       {
833         const std::string details = log->getError(n)->getMessage();
834         log->remove(UnknownCoreAttribute);
835         log->logPackageError("render",
836           RenderRenderCubicBezierAllowedCoreAttributes, pkgVersion, level, version,
837           details, getLine(), getColumn());
838       }
839     }
840   }
841 
842   string elplusid = "<renderCubicBezier> element";
843   if (!getId().empty()) {
844     elplusid += " with the id '" + mId + "'";
845   }
846 
847   std::string s;
848   RelAbsVector v = RelAbsVector();
849 
850   //
851   // basepoint1_x RelAbsVector (use = required)
852   //
853   assigned = attributes.readInto("basePoint1_x", s, this->getErrorLog(), false, getLine(), getColumn());
854   if (!assigned)
855   {
856     std::string message = "The required attribute 'basePoint1_x' is missing from the "
857       + elplusid + ".";
858     if (log) {
859       log->logPackageError("render", RenderRenderCubicBezierAllowedAttributes,
860         pkgVersion, level, version, message, getLine(), getColumn());
861     }
862     this->mBasePoint1_X = RelAbsVector(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN());
863   }
864   else
865   {
866     v.setCoordinate(s);
867     if (!(v.isSetCoordinate()))
868     {
869       std::string message = "The syntax '" + s + "' of the attribute 'basePoint1_x' on the "
870         + elplusid + " does not conform to the syntax of a RelAbsVector type.";
871       if (log)
872       {
873         log->logPackageError("render", RenderRenderCubicBezierBasePoint1_xMustBeRelAbsVector,
874           pkgVersion, level, version, message, getLine(), getColumn());
875       }
876       this->mBasePoint1_X = RelAbsVector(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN());
877     }
878     else
879     {
880       this->setBasePoint1_x(v);
881     }
882     v.erase();
883   }
884 
885   //
886   // basepoint1_y RelAbsVector (use = required)
887   //
888   assigned = attributes.readInto("basePoint1_y", s, this->getErrorLog(), false, getLine(), getColumn());
889   if (!assigned)
890   {
891     std::string message = "The required attribute 'basePoint1_y' is missing from the "
892       + elplusid + ".";
893     if (log)
894     {
895       log->logPackageError("render", RenderRenderCubicBezierAllowedAttributes,
896         pkgVersion, level, version, message, getLine(), getColumn());
897     }
898     this->mBasePoint1_Y = RelAbsVector(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN());
899   }
900   else
901   {
902     v.setCoordinate(s);
903     if (!(v.isSetCoordinate()))
904     {
905       if (log)
906       {
907         std::string message = "The syntax '" + s + "' of the attribute 'basePoint1_y' on the "
908           + elplusid + " does not conform to the syntax of a RelAbsVector type.";
909         log->logPackageError("render", RenderRenderCubicBezierBasePoint1_yMustBeRelAbsVector,
910           pkgVersion, level, version, message, getLine(), getColumn());
911       }
912       this->mBasePoint1_Y = RelAbsVector(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN());
913     }
914     else
915     {
916       this->setBasePoint1_y(v);
917     }
918     v.erase();
919   }
920 
921   //
922   // basepoint1_z RelAbsVector (use = optional)
923   //
924 
925   s = "";
926   assigned = attributes.readInto("basePoint1_z", s, getErrorLog(), false, getLine(), getColumn());
927   if (!assigned)
928   {
929     this->mBasePoint1_Z = RelAbsVector(0.0, 0.0);
930   }
931   else
932   {
933     v.setCoordinate(s);
934     if (!(v.isSetCoordinate()) && log)
935     {
936       std::string message = "The syntax '" + s + "' of the attribute 'basePoint1_z' on the "
937         + elplusid + " does not conform to the syntax of a RelAbsVector type.";
938       log->logPackageError("render", RenderRenderCubicBezierBasePoint1_zMustBeRelAbsVector,
939         pkgVersion, level, version, message, getLine(), getColumn());
940 
941     }
942  //   else
943     {
944       this->setBasePoint1_z(v);
945     }
946     v.erase();
947   }
948 
949   //
950   // basepoint2_x RelAbsVector (use = required)
951   //
952   assigned = attributes.readInto("basePoint2_x", s, this->getErrorLog(), false, getLine(), getColumn());
953   if (!assigned)
954   {
955     if (log)
956     {
957       std::string message = "The required attribute 'basePoint2_x' is missing from the "
958         + elplusid + ".";
959       log->logPackageError("render", RenderRenderCubicBezierAllowedAttributes,
960         pkgVersion, level, version, message, getLine(), getColumn());
961     }
962     this->mBasePoint2_X = RelAbsVector(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN());
963   }
964   else
965   {
966     v.setCoordinate(s);
967     if (!(v.isSetCoordinate()))
968     {
969       if (log)
970       {
971         std::string message = "The syntax '" + s + "' of the attribute 'basePoint2_x' on the "
972           + elplusid + " does not conform to the syntax of a RelAbsVector type.";
973         log->logPackageError("render", RenderRenderCubicBezierBasePoint2_xMustBeRelAbsVector,
974           pkgVersion, level, version, message, getLine(), getColumn());
975       }
976       this->mBasePoint2_X = RelAbsVector(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN());
977     }
978     else
979     {
980       this->setBasePoint2_x(v);
981     }
982     v.erase();
983   }
984 
985   //
986   // basepoint2_y RelAbsVector (use = required)
987   //
988   assigned = attributes.readInto("basePoint2_y", s, this->getErrorLog(), false, getLine(), getColumn());
989   if (!assigned)
990   {
991     if (log)
992     {
993       std::string message = "The required attribute 'basePoint2_y' is missing from the "
994         + elplusid + ".";
995       log->logPackageError("render", RenderRenderCubicBezierAllowedAttributes,
996         pkgVersion, level, version, message, getLine(), getColumn());
997     }
998     this->mBasePoint2_Y = RelAbsVector(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN());
999   }
1000   else
1001   {
1002     v.setCoordinate(s);
1003     if (!(v.isSetCoordinate()))
1004     {
1005       if (log)
1006       {
1007         std::string message = "The syntax '" + s + "' of the attribute 'basePoint2_y' on the "
1008           + elplusid + " does not conform to the syntax of a RelAbsVector type.";
1009         log->logPackageError("render", RenderRenderCubicBezierBasePoint2_yMustBeRelAbsVector,
1010           pkgVersion, level, version, message, getLine(), getColumn());
1011       }
1012       this->mBasePoint2_Y = RelAbsVector(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN());
1013     }
1014     else
1015     {
1016       this->setBasePoint2_y(v);
1017     }
1018     v.erase();
1019   }
1020 
1021   //
1022   // basepoint2_z RelAbsVector (use = optional)
1023   //
1024 
1025   s = "";
1026   assigned = attributes.readInto("basePoint2_z", s, getErrorLog(), false, getLine(), getColumn());
1027   if (!assigned)
1028   {
1029     this->mBasePoint2_Z = RelAbsVector(0.0, 0.0);
1030   }
1031   else
1032   {
1033     v.setCoordinate(s);
1034     if (!(v.isSetCoordinate()) && log)
1035     {
1036       std::string message = "The syntax '" + s + "' of the attribute 'basePoint2_z' on the "
1037         + elplusid + " does not conform to the syntax of a RelAbsVector type.";
1038       log->logPackageError("render", RenderRenderCubicBezierBasePoint2_zMustBeRelAbsVector,
1039         pkgVersion, level, version, message, getLine(), getColumn());
1040 
1041     }
1042     //else
1043     {
1044       this->setBasePoint2_z(v);
1045     }
1046     v.erase();
1047   }
1048 
1049 }
1050 /** @endcond */
1051 
1052 
1053 /** @cond doxygenLibsbmlInternal */
1054 /*
1055  * Subclasses should override this method to write their XML attributes
1056  * to the XMLOutputStream.  Be sure to call your parents implementation
1057  * of this method as well.  For example:
1058  *
1059  *   SBase::writeAttributes(stream);
1060  *   stream.writeAttribute( "id"  , mId   );
1061  *   stream.writeAttribute( "name", mName );
1062  *   ...
1063  */
writeAttributes(XMLOutputStream & stream) const1064 void RenderCubicBezier::writeAttributes (XMLOutputStream& stream) const
1065 {
1066     SBase::writeAttributes(stream);
1067     XMLTriple triple("type","","xsi");
1068     stream.writeAttribute(triple,std::string("RenderCubicBezier"));
1069     std::ostringstream os;
1070     os << this->mXOffset;
1071     stream.writeAttribute("x", getPrefix(), os.str());
1072     os.str("");
1073     os << this->mYOffset;
1074     stream.writeAttribute("y", getPrefix(), os.str());
1075     if(this->mZOffset!=RelAbsVector(0.0,0.0))
1076     {
1077         os.str("");
1078         os << this->mZOffset;
1079         stream.writeAttribute("z", getPrefix(), os.str());
1080     }
1081     os.str("");
1082     os << this->mBasePoint1_X;
1083     stream.writeAttribute("basePoint1_x", getPrefix(), os.str());
1084     os.str("");
1085     os << this->mBasePoint1_Y;
1086     stream.writeAttribute("basePoint1_y", getPrefix(), os.str());
1087     if(this->mBasePoint1_Z!=RelAbsVector(0.0,0.0))
1088     {
1089         os.str("");
1090         os << this->mBasePoint1_Z;
1091         stream.writeAttribute("basePoint1_z", getPrefix(), os.str());
1092     }
1093     os.str("");
1094     os << this->mBasePoint2_X;
1095     stream.writeAttribute("basePoint2_x", getPrefix(), os.str());
1096     os.str("");
1097     os << this->mBasePoint2_Y;
1098     stream.writeAttribute("basePoint2_y", getPrefix(), os.str());
1099     if(this->mBasePoint2_Z!=RelAbsVector(0.0,0.0))
1100     {
1101         os.str("");
1102         os << this->mBasePoint2_Z;
1103         stream.writeAttribute("basePoint2_z", getPrefix(), os.str());
1104     }
1105 }
1106 /** @endcond */
1107 
1108 void
writeXMLNS(XMLOutputStream & stream) const1109 RenderCubicBezier::writeXMLNS(XMLOutputStream& stream) const
1110 {
1111   XMLNamespaces xmlns;
1112   xmlns.add(LayoutExtension::getXmlnsXSI(), "xsi");
1113   stream << xmlns;
1114 }
1115 
1116 #endif /* __cplusplus */
1117 
1118 
1119 /*
1120  * Creates a new RenderCubicBezier_t using the given SBML Level, Version and
1121  * &ldquo;render&rdquo; package version.
1122  */
1123 LIBSBML_EXTERN
1124 RenderCubicBezier_t *
RenderCubicBezier_create(unsigned int level,unsigned int version,unsigned int pkgVersion)1125 RenderCubicBezier_create(unsigned int level,
1126                          unsigned int version,
1127                          unsigned int pkgVersion)
1128 {
1129   return new RenderCubicBezier(level, version, pkgVersion);
1130 }
1131 
1132 
1133 /*
1134  * Creates and returns a deep copy of this RenderCubicBezier_t object.
1135  */
1136 LIBSBML_EXTERN
1137 RenderCubicBezier_t*
RenderCubicBezier_clone(const RenderCubicBezier_t * rcb)1138 RenderCubicBezier_clone(const RenderCubicBezier_t* rcb)
1139 {
1140   if (rcb != NULL)
1141   {
1142     return static_cast<RenderCubicBezier_t*>(rcb->clone());
1143   }
1144   else
1145   {
1146     return NULL;
1147   }
1148 }
1149 
1150 
1151 /*
1152  * Frees this RenderCubicBezier_t object.
1153  */
1154 LIBSBML_EXTERN
1155 void
RenderCubicBezier_free(RenderCubicBezier_t * rcb)1156 RenderCubicBezier_free(RenderCubicBezier_t* rcb)
1157 {
1158   if (rcb != NULL)
1159   {
1160     delete rcb;
1161   }
1162 }
1163 
1164 
1165 /*
1166  * Returns the value of the "basePoint1_x" element of this RenderCubicBezier_t.
1167  */
1168 LIBSBML_EXTERN
1169 const RelAbsVector_t*
RenderCubicBezier_getBasePoint1_x(const RenderCubicBezier_t * rcb)1170 RenderCubicBezier_getBasePoint1_x(const RenderCubicBezier_t * rcb)
1171 {
1172   if (rcb == NULL)
1173   {
1174     return NULL;
1175   }
1176 
1177   return (RelAbsVector_t*)(&(rcb->getBasePoint1_x()));
1178 }
1179 
1180 
1181 /*
1182  * Returns the value of the "basePoint1_y" element of this RenderCubicBezier_t.
1183  */
1184 LIBSBML_EXTERN
1185 const RelAbsVector_t*
RenderCubicBezier_getBasePoint1_y(const RenderCubicBezier_t * rcb)1186 RenderCubicBezier_getBasePoint1_y(const RenderCubicBezier_t * rcb)
1187 {
1188   if (rcb == NULL)
1189   {
1190     return NULL;
1191   }
1192 
1193   return (RelAbsVector_t*)(&(rcb->getBasePoint1_y()));
1194 }
1195 
1196 
1197 /*
1198  * Returns the value of the "basePoint1_z" element of this RenderCubicBezier_t.
1199  */
1200 LIBSBML_EXTERN
1201 const RelAbsVector_t*
RenderCubicBezier_getBasePoint1_z(const RenderCubicBezier_t * rcb)1202 RenderCubicBezier_getBasePoint1_z(const RenderCubicBezier_t * rcb)
1203 {
1204   if (rcb == NULL)
1205   {
1206     return NULL;
1207   }
1208 
1209   return (RelAbsVector_t*)(&(rcb->getBasePoint1_z()));
1210 }
1211 
1212 
1213 /*
1214  * Returns the value of the "basePoint2_x" element of this RenderCubicBezier_t.
1215  */
1216 LIBSBML_EXTERN
1217 const RelAbsVector_t*
RenderCubicBezier_getBasePoint2_x(const RenderCubicBezier_t * rcb)1218 RenderCubicBezier_getBasePoint2_x(const RenderCubicBezier_t * rcb)
1219 {
1220   if (rcb == NULL)
1221   {
1222     return NULL;
1223   }
1224 
1225   return (RelAbsVector_t*)(&(rcb->getBasePoint2_x()));
1226 }
1227 
1228 
1229 /*
1230  * Returns the value of the "basePoint2_y" element of this RenderCubicBezier_t.
1231  */
1232 LIBSBML_EXTERN
1233 const RelAbsVector_t*
RenderCubicBezier_getBasePoint2_y(const RenderCubicBezier_t * rcb)1234 RenderCubicBezier_getBasePoint2_y(const RenderCubicBezier_t * rcb)
1235 {
1236   if (rcb == NULL)
1237   {
1238     return NULL;
1239   }
1240 
1241   return (RelAbsVector_t*)(&(rcb->getBasePoint2_y()));
1242 }
1243 
1244 
1245 /*
1246  * Returns the value of the "basePoint2_z" element of this RenderCubicBezier_t.
1247  */
1248 LIBSBML_EXTERN
1249 const RelAbsVector_t*
RenderCubicBezier_getBasePoint2_z(const RenderCubicBezier_t * rcb)1250 RenderCubicBezier_getBasePoint2_z(const RenderCubicBezier_t * rcb)
1251 {
1252   if (rcb == NULL)
1253   {
1254     return NULL;
1255   }
1256 
1257   return (RelAbsVector_t*)(&(rcb->getBasePoint2_z()));
1258 }
1259 
1260 
1261 /*
1262  * Predicate returning @c 1 (true) if this RenderCubicBezier_t's "basePoint1_x"
1263  * element is set.
1264  */
1265 LIBSBML_EXTERN
1266 int
RenderCubicBezier_isSetBasePoint1_x(const RenderCubicBezier_t * rcb)1267 RenderCubicBezier_isSetBasePoint1_x(const RenderCubicBezier_t * rcb)
1268 {
1269   return (rcb != NULL) ? static_cast<int>(rcb->isSetBasePoint1_x()) : 0;
1270 }
1271 
1272 
1273 /*
1274  * Predicate returning @c 1 (true) if this RenderCubicBezier_t's "basePoint1_y"
1275  * element is set.
1276  */
1277 LIBSBML_EXTERN
1278 int
RenderCubicBezier_isSetBasePoint1_y(const RenderCubicBezier_t * rcb)1279 RenderCubicBezier_isSetBasePoint1_y(const RenderCubicBezier_t * rcb)
1280 {
1281   return (rcb != NULL) ? static_cast<int>(rcb->isSetBasePoint1_y()) : 0;
1282 }
1283 
1284 
1285 /*
1286  * Predicate returning @c 1 (true) if this RenderCubicBezier_t's "basePoint1_z"
1287  * element is set.
1288  */
1289 LIBSBML_EXTERN
1290 int
RenderCubicBezier_isSetBasePoint1_z(const RenderCubicBezier_t * rcb)1291 RenderCubicBezier_isSetBasePoint1_z(const RenderCubicBezier_t * rcb)
1292 {
1293   return (rcb != NULL) ? static_cast<int>(rcb->isSetBasePoint1_z()) : 0;
1294 }
1295 
1296 
1297 /*
1298  * Predicate returning @c 1 (true) if this RenderCubicBezier_t's "basePoint2_x"
1299  * element is set.
1300  */
1301 LIBSBML_EXTERN
1302 int
RenderCubicBezier_isSetBasePoint2_x(const RenderCubicBezier_t * rcb)1303 RenderCubicBezier_isSetBasePoint2_x(const RenderCubicBezier_t * rcb)
1304 {
1305   return (rcb != NULL) ? static_cast<int>(rcb->isSetBasePoint2_x()) : 0;
1306 }
1307 
1308 
1309 /*
1310  * Predicate returning @c 1 (true) if this RenderCubicBezier_t's "basePoint2_y"
1311  * element is set.
1312  */
1313 LIBSBML_EXTERN
1314 int
RenderCubicBezier_isSetBasePoint2_y(const RenderCubicBezier_t * rcb)1315 RenderCubicBezier_isSetBasePoint2_y(const RenderCubicBezier_t * rcb)
1316 {
1317   return (rcb != NULL) ? static_cast<int>(rcb->isSetBasePoint2_y()) : 0;
1318 }
1319 
1320 
1321 /*
1322  * Predicate returning @c 1 (true) if this RenderCubicBezier_t's "basePoint2_z"
1323  * element is set.
1324  */
1325 LIBSBML_EXTERN
1326 int
RenderCubicBezier_isSetBasePoint2_z(const RenderCubicBezier_t * rcb)1327 RenderCubicBezier_isSetBasePoint2_z(const RenderCubicBezier_t * rcb)
1328 {
1329   return (rcb != NULL) ? static_cast<int>(rcb->isSetBasePoint2_z()) : 0;
1330 }
1331 
1332 
1333 /*
1334  * Sets the value of the "basePoint1_x" element of this RenderCubicBezier_t.
1335  */
1336 LIBSBML_EXTERN
1337 int
RenderCubicBezier_setBasePoint1_x(RenderCubicBezier_t * rcb,const RelAbsVector_t * basePoint1_x)1338 RenderCubicBezier_setBasePoint1_x(RenderCubicBezier_t * rcb,
1339                                   const RelAbsVector_t* basePoint1_x)
1340 {
1341   return (rcb != NULL) ? rcb->setBasePoint1_x(*basePoint1_x) :
1342     LIBSBML_INVALID_OBJECT;
1343 }
1344 
1345 
1346 /*
1347  * Sets the value of the "basePoint1_y" element of this RenderCubicBezier_t.
1348  */
1349 LIBSBML_EXTERN
1350 int
RenderCubicBezier_setBasePoint1_y(RenderCubicBezier_t * rcb,const RelAbsVector_t * basePoint1_y)1351 RenderCubicBezier_setBasePoint1_y(RenderCubicBezier_t * rcb,
1352                                   const RelAbsVector_t* basePoint1_y)
1353 {
1354   return (rcb != NULL) ? rcb->setBasePoint1_y(*basePoint1_y) :
1355     LIBSBML_INVALID_OBJECT;
1356 }
1357 
1358 
1359 /*
1360  * Sets the value of the "basePoint1_z" element of this RenderCubicBezier_t.
1361  */
1362 LIBSBML_EXTERN
1363 int
RenderCubicBezier_setBasePoint1_z(RenderCubicBezier_t * rcb,const RelAbsVector_t * basePoint1_z)1364 RenderCubicBezier_setBasePoint1_z(RenderCubicBezier_t * rcb,
1365                                   const RelAbsVector_t* basePoint1_z)
1366 {
1367   return (rcb != NULL) ? rcb->setBasePoint1_z(*basePoint1_z) :
1368     LIBSBML_INVALID_OBJECT;
1369 }
1370 
1371 
1372 /*
1373  * Sets the value of the "basePoint2_x" element of this RenderCubicBezier_t.
1374  */
1375 LIBSBML_EXTERN
1376 int
RenderCubicBezier_setBasePoint2_x(RenderCubicBezier_t * rcb,const RelAbsVector_t * basePoint2_x)1377 RenderCubicBezier_setBasePoint2_x(RenderCubicBezier_t * rcb,
1378                                   const RelAbsVector_t* basePoint2_x)
1379 {
1380   return (rcb != NULL) ? rcb->setBasePoint2_x(*basePoint2_x) :
1381     LIBSBML_INVALID_OBJECT;
1382 }
1383 
1384 
1385 /*
1386  * Sets the value of the "basePoint2_y" element of this RenderCubicBezier_t.
1387  */
1388 LIBSBML_EXTERN
1389 int
RenderCubicBezier_setBasePoint2_y(RenderCubicBezier_t * rcb,const RelAbsVector_t * basePoint2_y)1390 RenderCubicBezier_setBasePoint2_y(RenderCubicBezier_t * rcb,
1391                                   const RelAbsVector_t* basePoint2_y)
1392 {
1393   return (rcb != NULL) ? rcb->setBasePoint2_y(*basePoint2_y) :
1394     LIBSBML_INVALID_OBJECT;
1395 }
1396 
1397 
1398 /*
1399  * Sets the value of the "basePoint2_z" element of this RenderCubicBezier_t.
1400  */
1401 LIBSBML_EXTERN
1402 int
RenderCubicBezier_setBasePoint2_z(RenderCubicBezier_t * rcb,const RelAbsVector_t * basePoint2_z)1403 RenderCubicBezier_setBasePoint2_z(RenderCubicBezier_t * rcb,
1404                                   const RelAbsVector_t* basePoint2_z)
1405 {
1406   return (rcb != NULL) ? rcb->setBasePoint2_z(*basePoint2_z) :
1407     LIBSBML_INVALID_OBJECT;
1408 }
1409 
1410 
1411 /*
1412  * Unsets the value of the "basePoint1_x" element of this RenderCubicBezier_t.
1413  */
1414 LIBSBML_EXTERN
1415 int
RenderCubicBezier_unsetBasePoint1_x(RenderCubicBezier_t * rcb)1416 RenderCubicBezier_unsetBasePoint1_x(RenderCubicBezier_t * rcb)
1417 {
1418   return (rcb != NULL) ? rcb->unsetBasePoint1_x() : LIBSBML_INVALID_OBJECT;
1419 }
1420 
1421 
1422 /*
1423  * Unsets the value of the "basePoint1_y" element of this RenderCubicBezier_t.
1424  */
1425 LIBSBML_EXTERN
1426 int
RenderCubicBezier_unsetBasePoint1_y(RenderCubicBezier_t * rcb)1427 RenderCubicBezier_unsetBasePoint1_y(RenderCubicBezier_t * rcb)
1428 {
1429   return (rcb != NULL) ? rcb->unsetBasePoint1_y() : LIBSBML_INVALID_OBJECT;
1430 }
1431 
1432 
1433 /*
1434  * Unsets the value of the "basePoint1_z" element of this RenderCubicBezier_t.
1435  */
1436 LIBSBML_EXTERN
1437 int
RenderCubicBezier_unsetBasePoint1_z(RenderCubicBezier_t * rcb)1438 RenderCubicBezier_unsetBasePoint1_z(RenderCubicBezier_t * rcb)
1439 {
1440   return (rcb != NULL) ? rcb->unsetBasePoint1_z() : LIBSBML_INVALID_OBJECT;
1441 }
1442 
1443 
1444 /*
1445  * Unsets the value of the "basePoint2_x" element of this RenderCubicBezier_t.
1446  */
1447 LIBSBML_EXTERN
1448 int
RenderCubicBezier_unsetBasePoint2_x(RenderCubicBezier_t * rcb)1449 RenderCubicBezier_unsetBasePoint2_x(RenderCubicBezier_t * rcb)
1450 {
1451   return (rcb != NULL) ? rcb->unsetBasePoint2_x() : LIBSBML_INVALID_OBJECT;
1452 }
1453 
1454 
1455 /*
1456  * Unsets the value of the "basePoint2_y" element of this RenderCubicBezier_t.
1457  */
1458 LIBSBML_EXTERN
1459 int
RenderCubicBezier_unsetBasePoint2_y(RenderCubicBezier_t * rcb)1460 RenderCubicBezier_unsetBasePoint2_y(RenderCubicBezier_t * rcb)
1461 {
1462   return (rcb != NULL) ? rcb->unsetBasePoint2_y() : LIBSBML_INVALID_OBJECT;
1463 }
1464 
1465 
1466 /*
1467  * Unsets the value of the "basePoint2_z" element of this RenderCubicBezier_t.
1468  */
1469 LIBSBML_EXTERN
1470 int
RenderCubicBezier_unsetBasePoint2_z(RenderCubicBezier_t * rcb)1471 RenderCubicBezier_unsetBasePoint2_z(RenderCubicBezier_t * rcb)
1472 {
1473   return (rcb != NULL) ? rcb->unsetBasePoint2_z() : LIBSBML_INVALID_OBJECT;
1474 }
1475 
1476 
1477 /*
1478  * Predicate returning @c 1 (true) if all the required attributes for this
1479  * RenderCubicBezier_t object have been set.
1480  */
1481 LIBSBML_EXTERN
1482 int
RenderCubicBezier_hasRequiredAttributes(const RenderCubicBezier_t * rcb)1483 RenderCubicBezier_hasRequiredAttributes(const RenderCubicBezier_t * rcb)
1484 {
1485   return (rcb != NULL) ? static_cast<int>(rcb->hasRequiredAttributes()) : 0;
1486 }
1487 
1488 
1489 /*
1490  * Predicate returning @c 1 (true) if all the required elements for this
1491  * RenderCubicBezier_t object have been set.
1492  */
1493 LIBSBML_EXTERN
1494 int
RenderCubicBezier_hasRequiredElements(const RenderCubicBezier_t * rcb)1495 RenderCubicBezier_hasRequiredElements(const RenderCubicBezier_t * rcb)
1496 {
1497   return (rcb != NULL) ? static_cast<int>(rcb->hasRequiredElements()) : 0;
1498 }
1499 
1500 
1501 
1502 
1503 LIBSBML_CPP_NAMESPACE_END
1504 
1505 
1506