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