1 /** 2 * @file Image.h 3 * @brief Definition of the Image class. 4 * @author Ralph Gauges 5 * @author Frank T. Bergmann 6 * 7 * <!-------------------------------------------------------------------------- 8 * This file is part of libSBML. Please visit http://sbml.org for more 9 * information about SBML, and the latest version of libSBML. 10 * 11 * Copyright (C) 2020 jointly by the following organizations: 12 * 1. California Institute of Technology, Pasadena, CA, USA 13 * 2. University of Heidelberg, Heidelberg, Germany 14 * 3. University College London, London, UK 15 * 16 * Copyright (C) 2019 jointly by the following organizations: 17 * 1. California Institute of Technology, Pasadena, CA, USA 18 * 2. University of Heidelberg, Heidelberg, Germany 19 * 20 * Copyright (C) 2013-2018 jointly by the following organizations: 21 * 1. California Institute of Technology, Pasadena, CA, USA 22 * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK 23 * 3. University of Heidelberg, Heidelberg, Germany 24 * 25 * Copyright (C) 2011-2013 jointly by the following organizations: 26 * 1. California Institute of Technology, Pasadena, CA, USA 27 * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK 28 * 29 * Copyright 2010 Ralph Gauges 30 * Group for the modeling of biological processes 31 * University of Heidelberg 32 * Im Neuenheimer Feld 267 33 * 69120 Heidelberg 34 * Germany 35 * 36 * This library is free software; you can redistribute it and/or modify it 37 * under the terms of the GNU Lesser General Public License as published by 38 * the Free Software Foundation. A copy of the license agreement is provided 39 * in the file named "LICENSE.txt" included with this software distribution 40 * and also available online as http://sbml.org/software/libsbml/license.html 41 * ------------------------------------------------------------------------ --> 42 * 43 * @class Image 44 * @sbmlbrief{render} Representation of images. 45 * 46 * The image class represents a bitmap image representation. It is derived 47 * from Transformation2D and inherits all its attributes. 48 * 49 * There is an attribute that can be used to specify a file URL where that 50 * specifies where the image data can be found. If the URL is a relative 51 * path, it is considered to be relative to the document that contains the 52 * render extension info. The path should be the location of a JPEG or PNG 53 * image, other image formats are currently not supported by the SBML 54 * Level 3 Render package. 55 * 56 * Additionally it provides an id attribute as well as attributes that 57 * determine the dimensions and the position of the image relative to its 58 * viewport. 59 */ 60 61 #ifndef Image_H__ 62 #define Image_H__ 63 64 65 #include <sbml/common/extern.h> 66 #include <sbml/common/sbmlfwd.h> 67 #include <sbml/packages/render/common/renderfwd.h> 68 69 70 #ifdef __cplusplus 71 72 73 #include <string> 74 75 76 #include <sbml/packages/render/sbml/Transformation2D.h> 77 #include <sbml/packages/render/extension/RenderExtension.h> 78 #include <sbml/packages/render/sbml/RelAbsVector.h> 79 #include <sbml/xml/XMLNode.h> 80 81 82 LIBSBML_CPP_NAMESPACE_BEGIN 83 84 85 class LIBSBML_EXTERN Image : public Transformation2D 86 { 87 protected: 88 89 /** @cond doxygenLibsbmlInternal */ 90 91 RelAbsVector mX; 92 RelAbsVector mY; 93 RelAbsVector mZ; 94 RelAbsVector mWidth; 95 RelAbsVector mHeight; 96 std::string mHref; 97 98 /** @endcond */ 99 100 public: 101 102 /** 103 * Creates a new Image using the given SBML Level, Version and 104 * “render” package version. 105 * 106 * @param level an unsigned int, the SBML Level to assign to this Image. 107 * 108 * @param version an unsigned int, the SBML Version to assign to this Image. 109 * 110 * @param pkgVersion an unsigned int, the SBML Render Version to assign to 111 * this Image. 112 * 113 * @copydetails doc_note_setting_lv_pkg 114 */ 115 Image(unsigned int level = RenderExtension::getDefaultLevel(), 116 unsigned int version = RenderExtension::getDefaultVersion(), 117 unsigned int pkgVersion = RenderExtension::getDefaultPackageVersion()); 118 119 120 /** 121 * Creates a new Image using the given RenderPkgNamespaces object. 122 * 123 * @copydetails doc_what_are_sbml_package_namespaces 124 * 125 * @param renderns the RenderPkgNamespaces object. 126 * 127 * @copydetails doc_note_setting_lv_pkg 128 */ 129 Image(RenderPkgNamespaces *renderns); 130 131 132 /** 133 * Creates a new Image object from the given XMLNode object. 134 * The XMLNode object has to contain a valid XML representation of a 135 * Image object as defined in the render extension specification. 136 * This method is normally called when render information is read from a file and 137 * should normally not have to be called explicitly. 138 * 139 * @param node the XMLNode object reference that describes the Image 140 * object to be instantiated. 141 * 142 * @param l2version an integer indicating the version of SBML Level 2 143 */ 144 Image(const XMLNode& node, unsigned int l2version=4); 145 146 147 148 149 #ifndef OMIT_DEPRECATED 150 /** 151 * Instantiates an Image object with the given @p id. 152 * The image reference is unset, the position and the dimensions 153 * values of the image are set to 0. 154 * 155 * For the image to be valid, the reference has to be set and it has to 156 * have dimensions different from and larger than 0. 157 * 158 * @copydetails doc_warning_deprecated_constructor 159 */ 160 Image(RenderPkgNamespaces* renderns, const std::string& id); 161 #endif // OMIT_DEPRECATED 162 163 /** 164 * Copy constructor for Image. 165 * 166 * @param orig the Image instance to copy. 167 */ 168 Image(const Image& orig); 169 170 171 /** 172 * Assignment operator for Image. 173 * 174 * @param rhs the Image object whose values are to be used as the basis of 175 * the assignment. 176 */ 177 Image& operator=(const Image& rhs); 178 179 180 /** 181 * Creates and returns a deep copy of this Image object. 182 * 183 * @return a (deep) copy of this Image object. 184 */ 185 virtual Image* clone() const; 186 187 188 /** 189 * Destructor for Image. 190 */ 191 virtual ~Image(); 192 193 194 /** 195 * Returns the value of the "id" attribute of this Image. 196 * 197 * @return the value of the "id" attribute of this Image as a string. 198 */ 199 virtual const std::string& getId() const; 200 201 202 /** 203 * Returns the value of the "href" attribute of this Image. 204 * 205 * @return the value of the "href" attribute of this Image as a string. 206 */ 207 const std::string& getHref() const; 208 209 /** 210 * Returns the image reference URL string. 211 * 212 * @return The path to the image data as a string. 213 */ 214 const std::string& getImageReference() const; 215 216 /** 217 * Predicate returning @c true if this Image's "id" attribute is set. 218 * 219 * @return @c true if this Image's "id" attribute has been set, otherwise 220 * @c false is returned. 221 */ 222 virtual bool isSetId() const; 223 224 225 /** 226 * Predicate returning @c true if this Image's "href" attribute is set. 227 * 228 * @return @c true if this Image's "href" attribute has been set, otherwise 229 * @c false is returned. 230 */ 231 bool isSetHref() const; 232 233 234 /** 235 * Returns @c true if the image reference has been set. 236 * The image reference is considered set if the string does not 237 * only contain whitespace characters. 238 * 239 * @return @c true if the image reference has been set. 240 */ 241 bool isSetImageReference() const; 242 243 /** 244 * Sets the value of the "id" attribute of this Image. 245 * 246 * @param id std::string& value of the "id" attribute to be set. 247 * 248 * @copydetails doc_returns_success_code 249 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 250 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, 251 * OperationReturnValues_t} 252 * 253 * Calling this function with @p id = @c NULL or an empty string is 254 * equivalent to calling unsetId(). 255 */ 256 virtual int setId(const std::string& id); 257 258 259 /** 260 * Sets the value of the "href" attribute of this Image. 261 * 262 * @param href std::string& value of the "href" attribute to be set. 263 * 264 * @copydetails doc_returns_one_success_code 265 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 266 * 267 * Calling this function with @p href = @c NULL or an empty string is 268 * equivalent to calling unsetHref(). 269 */ 270 int setHref(const std::string& href); 271 272 273 274 /** 275 * Sets the reference to the image location. 276 * Relative paths are relative to the document that contains the render information. 277 * The path should be the location to a JPEG or PNG bitmap image; other formats are 278 * currently not supported. 279 * 280 * @param ref A URL string that specifies where the image is located on the disk. 281 */ 282 int setImageReference(const std::string& ref); 283 284 /** 285 * Unsets the value of the "id" attribute of this Image. 286 * 287 * @copydetails doc_returns_success_code 288 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 289 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 290 */ 291 virtual int unsetId(); 292 293 294 /** 295 * Unsets the value of the "href" attribute of this Image. 296 * 297 * @copydetails doc_returns_success_code 298 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 299 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 300 */ 301 int unsetHref(); 302 303 304 /** 305 * Unsets the reference to the image location. 306 * 307 * @copydetails doc_returns_success_code 308 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 309 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 310 */ 311 int unsetImageReference(); 312 313 314 /** 315 * Returns a const reference to the x coordinate of the image position. 316 * 317 * @return const reference to the x coordinate of the image position. 318 */ 319 const RelAbsVector& getX() const; 320 321 322 /** 323 * Returns a reference to the x coordinate of the image position. 324 * 325 * @return reference to the x coordinate of the image position. 326 */ 327 RelAbsVector& getX(); 328 329 330 /** 331 * Returns a const reference to the y coordinate of the image position. 332 * 333 * @return const reference to the y coordinate of the image position. 334 */ 335 const RelAbsVector& getY() const; 336 337 338 /** 339 * Returns a reference to the y coordinate of the image position. 340 * 341 * @return reference to the y coordinate of the image position. 342 */ 343 RelAbsVector& getY(); 344 345 346 /** 347 * Returns a const reference to the z coordinate of the image position. 348 * 349 * @return const reference to the z coordinate of the image position. 350 */ 351 const RelAbsVector& getZ() const; 352 353 354 /** 355 * Returns a reference to the z coordinate of the image position. 356 * 357 * @return reference to the z coordinate of the image position. 358 */ 359 RelAbsVector& getZ(); 360 361 362 /** 363 * Returns a const reference to the width of the image. 364 * 365 * @return const reference to the width 366 */ 367 const RelAbsVector& getWidth() const; 368 369 370 /** 371 * Returns a reference to the width of the image. 372 * 373 * @return reference to the width 374 */ 375 RelAbsVector& getWidth(); 376 377 378 /** 379 * Returns a const reference to the height of the image. 380 * 381 * @return const reference to the height 382 */ 383 const RelAbsVector& getHeight() const; 384 385 386 /** 387 * Returns a reference to the height of the image. 388 * 389 * @return reference to the height 390 */ 391 RelAbsVector& getHeight(); 392 393 394 /** 395 * Predicate returning @c true if this Image's "x" element is set. 396 * 397 * @return @c true if this Image's "x" element has been set, otherwise 398 * @c false is returned. 399 */ 400 bool isSetX() const; 401 402 403 /** 404 * Predicate returning @c true if this Image's "y" element is set. 405 * 406 * @return @c true if this Image's "y" element has been set, otherwise 407 * @c false is returned. 408 */ 409 bool isSetY() const; 410 411 412 /** 413 * Predicate returning @c true if this Image's "z" element is set. 414 * 415 * @return @c true if this Image's "z" element has been set, otherwise 416 * @c false is returned. 417 */ 418 bool isSetZ() const; 419 420 421 /** 422 * Predicate returning @c true if this Image's "width" element is set. 423 * 424 * @return @c true if this Image's "width" element has been set, otherwise 425 * @c false is returned. 426 */ 427 bool isSetWidth() const; 428 429 430 /** 431 * Predicate returning @c true if this Image's "height" element is set. 432 * 433 * @return @c true if this Image's "height" element has been set, otherwise 434 * @c false is returned. 435 */ 436 bool isSetHeight() const; 437 438 439 /** 440 * Sets the position of the image relative to its viewport. 441 * The position can either be specified in relative or in absolute coordinates 442 * or a combination of both. 443 * The z coordinate can be omitted. In that case it is set to 0. 444 * 445 * @param x x coordinate of the image position 446 * @param y y coordinate of the image position 447 * @param z z coordinate of the image position 448 */ 449 void setCoordinates(const RelAbsVector& x,const RelAbsVector& y,const RelAbsVector& z=RelAbsVector(0.0,0.0)); 450 451 452 /** 453 * Sets the dimensions of the image. 454 * The dimensions can be set as relative values or absolute values, or 455 * a combination of both. 456 * 457 * @param width the width of the image when rendered 458 * @param height the height of the image when rendered 459 */ 460 void setDimensions(const RelAbsVector& width,const RelAbsVector& height); 461 462 463 /** 464 * Sets the x coordinate of the image position. 465 * The position can either be specified in relative or in absolute coordinates 466 * or a combination of both. 467 * 468 * @param coord x-coordinate of the image position 469 */ 470 int setX(const RelAbsVector& coord); 471 472 473 /** 474 * Sets the y coordinate of the image position. 475 * The position can either be specified in relative or in absolute coordinates 476 * or a combination of both. 477 * 478 * @param coord y-coordinate of the image position 479 */ 480 int setY(const RelAbsVector& coord); 481 482 483 /** 484 * Sets the z coordinate of the image position. 485 * The position can either be specified in relative or in absolute coordinates 486 * or a combination of both. 487 * 488 * @param coord z-coordinate of the image position 489 */ 490 int setZ(const RelAbsVector& coord); 491 492 493 /** 494 * Sets the width of the image when rendered. 495 * The width can be set as relative values or absolute values, or 496 * a combination of both. 497 * 498 * @param width the width of the image when rendered 499 */ 500 int setWidth(const RelAbsVector& width); 501 502 503 /** 504 * Sets the height of the image when rendered. 505 * The height can be set as relative values or absolute values, or 506 * a combination of both. 507 * 508 * @param height the height of the image when rendered 509 */ 510 int setHeight(const RelAbsVector& height); 511 512 513 /** 514 * Unsets the value of the "x" element of this Image. 515 * 516 * @copydetails doc_returns_success_code 517 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 518 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 519 */ 520 int unsetX(); 521 522 523 /** 524 * Unsets the value of the "y" element of this Image. 525 * 526 * @copydetails doc_returns_success_code 527 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 528 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 529 */ 530 int unsetY(); 531 532 533 /** 534 * Unsets the value of the "z" element of this Image. 535 * 536 * @copydetails doc_returns_success_code 537 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 538 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 539 */ 540 int unsetZ(); 541 542 543 /** 544 * Unsets the value of the "width" element of this Image. 545 * 546 * @copydetails doc_returns_success_code 547 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 548 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 549 */ 550 int unsetWidth(); 551 552 553 /** 554 * Unsets the value of the "height" element of this Image. 555 * 556 * @copydetails doc_returns_success_code 557 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 558 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 559 */ 560 int unsetHeight(); 561 562 563 /** 564 * Returns the XML element name of this Image object. 565 * 566 * For Image, the XML element name is always @c "image". 567 * 568 * @return the name of this element, i.e. @c "image". 569 */ 570 virtual const std::string& getElementName() const; 571 572 573 /** 574 * Returns the libSBML type code for this Image object. 575 * 576 * @copydetails doc_what_are_typecodes 577 * 578 * @return the SBML type code for this object: 579 * @sbmlconstant{SBML_RENDER_IMAGE, SBMLRenderTypeCode_t}. 580 * 581 * @copydetails doc_warning_typecodes_not_unique 582 * 583 * @see getElementName() 584 * @see getPackageName() 585 */ 586 virtual int getTypeCode() const; 587 588 589 /** 590 * Predicate returning @c true if all the required attributes for this Image 591 * object have been set. 592 * 593 * @return @c true to indicate that all the required attributes of this Image 594 * have been set, otherwise @c false is returned. 595 * 596 * 597 * @note The required attributes for the Image object are: 598 * @li "x" 599 * @li "y" 600 * @li "width" 601 * @li "height" 602 * @li "href" 603 */ 604 virtual bool hasRequiredAttributes() const; 605 606 607 /** @cond doxygenLibsbmlInternal */ 608 609 /** 610 * Accepts the given SBMLVisitor 611 */ 612 virtual bool accept(SBMLVisitor& v) const; 613 614 /** @endcond */ 615 616 617 618 /** 619 * Creates an XMLNode object from this Image object. 620 * 621 * @return the XMLNode with the XML representation for the 622 * Image object. 623 */ 624 virtual XMLNode toXML() const; 625 626 protected: 627 628 629 /** @cond doxygenLibsbmlInternal */ 630 631 /** 632 * Adds the expected attributes for this element 633 */ 634 virtual void addExpectedAttributes(ExpectedAttributes& attributes); 635 636 /** @endcond */ 637 638 639 640 /** @cond doxygenLibsbmlInternal */ 641 642 /** 643 * Reads the expected attributes into the member data variables 644 */ 645 virtual void readAttributes(const XMLAttributes& attributes, 646 const ExpectedAttributes& expectedAttributes); 647 648 /** @endcond */ 649 650 651 652 /** @cond doxygenLibsbmlInternal */ 653 654 /** 655 * Writes the attributes to the stream 656 */ 657 virtual void writeAttributes(XMLOutputStream& stream) const; 658 659 /** @endcond */ 660 661 662 }; 663 664 LIBSBML_CPP_NAMESPACE_END 665 666 667 #endif /* __cplusplus */ 668 669 670 671 672 #ifndef SWIG 673 674 675 676 677 LIBSBML_CPP_NAMESPACE_BEGIN 678 679 680 681 682 BEGIN_C_DECLS 683 684 685 /** 686 * Creates a new Image_t using the given SBML Level, Version and 687 * “render” package version. 688 * 689 * @param level an unsigned int, the SBML Level to assign to this Image_t. 690 * 691 * @param version an unsigned int, the SBML Version to assign to this Image_t. 692 * 693 * @param pkgVersion an unsigned int, the SBML Render Version to assign to this 694 * Image_t. 695 * 696 * @copydetails doc_note_setting_lv_pkg 697 * 698 * @copydetails doc_warning_returns_owned_pointer 699 * 700 * @memberof Image_t 701 */ 702 LIBSBML_EXTERN 703 Image_t * 704 Image_create(unsigned int level, 705 unsigned int version, 706 unsigned int pkgVersion); 707 708 709 /** 710 * Creates and returns a deep copy of this Image_t object. 711 * 712 * @param i the Image_t structure. 713 * 714 * @return a (deep) copy of this Image_t object. 715 * 716 * @copydetails doc_warning_returns_owned_pointer 717 * 718 * @memberof Image_t 719 */ 720 LIBSBML_EXTERN 721 Image_t* 722 Image_clone(const Image_t* i); 723 724 725 /** 726 * Frees this Image_t object. 727 * 728 * @param i the Image_t structure. 729 * 730 * @memberof Image_t 731 */ 732 LIBSBML_EXTERN 733 void 734 Image_free(Image_t* i); 735 736 737 /** 738 * Returns the value of the "id" attribute of this Image_t. 739 * 740 * @param i the Image_t structure whose id is sought. 741 * 742 * @return the value of the "id" attribute of this Image_t as a pointer to a 743 * string. 744 * 745 * @copydetails doc_warning_returns_owned_char 746 * 747 * @memberof Image_t 748 */ 749 LIBSBML_EXTERN 750 char * 751 Image_getId(const Image_t * i); 752 753 754 /** 755 * Returns the value of the "href" attribute of this Image_t. 756 * 757 * @param i the Image_t structure whose href is sought. 758 * 759 * @return the value of the "href" attribute of this Image_t as a pointer to a 760 * string. 761 * 762 * @copydetails doc_warning_returns_owned_char 763 * 764 * @memberof Image_t 765 */ 766 LIBSBML_EXTERN 767 char * 768 Image_getHref(const Image_t * i); 769 770 771 /** 772 * Predicate returning @c 1 (true) if this Image_t's "id" attribute is set. 773 * 774 * @param i the Image_t structure. 775 * 776 * @return @c 1 (true) if this Image_t's "id" attribute has been set, otherwise 777 * @c 0 (false) is returned. 778 * 779 * @memberof Image_t 780 */ 781 LIBSBML_EXTERN 782 int 783 Image_isSetId(const Image_t * i); 784 785 786 /** 787 * Predicate returning @c 1 (true) if this Image_t's "href" attribute is set. 788 * 789 * @param i the Image_t structure. 790 * 791 * @return @c 1 (true) if this Image_t's "href" attribute has been set, 792 * otherwise @c 0 (false) is returned. 793 * 794 * @memberof Image_t 795 */ 796 LIBSBML_EXTERN 797 int 798 Image_isSetHref(const Image_t * i); 799 800 801 /** 802 * Sets the value of the "id" attribute of this Image_t. 803 * 804 * @param i the Image_t structure. 805 * 806 * @param id const char * value of the "id" attribute to be set. 807 * 808 * @copydetails doc_returns_success_code 809 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 810 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 811 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 812 * 813 * Calling this function with @p id = @c NULL or an empty string is equivalent 814 * to calling Image_unsetId(). 815 * 816 * @memberof Image_t 817 */ 818 LIBSBML_EXTERN 819 int 820 Image_setId(Image_t * i, const char * id); 821 822 823 /** 824 * Sets the value of the "href" attribute of this Image_t. 825 * 826 * @param i the Image_t structure. 827 * 828 * @param href const char * value of the "href" attribute to be set. 829 * 830 * @copydetails doc_returns_success_code 831 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 832 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 833 * 834 * Calling this function with @p href = @c NULL or an empty string is 835 * equivalent to calling Image_unsetHref(). 836 * 837 * @memberof Image_t 838 */ 839 LIBSBML_EXTERN 840 int 841 Image_setHref(Image_t * i, const char * href); 842 843 844 /** 845 * Unsets the value of the "id" attribute of this Image_t. 846 * 847 * @param i the Image_t structure. 848 * 849 * @copydetails doc_returns_success_code 850 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 851 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 852 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 853 * 854 * @memberof Image_t 855 */ 856 LIBSBML_EXTERN 857 int 858 Image_unsetId(Image_t * i); 859 860 861 /** 862 * Unsets the value of the "href" attribute of this Image_t. 863 * 864 * @param i the Image_t structure. 865 * 866 * @copydetails doc_returns_success_code 867 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 868 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 869 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 870 * 871 * @memberof Image_t 872 */ 873 LIBSBML_EXTERN 874 int 875 Image_unsetHref(Image_t * i); 876 877 878 /** 879 * Returns the value of the "x" element of this Image_t. 880 * 881 * @param i the Image_t structure whose x is sought. 882 * 883 * @return the value of the "x" element of this Image_t as a RelAbsVector_t. 884 * 885 * @memberof Image_t 886 */ 887 LIBSBML_EXTERN 888 RelAbsVector_t* 889 Image_getX(const Image_t * i); 890 891 892 /** 893 * Returns the value of the "y" element of this Image_t. 894 * 895 * @param i the Image_t structure whose y is sought. 896 * 897 * @return the value of the "y" element of this Image_t as a RelAbsVector_t. 898 * 899 * @memberof Image_t 900 */ 901 LIBSBML_EXTERN 902 RelAbsVector_t* 903 Image_getY(const Image_t * i); 904 905 906 /** 907 * Returns the value of the "z" element of this Image_t. 908 * 909 * @param i the Image_t structure whose z is sought. 910 * 911 * @return the value of the "z" element of this Image_t as a RelAbsVector_t. 912 * 913 * @memberof Image_t 914 */ 915 LIBSBML_EXTERN 916 RelAbsVector_t* 917 Image_getZ(const Image_t * i); 918 919 920 /** 921 * Returns the value of the "width" element of this Image_t. 922 * 923 * @param i the Image_t structure whose width is sought. 924 * 925 * @return the value of the "width" element of this Image_t as a RelAbsVector_t. 926 * 927 * @memberof Image_t 928 */ 929 LIBSBML_EXTERN 930 RelAbsVector_t* 931 Image_getWidth(const Image_t * i); 932 933 934 /** 935 * Returns the value of the "height" element of this Image_t. 936 * 937 * @param i the Image_t structure whose height is sought. 938 * 939 * @return the value of the "height" element of this Image_t as a 940 * RelAbsVector_t. 941 * 942 * @memberof Image_t 943 */ 944 LIBSBML_EXTERN 945 RelAbsVector_t* 946 Image_getHeight(const Image_t * i); 947 948 949 /** 950 * Predicate returning @c 1 (true) if this Image_t's "x" element is set. 951 * 952 * @param i the Image_t structure. 953 * 954 * @return @c 1 (true) if this Image_t's "x" element has been set, otherwise 955 * @c 0 (false) is returned. 956 * 957 * @memberof Image_t 958 */ 959 LIBSBML_EXTERN 960 int 961 Image_isSetX(const Image_t * i); 962 963 964 /** 965 * Predicate returning @c 1 (true) if this Image_t's "y" element is set. 966 * 967 * @param i the Image_t structure. 968 * 969 * @return @c 1 (true) if this Image_t's "y" element has been set, otherwise 970 * @c 0 (false) is returned. 971 * 972 * @memberof Image_t 973 */ 974 LIBSBML_EXTERN 975 int 976 Image_isSetY(const Image_t * i); 977 978 979 /** 980 * Predicate returning @c 1 (true) if this Image_t's "z" element is set. 981 * 982 * @param i the Image_t structure. 983 * 984 * @return @c 1 (true) if this Image_t's "z" element has been set, otherwise 985 * @c 0 (false) is returned. 986 * 987 * @memberof Image_t 988 */ 989 LIBSBML_EXTERN 990 int 991 Image_isSetZ(const Image_t * i); 992 993 994 /** 995 * Predicate returning @c 1 (true) if this Image_t's "width" element is set. 996 * 997 * @param i the Image_t structure. 998 * 999 * @return @c 1 (true) if this Image_t's "width" element has been set, 1000 * otherwise @c 0 (false) is returned. 1001 * 1002 * @memberof Image_t 1003 */ 1004 LIBSBML_EXTERN 1005 int 1006 Image_isSetWidth(const Image_t * i); 1007 1008 1009 /** 1010 * Predicate returning @c 1 (true) if this Image_t's "height" element is set. 1011 * 1012 * @param i the Image_t structure. 1013 * 1014 * @return @c 1 (true) if this Image_t's "height" element has been set, 1015 * otherwise @c 0 (false) is returned. 1016 * 1017 * @memberof Image_t 1018 */ 1019 LIBSBML_EXTERN 1020 int 1021 Image_isSetHeight(const Image_t * i); 1022 1023 1024 /** 1025 * Sets the value of the "x" element of this Image_t. 1026 * 1027 * @param i the Image_t structure. 1028 * 1029 * @param x RelAbsVector_t value of the "x" element to be set. 1030 * 1031 * @copydetails doc_returns_success_code 1032 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1033 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1034 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1035 * 1036 * @memberof Image_t 1037 */ 1038 LIBSBML_EXTERN 1039 int 1040 Image_setX(Image_t * i, const RelAbsVector_t* x); 1041 1042 1043 /** 1044 * Sets the value of the "y" element of this Image_t. 1045 * 1046 * @param i the Image_t structure. 1047 * 1048 * @param y RelAbsVector_t value of the "y" element to be set. 1049 * 1050 * @copydetails doc_returns_success_code 1051 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1052 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1053 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1054 * 1055 * @memberof Image_t 1056 */ 1057 LIBSBML_EXTERN 1058 int 1059 Image_setY(Image_t * i, const RelAbsVector_t* y); 1060 1061 1062 /** 1063 * Sets the value of the "z" element of this Image_t. 1064 * 1065 * @param i the Image_t structure. 1066 * 1067 * @param z RelAbsVector_t value of the "z" element to be set. 1068 * 1069 * @copydetails doc_returns_success_code 1070 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1071 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1072 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1073 * 1074 * @memberof Image_t 1075 */ 1076 LIBSBML_EXTERN 1077 int 1078 Image_setZ(Image_t * i, const RelAbsVector_t* z); 1079 1080 1081 /** 1082 * Sets the value of the "width" element of this Image_t. 1083 * 1084 * @param i the Image_t structure. 1085 * 1086 * @param width RelAbsVector_t value of the "width" element to be set. 1087 * 1088 * @copydetails doc_returns_success_code 1089 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1090 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1091 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1092 * 1093 * @memberof Image_t 1094 */ 1095 LIBSBML_EXTERN 1096 int 1097 Image_setWidth(Image_t * i, const RelAbsVector_t* width); 1098 1099 1100 /** 1101 * Sets the value of the "height" element of this Image_t. 1102 * 1103 * @param i the Image_t structure. 1104 * 1105 * @param height RelAbsVector_t value of the "height" element to be set. 1106 * 1107 * @copydetails doc_returns_success_code 1108 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1109 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1110 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1111 * 1112 * @memberof Image_t 1113 */ 1114 LIBSBML_EXTERN 1115 int 1116 Image_setHeight(Image_t * i, const RelAbsVector_t* height); 1117 1118 1119 /** 1120 * Unsets the value of the "x" element of this Image_t. 1121 * 1122 * @param i the Image_t structure. 1123 * 1124 * @copydetails doc_returns_success_code 1125 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1126 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1127 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1128 * 1129 * @memberof Image_t 1130 */ 1131 LIBSBML_EXTERN 1132 int 1133 Image_unsetX(Image_t * i); 1134 1135 1136 /** 1137 * Unsets the value of the "y" element of this Image_t. 1138 * 1139 * @param i the Image_t structure. 1140 * 1141 * @copydetails doc_returns_success_code 1142 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1143 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1144 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1145 * 1146 * @memberof Image_t 1147 */ 1148 LIBSBML_EXTERN 1149 int 1150 Image_unsetY(Image_t * i); 1151 1152 1153 /** 1154 * Unsets the value of the "z" element of this Image_t. 1155 * 1156 * @param i the Image_t structure. 1157 * 1158 * @copydetails doc_returns_success_code 1159 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1160 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1161 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1162 * 1163 * @memberof Image_t 1164 */ 1165 LIBSBML_EXTERN 1166 int 1167 Image_unsetZ(Image_t * i); 1168 1169 1170 /** 1171 * Unsets the value of the "width" element of this Image_t. 1172 * 1173 * @param i the Image_t structure. 1174 * 1175 * @copydetails doc_returns_success_code 1176 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1177 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1178 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1179 * 1180 * @memberof Image_t 1181 */ 1182 LIBSBML_EXTERN 1183 int 1184 Image_unsetWidth(Image_t * i); 1185 1186 1187 /** 1188 * Unsets the value of the "height" element of this Image_t. 1189 * 1190 * @param i the Image_t structure. 1191 * 1192 * @copydetails doc_returns_success_code 1193 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1194 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1195 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1196 * 1197 * @memberof Image_t 1198 */ 1199 LIBSBML_EXTERN 1200 int 1201 Image_unsetHeight(Image_t * i); 1202 1203 1204 /** 1205 * Predicate returning @c 1 (true) if all the required attributes for this 1206 * Image_t object have been set. 1207 * 1208 * @param i the Image_t structure. 1209 * 1210 * @return @c 1 (true) to indicate that all the required attributes of this 1211 * Image_t have been set, otherwise @c 0 (false) is returned. 1212 * 1213 * 1214 * @note The required attributes for the Image_t object are: 1215 * @li "href" 1216 * @li "x" 1217 * @li "y" 1218 * @li "width" 1219 * @li "height" 1220 * 1221 * @memberof Image_t 1222 */ 1223 LIBSBML_EXTERN 1224 int 1225 Image_hasRequiredAttributes(const Image_t * i); 1226 1227 1228 1229 1230 END_C_DECLS 1231 1232 1233 1234 1235 LIBSBML_CPP_NAMESPACE_END 1236 1237 1238 1239 1240 #endif /* !SWIG */ 1241 1242 1243 1244 1245 #endif /* !Image_H__ */ 1246 1247 1248