1 /** 2 * @file GraphicalPrimitive1D.h 3 * @brief Definition of the GraphicalPrimitive1D 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 GraphicalPrimitive1D 44 * @sbmlbrief{render} Base class for graphical primitives implementing 1D attributes. 45 * 46 * The GraphicalPrimitive1D class implements attributes and methods necessary 47 * for 1D objects like lines. The attributes that are implemented are a 48 * stroke color, a stroke width and a stroke dasharray for dashed line 49 * drawing. Additionally, this class adds an id attribute with which all 50 * graphical primitives can be referenced. 51 * 52 * The GraphicalPrimitive1D class is derived from Transformation2D and 53 * inherits all its methods and attributes. 54 */ 55 56 #ifndef GraphicalPrimitive1D_H__ 57 #define GraphicalPrimitive1D_H__ 58 59 60 #include <sbml/common/extern.h> 61 #include <sbml/common/sbmlfwd.h> 62 #include <sbml/packages/render/common/renderfwd.h> 63 64 #include <sbml/packages/render/extension/RenderExtension.h> 65 #include <sbml/packages/render/sbml/Transformation2D.h> 66 #include <sbml/xml/XMLNode.h> 67 68 #ifdef __cplusplus 69 70 #include <string> 71 #include <vector> 72 73 LIBSBML_CPP_NAMESPACE_BEGIN 74 75 76 class Ellipse; 77 class Rectangle; 78 class Polygon; 79 class RenderGroup; 80 class LineEnding; 81 class Text; 82 class RenderCurve; 83 84 class LIBSBML_EXTERN GraphicalPrimitive1D : public Transformation2D 85 { 86 protected: 87 /** @cond doxygenLibsbmlInternal */ 88 89 std::string mStroke; 90 double mStrokeWidth; 91 bool mIsSetStrokeWidth; 92 std::vector<unsigned int> mStrokeDashArray; 93 94 /** @endcond */ 95 96 public: 97 98 /** 99 * Creates a new GraphicalPrimitive1D using the given SBML Level, Version and 100 * “render” package version. 101 * 102 * @param level an unsigned int, the SBML Level to assign to this 103 * GraphicalPrimitive1D. 104 * 105 * @param version an unsigned int, the SBML Version to assign to this 106 * GraphicalPrimitive1D. 107 * 108 * @param pkgVersion an unsigned int, the SBML Render Version to assign to 109 * this GraphicalPrimitive1D. 110 * 111 * @copydetails doc_note_setting_lv_pkg 112 */ 113 GraphicalPrimitive1D(unsigned int level = RenderExtension::getDefaultLevel(), 114 unsigned int version = 115 RenderExtension::getDefaultVersion(), 116 unsigned int pkgVersion = 117 RenderExtension::getDefaultPackageVersion()); 118 119 120 /** 121 * Creates a new GraphicalPrimitive1D using the given RenderPkgNamespaces 122 * object. 123 * 124 * @copydetails doc_what_are_sbml_package_namespaces 125 * 126 * @param renderns the RenderPkgNamespaces object. 127 * 128 * @copydetails doc_note_setting_lv_pkg 129 */ 130 GraphicalPrimitive1D(RenderPkgNamespaces *renderns); 131 132 /** 133 * Creates a new GraphicalPrimitive1D object from the given XMLNode object. 134 * The XMLNode object has to contain a valid XML representation of a 135 * GraphicalPrimitive1D 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 GraphicalPrimitive1D 140 * object to be instantiated. 141 * 142 * @param l2version an integer indicating the version of SBML Level 2 143 */ 144 GraphicalPrimitive1D(const XMLNode& node, unsigned int l2version=4); 145 146 147 #ifndef OMIT_DEPRECATED 148 /** 149 * Constructor which creates a GraphicalPrimitive1D. 150 * The transformation properties are not set, neither is the stroke or the stroke width. 151 * The id is set to the given string. 152 * 153 * @param renderns the SBMLNamespaces object for the SBML "render" package 154 * @param id The id for the GraphicalPrimitive1D object 155 * 156 * @copydetails doc_warning_deprecated_constructor 157 */ 158 GraphicalPrimitive1D(RenderPkgNamespaces* renderns, const std::string& id); 159 #endif // OMIT_DEPRECATED 160 161 162 /** 163 * Copy constructor for GraphicalPrimitive1D. 164 * 165 * @param orig the GraphicalPrimitive1D instance to copy. 166 */ 167 GraphicalPrimitive1D(const GraphicalPrimitive1D& orig); 168 169 170 /** 171 * Assignment operator for GraphicalPrimitive1D. 172 * 173 * @param rhs the GraphicalPrimitive1D object whose values are to be used as 174 * the basis of the assignment. 175 */ 176 GraphicalPrimitive1D& operator=(const GraphicalPrimitive1D& rhs); 177 178 179 /** 180 * Creates and returns a deep copy of this GraphicalPrimitive1D object. 181 * 182 * @return a (deep) copy of this GraphicalPrimitive1D object. 183 */ 184 virtual GraphicalPrimitive1D* clone() const; 185 186 187 /** 188 * Destructor for GraphicalPrimitive1D. 189 */ 190 virtual ~GraphicalPrimitive1D(); 191 192 193 /** 194 * Returns the value of the "id" attribute of this GraphicalPrimitive1D. 195 * 196 * @return the value of the "id" attribute of this GraphicalPrimitive1D as a 197 * string. 198 */ 199 virtual const std::string& getId() const; 200 201 202 /** 203 * Returns the value of the "stroke" attribute of this GraphicalPrimitive1D. 204 * 205 * @return the value of the "stroke" attribute of this GraphicalPrimitive1D 206 * as a string. 207 */ 208 const std::string& getStroke() const; 209 210 211 /** 212 * Returns the value of the "stroke-width" attribute of this 213 * GraphicalPrimitive1D. 214 * 215 * @return the value of the "stroke-width" attribute of this 216 * GraphicalPrimitive1D as a double. 217 */ 218 double getStrokeWidth() const; 219 220 221 /** 222 * Returns the value of the "stroke-dasharray" attribute of this 223 * GraphicalPrimitive1D. 224 * 225 * @note the value of the "stroke-dasharray" attribute of this 226 * GraphicalPrimitive1D is returned in the argument array. 227 */ 228 const std::vector<unsigned int>& getStrokeDashArray() const; 229 230 231 /** 232 * Returns a const reference to the stroke dasharray. 233 * 234 * @return const reference to stroke dash array 235 */ 236 const std::vector<unsigned int>& getDashArray() const; 237 238 239 /** 240 * Returns a reference to the stroke dasharray. 241 * 242 * @return reference to stroke dash array 243 */ 244 std::vector<unsigned int>& getDashArray(); 245 246 247 /** 248 * Predicate returning @c true if this GraphicalPrimitive1D's "id" attribute 249 * is set. 250 * 251 * @return @c true if this GraphicalPrimitive1D's "id" attribute has been 252 * set, otherwise @c false is returned. 253 */ 254 virtual bool isSetId() const; 255 256 257 /** 258 * Predicate returning @c true if this GraphicalPrimitive1D's "stroke" 259 * attribute is set. 260 * 261 * @return @c true if this GraphicalPrimitive1D's "stroke" attribute has been 262 * set, otherwise @c false is returned. 263 */ 264 bool isSetStroke() const; 265 266 267 /** 268 * Predicate returning @c true if this GraphicalPrimitive1D's "stroke-width" 269 * attribute is set. 270 * 271 * @return @c true if this GraphicalPrimitive1D's "stroke-width" attribute 272 * has been set, otherwise @c false is returned. 273 */ 274 bool isSetStrokeWidth() const; 275 276 277 /** 278 * Predicate returning @c true if this GraphicalPrimitive1D's 279 * "stroke-dasharray" attribute is set. 280 * 281 * @return @c true if this GraphicalPrimitive1D's "stroke-dasharray" 282 * attribute has been set, otherwise @c false is returned. 283 */ 284 bool isSetStrokeDashArray() const; 285 286 287 /** 288 * Returns @c true if the dash array has been set or @c false otherwise. 289 * The array is considered set if it is not empty and if the first entry is 290 * not @c NaN. 291 * 292 * @return @c true if the stroke-dasharray is set, @c false otherwise. 293 */ 294 bool isSetDashArray() const; 295 296 /** 297 * Sets the value of the "id" attribute of this GraphicalPrimitive1D. 298 * 299 * @param id std::string& value of the "id" attribute to be set. 300 * 301 * @copydetails doc_returns_success_code 302 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 303 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, 304 * OperationReturnValues_t} 305 * 306 * Calling this function with @p id = @c NULL or an empty string is 307 * equivalent to calling unsetId(). 308 */ 309 virtual int setId(const std::string& id); 310 311 312 /** 313 * Sets the value of the "stroke" attribute of this GraphicalPrimitive1D. 314 * 315 * @param stroke std::string& value of the "stroke" attribute to be set. 316 * 317 * @copydetails doc_returns_one_success_code 318 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 319 * 320 * Calling this function with @p stroke = @c NULL or an empty string is 321 * equivalent to calling unsetStroke(). 322 */ 323 int setStroke(const std::string& stroke); 324 325 326 /** 327 * Sets the value of the "stroke-width" attribute of this 328 * GraphicalPrimitive1D. 329 * 330 * @param strokeWidth double value of the "stroke-width" attribute to be set. 331 * 332 * @copydetails doc_returns_success_code 333 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 334 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, 335 * OperationReturnValues_t} 336 */ 337 int setStrokeWidth(double strokeWidth); 338 339 340 /** 341 * Sets the value of the "stroke-dasharray" attribute of this 342 * GraphicalPrimitive1D. 343 * 344 * @param array value of the "stroke-dasharray" 345 * attribute to be set. 346 * 347 * @copydetails doc_returns_success_code 348 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 349 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, 350 * OperationReturnValues_t} 351 */ 352 int setStrokeDashArray(const std::vector<unsigned int>& array); 353 354 355 /** 356 * Sets the 'stroke-dasharray' attribute to have the values 357 * in the given array. 358 * 359 * @param array Array of alternating stroke and gap length values. 360 */ 361 void setDashArray(const std::vector<unsigned int>& array); 362 363 /** 364 * Sets the 'stroke-dasharray' attribute from the given string. 365 * If the string is not a valid dasharray string, @c false 366 * is returned and the dasharray remains in the state is was 367 * before the call. 368 * 369 * The individual numerical values in the string have to be separated by commas. 370 * 371 * @param arrayString a string with number representing a dash array. 372 * 373 * @return @c true if setting 'stroke-dasharray' from the string succeeds or @c false otherwise. 374 */ 375 bool setDashArray(const std::string& arrayString); 376 377 378 /** 379 * Returns the number of defined dashes in the 'stroke-dasharray' attribute. 380 * 381 * @return the number of dashes in the 'stroke-dasharray' attribute. 382 */ 383 unsigned int getNumDashes() const; 384 385 /** 386 * Returns the dash at the given index of the 'stroke-dasharray' attribute. 387 * 388 * @param index the index of the dash length to return from the 389 * 'stroke-dasharray' attribute. 390 * 391 * @return the value of the dash length from the 'stroke-dasharray' 392 * attribute at the given index, or -1 (cast to an unsigned int) 393 * if no such index exists. 394 */ 395 unsigned int getDashByIndex(unsigned int index) const; 396 397 /** 398 * Adds a new length of a dash to the 'stroke-dasharray' attribute. 399 * 400 * @param dash the integer length of the dash to add to the end 401 * of the 'stroke-dasharray' attribute. 402 */ 403 void addDash(unsigned int dash); 404 405 /** 406 * Unsets the value of the "stroke-dasharray" attribute of this 407 * GraphicalPrimitive1D. 408 */ 409 void clearDashes(); 410 411 /** 412 * Sets the integer value of the dash at the given position. 413 * 414 * @param index the index of the dash length to replace in the 415 * 'stroke-dasharray' attribute. The function will fail silently 416 * if no such index exists. 417 * 418 * @param dash the integer length to set the indexed dash to. 419 */ 420 void setDashByIndex(unsigned int index, unsigned int dash); 421 422 /** 423 * Inserts the given integer value for the dash length at the 424 * given position. 425 * 426 * @param index the index of the dash length at which the new dash is 427 * to be inserted in the 'stroke-dasharray' attribute. The function 428 * will fail silently if no such index exists. 429 * 430 * @param dash the integer length to set the inserted dash to. 431 */ 432 void insertDash(unsigned int index, unsigned int dash); 433 434 435 /** 436 * Removes the dash length at the given index. 437 * 438 * @param index the index of the dash length to remove from the 439 * 'stroke-dasharray' attribute. 440 * The function will fail silently if no such index exists. 441 */ 442 void removeDash(unsigned int index); 443 444 /** 445 * Unsets the value of the "id" attribute of this GraphicalPrimitive1D. 446 * 447 * @copydetails doc_returns_success_code 448 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 449 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 450 */ 451 virtual int unsetId(); 452 453 454 /** 455 * Unsets the value of the "stroke" attribute of this GraphicalPrimitive1D. 456 * 457 * @copydetails doc_returns_success_code 458 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 459 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 460 */ 461 int unsetStroke(); 462 463 464 /** 465 * Unsets the value of the "stroke-width" attribute of this 466 * GraphicalPrimitive1D. 467 * 468 * @copydetails doc_returns_success_code 469 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 470 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 471 */ 472 int unsetStrokeWidth(); 473 474 475 /** 476 * Unsets the value of the "stroke-dasharray" attribute of this 477 * GraphicalPrimitive1D. 478 * 479 * @copydetails doc_returns_success_code 480 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 481 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 482 */ 483 int unsetStrokeDashArray(); 484 485 486 /** 487 * Predicate returning @c true if this abstract GraphicalPrimitive1D is of 488 * type Ellipse 489 * 490 * @return @c true if this abstract GraphicalPrimitive1D is of type 491 * Ellipse, @c false otherwise 492 */ 493 virtual bool isEllipse() const; 494 495 496 /** 497 * Predicate returning @c true if this abstract GraphicalPrimitive1D is of 498 * type Rectangle 499 * 500 * @return @c true if this abstract GraphicalPrimitive1D is of type 501 * Rectangle, @c false otherwise 502 */ 503 virtual bool isRectangle() const; 504 505 506 /** 507 * Predicate returning @c true if this abstract GraphicalPrimitive1D is of 508 * type Polygon 509 * 510 * @return @c true if this abstract GraphicalPrimitive1D is of type 511 * Polygon, @c false otherwise 512 */ 513 virtual bool isPolygon() const; 514 515 516 /** 517 * Predicate returning @c true if this abstract GraphicalPrimitive1D is of 518 * type RenderGroup 519 * 520 * @return @c true if this abstract GraphicalPrimitive1D is of type 521 * RenderGroup, @c false otherwise 522 */ 523 virtual bool isRenderGroup() const; 524 525 526 /** 527 * Predicate returning @c true if this abstract GraphicalPrimitive1D is of 528 * type LineEnding 529 * 530 * @return @c true if this abstract GraphicalPrimitive1D is of type 531 * LineEnding, @c false otherwise 532 */ 533 virtual bool isLineEnding() const; 534 535 536 /** 537 * Predicate returning @c true if this abstract GraphicalPrimitive1D is of 538 * type Text 539 * 540 * @return @c true if this abstract GraphicalPrimitive1D is of type Text, 541 * @c false otherwise 542 */ 543 virtual bool isText() const; 544 545 546 /** 547 * Predicate returning @c true if this abstract GraphicalPrimitive1D is of 548 * type RenderCurve 549 * 550 * @return @c true if this abstract GraphicalPrimitive1D is of type Text, 551 * @c false otherwise 552 */ 553 virtual bool isRenderCurve() const; 554 555 556 /** 557 * Returns the libSBML type code for this GraphicalPrimitive1D object. 558 * 559 * @copydetails doc_what_are_typecodes 560 * 561 * @return the SBML type code for this object: 562 * @sbmlconstant{SBML_RENDER_GRAPHICALPRIMITIVE1D, SBMLRenderTypeCode_t}. 563 * 564 * @copydetails doc_warning_typecodes_not_unique 565 * 566 * @see getElementName() 567 * @see getPackageName() 568 */ 569 virtual int getTypeCode() const; 570 571 572 /** 573 * Predicate returning @c true if all the required attributes for this 574 * GraphicalPrimitive1D object have been set. 575 * 576 * @return @c true to indicate that all the required attributes of this 577 * GraphicalPrimitive1D have been set, otherwise @c false is returned. 578 */ 579 virtual bool hasRequiredAttributes() const; 580 581 582 583 /** @cond doxygenLibsbmlInternal */ 584 585 /** 586 * Write any contained elements 587 */ 588 virtual void writeElements(XMLOutputStream& stream) const; 589 590 /** @endcond */ 591 592 593 594 /** @cond doxygenLibsbmlInternal */ 595 596 /** 597 * Accepts the given SBMLVisitor 598 */ 599 virtual bool accept(SBMLVisitor& v) const; 600 601 /** @endcond */ 602 603 604 605 /** @cond doxygenLibsbmlInternal */ 606 607 /** 608 * Sets the parent SBMLDocument 609 */ 610 virtual void setSBMLDocument(SBMLDocument* d); 611 612 /** @endcond */ 613 614 615 616 /** @cond doxygenLibsbmlInternal */ 617 618 /** 619 * Enables/disables the given package with this element 620 */ 621 virtual void enablePackageInternal(const std::string& pkgURI, 622 const std::string& pkgPrefix, 623 bool flag); 624 625 /** @endcond */ 626 627 628 629 630 #ifndef SWIG 631 632 633 634 /** @cond doxygenLibsbmlInternal */ 635 636 /** 637 * Returns the value of the "attributeName" attribute of this 638 * GraphicalPrimitive1D. 639 * 640 * @param attributeName, the name of the attribute to retrieve. 641 * 642 * @param value, the address of the value to record. 643 * 644 * @copydetails doc_returns_success_code 645 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 646 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 647 */ 648 virtual int getAttribute(const std::string& attributeName, bool& value) 649 const; 650 651 /** @endcond */ 652 653 654 655 /** @cond doxygenLibsbmlInternal */ 656 657 /** 658 * Returns the value of the "attributeName" attribute of this 659 * GraphicalPrimitive1D. 660 * 661 * @param attributeName, the name of the attribute to retrieve. 662 * 663 * @param value, the address of the value to record. 664 * 665 * @copydetails doc_returns_success_code 666 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 667 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 668 */ 669 virtual int getAttribute(const std::string& attributeName, int& value) const; 670 671 /** @endcond */ 672 673 674 675 /** @cond doxygenLibsbmlInternal */ 676 677 /** 678 * Returns the value of the "attributeName" attribute of this 679 * GraphicalPrimitive1D. 680 * 681 * @param attributeName, the name of the attribute to retrieve. 682 * 683 * @param value, the address of the value to record. 684 * 685 * @copydetails doc_returns_success_code 686 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 687 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 688 */ 689 virtual int getAttribute(const std::string& attributeName, 690 double& value) const; 691 692 /** @endcond */ 693 694 695 696 /** @cond doxygenLibsbmlInternal */ 697 698 /** 699 * Returns the value of the "attributeName" attribute of this 700 * GraphicalPrimitive1D. 701 * 702 * @param attributeName, the name of the attribute to retrieve. 703 * 704 * @param value, the address of the value to record. 705 * 706 * @copydetails doc_returns_success_code 707 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 708 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 709 */ 710 virtual int getAttribute(const std::string& attributeName, 711 unsigned int& value) const; 712 713 /** @endcond */ 714 715 716 717 /** @cond doxygenLibsbmlInternal */ 718 719 /** 720 * Returns the value of the "attributeName" attribute of this 721 * GraphicalPrimitive1D. 722 * 723 * @param attributeName, the name of the attribute to retrieve. 724 * 725 * @param value, the address of the value to record. 726 * 727 * @copydetails doc_returns_success_code 728 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 729 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 730 */ 731 virtual int getAttribute(const std::string& attributeName, 732 std::string& value) const; 733 734 /** @endcond */ 735 736 737 738 /** @cond doxygenLibsbmlInternal */ 739 740 /** 741 * Predicate returning @c true if this GraphicalPrimitive1D's attribute 742 * "attributeName" is set. 743 * 744 * @param attributeName, the name of the attribute to query. 745 * 746 * @return @c true if this GraphicalPrimitive1D's attribute "attributeName" 747 * has been set, otherwise @c false is returned. 748 */ 749 virtual bool isSetAttribute(const std::string& attributeName) const; 750 751 /** @endcond */ 752 753 754 755 /** @cond doxygenLibsbmlInternal */ 756 757 /** 758 * Sets the value of the "attributeName" attribute of this 759 * GraphicalPrimitive1D. 760 * 761 * @param attributeName, the name of the attribute to set. 762 * 763 * @param value, the value of the attribute to set. 764 * 765 * @copydetails doc_returns_success_code 766 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 767 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 768 */ 769 virtual int setAttribute(const std::string& attributeName, bool value); 770 771 /** @endcond */ 772 773 774 775 /** @cond doxygenLibsbmlInternal */ 776 777 /** 778 * Sets the value of the "attributeName" attribute of this 779 * GraphicalPrimitive1D. 780 * 781 * @param attributeName, the name of the attribute to set. 782 * 783 * @param value, the value of the attribute to set. 784 * 785 * @copydetails doc_returns_success_code 786 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 787 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 788 */ 789 virtual int setAttribute(const std::string& attributeName, int value); 790 791 /** @endcond */ 792 793 794 795 /** @cond doxygenLibsbmlInternal */ 796 797 /** 798 * Sets the value of the "attributeName" attribute of this 799 * GraphicalPrimitive1D. 800 * 801 * @param attributeName, the name of the attribute to set. 802 * 803 * @param value, the value of the attribute to set. 804 * 805 * @copydetails doc_returns_success_code 806 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 807 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 808 */ 809 virtual int setAttribute(const std::string& attributeName, double value); 810 811 /** @endcond */ 812 813 814 815 /** @cond doxygenLibsbmlInternal */ 816 817 /** 818 * Sets the value of the "attributeName" attribute of this 819 * GraphicalPrimitive1D. 820 * 821 * @param attributeName, the name of the attribute to set. 822 * 823 * @param value, the value of the attribute to set. 824 * 825 * @copydetails doc_returns_success_code 826 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 827 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 828 */ 829 virtual int setAttribute(const std::string& attributeName, 830 unsigned int value); 831 832 /** @endcond */ 833 834 835 836 /** @cond doxygenLibsbmlInternal */ 837 838 /** 839 * Sets the value of the "attributeName" attribute of this 840 * GraphicalPrimitive1D. 841 * 842 * @param attributeName, the name of the attribute to set. 843 * 844 * @param value, the value of the attribute to set. 845 * 846 * @copydetails doc_returns_success_code 847 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 848 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 849 */ 850 virtual int setAttribute(const std::string& attributeName, 851 const std::string& value); 852 853 /** @endcond */ 854 855 856 857 /** @cond doxygenLibsbmlInternal */ 858 859 /** 860 * Unsets the value of the "attributeName" attribute of this 861 * GraphicalPrimitive1D. 862 * 863 * @param attributeName, the name of the attribute to query. 864 * 865 * @copydetails doc_returns_success_code 866 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 867 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 868 */ 869 virtual int unsetAttribute(const std::string& attributeName); 870 871 /** @endcond */ 872 873 874 875 876 #endif /* !SWIG */ 877 878 879 /** 880 * Creates an XMLNode object from this GraphicalPrimitive1D object. 881 * 882 * @return the XMLNode with the XML representation for the 883 * GraphicalPrimitive1D object. 884 * 885 * This method is purely virtual and has to be implemented by subclasses. 886 */ 887 virtual XMLNode toXML() const = 0; 888 889 protected: 890 891 892 /** @cond doxygenLibsbmlInternal */ 893 894 /** 895 * Creates a new object from the next XMLToken on the XMLInputStream 896 */ 897 virtual SBase* createObject(XMLInputStream& stream); 898 899 /** @endcond */ 900 901 902 903 /** @cond doxygenLibsbmlInternal */ 904 905 /** 906 * Adds the expected attributes for this element 907 */ 908 virtual void addExpectedAttributes(ExpectedAttributes& attributes); 909 910 /** @endcond */ 911 912 913 914 /** @cond doxygenLibsbmlInternal */ 915 916 /** 917 * Reads the expected attributes into the member data variables 918 */ 919 virtual void readAttributes(const XMLAttributes& attributes, 920 const ExpectedAttributes& expectedAttributes); 921 922 /** @endcond */ 923 924 925 926 /** @cond doxygenLibsbmlInternal */ 927 928 /** 929 * Writes the attributes to the stream 930 */ 931 virtual void writeAttributes(XMLOutputStream& stream) const; 932 933 /** @endcond */ 934 935 936 937 /** @cond doxygenLibsbmlInternal */ 938 /** 939 * Adds all set attributes specific to the given GraphicalPrimitive1D objects to the given 940 * XMLAttributes object. 941 */ 942 static void addGraphicalPrimitive1DAttributes(const GraphicalPrimitive1D& primitive,XMLAttributes& attributes); 943 /** @endcond */ 944 945 /** @cond doxygenLibsbmlInternal */ 946 /** 947 * This method parses a dasharray string into the given vector. 948 * The vector is first cleared. 949 * If the dasharray is invalid, false is returned. 950 */ 951 static bool parseDashArray(const std::string& s,std::vector<unsigned int>& array); 952 /** @endcond */ 953 954 }; 955 956 957 958 LIBSBML_CPP_NAMESPACE_END 959 960 961 962 963 #endif /* __cplusplus */ 964 965 966 967 968 #ifndef SWIG 969 970 971 972 973 LIBSBML_CPP_NAMESPACE_BEGIN 974 975 976 977 978 BEGIN_C_DECLS 979 980 981 /** 982 * Creates a new Ellipse (GraphicalPrimitive1D_t) using the given SBML Level, Version 983 * and “render” package version. 984 * 985 * @param level an unsigned int, the SBML Level to assign to this 986 * GraphicalPrimitive1D_t. 987 * 988 * @param version an unsigned int, the SBML Version to assign to this 989 * GraphicalPrimitive1D_t. 990 * 991 * @param pkgVersion an unsigned int, the SBML Render Version to assign to this 992 * GraphicalPrimitive1D_t. 993 * 994 * @copydetails doc_note_setting_lv_pkg 995 * 996 * @copydetails doc_warning_returns_owned_pointer 997 * 998 * @memberof GraphicalPrimitive1D_t 999 */ 1000 LIBSBML_EXTERN 1001 GraphicalPrimitive1D_t * 1002 GraphicalPrimitive1D_createEllipse(unsigned int level, 1003 unsigned int version, 1004 unsigned int pkgVersion); 1005 1006 1007 /** 1008 * Creates a new Rectangle (GraphicalPrimitive1D_t) using the given SBML Level, 1009 * Version and “render” package version. 1010 * 1011 * @param level an unsigned int, the SBML Level to assign to this 1012 * GraphicalPrimitive1D_t. 1013 * 1014 * @param version an unsigned int, the SBML Version to assign to this 1015 * GraphicalPrimitive1D_t. 1016 * 1017 * @param pkgVersion an unsigned int, the SBML Render Version to assign to this 1018 * GraphicalPrimitive1D_t. 1019 * 1020 * @copydetails doc_note_setting_lv_pkg 1021 * 1022 * @copydetails doc_warning_returns_owned_pointer 1023 * 1024 * @memberof GraphicalPrimitive1D_t 1025 */ 1026 LIBSBML_EXTERN 1027 GraphicalPrimitive1D_t * 1028 GraphicalPrimitive1D_createRectangle(unsigned int level, 1029 unsigned int version, 1030 unsigned int pkgVersion); 1031 1032 1033 /** 1034 * Creates a new Polygon (GraphicalPrimitive1D_t) using the given SBML Level, Version 1035 * and “render” package version. 1036 * 1037 * @param level an unsigned int, the SBML Level to assign to this 1038 * GraphicalPrimitive1D_t. 1039 * 1040 * @param version an unsigned int, the SBML Version to assign to this 1041 * GraphicalPrimitive1D_t. 1042 * 1043 * @param pkgVersion an unsigned int, the SBML Render Version to assign to this 1044 * GraphicalPrimitive1D_t. 1045 * 1046 * @copydetails doc_note_setting_lv_pkg 1047 * 1048 * @copydetails doc_warning_returns_owned_pointer 1049 * 1050 * @memberof GraphicalPrimitive1D_t 1051 */ 1052 LIBSBML_EXTERN 1053 GraphicalPrimitive1D_t * 1054 GraphicalPrimitive1D_createPolygon(unsigned int level, 1055 unsigned int version, 1056 unsigned int pkgVersion); 1057 1058 1059 /** 1060 * Creates a new RenderGroup (GraphicalPrimitive1D_t) using the given SBML Level, 1061 * Version and “render” package version. 1062 * 1063 * @param level an unsigned int, the SBML Level to assign to this 1064 * GraphicalPrimitive1D_t. 1065 * 1066 * @param version an unsigned int, the SBML Version to assign to this 1067 * GraphicalPrimitive1D_t. 1068 * 1069 * @param pkgVersion an unsigned int, the SBML Render Version to assign to this 1070 * GraphicalPrimitive1D_t. 1071 * 1072 * @copydetails doc_note_setting_lv_pkg 1073 * 1074 * @copydetails doc_warning_returns_owned_pointer 1075 * 1076 * @memberof GraphicalPrimitive1D_t 1077 */ 1078 LIBSBML_EXTERN 1079 GraphicalPrimitive1D_t * 1080 GraphicalPrimitive1D_createRenderGroup(unsigned int level, 1081 unsigned int version, 1082 unsigned int pkgVersion); 1083 1084 1085 /** 1086 * Creates a new LineEnding (GraphicalPrimitive1D_t) using the given SBML Level, 1087 * Version and “render” package version. 1088 * 1089 * @param level an unsigned int, the SBML Level to assign to this 1090 * GraphicalPrimitive1D_t. 1091 * 1092 * @param version an unsigned int, the SBML Version to assign to this 1093 * GraphicalPrimitive1D_t. 1094 * 1095 * @param pkgVersion an unsigned int, the SBML Render Version to assign to this 1096 * GraphicalPrimitive1D_t. 1097 * 1098 * @copydetails doc_note_setting_lv_pkg 1099 * 1100 * @copydetails doc_warning_returns_owned_pointer 1101 * 1102 * @memberof GraphicalPrimitive1D_t 1103 */ 1104 LIBSBML_EXTERN 1105 GraphicalPrimitive1D_t * 1106 GraphicalPrimitive1D_createLineEnding(unsigned int level, 1107 unsigned int version, 1108 unsigned int pkgVersion); 1109 1110 1111 /** 1112 * Creates a new Text (GraphicalPrimitive1D_t) using the given SBML Level, Version 1113 * and “render” package version. 1114 * 1115 * @param level an unsigned int, the SBML Level to assign to this 1116 * GraphicalPrimitive1D_t. 1117 * 1118 * @param version an unsigned int, the SBML Version to assign to this 1119 * GraphicalPrimitive1D_t. 1120 * 1121 * @param pkgVersion an unsigned int, the SBML Render Version to assign to this 1122 * GraphicalPrimitive1D_t. 1123 * 1124 * @copydetails doc_note_setting_lv_pkg 1125 * 1126 * @copydetails doc_warning_returns_owned_pointer 1127 * 1128 * @memberof GraphicalPrimitive1D_t 1129 */ 1130 LIBSBML_EXTERN 1131 GraphicalPrimitive1D_t * 1132 GraphicalPrimitive1D_createText(unsigned int level, 1133 unsigned int version, 1134 unsigned int pkgVersion); 1135 1136 1137 /** 1138 * Creates a new RenderCurve (GraphicalPrimitive1D_t) using the given SBML Level, 1139 * Version and “render” package version. 1140 * 1141 * @param level an unsigned int, the SBML Level to assign to this 1142 * GraphicalPrimitive1D_t. 1143 * 1144 * @param version an unsigned int, the SBML Version to assign to this 1145 * GraphicalPrimitive1D_t. 1146 * 1147 * @param pkgVersion an unsigned int, the SBML Render Version to assign to this 1148 * GraphicalPrimitive1D_t. 1149 * 1150 * @copydetails doc_note_setting_lv_pkg 1151 * 1152 * @copydetails doc_warning_returns_owned_pointer 1153 * 1154 * @memberof GraphicalPrimitive1D_t 1155 */ 1156 LIBSBML_EXTERN 1157 GraphicalPrimitive1D_t * 1158 GraphicalPrimitive1D_createRenderCurve(unsigned int level, 1159 unsigned int version, 1160 unsigned int pkgVersion); 1161 1162 1163 /** 1164 * Creates and returns a deep copy of this GraphicalPrimitive1D_t object. 1165 * 1166 * @param gpd the GraphicalPrimitive1D_t structure. 1167 * 1168 * @return a (deep) copy of this GraphicalPrimitive1D_t object. 1169 * 1170 * @copydetails doc_warning_returns_owned_pointer 1171 * 1172 * @memberof GraphicalPrimitive1D_t 1173 */ 1174 LIBSBML_EXTERN 1175 GraphicalPrimitive1D_t* 1176 GraphicalPrimitive1D_clone(const GraphicalPrimitive1D_t* gpd); 1177 1178 1179 /** 1180 * Frees this GraphicalPrimitive1D_t object. 1181 * 1182 * @param gpd the GraphicalPrimitive1D_t structure. 1183 * 1184 * @memberof GraphicalPrimitive1D_t 1185 */ 1186 LIBSBML_EXTERN 1187 void 1188 GraphicalPrimitive1D_free(GraphicalPrimitive1D_t* gpd); 1189 1190 1191 /** 1192 * Returns the value of the "id" attribute of this GraphicalPrimitive1D_t. 1193 * 1194 * @param gpd the GraphicalPrimitive1D_t structure whose id is sought. 1195 * 1196 * @return the value of the "id" attribute of this GraphicalPrimitive1D_t as a 1197 * pointer to a string. 1198 * 1199 * @copydetails doc_warning_returns_owned_char 1200 * 1201 * @memberof GraphicalPrimitive1D_t 1202 */ 1203 LIBSBML_EXTERN 1204 char * 1205 GraphicalPrimitive1D_getId(const GraphicalPrimitive1D_t * gpd); 1206 1207 1208 /** 1209 * Returns the value of the "stroke" attribute of this GraphicalPrimitive1D_t. 1210 * 1211 * @param gpd the GraphicalPrimitive1D_t structure whose stroke is sought. 1212 * 1213 * @return the value of the "stroke" attribute of this GraphicalPrimitive1D_t 1214 * as a pointer to a string. 1215 * 1216 * @copydetails doc_warning_returns_owned_char 1217 * 1218 * @memberof GraphicalPrimitive1D_t 1219 */ 1220 LIBSBML_EXTERN 1221 char * 1222 GraphicalPrimitive1D_getStroke(const GraphicalPrimitive1D_t * gpd); 1223 1224 1225 /** 1226 * Returns the value of the "stroke-width" attribute of this 1227 * GraphicalPrimitive1D_t. 1228 * 1229 * @param gpd the GraphicalPrimitive1D_t structure whose stroke-width is 1230 * sought. 1231 * 1232 * @return the value of the "stroke-width" attribute of this 1233 * GraphicalPrimitive1D_t as a double. 1234 * 1235 * @memberof GraphicalPrimitive1D_t 1236 */ 1237 LIBSBML_EXTERN 1238 double 1239 GraphicalPrimitive1D_getStrokeWidth(const GraphicalPrimitive1D_t * gpd); 1240 1241 1242 /** 1243 * Predicate returning @c 1 (true) if this GraphicalPrimitive1D_t's "id" 1244 * attribute is set. 1245 * 1246 * @param gpd the GraphicalPrimitive1D_t structure. 1247 * 1248 * @return @c 1 (true) if this GraphicalPrimitive1D_t's "id" attribute has been 1249 * set, otherwise @c 0 (false) is returned. 1250 * 1251 * @memberof GraphicalPrimitive1D_t 1252 */ 1253 LIBSBML_EXTERN 1254 int 1255 GraphicalPrimitive1D_isSetId(const GraphicalPrimitive1D_t * gpd); 1256 1257 1258 /** 1259 * Predicate returning @c 1 (true) if this GraphicalPrimitive1D_t's "stroke" 1260 * attribute is set. 1261 * 1262 * @param gpd the GraphicalPrimitive1D_t structure. 1263 * 1264 * @return @c 1 (true) if this GraphicalPrimitive1D_t's "stroke" attribute has 1265 * been set, otherwise @c 0 (false) is returned. 1266 * 1267 * @memberof GraphicalPrimitive1D_t 1268 */ 1269 LIBSBML_EXTERN 1270 int 1271 GraphicalPrimitive1D_isSetStroke(const GraphicalPrimitive1D_t * gpd); 1272 1273 1274 /** 1275 * Predicate returning @c 1 (true) if this GraphicalPrimitive1D_t's 1276 * "stroke-width" attribute is set. 1277 * 1278 * @param gpd the GraphicalPrimitive1D_t structure. 1279 * 1280 * @return @c 1 (true) if this GraphicalPrimitive1D_t's "stroke-width" 1281 * attribute has been set, otherwise @c 0 (false) is returned. 1282 * 1283 * @memberof GraphicalPrimitive1D_t 1284 */ 1285 LIBSBML_EXTERN 1286 int 1287 GraphicalPrimitive1D_isSetStrokeWidth(const GraphicalPrimitive1D_t * gpd); 1288 1289 1290 /** 1291 * Predicate returning @c 1 (true) if this GraphicalPrimitive1D_t's 1292 * "stroke-dasharray" attribute is set. 1293 * 1294 * @param gpd the GraphicalPrimitive1D_t structure. 1295 * 1296 * @return @c 1 (true) if this GraphicalPrimitive1D_t's "stroke-dasharray" 1297 * attribute has been set, otherwise @c 0 (false) is returned. 1298 * 1299 * @memberof GraphicalPrimitive1D_t 1300 */ 1301 LIBSBML_EXTERN 1302 int 1303 GraphicalPrimitive1D_isSetStrokeDashArray(const GraphicalPrimitive1D_t * gpd); 1304 1305 1306 /** 1307 * Sets the value of the "id" attribute of this GraphicalPrimitive1D_t. 1308 * 1309 * @param gpd the GraphicalPrimitive1D_t structure. 1310 * 1311 * @param id const char * value of the "id" attribute to be set. 1312 * 1313 * @copydetails doc_returns_success_code 1314 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1315 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1316 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1317 * 1318 * Calling this function with @p id = @c NULL or an empty string is equivalent 1319 * to calling GraphicalPrimitive1D_unsetId(). 1320 * 1321 * @memberof GraphicalPrimitive1D_t 1322 */ 1323 LIBSBML_EXTERN 1324 int 1325 GraphicalPrimitive1D_setId(GraphicalPrimitive1D_t * gpd, const char * id); 1326 1327 1328 /** 1329 * Sets the value of the "stroke" attribute of this GraphicalPrimitive1D_t. 1330 * 1331 * @param gpd the GraphicalPrimitive1D_t structure. 1332 * 1333 * @param stroke const char * value of the "stroke" attribute to be set. 1334 * 1335 * @copydetails doc_returns_success_code 1336 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1337 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1338 * 1339 * Calling this function with @p stroke = @c NULL or an empty string is 1340 * equivalent to calling GraphicalPrimitive1D_unsetStroke(). 1341 * 1342 * @memberof GraphicalPrimitive1D_t 1343 */ 1344 LIBSBML_EXTERN 1345 int 1346 GraphicalPrimitive1D_setStroke(GraphicalPrimitive1D_t * gpd, 1347 const char * stroke); 1348 1349 1350 /** 1351 * Sets the value of the "stroke-width" attribute of this 1352 * GraphicalPrimitive1D_t. 1353 * 1354 * @param gpd the GraphicalPrimitive1D_t structure. 1355 * 1356 * @param strokeWidth double value of the "stroke-width" attribute to be set. 1357 * 1358 * @copydetails doc_returns_success_code 1359 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1360 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1361 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1362 * 1363 * @memberof GraphicalPrimitive1D_t 1364 */ 1365 LIBSBML_EXTERN 1366 int 1367 GraphicalPrimitive1D_setStrokeWidth(GraphicalPrimitive1D_t * gpd, 1368 double strokeWidth); 1369 1370 1371 /** 1372 * Sets the value of the "stroke-dasharray" attribute of this 1373 * GraphicalPrimitive1D_t. 1374 * 1375 * @param gpd the GraphicalPrimitive1D_t structure. 1376 * 1377 * @param strokeDash pointer value of the "stroke-dasharray" attribute to 1378 * be set. 1379 * 1380 * @copydetails doc_returns_success_code 1381 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1382 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1383 * 1384 * @memberof GraphicalPrimitive1D_t 1385 */ 1386 LIBSBML_EXTERN 1387 int 1388 GraphicalPrimitive1D_setStrokeDashArray(GraphicalPrimitive1D_t* gpd, 1389 const char* strokeDash); 1390 1391 1392 /** 1393 * Unsets the value of the "id" attribute of this GraphicalPrimitive1D_t. 1394 * 1395 * @param gpd the GraphicalPrimitive1D_t structure. 1396 * 1397 * @copydetails doc_returns_success_code 1398 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1399 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1400 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1401 * 1402 * @memberof GraphicalPrimitive1D_t 1403 */ 1404 LIBSBML_EXTERN 1405 int 1406 GraphicalPrimitive1D_unsetId(GraphicalPrimitive1D_t * gpd); 1407 1408 1409 /** 1410 * Unsets the value of the "stroke" attribute of this GraphicalPrimitive1D_t. 1411 * 1412 * @param gpd the GraphicalPrimitive1D_t structure. 1413 * 1414 * @copydetails doc_returns_success_code 1415 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1416 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1417 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1418 * 1419 * @memberof GraphicalPrimitive1D_t 1420 */ 1421 LIBSBML_EXTERN 1422 int 1423 GraphicalPrimitive1D_unsetStroke(GraphicalPrimitive1D_t * gpd); 1424 1425 1426 /** 1427 * Unsets the value of the "stroke-width" attribute of this 1428 * GraphicalPrimitive1D_t. 1429 * 1430 * @param gpd the GraphicalPrimitive1D_t structure. 1431 * 1432 * @copydetails doc_returns_success_code 1433 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1434 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1435 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1436 * 1437 * @memberof GraphicalPrimitive1D_t 1438 */ 1439 LIBSBML_EXTERN 1440 int 1441 GraphicalPrimitive1D_unsetStrokeWidth(GraphicalPrimitive1D_t * gpd); 1442 1443 1444 /** 1445 * Unsets the value of the "stroke-dasharray" attribute of this 1446 * GraphicalPrimitive1D_t. 1447 * 1448 * @param gpd the GraphicalPrimitive1D_t structure. 1449 * 1450 * @copydetails doc_returns_success_code 1451 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1452 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1453 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1454 * 1455 * @memberof GraphicalPrimitive1D_t 1456 */ 1457 LIBSBML_EXTERN 1458 int 1459 GraphicalPrimitive1D_unsetStrokeDashArray(GraphicalPrimitive1D_t * gpd); 1460 1461 1462 /** 1463 * Predicate returning @c 1 if this GraphicalPrimitive1D_t is of type Ellipse_t 1464 * 1465 * @param gpd the GraphicalPrimitive1D_t structure. 1466 * 1467 * @return @c 1 if this GraphicalPrimitive1D_t is of type Ellipse_t, @c 0 1468 * otherwise 1469 * 1470 * @memberof GraphicalPrimitive1D_t 1471 */ 1472 LIBSBML_EXTERN 1473 int 1474 GraphicalPrimitive1D_isEllipse(const GraphicalPrimitive1D_t * gpd); 1475 1476 1477 /** 1478 * Predicate returning @c 1 if this GraphicalPrimitive1D_t is of type 1479 * Rectangle_t 1480 * 1481 * @param gpd the GraphicalPrimitive1D_t structure. 1482 * 1483 * @return @c 1 if this GraphicalPrimitive1D_t is of type Rectangle_t, @c 0 1484 * otherwise 1485 * 1486 * @memberof GraphicalPrimitive1D_t 1487 */ 1488 LIBSBML_EXTERN 1489 int 1490 GraphicalPrimitive1D_isRectangle(const GraphicalPrimitive1D_t * gpd); 1491 1492 1493 /** 1494 * Predicate returning @c 1 if this GraphicalPrimitive1D_t is of type Polygon_t 1495 * 1496 * @param gpd the GraphicalPrimitive1D_t structure. 1497 * 1498 * @return @c 1 if this GraphicalPrimitive1D_t is of type Polygon_t, @c 0 1499 * otherwise 1500 * 1501 * @memberof GraphicalPrimitive1D_t 1502 */ 1503 LIBSBML_EXTERN 1504 int 1505 GraphicalPrimitive1D_isPolygon(const GraphicalPrimitive1D_t * gpd); 1506 1507 1508 /** 1509 * Predicate returning @c 1 if this GraphicalPrimitive1D_t is of type 1510 * RenderGroup_t 1511 * 1512 * @param gpd the GraphicalPrimitive1D_t structure. 1513 * 1514 * @return @c 1 if this GraphicalPrimitive1D_t is of type RenderGroup_t, @c 0 1515 * otherwise 1516 * 1517 * @memberof GraphicalPrimitive1D_t 1518 */ 1519 LIBSBML_EXTERN 1520 int 1521 GraphicalPrimitive1D_isRenderGroup(const GraphicalPrimitive1D_t * gpd); 1522 1523 1524 /** 1525 * Predicate returning @c 1 if this GraphicalPrimitive1D_t is of type 1526 * LineEnding_t 1527 * 1528 * @param gpd the GraphicalPrimitive1D_t structure. 1529 * 1530 * @return @c 1 if this GraphicalPrimitive1D_t is of type LineEnding_t, @c 0 1531 * otherwise 1532 * 1533 * @memberof GraphicalPrimitive1D_t 1534 */ 1535 LIBSBML_EXTERN 1536 int 1537 GraphicalPrimitive1D_isLineEnding(const GraphicalPrimitive1D_t * gpd); 1538 1539 1540 /** 1541 * Predicate returning @c 1 if this GraphicalPrimitive1D_t is of type Text_t 1542 * 1543 * @param gpd the GraphicalPrimitive1D_t structure. 1544 * 1545 * @return @c 1 if this GraphicalPrimitive1D_t is of type Text_t, @c 0 1546 * otherwise 1547 * 1548 * @memberof GraphicalPrimitive1D_t 1549 */ 1550 LIBSBML_EXTERN 1551 int 1552 GraphicalPrimitive1D_isText(const GraphicalPrimitive1D_t * gpd); 1553 1554 1555 /** 1556 * Predicate returning @c 1 if this GraphicalPrimitive1D_t is of type 1557 * RenderCurve_t 1558 * 1559 * @param gpd the GraphicalPrimitive1D_t structure. 1560 * 1561 * @return @c 1 if this GraphicalPrimitive1D_t is of type RenderCurve_t, @c 0 1562 * otherwise 1563 * 1564 * @memberof GraphicalPrimitive1D_t 1565 */ 1566 LIBSBML_EXTERN 1567 int 1568 GraphicalPrimitive1D_isRenderCurve(const GraphicalPrimitive1D_t * gpd); 1569 1570 1571 /** 1572 * Predicate returning @c 1 (true) if all the required attributes for this 1573 * GraphicalPrimitive1D_t object have been set. 1574 * 1575 * @param gpd the GraphicalPrimitive1D_t structure. 1576 * 1577 * @return @c 1 (true) to indicate that all the required attributes of this 1578 * GraphicalPrimitive1D_t have been set, otherwise @c 0 (false) is returned. 1579 * 1580 * @memberof GraphicalPrimitive1D_t 1581 */ 1582 LIBSBML_EXTERN 1583 int 1584 GraphicalPrimitive1D_hasRequiredAttributes(const GraphicalPrimitive1D_t * gpd); 1585 1586 1587 1588 1589 END_C_DECLS 1590 1591 1592 1593 1594 LIBSBML_CPP_NAMESPACE_END 1595 1596 1597 1598 1599 #endif /* !SWIG */ 1600 1601 1602 1603 1604 #endif /* !GraphicalPrimitive1D_H__ */ 1605 1606 1607