1 /**
2 * @file SedLine.cpp
3 * @brief Implementation of the SedLine class.
4 * @author DEVISER
5 *
6 * <!--------------------------------------------------------------------------
7 * This file is part of libSEDML. Please visit http://sed-ml.org for more
8 * information about SED-ML. The latest version of libSEDML can be found on
9 * github: https://github.com/fbergmann/libSEDML/
10 *
11
12 * Copyright (c) 2013-2019, Frank T. Bergmann
13 * All rights reserved.
14 *
15
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions are met:
18 *
19
20 * 1. Redistributions of source code must retain the above copyright notice,
21 * this
22 * list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright notice,
24 * this list of conditions and the following disclaimer in the documentation
25 * and/or other materials provided with the distribution.
26 *
27 * This library is free software; you can redistribute it and/or modify it
28 * under the terms of the GNU Lesser General Public License as published by the
29 * Free Software Foundation. A copy of the license agreement is provided in the
30 * file named "LICENSE.txt" included with this software distribution and also
31 * available online as http://sbml.org/software/libsbml/license.html
32 * ------------------------------------------------------------------------ -->
33 */
34 #include <sedml/SedLine.h>
35 #include <sbml/xml/XMLInputStream.h>
36
37
38 using namespace std;
39
40
41
42 LIBSEDML_CPP_NAMESPACE_BEGIN
43
44
45
46
47 #ifdef __cplusplus
48
49
50 /*
51 * Creates a new SedLine using the given SED-ML Level and @ p version values.
52 */
SedLine(unsigned int level,unsigned int version)53 SedLine::SedLine(unsigned int level, unsigned int version)
54 : SedBase(level, version)
55 , mType (SEDML_LINETYPE_INVALID)
56 , mColor ("")
57 , mThickness (util_NaN())
58 , mIsSetThickness (false)
59 {
60 setSedNamespacesAndOwn(new SedNamespaces(level, version));
61 }
62
63
64 /*
65 * Creates a new SedLine using the given SedNamespaces object @p sedmlns.
66 */
SedLine(SedNamespaces * sedmlns)67 SedLine::SedLine(SedNamespaces *sedmlns)
68 : SedBase(sedmlns)
69 , mType (SEDML_LINETYPE_INVALID)
70 , mColor ("")
71 , mThickness (util_NaN())
72 , mIsSetThickness (false)
73 {
74 setElementNamespace(sedmlns->getURI());
75 }
76
77
78 /*
79 * Copy constructor for SedLine.
80 */
SedLine(const SedLine & orig)81 SedLine::SedLine(const SedLine& orig)
82 : SedBase( orig )
83 , mType ( orig.mType )
84 , mColor ( orig.mColor )
85 , mThickness ( orig.mThickness )
86 , mIsSetThickness ( orig.mIsSetThickness )
87 {
88 }
89
90
91 /*
92 * Assignment operator for SedLine.
93 */
94 SedLine&
operator =(const SedLine & rhs)95 SedLine::operator=(const SedLine& rhs)
96 {
97 if (&rhs != this)
98 {
99 SedBase::operator=(rhs);
100 mType = rhs.mType;
101 mColor = rhs.mColor;
102 mThickness = rhs.mThickness;
103 mIsSetThickness = rhs.mIsSetThickness;
104 }
105
106 return *this;
107 }
108
109
110 /*
111 * Creates and returns a deep copy of this SedLine object.
112 */
113 SedLine*
clone() const114 SedLine::clone() const
115 {
116 return new SedLine(*this);
117 }
118
119
120 /*
121 * Destructor for SedLine.
122 */
~SedLine()123 SedLine::~SedLine()
124 {
125 }
126
127
128 /*
129 * Returns the value of the "type" attribute of this SedLine.
130 */
131 LineType_t
getType() const132 SedLine::getType() const
133 {
134 return mType;
135 }
136
137
138 /*
139 * Returns the value of the "type" attribute of this SedLine.
140 */
141 std::string
getTypeAsString() const142 SedLine::getTypeAsString() const
143 {
144 std::string code_str = LineType_toString(mType);
145 return code_str;
146 }
147
148
149 /*
150 * Returns the value of the "color" attribute of this SedLine.
151 */
152 const std::string&
getColor() const153 SedLine::getColor() const
154 {
155 return mColor;
156 }
157
158
159 /*
160 * Returns the value of the "thickness" attribute of this SedLine.
161 */
162 double
getThickness() const163 SedLine::getThickness() const
164 {
165 return mThickness;
166 }
167
168
169 /*
170 * Predicate returning @c true if this SedLine's "type" attribute is set.
171 */
172 bool
isSetType() const173 SedLine::isSetType() const
174 {
175 return (mType != SEDML_LINETYPE_INVALID);
176 }
177
178
179 /*
180 * Predicate returning @c true if this SedLine's "color" attribute is set.
181 */
182 bool
isSetColor() const183 SedLine::isSetColor() const
184 {
185 return (mColor.empty() == false);
186 }
187
188
189 /*
190 * Predicate returning @c true if this SedLine's "thickness" attribute is set.
191 */
192 bool
isSetThickness() const193 SedLine::isSetThickness() const
194 {
195 return mIsSetThickness;
196 }
197
198
199 /*
200 * Sets the value of the "type" attribute of this SedLine.
201 */
202 int
setType(const LineType_t type)203 SedLine::setType(const LineType_t type)
204 {
205 if (LineType_isValid(type) == 0)
206 {
207 mType = SEDML_LINETYPE_INVALID;
208 return LIBSEDML_INVALID_ATTRIBUTE_VALUE;
209 }
210 else
211 {
212 mType = type;
213 return LIBSEDML_OPERATION_SUCCESS;
214 }
215 }
216
217
218 /*
219 * Sets the value of the "type" attribute of this SedLine.
220 */
221 int
setType(const std::string & type)222 SedLine::setType(const std::string& type)
223 {
224 mType = LineType_fromString(type.c_str());
225
226 if (mType == SEDML_LINETYPE_INVALID)
227 {
228 return LIBSEDML_INVALID_ATTRIBUTE_VALUE;
229 }
230
231 return LIBSEDML_OPERATION_SUCCESS;
232 }
233
234
235 /*
236 * Sets the value of the "color" attribute of this SedLine.
237 */
238 int
setColor(const std::string & color)239 SedLine::setColor(const std::string& color)
240 {
241 mColor = color;
242 return LIBSEDML_OPERATION_SUCCESS;
243 }
244
245
246 /*
247 * Sets the value of the "thickness" attribute of this SedLine.
248 */
249 int
setThickness(double thickness)250 SedLine::setThickness(double thickness)
251 {
252 mThickness = thickness;
253 mIsSetThickness = true;
254 return LIBSEDML_OPERATION_SUCCESS;
255 }
256
257
258 /*
259 * Unsets the value of the "type" attribute of this SedLine.
260 */
261 int
unsetType()262 SedLine::unsetType()
263 {
264 mType = SEDML_LINETYPE_INVALID;
265 return LIBSEDML_OPERATION_SUCCESS;
266 }
267
268
269 /*
270 * Unsets the value of the "color" attribute of this SedLine.
271 */
272 int
unsetColor()273 SedLine::unsetColor()
274 {
275 mColor.erase();
276
277 if (mColor.empty() == true)
278 {
279 return LIBSEDML_OPERATION_SUCCESS;
280 }
281 else
282 {
283 return LIBSEDML_OPERATION_FAILED;
284 }
285 }
286
287
288 /*
289 * Unsets the value of the "thickness" attribute of this SedLine.
290 */
291 int
unsetThickness()292 SedLine::unsetThickness()
293 {
294 mThickness = util_NaN();
295 mIsSetThickness = false;
296
297 if (isSetThickness() == false)
298 {
299 return LIBSEDML_OPERATION_SUCCESS;
300 }
301 else
302 {
303 return LIBSEDML_OPERATION_FAILED;
304 }
305 }
306
307
308 /*
309 * Returns the XML element name of this SedLine object.
310 */
311 const std::string&
getElementName() const312 SedLine::getElementName() const
313 {
314 static const string name = "line";
315 return name;
316 }
317
318
319 /*
320 * Returns the libSEDML type code for this SedLine object.
321 */
322 int
getTypeCode() const323 SedLine::getTypeCode() const
324 {
325 return SEDML_LINE;
326 }
327
328
329 /*
330 * Predicate returning @c true if all the required attributes for this SedLine
331 * object have been set.
332 */
333 bool
hasRequiredAttributes() const334 SedLine::hasRequiredAttributes() const
335 {
336 bool allPresent = true;
337
338 return allPresent;
339 }
340
341
342
343 /** @cond doxygenLibSEDMLInternal */
344
345 /*
346 * Write any contained elements
347 */
348 void
writeElements(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream & stream) const349 SedLine::writeElements(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& stream)
350 const
351 {
352 SedBase::writeElements(stream);
353 }
354
355 /** @endcond */
356
357
358
359 /** @cond doxygenLibSEDMLInternal */
360
361 /*
362 * Accepts the given SedVisitor
363 */
364 bool
accept(SedVisitor & v) const365 SedLine::accept(SedVisitor& v) const
366 {
367 return false;
368 }
369
370 /** @endcond */
371
372
373
374 /** @cond doxygenLibSEDMLInternal */
375
376 /*
377 * Sets the parent SedDocument
378 */
379 void
setSedDocument(SedDocument * d)380 SedLine::setSedDocument(SedDocument* d)
381 {
382 SedBase::setSedDocument(d);
383 }
384
385 /** @endcond */
386
387
388
389 /** @cond doxygenLibSEDMLInternal */
390
391 /*
392 * Gets the value of the "attributeName" attribute of this SedLine.
393 */
394 int
getAttribute(const std::string & attributeName,bool & value) const395 SedLine::getAttribute(const std::string& attributeName, bool& value) const
396 {
397 int return_value = SedBase::getAttribute(attributeName, value);
398
399 return return_value;
400 }
401
402 /** @endcond */
403
404
405
406 /** @cond doxygenLibSEDMLInternal */
407
408 /*
409 * Gets the value of the "attributeName" attribute of this SedLine.
410 */
411 int
getAttribute(const std::string & attributeName,int & value) const412 SedLine::getAttribute(const std::string& attributeName, int& value) const
413 {
414 int return_value = SedBase::getAttribute(attributeName, value);
415
416 return return_value;
417 }
418
419 /** @endcond */
420
421
422
423 /** @cond doxygenLibSEDMLInternal */
424
425 /*
426 * Gets the value of the "attributeName" attribute of this SedLine.
427 */
428 int
getAttribute(const std::string & attributeName,double & value) const429 SedLine::getAttribute(const std::string& attributeName, double& value) const
430 {
431 int return_value = SedBase::getAttribute(attributeName, value);
432
433 if (return_value == LIBSEDML_OPERATION_SUCCESS)
434 {
435 return return_value;
436 }
437
438 if (attributeName == "thickness")
439 {
440 value = getThickness();
441 return_value = LIBSEDML_OPERATION_SUCCESS;
442 }
443
444 return return_value;
445 }
446
447 /** @endcond */
448
449
450
451 /** @cond doxygenLibSEDMLInternal */
452
453 /*
454 * Gets the value of the "attributeName" attribute of this SedLine.
455 */
456 int
getAttribute(const std::string & attributeName,unsigned int & value) const457 SedLine::getAttribute(const std::string& attributeName,
458 unsigned int& value) const
459 {
460 int return_value = SedBase::getAttribute(attributeName, value);
461
462 return return_value;
463 }
464
465 /** @endcond */
466
467
468
469 /** @cond doxygenLibSEDMLInternal */
470
471 /*
472 * Gets the value of the "attributeName" attribute of this SedLine.
473 */
474 int
getAttribute(const std::string & attributeName,std::string & value) const475 SedLine::getAttribute(const std::string& attributeName,
476 std::string& value) const
477 {
478 int return_value = SedBase::getAttribute(attributeName, value);
479
480 if (return_value == LIBSEDML_OPERATION_SUCCESS)
481 {
482 return return_value;
483 }
484
485 if (attributeName == "type")
486 {
487 value = getTypeAsString();
488 return_value = LIBSEDML_OPERATION_SUCCESS;
489 }
490 else if (attributeName == "color")
491 {
492 value = getColor();
493 return_value = LIBSEDML_OPERATION_SUCCESS;
494 }
495
496 return return_value;
497 }
498
499 /** @endcond */
500
501
502
503 /** @cond doxygenLibSEDMLInternal */
504
505 /*
506 * Predicate returning @c true if this SedLine's attribute "attributeName" is
507 * set.
508 */
509 bool
isSetAttribute(const std::string & attributeName) const510 SedLine::isSetAttribute(const std::string& attributeName) const
511 {
512 bool value = SedBase::isSetAttribute(attributeName);
513
514 if (attributeName == "type")
515 {
516 value = isSetType();
517 }
518 else if (attributeName == "color")
519 {
520 value = isSetColor();
521 }
522 else if (attributeName == "thickness")
523 {
524 value = isSetThickness();
525 }
526
527 return value;
528 }
529
530 /** @endcond */
531
532
533
534 /** @cond doxygenLibSEDMLInternal */
535
536 /*
537 * Sets the value of the "attributeName" attribute of this SedLine.
538 */
539 int
setAttribute(const std::string & attributeName,bool value)540 SedLine::setAttribute(const std::string& attributeName, bool value)
541 {
542 int return_value = SedBase::setAttribute(attributeName, value);
543
544 return return_value;
545 }
546
547 /** @endcond */
548
549
550
551 /** @cond doxygenLibSEDMLInternal */
552
553 /*
554 * Sets the value of the "attributeName" attribute of this SedLine.
555 */
556 int
setAttribute(const std::string & attributeName,int value)557 SedLine::setAttribute(const std::string& attributeName, int value)
558 {
559 int return_value = SedBase::setAttribute(attributeName, value);
560
561 return return_value;
562 }
563
564 /** @endcond */
565
566
567
568 /** @cond doxygenLibSEDMLInternal */
569
570 /*
571 * Sets the value of the "attributeName" attribute of this SedLine.
572 */
573 int
setAttribute(const std::string & attributeName,double value)574 SedLine::setAttribute(const std::string& attributeName, double value)
575 {
576 int return_value = SedBase::setAttribute(attributeName, value);
577
578 if (attributeName == "thickness")
579 {
580 return_value = setThickness(value);
581 }
582
583 return return_value;
584 }
585
586 /** @endcond */
587
588
589
590 /** @cond doxygenLibSEDMLInternal */
591
592 /*
593 * Sets the value of the "attributeName" attribute of this SedLine.
594 */
595 int
setAttribute(const std::string & attributeName,unsigned int value)596 SedLine::setAttribute(const std::string& attributeName, unsigned int value)
597 {
598 int return_value = SedBase::setAttribute(attributeName, value);
599
600 return return_value;
601 }
602
603 /** @endcond */
604
605
606
607 /** @cond doxygenLibSEDMLInternal */
608
609 /*
610 * Sets the value of the "attributeName" attribute of this SedLine.
611 */
612 int
setAttribute(const std::string & attributeName,const std::string & value)613 SedLine::setAttribute(const std::string& attributeName,
614 const std::string& value)
615 {
616 int return_value = SedBase::setAttribute(attributeName, value);
617
618 if (attributeName == "type")
619 {
620 return_value = setType(value);
621 }
622 else if (attributeName == "color")
623 {
624 return_value = setColor(value);
625 }
626
627 return return_value;
628 }
629
630 /** @endcond */
631
632
633
634 /** @cond doxygenLibSEDMLInternal */
635
636 /*
637 * Unsets the value of the "attributeName" attribute of this SedLine.
638 */
639 int
unsetAttribute(const std::string & attributeName)640 SedLine::unsetAttribute(const std::string& attributeName)
641 {
642 int value = SedBase::unsetAttribute(attributeName);
643
644 if (attributeName == "type")
645 {
646 value = unsetType();
647 }
648 else if (attributeName == "color")
649 {
650 value = unsetColor();
651 }
652 else if (attributeName == "thickness")
653 {
654 value = unsetThickness();
655 }
656
657 return value;
658 }
659
660 /** @endcond */
661
662
663
664 /** @cond doxygenLibSEDMLInternal */
665
666 /*
667 * Adds the expected attributes for this element
668 */
669 void
addExpectedAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER ExpectedAttributes & attributes)670 SedLine::addExpectedAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER
671 ExpectedAttributes& attributes)
672 {
673 SedBase::addExpectedAttributes(attributes);
674
675 attributes.add("type");
676
677 attributes.add("color");
678
679 attributes.add("thickness");
680 }
681
682 /** @endcond */
683
684
685
686 /** @cond doxygenLibSEDMLInternal */
687
688 /*
689 * Reads the expected attributes into the member data variables
690 */
691 void
readAttributes(const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLAttributes & attributes,const LIBSBML_CPP_NAMESPACE_QUALIFIER ExpectedAttributes & expectedAttributes)692 SedLine::readAttributes(
693 const LIBSBML_CPP_NAMESPACE_QUALIFIER XMLAttributes&
694 attributes,
695 const LIBSBML_CPP_NAMESPACE_QUALIFIER
696 ExpectedAttributes& expectedAttributes)
697 {
698 unsigned int level = getLevel();
699 unsigned int version = getVersion();
700 unsigned int numErrs;
701 bool assigned = false;
702 SedErrorLog* log = getErrorLog();
703
704 SedBase::readAttributes(attributes, expectedAttributes);
705
706 if (log)
707 {
708 numErrs = log->getNumErrors();
709
710 for (int n = numErrs-1; n >= 0; n--)
711 {
712 if (log->getError(n)->getErrorId() == SedUnknownCoreAttribute)
713 {
714 const std::string details = log->getError(n)->getMessage();
715 log->remove(SedUnknownCoreAttribute);
716 log->logError(SedmlLineAllowedAttributes, level, version, details,
717 getLine(), getColumn());
718 }
719 }
720 }
721
722 //
723 // type enum (use = "optional" )
724 //
725
726 std::string type;
727 assigned = attributes.readInto("type", type);
728
729 if (assigned == true)
730 {
731 if (type.empty() == true)
732 {
733 logEmptyString(type, level, version, "<SedLine>");
734 }
735 else
736 {
737 mType = LineType_fromString(type.c_str());
738
739 if (log && LineType_isValid(mType) == 0)
740 {
741 std::string msg = "The type on the <SedLine> ";
742
743 if (isSetId())
744 {
745 msg += "with id '" + getId() + "'";
746 }
747
748 msg += "is '" + type + "', which is not a valid option.";
749
750 log->logError(SedmlLineTypeMustBeLineTypeEnum, level, version, msg,
751 getLine(), getColumn());
752 }
753 }
754 }
755
756 //
757 // color string (use = "optional" )
758 //
759
760 assigned = attributes.readInto("color", mColor);
761
762 if (assigned == true)
763 {
764 if (mColor.empty() == true)
765 {
766 logEmptyString(mColor, level, version, "<SedLine>");
767 }
768 }
769
770 //
771 // thickness double (use = "optional" )
772 //
773
774 numErrs = log ? log->getNumErrors() : 0;
775 mIsSetThickness = attributes.readInto("thickness", mThickness);
776
777 if ( mIsSetThickness == false && log)
778 {
779 if (log && log->getNumErrors() == numErrs + 1 &&
780 log->contains(XMLAttributeTypeMismatch))
781 {
782 log->remove(XMLAttributeTypeMismatch);
783 std::string message = "Sedml attribute 'thickness' from the <SedLine> "
784 "element must be an integer.";
785 log->logError(SedmlLineThicknessMustBeDouble, level, version, message,
786 getLine(), getColumn());
787 }
788 }
789 }
790
791 /** @endcond */
792
793
794
795 /** @cond doxygenLibSEDMLInternal */
796
797 /*
798 * Writes the attributes to the stream
799 */
800 void
writeAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream & stream) const801 SedLine::writeAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream&
802 stream) const
803 {
804 SedBase::writeAttributes(stream);
805
806 if (isSetType() == true)
807 {
808 stream.writeAttribute("type", getPrefix(), LineType_toString(mType));
809 }
810
811 if (isSetColor() == true)
812 {
813 stream.writeAttribute("color", getPrefix(), mColor);
814 }
815
816 if (isSetThickness() == true)
817 {
818 stream.writeAttribute("thickness", getPrefix(), mThickness);
819 }
820 }
821
822 /** @endcond */
823
824
825
826
827 #endif /* __cplusplus */
828
829
830 /*
831 * Creates a new SedLine_t using the given SED-ML Level and @ p version values.
832 */
833 LIBSEDML_EXTERN
834 SedLine_t *
SedLine_create(unsigned int level,unsigned int version)835 SedLine_create(unsigned int level, unsigned int version)
836 {
837 return new SedLine(level, version);
838 }
839
840
841 /*
842 * Creates and returns a deep copy of this SedLine_t object.
843 */
844 LIBSEDML_EXTERN
845 SedLine_t*
SedLine_clone(const SedLine_t * sl)846 SedLine_clone(const SedLine_t* sl)
847 {
848 if (sl != NULL)
849 {
850 return static_cast<SedLine_t*>(sl->clone());
851 }
852 else
853 {
854 return NULL;
855 }
856 }
857
858
859 /*
860 * Frees this SedLine_t object.
861 */
862 LIBSEDML_EXTERN
863 void
SedLine_free(SedLine_t * sl)864 SedLine_free(SedLine_t* sl)
865 {
866 if (sl != NULL)
867 {
868 delete sl;
869 }
870 }
871
872
873 /*
874 * Returns the value of the "type" attribute of this SedLine_t.
875 */
876 LIBSEDML_EXTERN
877 LineType_t
SedLine_getType(const SedLine_t * sl)878 SedLine_getType(const SedLine_t * sl)
879 {
880 if (sl == NULL)
881 {
882 return SEDML_LINETYPE_INVALID;
883 }
884
885 return sl->getType();
886 }
887
888
889 /*
890 * Returns the value of the "type" attribute of this SedLine_t.
891 */
892 LIBSEDML_EXTERN
893 char *
SedLine_getTypeAsString(const SedLine_t * sl)894 SedLine_getTypeAsString(const SedLine_t * sl)
895 {
896 return (char*)(LineType_toString(sl->getType()));
897 }
898
899
900 /*
901 * Returns the value of the "color" attribute of this SedLine_t.
902 */
903 LIBSEDML_EXTERN
904 char *
SedLine_getColor(const SedLine_t * sl)905 SedLine_getColor(const SedLine_t * sl)
906 {
907 if (sl == NULL)
908 {
909 return NULL;
910 }
911
912 return sl->getColor().empty() ? NULL : safe_strdup(sl->getColor().c_str());
913 }
914
915
916 /*
917 * Returns the value of the "thickness" attribute of this SedLine_t.
918 */
919 LIBSEDML_EXTERN
920 double
SedLine_getThickness(const SedLine_t * sl)921 SedLine_getThickness(const SedLine_t * sl)
922 {
923 return (sl != NULL) ? sl->getThickness() : util_NaN();
924 }
925
926
927 /*
928 * Predicate returning @c 1 (true) if this SedLine_t's "type" attribute is
929 * set.
930 */
931 LIBSEDML_EXTERN
932 int
SedLine_isSetType(const SedLine_t * sl)933 SedLine_isSetType(const SedLine_t * sl)
934 {
935 return (sl != NULL) ? static_cast<int>(sl->isSetType()) : 0;
936 }
937
938
939 /*
940 * Predicate returning @c 1 (true) if this SedLine_t's "color" attribute is
941 * set.
942 */
943 LIBSEDML_EXTERN
944 int
SedLine_isSetColor(const SedLine_t * sl)945 SedLine_isSetColor(const SedLine_t * sl)
946 {
947 return (sl != NULL) ? static_cast<int>(sl->isSetColor()) : 0;
948 }
949
950
951 /*
952 * Predicate returning @c 1 (true) if this SedLine_t's "thickness" attribute is
953 * set.
954 */
955 LIBSEDML_EXTERN
956 int
SedLine_isSetThickness(const SedLine_t * sl)957 SedLine_isSetThickness(const SedLine_t * sl)
958 {
959 return (sl != NULL) ? static_cast<int>(sl->isSetThickness()) : 0;
960 }
961
962
963 /*
964 * Sets the value of the "type" attribute of this SedLine_t.
965 */
966 LIBSEDML_EXTERN
967 int
SedLine_setType(SedLine_t * sl,LineType_t type)968 SedLine_setType(SedLine_t * sl, LineType_t type)
969 {
970 return (sl != NULL) ? sl->setType(type) : LIBSEDML_INVALID_OBJECT;
971 }
972
973
974 /*
975 * Sets the value of the "type" attribute of this SedLine_t.
976 */
977 LIBSEDML_EXTERN
978 int
SedLine_setTypeAsString(SedLine_t * sl,const char * type)979 SedLine_setTypeAsString(SedLine_t * sl, const char * type)
980 {
981 return (sl != NULL) ? sl->setType(type): LIBSEDML_INVALID_OBJECT;
982 }
983
984
985 /*
986 * Sets the value of the "color" attribute of this SedLine_t.
987 */
988 LIBSEDML_EXTERN
989 int
SedLine_setColor(SedLine_t * sl,const char * color)990 SedLine_setColor(SedLine_t * sl, const char * color)
991 {
992 return (sl != NULL) ? sl->setColor(color) : LIBSEDML_INVALID_OBJECT;
993 }
994
995
996 /*
997 * Sets the value of the "thickness" attribute of this SedLine_t.
998 */
999 LIBSEDML_EXTERN
1000 int
SedLine_setThickness(SedLine_t * sl,double thickness)1001 SedLine_setThickness(SedLine_t * sl, double thickness)
1002 {
1003 return (sl != NULL) ? sl->setThickness(thickness) : LIBSEDML_INVALID_OBJECT;
1004 }
1005
1006
1007 /*
1008 * Unsets the value of the "type" attribute of this SedLine_t.
1009 */
1010 LIBSEDML_EXTERN
1011 int
SedLine_unsetType(SedLine_t * sl)1012 SedLine_unsetType(SedLine_t * sl)
1013 {
1014 return (sl != NULL) ? sl->unsetType () : LIBSEDML_INVALID_OBJECT;
1015 }
1016
1017
1018 /*
1019 * Unsets the value of the "color" attribute of this SedLine_t.
1020 */
1021 LIBSEDML_EXTERN
1022 int
SedLine_unsetColor(SedLine_t * sl)1023 SedLine_unsetColor(SedLine_t * sl)
1024 {
1025 return (sl != NULL) ? sl->unsetColor() : LIBSEDML_INVALID_OBJECT;
1026 }
1027
1028
1029 /*
1030 * Unsets the value of the "thickness" attribute of this SedLine_t.
1031 */
1032 LIBSEDML_EXTERN
1033 int
SedLine_unsetThickness(SedLine_t * sl)1034 SedLine_unsetThickness(SedLine_t * sl)
1035 {
1036 return (sl != NULL) ? sl->unsetThickness() : LIBSEDML_INVALID_OBJECT;
1037 }
1038
1039
1040 /*
1041 * Predicate returning @c 1 (true) if all the required attributes for this
1042 * SedLine_t object have been set.
1043 */
1044 LIBSEDML_EXTERN
1045 int
SedLine_hasRequiredAttributes(const SedLine_t * sl)1046 SedLine_hasRequiredAttributes(const SedLine_t * sl)
1047 {
1048 return (sl != NULL) ? static_cast<int>(sl->hasRequiredAttributes()) : 0;
1049 }
1050
1051
1052
1053
1054 LIBSEDML_CPP_NAMESPACE_END
1055
1056
1057