1 /** 2 * @file SedAxis.h 3 * @brief Definition of the SedAxis 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 * @class SedAxis 35 * @sbmlbrief{sedml} TODO:Definition of the SedAxis class. 36 */ 37 38 /** 39 * <!-- ~ ~ ~ ~ ~ Start of common documentation strings ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 40 * The following text is used as common documentation blocks copied multiple 41 * times elsewhere in this file. The use of @class is a hack needed because 42 * Doxygen's @copydetails command has limited functionality. Symbols 43 * beginning with "doc_" are marked as ignored in our Doxygen configuration. 44 * ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --> 45 * 46 * 47 * @class doc_sedaxis_type 48 * 49 * @par 50 * The attribute "type" on a SedAxis object is used to TODO:add explanation 51 * 52 * In the SBML 53 * Level 3 Version 1 Sedml specification, the following are the 54 * allowable values for "type": 55 * <ul> 56 * <li> @c "linear", TODO:add description 57 * 58 * <li> @c "log10", TODO:add description 59 * 60 * </ul> 61 */ 62 63 64 #ifndef SedAxis_H__ 65 #define SedAxis_H__ 66 67 68 #include <sedml/common/extern.h> 69 #include <sedml/common/sedmlfwd.h> 70 #include <sedml/common/SedmlEnumerations.h> 71 72 73 #ifdef __cplusplus 74 75 76 #include <string> 77 78 79 #include <sedml/SedBase.h> 80 #include <sbml/common/libsbml-namespace.h> 81 82 83 LIBSEDML_CPP_NAMESPACE_BEGIN 84 85 86 class LIBSEDML_EXTERN SedAxis : public SedBase 87 { 88 protected: 89 90 /** @cond doxygenLibSEDMLInternal */ 91 92 AxisType_t mType; 93 double mMin; 94 bool mIsSetMin; 95 double mMax; 96 bool mIsSetMax; 97 bool mGrid; 98 bool mIsSetGrid; 99 bool mReverse; 100 bool mIsSetReverse; 101 std::string mStyle; 102 std::string mElementName; 103 104 /** @endcond */ 105 106 public: 107 108 /** 109 * Creates a new SedAxis using the given SED-ML Level and @ p version values. 110 * 111 * @param level an unsigned int, the SED-ML Level to assign to this SedAxis. 112 * 113 * @param version an unsigned int, the SED-ML Version to assign to this 114 * SedAxis. 115 * 116 * @copydetails doc_note_setting_lv_pkg 117 */ 118 SedAxis(unsigned int level = SEDML_DEFAULT_LEVEL, 119 unsigned int version = SEDML_DEFAULT_VERSION); 120 121 122 /** 123 * Creates a new SedAxis using the given SedNamespaces object @p sedmlns. 124 * 125 * @param sedmlns the SedNamespaces object. 126 * 127 * @copydetails doc_note_setting_lv_pkg 128 */ 129 SedAxis(SedNamespaces *sedmlns); 130 131 132 /** 133 * Copy constructor for SedAxis. 134 * 135 * @param orig the SedAxis instance to copy. 136 */ 137 SedAxis(const SedAxis& orig); 138 139 140 /** 141 * Assignment operator for SedAxis. 142 * 143 * @param rhs the SedAxis object whose values are to be used as the basis of 144 * the assignment. 145 */ 146 SedAxis& operator=(const SedAxis& rhs); 147 148 149 /** 150 * Creates and returns a deep copy of this SedAxis object. 151 * 152 * @return a (deep) copy of this SedAxis object. 153 */ 154 virtual SedAxis* clone() const; 155 156 157 /** 158 * Destructor for SedAxis. 159 */ 160 virtual ~SedAxis(); 161 162 163 /** 164 * Returns the value of the "type" attribute of this SedAxis. 165 * 166 * @return the value of the "type" attribute of this SedAxis as a AxisType_t. 167 * 168 * @copydetails doc_sedaxis_type 169 * @if clike The value is drawn from the enumeration @ref AxisType_t @endif 170 * The possible values returned by this method are: 171 * @li @sbmlconstant{SEDML_AXISTYPE_LINEAR, AxisType_t} 172 * @li @sbmlconstant{SEDML_AXISTYPE_LOG10, AxisType_t} 173 * @li @sbmlconstant{SEDML_AXISTYPE_INVALID, AxisType_t} 174 */ 175 AxisType_t getType() const; 176 177 178 /** 179 * Returns the value of the "type" attribute of this SedAxis. 180 * 181 * @return the value of the "type" attribute of this SedAxis as a string. 182 * 183 * @copydetails doc_sedaxis_type 184 * The possible values returned by this method are: 185 * @li @c "linear" 186 * @li @c "log10" 187 * @li @c "invalid AxisType value" 188 */ 189 std::string getTypeAsString() const; 190 191 192 /** 193 * Returns the value of the "min" attribute of this SedAxis. 194 * 195 * @return the value of the "min" attribute of this SedAxis as a double. 196 */ 197 double getMin() const; 198 199 200 /** 201 * Returns the value of the "max" attribute of this SedAxis. 202 * 203 * @return the value of the "max" attribute of this SedAxis as a double. 204 */ 205 double getMax() const; 206 207 208 /** 209 * Returns the value of the "grid" attribute of this SedAxis. 210 * 211 * @return the value of the "grid" attribute of this SedAxis as a boolean. 212 */ 213 bool getGrid() const; 214 215 216 /** 217 * Returns the value of the "reverse" attribute of this SedAxis. 218 * 219 * @return the value of the "reverse" attribute of this SedAxis as a boolean. 220 */ 221 bool getReverse() const; 222 223 224 /** 225 * Returns the value of the "style" attribute of this SedAxis. 226 * 227 * @return the value of the "style" attribute of this SedAxis as a string. 228 */ 229 const std::string& getStyle() const; 230 231 232 /** 233 * Predicate returning @c true if this SedAxis's "type" attribute is set. 234 * 235 * @return @c true if this SedAxis's "type" attribute has been set, otherwise 236 * @c false is returned. 237 * 238 * @copydetails doc_sedaxis_type 239 */ 240 bool isSetType() const; 241 242 243 /** 244 * Predicate returning @c true if this SedAxis's "min" attribute is set. 245 * 246 * @return @c true if this SedAxis's "min" attribute has been set, otherwise 247 * @c false is returned. 248 */ 249 bool isSetMin() const; 250 251 252 /** 253 * Predicate returning @c true if this SedAxis's "max" attribute is set. 254 * 255 * @return @c true if this SedAxis's "max" attribute has been set, otherwise 256 * @c false is returned. 257 */ 258 bool isSetMax() const; 259 260 261 /** 262 * Predicate returning @c true if this SedAxis's "grid" attribute is set. 263 * 264 * @return @c true if this SedAxis's "grid" attribute has been set, otherwise 265 * @c false is returned. 266 */ 267 bool isSetGrid() const; 268 269 270 /** 271 * Predicate returning @c true if this SedAxis's "reverse" attribute is set. 272 * 273 * @return @c true if this SedAxis's "reverse" attribute has been set, otherwise 274 * @c false is returned. 275 */ 276 bool isSetReverse() const; 277 278 279 /** 280 * Predicate returning @c true if this SedAxis's "style" attribute is set. 281 * 282 * @return @c true if this SedAxis's "style" attribute has been set, 283 * otherwise @c false is returned. 284 */ 285 bool isSetStyle() const; 286 287 288 /** 289 * Sets the value of the "type" attribute of this SedAxis. 290 * 291 * @param type @if clike AxisType_t@else int@endif value of the "type" 292 * attribute to be set. 293 * 294 * @copydetails doc_returns_success_code 295 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 296 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 297 * OperationReturnValues_t} 298 * 299 * @copydetails doc_sedaxis_type 300 */ 301 int setType(const AxisType_t type); 302 303 304 /** 305 * Sets the value of the "type" attribute of this SedAxis. 306 * 307 * @param type std::string& of the "type" attribute to be set. 308 * 309 * @copydetails doc_returns_success_code 310 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 311 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 312 * OperationReturnValues_t} 313 * 314 * @copydetails doc_sedaxis_type 315 */ 316 int setType(const std::string& type); 317 318 319 /** 320 * Sets the value of the "min" attribute of this SedAxis. 321 * 322 * @param min double value of the "min" attribute to be set. 323 * 324 * @copydetails doc_returns_success_code 325 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 326 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 327 * OperationReturnValues_t} 328 */ 329 int setMin(double min); 330 331 332 /** 333 * Sets the value of the "max" attribute of this SedAxis. 334 * 335 * @param max double value of the "max" attribute to be set. 336 * 337 * @copydetails doc_returns_success_code 338 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 339 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 340 * OperationReturnValues_t} 341 */ 342 int setMax(double max); 343 344 345 /** 346 * Sets the value of the "grid" attribute of this SedAxis. 347 * 348 * @param grid bool value of the "grid" attribute to be set. 349 * 350 * @copydetails doc_returns_success_code 351 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 352 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 353 * OperationReturnValues_t} 354 */ 355 int setGrid(bool grid); 356 357 358 /** 359 * Sets the value of the "reverse" attribute of this SedAxis. 360 * 361 * @param reverse bool value of the "reverse" attribute to be set. 362 * 363 * @copydetails doc_returns_success_code 364 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 365 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 366 * OperationReturnValues_t} 367 */ 368 int setReverse(bool reverse); 369 370 371 /** 372 * Sets the value of the "style" attribute of this SedAxis. 373 * 374 * @param style std::string& value of the "style" attribute to be set. 375 * 376 * @copydetails doc_returns_success_code 377 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 378 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 379 * OperationReturnValues_t} 380 */ 381 int setStyle(const std::string& style); 382 383 384 /** 385 * Unsets the value of the "type" attribute of this SedAxis. 386 * 387 * @copydetails doc_returns_one_success_code 388 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 389 * 390 * @copydetails doc_sedaxis_type 391 */ 392 int unsetType(); 393 394 395 /** 396 * Unsets the value of the "min" attribute of this SedAxis. 397 * 398 * @copydetails doc_returns_success_code 399 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 400 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 401 */ 402 int unsetMin(); 403 404 405 /** 406 * Unsets the value of the "max" attribute of this SedAxis. 407 * 408 * @copydetails doc_returns_success_code 409 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 410 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 411 */ 412 int unsetMax(); 413 414 415 /** 416 * Unsets the value of the "grid" attribute of this SedAxis. 417 * 418 * @copydetails doc_returns_success_code 419 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 420 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 421 */ 422 int unsetGrid(); 423 424 425 /** 426 * Unsets the value of the "reverse" attribute of this SedAxis. 427 * 428 * @copydetails doc_returns_success_code 429 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 430 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 431 */ 432 int unsetReverse(); 433 434 435 /** 436 * Unsets the value of the "style" attribute of this SedAxis. 437 * 438 * @copydetails doc_returns_success_code 439 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 440 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 441 */ 442 int unsetStyle(); 443 444 445 /** 446 * @copydoc doc_renamesidref_common 447 */ 448 virtual void renameSIdRefs(const std::string& oldid, 449 const std::string& newid); 450 451 452 /** 453 * Returns the XML element name of this SedAxis object. 454 * 455 * For SedAxis, the XML element name is always @c "axis". 456 * 457 * @return the name of this element, i.e. @c "axis". 458 */ 459 virtual const std::string& getElementName() const; 460 461 462 463 /** @cond doxygenLibSEDMLInternal */ 464 465 /** 466 * Sets the XML name of this SedAxis object. 467 */ 468 virtual void setElementName(const std::string& name); 469 470 /** @endcond */ 471 472 473 /** 474 * Returns the libSEDML type code for this SedAxis object. 475 * 476 * @copydetails doc_what_are_typecodes 477 * 478 * @return the SED-ML type code for this object: 479 * @sedmlconstant{SEDML_AXIS, SedTypeCode_t}. 480 * 481 * @copydetails doc_warning_typecodes_not_unique 482 * 483 * @see getElementName() 484 */ 485 virtual int getTypeCode() const; 486 487 488 /** 489 * Predicate returning @c true if all the required attributes for this 490 * SedAxis object have been set. 491 * 492 * @return @c true to indicate that all the required attributes of this 493 * SedAxis have been set, otherwise @c false is returned. 494 * 495 * 496 * @note The required attributes for the SedAxis object are: 497 * @li "type" 498 */ 499 virtual bool hasRequiredAttributes() const; 500 501 502 503 /** @cond doxygenLibSEDMLInternal */ 504 505 /** 506 * Write any contained elements 507 */ 508 virtual void writeElements(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& 509 stream) const; 510 511 /** @endcond */ 512 513 514 515 /** @cond doxygenLibSEDMLInternal */ 516 517 /** 518 * Accepts the given SedVisitor 519 */ 520 virtual bool accept(SedVisitor& v) const; 521 522 /** @endcond */ 523 524 525 526 /** @cond doxygenLibSEDMLInternal */ 527 528 /** 529 * Sets the parent SedDocument 530 */ 531 virtual void setSedDocument(SedDocument* d); 532 533 /** @endcond */ 534 535 536 537 538 #ifndef SWIG 539 540 541 542 /** @cond doxygenLibSEDMLInternal */ 543 544 /** 545 * Gets the value of the "attributeName" attribute of this SedAxis. 546 * 547 * @param attributeName, the name of the attribute to retrieve. 548 * 549 * @param value, the address of the value to record. 550 * 551 * @copydetails doc_returns_success_code 552 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 553 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 554 */ 555 virtual int getAttribute(const std::string& attributeName, bool& value) 556 const; 557 558 /** @endcond */ 559 560 561 562 /** @cond doxygenLibSEDMLInternal */ 563 564 /** 565 * Gets the value of the "attributeName" attribute of this SedAxis. 566 * 567 * @param attributeName, the name of the attribute to retrieve. 568 * 569 * @param value, the address of the value to record. 570 * 571 * @copydetails doc_returns_success_code 572 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 573 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 574 */ 575 virtual int getAttribute(const std::string& attributeName, int& value) const; 576 577 /** @endcond */ 578 579 580 581 /** @cond doxygenLibSEDMLInternal */ 582 583 /** 584 * Gets the value of the "attributeName" attribute of this SedAxis. 585 * 586 * @param attributeName, the name of the attribute to retrieve. 587 * 588 * @param value, the address of the value to record. 589 * 590 * @copydetails doc_returns_success_code 591 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 592 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 593 */ 594 virtual int getAttribute(const std::string& attributeName, 595 double& value) const; 596 597 /** @endcond */ 598 599 600 601 /** @cond doxygenLibSEDMLInternal */ 602 603 /** 604 * Gets the value of the "attributeName" attribute of this SedAxis. 605 * 606 * @param attributeName, the name of the attribute to retrieve. 607 * 608 * @param value, the address of the value to record. 609 * 610 * @copydetails doc_returns_success_code 611 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 612 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 613 */ 614 virtual int getAttribute(const std::string& attributeName, 615 unsigned int& value) const; 616 617 /** @endcond */ 618 619 620 621 /** @cond doxygenLibSEDMLInternal */ 622 623 /** 624 * Gets the value of the "attributeName" attribute of this SedAxis. 625 * 626 * @param attributeName, the name of the attribute to retrieve. 627 * 628 * @param value, the address of the value to record. 629 * 630 * @copydetails doc_returns_success_code 631 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 632 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 633 */ 634 virtual int getAttribute(const std::string& attributeName, 635 std::string& value) const; 636 637 /** @endcond */ 638 639 640 641 /** @cond doxygenLibSEDMLInternal */ 642 643 /** 644 * Predicate returning @c true if this SedAxis's attribute "attributeName" is 645 * set. 646 * 647 * @param attributeName, the name of the attribute to query. 648 * 649 * @return @c true if this SedAxis's attribute "attributeName" has been set, 650 * otherwise @c false is returned. 651 */ 652 virtual bool isSetAttribute(const std::string& attributeName) const; 653 654 /** @endcond */ 655 656 657 658 /** @cond doxygenLibSEDMLInternal */ 659 660 /** 661 * Sets the value of the "attributeName" attribute of this SedAxis. 662 * 663 * @param attributeName, the name of the attribute to set. 664 * 665 * @param value, the value of the attribute to set. 666 * 667 * @copydetails doc_returns_success_code 668 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 669 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 670 */ 671 virtual int setAttribute(const std::string& attributeName, bool value); 672 673 /** @endcond */ 674 675 676 677 /** @cond doxygenLibSEDMLInternal */ 678 679 /** 680 * Sets the value of the "attributeName" attribute of this SedAxis. 681 * 682 * @param attributeName, the name of the attribute to set. 683 * 684 * @param value, the value of the attribute to set. 685 * 686 * @copydetails doc_returns_success_code 687 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 688 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 689 */ 690 virtual int setAttribute(const std::string& attributeName, int value); 691 692 /** @endcond */ 693 694 695 696 /** @cond doxygenLibSEDMLInternal */ 697 698 /** 699 * Sets the value of the "attributeName" attribute of this SedAxis. 700 * 701 * @param attributeName, the name of the attribute to set. 702 * 703 * @param value, the value of the attribute to set. 704 * 705 * @copydetails doc_returns_success_code 706 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 707 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 708 */ 709 virtual int setAttribute(const std::string& attributeName, double value); 710 711 /** @endcond */ 712 713 714 715 /** @cond doxygenLibSEDMLInternal */ 716 717 /** 718 * Sets the value of the "attributeName" attribute of this SedAxis. 719 * 720 * @param attributeName, the name of the attribute to set. 721 * 722 * @param value, the value of the attribute to set. 723 * 724 * @copydetails doc_returns_success_code 725 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 726 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 727 */ 728 virtual int setAttribute(const std::string& attributeName, 729 unsigned int value); 730 731 /** @endcond */ 732 733 734 735 /** @cond doxygenLibSEDMLInternal */ 736 737 /** 738 * Sets the value of the "attributeName" attribute of this SedAxis. 739 * 740 * @param attributeName, the name of the attribute to set. 741 * 742 * @param value, the value of the attribute to set. 743 * 744 * @copydetails doc_returns_success_code 745 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 746 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 747 */ 748 virtual int setAttribute(const std::string& attributeName, 749 const std::string& value); 750 751 /** @endcond */ 752 753 754 755 /** @cond doxygenLibSEDMLInternal */ 756 757 /** 758 * Unsets the value of the "attributeName" attribute of this SedAxis. 759 * 760 * @param attributeName, the name of the attribute to query. 761 * 762 * @copydetails doc_returns_success_code 763 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 764 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 765 */ 766 virtual int unsetAttribute(const std::string& attributeName); 767 768 /** @endcond */ 769 770 771 772 773 #endif /* !SWIG */ 774 775 776 protected: 777 778 779 /** @cond doxygenLibSEDMLInternal */ 780 781 /** 782 * Adds the expected attributes for this element 783 */ 784 virtual void addExpectedAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER 785 ExpectedAttributes& attributes); 786 787 /** @endcond */ 788 789 790 791 /** @cond doxygenLibSEDMLInternal */ 792 793 /** 794 * Reads the expected attributes into the member data variables 795 */ 796 virtual void readAttributes( 797 const LIBSBML_CPP_NAMESPACE_QUALIFIER 798 XMLAttributes& attributes, 799 const LIBSBML_CPP_NAMESPACE_QUALIFIER 800 ExpectedAttributes& expectedAttributes); 801 802 /** @endcond */ 803 804 805 806 /** @cond doxygenLibSEDMLInternal */ 807 808 /** 809 * Writes the attributes to the stream 810 */ 811 virtual void writeAttributes(LIBSBML_CPP_NAMESPACE_QUALIFIER XMLOutputStream& 812 stream) const; 813 814 /** @endcond */ 815 816 817 }; 818 819 820 821 LIBSEDML_CPP_NAMESPACE_END 822 823 824 825 826 #endif /* __cplusplus */ 827 828 829 830 831 #ifndef SWIG 832 833 834 835 836 LIBSEDML_CPP_NAMESPACE_BEGIN 837 838 839 840 841 BEGIN_C_DECLS 842 843 844 /** 845 * Creates a new SedAxis_t using the given SED-ML Level and @ p version values. 846 * 847 * @param level an unsigned int, the SED-ML Level to assign to this SedAxis_t. 848 * 849 * @param version an unsigned int, the SED-ML Version to assign to this 850 * SedAxis_t. 851 * 852 * @copydetails doc_note_setting_lv_pkg 853 * 854 * @copydetails doc_returned_owned_pointer 855 * 856 * @memberof SedAxis_t 857 */ 858 LIBSEDML_EXTERN 859 SedAxis_t * 860 SedAxis_create(unsigned int level, unsigned int version); 861 862 863 /** 864 * Creates and returns a deep copy of this SedAxis_t object. 865 * 866 * @param sa the SedAxis_t structure. 867 * 868 * @return a (deep) copy of this SedAxis_t object. 869 * 870 * @copydetails doc_returned_owned_pointer 871 * 872 * @memberof SedAxis_t 873 */ 874 LIBSEDML_EXTERN 875 SedAxis_t* 876 SedAxis_clone(const SedAxis_t* sa); 877 878 879 /** 880 * Frees this SedAxis_t object. 881 * 882 * @param sa the SedAxis_t structure. 883 * 884 * @memberof SedAxis_t 885 */ 886 LIBSEDML_EXTERN 887 void 888 SedAxis_free(SedAxis_t* sa); 889 890 891 /** 892 * Returns the value of the "type" attribute of this SedAxis_t. 893 * 894 * @param sa the SedAxis_t structure whose type is sought. 895 * 896 * @return the value of the "type" attribute of this SedAxis_t as a AxisType_t. 897 * 898 * @copydetails doc_sedaxis_type 899 * @if clike The value is drawn from the enumeration @ref AxisType_t @endif 900 * The possible values returned by this method are: 901 * @li @sbmlconstant{SEDML_AXISTYPE_LINEAR, AxisType_t} 902 * @li @sbmlconstant{SEDML_AXISTYPE_LOG10, AxisType_t} 903 * @li @sbmlconstant{SEDML_AXISTYPE_INVALID, AxisType_t} 904 * 905 * @memberof SedAxis_t 906 */ 907 LIBSEDML_EXTERN 908 AxisType_t 909 SedAxis_getType(const SedAxis_t * sa); 910 911 912 /** 913 * Returns the value of the "type" attribute of this SedAxis_t. 914 * 915 * @param sa the SedAxis_t structure whose type is sought. 916 * 917 * @return the value of the "type" attribute of this SedAxis_t as a const char 918 * *. 919 * 920 * @copydetails doc_returned_unowned_char 921 * 922 * @copydetails doc_sedaxis_type 923 * The possible values returned by this method are: 924 * @li @c "linear" 925 * @li @c "log10" 926 * @li @c "invalid AxisType value" 927 * 928 * @memberof SedAxis_t 929 */ 930 LIBSEDML_EXTERN 931 char * 932 SedAxis_getTypeAsString(const SedAxis_t * sa); 933 934 935 /** 936 * Returns the value of the "min" attribute of this SedAxis_t. 937 * 938 * @param sa the SedAxis_t structure whose min is sought. 939 * 940 * @return the value of the "min" attribute of this SedAxis_t as a double. 941 * 942 * @memberof SedAxis_t 943 */ 944 LIBSEDML_EXTERN 945 double 946 SedAxis_getMin(const SedAxis_t * sa); 947 948 949 /** 950 * Returns the value of the "max" attribute of this SedAxis_t. 951 * 952 * @param sa the SedAxis_t structure whose max is sought. 953 * 954 * @return the value of the "max" attribute of this SedAxis_t as a double. 955 * 956 * @memberof SedAxis_t 957 */ 958 LIBSEDML_EXTERN 959 double 960 SedAxis_getMax(const SedAxis_t * sa); 961 962 963 /** 964 * Returns the value of the "grid" attribute of this SedAxis_t. 965 * 966 * @param sa the SedAxis_t structure whose grid is sought. 967 * 968 * @return the value of the "grid" attribute of this SedAxis_t as a boolean. 969 * 970 * @memberof SedAxis_t 971 */ 972 LIBSEDML_EXTERN 973 int 974 SedAxis_getGrid(const SedAxis_t * sa); 975 976 977 /** 978 * Returns the value of the "reverse" attribute of this SedAxis_t. 979 * 980 * @param sa the SedAxis_t structure whose reverse is sought. 981 * 982 * @return the value of the "reverse" attribute of this SedAxis_t as a boolean. 983 * 984 * @memberof SedAxis_t 985 */ 986 LIBSEDML_EXTERN 987 int 988 SedAxis_getReverse(const SedAxis_t* sa); 989 990 991 /** 992 * Returns the value of the "style" attribute of this SedAxis_t. 993 * 994 * @param sa the SedAxis_t structure whose style is sought. 995 * 996 * @return the value of the "style" attribute of this SedAxis_t as a pointer to 997 * a string. 998 * 999 * @copydetails doc_returned_owned_char 1000 * 1001 * @memberof SedAxis_t 1002 */ 1003 LIBSEDML_EXTERN 1004 char * 1005 SedAxis_getStyle(const SedAxis_t * sa); 1006 1007 1008 /** 1009 * Predicate returning @c 1 (true) if this SedAxis_t's "type" attribute is set. 1010 * 1011 * @param sa the SedAxis_t structure. 1012 * 1013 * @return @c 1 (true) if this SedAxis_t's "type" attribute has been set, 1014 * otherwise @c 0 (false) is returned. 1015 * 1016 * @copydetails doc_sedaxis_type 1017 * 1018 * @memberof SedAxis_t 1019 */ 1020 LIBSEDML_EXTERN 1021 int 1022 SedAxis_isSetType(const SedAxis_t * sa); 1023 1024 1025 /** 1026 * Predicate returning @c 1 (true) if this SedAxis_t's "min" attribute is set. 1027 * 1028 * @param sa the SedAxis_t structure. 1029 * 1030 * @return @c 1 (true) if this SedAxis_t's "min" attribute has been set, 1031 * otherwise @c 0 (false) is returned. 1032 * 1033 * @memberof SedAxis_t 1034 */ 1035 LIBSEDML_EXTERN 1036 int 1037 SedAxis_isSetMin(const SedAxis_t * sa); 1038 1039 1040 /** 1041 * Predicate returning @c 1 (true) if this SedAxis_t's "max" attribute is set. 1042 * 1043 * @param sa the SedAxis_t structure. 1044 * 1045 * @return @c 1 (true) if this SedAxis_t's "max" attribute has been set, 1046 * otherwise @c 0 (false) is returned. 1047 * 1048 * @memberof SedAxis_t 1049 */ 1050 LIBSEDML_EXTERN 1051 int 1052 SedAxis_isSetMax(const SedAxis_t * sa); 1053 1054 1055 /** 1056 * Predicate returning @c 1 (true) if this SedAxis_t's "grid" attribute is set. 1057 * 1058 * @param sa the SedAxis_t structure. 1059 * 1060 * @return @c 1 (true) if this SedAxis_t's "grid" attribute has been set, 1061 * otherwise @c 0 (false) is returned. 1062 * 1063 * @memberof SedAxis_t 1064 */ 1065 LIBSEDML_EXTERN 1066 int 1067 SedAxis_isSetGrid(const SedAxis_t * sa); 1068 1069 1070 /** 1071 * Predicate returning @c 1 (true) if this SedAxis_t's "reverse" attribute is set. 1072 * 1073 * @param sa the SedAxis_t structure. 1074 * 1075 * @return @c 1 (true) if this SedAxis_t's "reverse" attribute has been set, 1076 * otherwise @c 0 (false) is returned. 1077 * 1078 * @memberof SedAxis_t 1079 */ 1080 LIBSEDML_EXTERN 1081 int 1082 SedAxis_isSetReverse(const SedAxis_t* sa); 1083 1084 1085 /** 1086 * Predicate returning @c 1 (true) if this SedAxis_t's "style" attribute is 1087 * set. 1088 * 1089 * @param sa the SedAxis_t structure. 1090 * 1091 * @return @c 1 (true) if this SedAxis_t's "style" attribute has been set, 1092 * otherwise @c 0 (false) is returned. 1093 * 1094 * @memberof SedAxis_t 1095 */ 1096 LIBSEDML_EXTERN 1097 int 1098 SedAxis_isSetStyle(const SedAxis_t * sa); 1099 1100 1101 /** 1102 * Sets the value of the "type" attribute of this SedAxis_t. 1103 * 1104 * @param sa the SedAxis_t structure. 1105 * 1106 * @param type AxisType_t value of the "type" attribute to be set. 1107 * 1108 * @copydetails doc_returns_success_code 1109 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1110 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 1111 * OperationReturnValues_t} 1112 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1113 * 1114 * @copydetails doc_sedaxis_type 1115 * 1116 * @memberof SedAxis_t 1117 */ 1118 LIBSEDML_EXTERN 1119 int 1120 SedAxis_setType(SedAxis_t * sa, AxisType_t type); 1121 1122 1123 /** 1124 * Sets the value of the "type" attribute of this SedAxis_t. 1125 * 1126 * @param sa the SedAxis_t structure. 1127 * 1128 * @param type const char * of the "type" attribute to be set. 1129 * 1130 * @copydetails doc_returns_success_code 1131 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1132 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 1133 * OperationReturnValues_t} 1134 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1135 * 1136 * @copydetails doc_sedaxis_type 1137 * 1138 * @memberof SedAxis_t 1139 */ 1140 LIBSEDML_EXTERN 1141 int 1142 SedAxis_setTypeAsString(SedAxis_t * sa, const char * type); 1143 1144 1145 /** 1146 * Sets the value of the "min" attribute of this SedAxis_t. 1147 * 1148 * @param sa the SedAxis_t structure. 1149 * 1150 * @param min double value of the "min" attribute to be set. 1151 * 1152 * @copydetails doc_returns_success_code 1153 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1154 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 1155 * OperationReturnValues_t} 1156 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1157 * 1158 * @memberof SedAxis_t 1159 */ 1160 LIBSEDML_EXTERN 1161 int 1162 SedAxis_setMin(SedAxis_t * sa, double min); 1163 1164 1165 /** 1166 * Sets the value of the "max" attribute of this SedAxis_t. 1167 * 1168 * @param sa the SedAxis_t structure. 1169 * 1170 * @param max double value of the "max" attribute to be set. 1171 * 1172 * @copydetails doc_returns_success_code 1173 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1174 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 1175 * OperationReturnValues_t} 1176 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1177 * 1178 * @memberof SedAxis_t 1179 */ 1180 LIBSEDML_EXTERN 1181 int 1182 SedAxis_setMax(SedAxis_t * sa, double max); 1183 1184 1185 /** 1186 * Sets the value of the "grid" attribute of this SedAxis_t. 1187 * 1188 * @param sa the SedAxis_t structure. 1189 * 1190 * @param grid int value of the "grid" attribute to be set. 1191 * 1192 * @copydetails doc_returns_success_code 1193 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1194 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 1195 * OperationReturnValues_t} 1196 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1197 * 1198 * @memberof SedAxis_t 1199 */ 1200 LIBSEDML_EXTERN 1201 int 1202 SedAxis_setGrid(SedAxis_t * sa, int grid); 1203 1204 1205 /** 1206 * Sets the value of the "reverse" attribute of this SedAxis_t. 1207 * 1208 * @param sa the SedAxis_t structure. 1209 * 1210 * @param reverse int value of the "reverse" attribute to be set. 1211 * 1212 * @copydetails doc_returns_success_code 1213 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1214 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 1215 * OperationReturnValues_t} 1216 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1217 * 1218 * @memberof SedAxis_t 1219 */ 1220 LIBSEDML_EXTERN 1221 int 1222 SedAxis_setReverse(SedAxis_t* sa, int reverse); 1223 1224 1225 /** 1226 * Sets the value of the "style" attribute of this SedAxis_t. 1227 * 1228 * @param sa the SedAxis_t structure. 1229 * 1230 * @param style const char * value of the "style" attribute to be set. 1231 * 1232 * @copydetails doc_returns_success_code 1233 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1234 * @li @sedmlconstant{LIBSEDML_INVALID_ATTRIBUTE_VALUE, 1235 * OperationReturnValues_t} 1236 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1237 * 1238 * @memberof SedAxis_t 1239 */ 1240 LIBSEDML_EXTERN 1241 int 1242 SedAxis_setStyle(SedAxis_t * sa, const char * style); 1243 1244 1245 /** 1246 * Unsets the value of the "type" attribute of this SedAxis_t. 1247 * 1248 * @param sa the SedAxis_t structure. 1249 * 1250 * @copydetails doc_returns_success_code 1251 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1252 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1253 * 1254 * @copydetails doc_sedaxis_type 1255 * 1256 * @memberof SedAxis_t 1257 */ 1258 LIBSEDML_EXTERN 1259 int 1260 SedAxis_unsetType(SedAxis_t * sa); 1261 1262 1263 /** 1264 * Unsets the value of the "min" attribute of this SedAxis_t. 1265 * 1266 * @param sa the SedAxis_t structure. 1267 * 1268 * @copydetails doc_returns_success_code 1269 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1270 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 1271 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1272 * 1273 * @memberof SedAxis_t 1274 */ 1275 LIBSEDML_EXTERN 1276 int 1277 SedAxis_unsetMin(SedAxis_t * sa); 1278 1279 1280 /** 1281 * Unsets the value of the "max" attribute of this SedAxis_t. 1282 * 1283 * @param sa the SedAxis_t structure. 1284 * 1285 * @copydetails doc_returns_success_code 1286 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1287 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 1288 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1289 * 1290 * @memberof SedAxis_t 1291 */ 1292 LIBSEDML_EXTERN 1293 int 1294 SedAxis_unsetMax(SedAxis_t * sa); 1295 1296 1297 /** 1298 * Unsets the value of the "grid" attribute of this SedAxis_t. 1299 * 1300 * @param sa the SedAxis_t structure. 1301 * 1302 * @copydetails doc_returns_success_code 1303 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1304 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 1305 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1306 * 1307 * @memberof SedAxis_t 1308 */ 1309 LIBSEDML_EXTERN 1310 int 1311 SedAxis_unsetGrid(SedAxis_t * sa); 1312 1313 1314 /** 1315 * Unsets the value of the "reverse" attribute of this SedAxis_t. 1316 * 1317 * @param sa the SedAxis_t structure. 1318 * 1319 * @copydetails doc_returns_success_code 1320 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1321 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 1322 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1323 * 1324 * @memberof SedAxis_t 1325 */ 1326 LIBSEDML_EXTERN 1327 int 1328 SedAxis_unsetReverse(SedAxis_t* sa); 1329 1330 1331 /** 1332 * Unsets the value of the "style" attribute of this SedAxis_t. 1333 * 1334 * @param sa the SedAxis_t structure. 1335 * 1336 * @copydetails doc_returns_success_code 1337 * @li @sedmlconstant{LIBSEDML_OPERATION_SUCCESS, OperationReturnValues_t} 1338 * @li @sedmlconstant{LIBSEDML_OPERATION_FAILED, OperationReturnValues_t} 1339 * @li @sedmlconstant{LIBSEDML_INVALID_OBJECT, OperationReturnValues_t} 1340 * 1341 * @memberof SedAxis_t 1342 */ 1343 LIBSEDML_EXTERN 1344 int 1345 SedAxis_unsetStyle(SedAxis_t * sa); 1346 1347 1348 /** 1349 * Predicate returning @c 1 (true) if all the required attributes for this 1350 * SedAxis_t object have been set. 1351 * 1352 * @param sa the SedAxis_t structure. 1353 * 1354 * @return @c 1 (true) to indicate that all the required attributes of this 1355 * SedAxis_t have been set, otherwise @c 0 (false) is returned. 1356 * 1357 * 1358 * @note The required attributes for the SedAxis_t object are: 1359 * @li "type" 1360 * 1361 * @memberof SedAxis_t 1362 */ 1363 LIBSEDML_EXTERN 1364 int 1365 SedAxis_hasRequiredAttributes(const SedAxis_t * sa); 1366 1367 1368 1369 1370 END_C_DECLS 1371 1372 1373 1374 1375 LIBSEDML_CPP_NAMESPACE_END 1376 1377 1378 1379 1380 #endif /* !SWIG */ 1381 1382 1383 1384 1385 #endif /* !SedAxis_H__ */ 1386 1387 1388