1 /** 2 * @file CSGObject.h 3 * @brief Definition of the CSGObject class. 4 * @author SBMLTeam 5 * 6 * <!-------------------------------------------------------------------------- 7 * This file is part of libSBML. Please visit http://sbml.org for more 8 * information about SBML, and the latest version of libSBML. 9 * 10 * Copyright (C) 2020 jointly by the following organizations: 11 * 1. California Institute of Technology, Pasadena, CA, USA 12 * 2. University of Heidelberg, Heidelberg, Germany 13 * 3. University College London, London, UK 14 * 15 * Copyright (C) 2019 jointly by the following organizations: 16 * 1. California Institute of Technology, Pasadena, CA, USA 17 * 2. University of Heidelberg, Heidelberg, Germany 18 * 19 * Copyright (C) 2013-2018 jointly by the following organizations: 20 * 1. California Institute of Technology, Pasadena, CA, USA 21 * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK 22 * 3. University of Heidelberg, Heidelberg, Germany 23 * 24 * Copyright (C) 2009-2013 jointly by the following organizations: 25 * 1. California Institute of Technology, Pasadena, CA, USA 26 * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK 27 * 28 * Copyright (C) 2006-2008 by the California Institute of Technology, 29 * Pasadena, CA, USA 30 * 31 * Copyright (C) 2002-2005 jointly by the following organizations: 32 * 1. California Institute of Technology, Pasadena, CA, USA 33 * 2. Japan Science and Technology Agency, Japan 34 * 35 * This library is free software; you can redistribute it and/or modify it 36 * under the terms of the GNU Lesser General Public License as published by the 37 * Free Software Foundation. A copy of the license agreement is provided in the 38 * file named "LICENSE.txt" included with this software distribution and also 39 * available online as http://sbml.org/software/libsbml/license.html 40 * ------------------------------------------------------------------------ --> 41 * 42 * @class CSGObject 43 * @sbmlbrief{spatial} TODO:Definition of the CSGObject class. 44 */ 45 46 47 #ifndef CSGObject_H__ 48 #define CSGObject_H__ 49 50 51 #include <sbml/common/extern.h> 52 #include <sbml/common/sbmlfwd.h> 53 #include <sbml/packages/spatial/common/spatialfwd.h> 54 55 56 #ifdef __cplusplus 57 58 59 #include <string> 60 61 62 #include <sbml/SBase.h> 63 #include <sbml/packages/spatial/extension/SpatialExtension.h> 64 #include <sbml/packages/spatial/sbml/CSGNode.h> 65 66 67 LIBSBML_CPP_NAMESPACE_BEGIN 68 69 70 class LIBSBML_EXTERN CSGObject : public SBase 71 { 72 protected: 73 74 /** @cond doxygenLibsbmlInternal */ 75 76 std::string mDomainType; 77 int mOrdinal; 78 bool mIsSetOrdinal; 79 CSGNode* mCSGNode; 80 81 /** @endcond */ 82 83 public: 84 85 /** 86 * Creates a new CSGObject using the given SBML Level, Version and 87 * “spatial” package version. 88 * 89 * @param level an unsigned int, the SBML Level to assign to this CSGObject. 90 * 91 * @param version an unsigned int, the SBML Version to assign to this 92 * CSGObject. 93 * 94 * @param pkgVersion an unsigned int, the SBML Spatial Version to assign to 95 * this CSGObject. 96 * 97 * @copydetails doc_note_setting_lv_pkg 98 */ 99 CSGObject(unsigned int level = SpatialExtension::getDefaultLevel(), 100 unsigned int version = SpatialExtension::getDefaultVersion(), 101 unsigned int pkgVersion = 102 SpatialExtension::getDefaultPackageVersion()); 103 104 105 /** 106 * Creates a new CSGObject using the given SpatialPkgNamespaces object. 107 * 108 * @copydetails doc_what_are_sbml_package_namespaces 109 * 110 * @param spatialns the SpatialPkgNamespaces object. 111 * 112 * @copydetails doc_note_setting_lv_pkg 113 */ 114 CSGObject(SpatialPkgNamespaces *spatialns); 115 116 117 /** 118 * Copy constructor for CSGObject. 119 * 120 * @param orig the CSGObject instance to copy. 121 */ 122 CSGObject(const CSGObject& orig); 123 124 125 /** 126 * Assignment operator for CSGObject. 127 * 128 * @param rhs the CSGObject object whose values are to be used as the basis 129 * of the assignment. 130 */ 131 CSGObject& operator=(const CSGObject& rhs); 132 133 134 /** 135 * Creates and returns a deep copy of this CSGObject object. 136 * 137 * @return a (deep) copy of this CSGObject object. 138 */ 139 virtual CSGObject* clone() const; 140 141 142 /** 143 * Destructor for CSGObject. 144 */ 145 virtual ~CSGObject(); 146 147 148 /** 149 * Returns the value of the "id" attribute of this CSGObject. 150 * 151 * @return the value of the "id" attribute of this CSGObject as a string. 152 */ 153 virtual const std::string& getId() const; 154 155 156 /** 157 * Returns the value of the "name" attribute of this CSGObject. 158 * 159 * @return the value of the "name" attribute of this CSGObject as a string. 160 */ 161 virtual const std::string& getName() const; 162 163 164 /** 165 * Returns the value of the "domainType" attribute of this CSGObject. 166 * 167 * @return the value of the "domainType" attribute of this CSGObject as a 168 * string. 169 */ 170 const std::string& getDomainType() const; 171 172 173 /** 174 * Returns the value of the "ordinal" attribute of this CSGObject. 175 * 176 * @return the value of the "ordinal" attribute of this CSGObject as a 177 * integer. 178 */ 179 int getOrdinal() const; 180 181 182 /** 183 * Predicate returning @c true if this CSGObject's "id" attribute is set. 184 * 185 * @return @c true if this CSGObject's "id" attribute has been set, otherwise 186 * @c false is returned. 187 */ 188 virtual bool isSetId() const; 189 190 191 /** 192 * Predicate returning @c true if this CSGObject's "name" attribute is set. 193 * 194 * @return @c true if this CSGObject's "name" attribute has been set, 195 * otherwise @c false is returned. 196 */ 197 virtual bool isSetName() const; 198 199 200 /** 201 * Predicate returning @c true if this CSGObject's "domainType" attribute is 202 * set. 203 * 204 * @return @c true if this CSGObject's "domainType" attribute has been set, 205 * otherwise @c false is returned. 206 */ 207 bool isSetDomainType() const; 208 209 210 /** 211 * Predicate returning @c true if this CSGObject's "ordinal" attribute is 212 * set. 213 * 214 * @return @c true if this CSGObject's "ordinal" attribute has been set, 215 * otherwise @c false is returned. 216 */ 217 bool isSetOrdinal() const; 218 219 220 /** 221 * Sets the value of the "id" attribute of this CSGObject. 222 * 223 * @param id std::string& value of the "id" attribute to be set. 224 * 225 * @copydetails doc_returns_success_code 226 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 227 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, 228 * OperationReturnValues_t} 229 * 230 * Calling this function with @p id = @c NULL or an empty string is 231 * equivalent to calling unsetId(). 232 */ 233 virtual int setId(const std::string& id); 234 235 236 /** 237 * Sets the value of the "name" attribute of this CSGObject. 238 * 239 * @param name std::string& value of the "name" attribute to be set. 240 * 241 * @copydetails doc_returns_one_success_code 242 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 243 * 244 * Calling this function with @p name = @c NULL or an empty string is 245 * equivalent to calling unsetName(). 246 */ 247 virtual int setName(const std::string& name); 248 249 250 /** 251 * Sets the value of the "domainType" attribute of this CSGObject. 252 * 253 * @param domainType std::string& value of the "domainType" attribute to be 254 * set. 255 * 256 * @copydetails doc_returns_success_code 257 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 258 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, 259 * OperationReturnValues_t} 260 */ 261 int setDomainType(const std::string& domainType); 262 263 264 /** 265 * Sets the value of the "ordinal" attribute of this CSGObject. 266 * 267 * @param ordinal int value of the "ordinal" attribute to be set. 268 * 269 * @copydetails doc_returns_success_code 270 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 271 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, 272 * OperationReturnValues_t} 273 */ 274 int setOrdinal(int ordinal); 275 276 277 /** 278 * Unsets the value of the "id" attribute of this CSGObject. 279 * 280 * @copydetails doc_returns_success_code 281 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 282 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 283 */ 284 virtual int unsetId(); 285 286 287 /** 288 * Unsets the value of the "name" attribute of this CSGObject. 289 * 290 * @copydetails doc_returns_success_code 291 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 292 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 293 */ 294 virtual int unsetName(); 295 296 297 /** 298 * Unsets the value of the "domainType" attribute of this CSGObject. 299 * 300 * @copydetails doc_returns_success_code 301 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 302 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 303 */ 304 int unsetDomainType(); 305 306 307 /** 308 * Unsets the value of the "ordinal" attribute of this CSGObject. 309 * 310 * @copydetails doc_returns_success_code 311 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 312 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 313 */ 314 int unsetOrdinal(); 315 316 317 /** 318 * Returns the value of the "csgNode" element of this CSGObject. 319 * 320 * @return the value of the "csgNode" element of this CSGObject as a 321 * CSGNode*. 322 */ 323 const CSGNode* getCSGNode() const; 324 325 326 /** 327 * Returns the value of the "csgNode" element of this CSGObject. 328 * 329 * @return the value of the "csgNode" element of this CSGObject as a 330 * CSGNode*. 331 */ 332 CSGNode* getCSGNode(); 333 334 335 /** 336 * Predicate returning @c true if this CSGObject's "csgNode" element is set. 337 * 338 * @return @c true if this CSGObject's "csgNode" element has been set, 339 * otherwise @c false is returned. 340 */ 341 bool isSetCSGNode() const; 342 343 344 /** 345 * Sets the value of the "csgNode" element of this CSGObject. 346 * 347 * @param csgNode CSGNode* value of the "csgNode" element to be set. 348 * 349 * @copydetails doc_returns_success_code 350 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 351 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, 352 * OperationReturnValues_t} 353 */ 354 int setCSGNode(const CSGNode* csgNode); 355 356 357 /** 358 * Creates a new CSGPrimitive object, adds it to this CSGObject object and 359 * returns the CSGPrimitive object created. 360 * 361 * @return a new CSGPrimitive object instance. 362 */ 363 CSGPrimitive* createCSGPrimitive(); 364 365 366 /** 367 * Creates a new CSGTranslation object, adds it to this CSGObject object and 368 * returns the CSGTranslation object created. 369 * 370 * @return a new CSGTranslation object instance. 371 */ 372 CSGTranslation* createCSGTranslation(); 373 374 375 /** 376 * Creates a new CSGRotation object, adds it to this CSGObject object and 377 * returns the CSGRotation object created. 378 * 379 * @return a new CSGRotation object instance. 380 */ 381 CSGRotation* createCSGRotation(); 382 383 384 /** 385 * Creates a new CSGScale object, adds it to this CSGObject object and 386 * returns the CSGScale object created. 387 * 388 * @return a new CSGScale object instance. 389 */ 390 CSGScale* createCSGScale(); 391 392 393 /** 394 * Creates a new CSGHomogeneousTransformation object, adds it to this 395 * CSGObject object and returns the CSGHomogeneousTransformation object 396 * created. 397 * 398 * @return a new CSGHomogeneousTransformation object instance. 399 */ 400 CSGHomogeneousTransformation* createCSGHomogeneousTransformation(); 401 402 403 /** 404 * Creates a new CSGSetOperator object, adds it to this CSGObject object and 405 * returns the CSGSetOperator object created. 406 * 407 * @return a new CSGSetOperator object instance. 408 */ 409 CSGSetOperator* createCSGSetOperator(); 410 411 412 /** 413 * Unsets the value of the "csgNode" element of this CSGObject. 414 * 415 * @copydetails doc_returns_success_code 416 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 417 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 418 */ 419 int unsetCSGNode(); 420 421 422 /** 423 * @copydoc doc_renamesidref_common 424 */ 425 virtual void renameSIdRefs(const std::string& oldid, 426 const std::string& newid); 427 428 429 /** 430 * Returns the XML element name of this CSGObject object. 431 * 432 * For CSGObject, the XML element name is always @c "csgObject". 433 * 434 * @return the name of this element, i.e. @c "csgObject". 435 */ 436 virtual const std::string& getElementName() const; 437 438 439 /** 440 * Returns the libSBML type code for this CSGObject object. 441 * 442 * @copydetails doc_what_are_typecodes 443 * 444 * @return the SBML type code for this object: 445 * @sbmlconstant{SBML_SPATIAL_CSGOBJECT, SBMLSpatialTypeCode_t}. 446 * 447 * @copydetails doc_warning_typecodes_not_unique 448 * 449 * @see getElementName() 450 * @see getPackageName() 451 */ 452 virtual int getTypeCode() const; 453 454 455 /** 456 * Predicate returning @c true if all the required attributes for this 457 * CSGObject object have been set. 458 * 459 * @return @c true to indicate that all the required attributes of this 460 * CSGObject have been set, otherwise @c false is returned. 461 * 462 * 463 * @note The required attributes for the CSGObject object are: 464 * @li "id" 465 * @li "domainType" 466 */ 467 virtual bool hasRequiredAttributes() const; 468 469 470 /** 471 * Predicate returning @c true if all the required elements for this 472 * CSGObject object have been set. 473 * 474 * @return @c true to indicate that all the required elements of this 475 * CSGObject have been set, otherwise @c false is returned. 476 * 477 * 478 * @note The required elements for the CSGObject object are: 479 * @li "csgNode" 480 */ 481 virtual bool hasRequiredElements() const; 482 483 484 485 /** @cond doxygenLibsbmlInternal */ 486 487 /** 488 * Write any contained elements 489 */ 490 virtual void writeElements(XMLOutputStream& stream) const; 491 492 /** @endcond */ 493 494 495 496 /** @cond doxygenLibsbmlInternal */ 497 498 /** 499 * Accepts the given SBMLVisitor 500 */ 501 virtual bool accept(SBMLVisitor& v) const; 502 503 /** @endcond */ 504 505 506 507 /** @cond doxygenLibsbmlInternal */ 508 509 /** 510 * Sets the parent SBMLDocument 511 */ 512 virtual void setSBMLDocument(SBMLDocument* d); 513 514 /** @endcond */ 515 516 517 518 /** @cond doxygenLibsbmlInternal */ 519 520 /** 521 * Connects to child elements 522 */ 523 virtual void connectToChild(); 524 525 /** @endcond */ 526 527 528 529 /** @cond doxygenLibsbmlInternal */ 530 531 /** 532 * Enables/disables the given package with this element 533 */ 534 virtual void enablePackageInternal(const std::string& pkgURI, 535 const std::string& pkgPrefix, 536 bool flag); 537 538 /** @endcond */ 539 540 541 542 /** @cond doxygenLibsbmlInternal */ 543 544 /** 545 * Updates the namespaces when setLevelVersion is used 546 */ 547 virtual void updateSBMLNamespace(const std::string& package, 548 unsigned int level, 549 unsigned int version); 550 551 /** @endcond */ 552 553 554 555 556 #ifndef SWIG 557 558 559 560 /** @cond doxygenLibsbmlInternal */ 561 562 /** 563 * Gets the value of the "attributeName" attribute of this CSGObject. 564 * 565 * @param attributeName, the name of the attribute to retrieve. 566 * 567 * @param value, the address of the value to record. 568 * 569 * @copydetails doc_returns_success_code 570 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 571 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 572 */ 573 virtual int getAttribute(const std::string& attributeName, bool& value) 574 const; 575 576 /** @endcond */ 577 578 579 580 /** @cond doxygenLibsbmlInternal */ 581 582 /** 583 * Gets the value of the "attributeName" attribute of this CSGObject. 584 * 585 * @param attributeName, the name of the attribute to retrieve. 586 * 587 * @param value, the address of the value to record. 588 * 589 * @copydetails doc_returns_success_code 590 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 591 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 592 */ 593 virtual int getAttribute(const std::string& attributeName, int& value) const; 594 595 /** @endcond */ 596 597 598 599 /** @cond doxygenLibsbmlInternal */ 600 601 /** 602 * Gets the value of the "attributeName" attribute of this CSGObject. 603 * 604 * @param attributeName, the name of the attribute to retrieve. 605 * 606 * @param value, the address of the value to record. 607 * 608 * @copydetails doc_returns_success_code 609 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 610 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 611 */ 612 virtual int getAttribute(const std::string& attributeName, 613 double& value) const; 614 615 /** @endcond */ 616 617 618 619 /** @cond doxygenLibsbmlInternal */ 620 621 /** 622 * Gets the value of the "attributeName" attribute of this CSGObject. 623 * 624 * @param attributeName, the name of the attribute to retrieve. 625 * 626 * @param value, the address of the value to record. 627 * 628 * @copydetails doc_returns_success_code 629 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 630 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 631 */ 632 virtual int getAttribute(const std::string& attributeName, 633 unsigned int& value) const; 634 635 /** @endcond */ 636 637 638 639 /** @cond doxygenLibsbmlInternal */ 640 641 /** 642 * Gets the value of the "attributeName" attribute of this CSGObject. 643 * 644 * @param attributeName, the name of the attribute to retrieve. 645 * 646 * @param value, the address of the value to record. 647 * 648 * @copydetails doc_returns_success_code 649 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 650 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 651 */ 652 virtual int getAttribute(const std::string& attributeName, 653 std::string& value) const; 654 655 /** @endcond */ 656 657 658 659 /** @cond doxygenLibsbmlInternal */ 660 661 /** 662 * Predicate returning @c true if this CSGObject's attribute "attributeName" 663 * is set. 664 * 665 * @param attributeName, the name of the attribute to query. 666 * 667 * @return @c true if this CSGObject's attribute "attributeName" has been 668 * set, otherwise @c false is returned. 669 */ 670 virtual bool isSetAttribute(const std::string& attributeName) const; 671 672 /** @endcond */ 673 674 675 676 /** @cond doxygenLibsbmlInternal */ 677 678 /** 679 * Sets the value of the "attributeName" attribute of this CSGObject. 680 * 681 * @param attributeName, the name of the attribute to set. 682 * 683 * @param value, the value of the attribute to set. 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 setAttribute(const std::string& attributeName, bool value); 690 691 /** @endcond */ 692 693 694 695 /** @cond doxygenLibsbmlInternal */ 696 697 /** 698 * Sets the value of the "attributeName" attribute of this CSGObject. 699 * 700 * @param attributeName, the name of the attribute to set. 701 * 702 * @param value, the value of the attribute to set. 703 * 704 * @copydetails doc_returns_success_code 705 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 706 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 707 */ 708 virtual int setAttribute(const std::string& attributeName, int value); 709 710 /** @endcond */ 711 712 713 714 /** @cond doxygenLibsbmlInternal */ 715 716 /** 717 * Sets the value of the "attributeName" attribute of this CSGObject. 718 * 719 * @param attributeName, the name of the attribute to set. 720 * 721 * @param value, the value of the attribute to set. 722 * 723 * @copydetails doc_returns_success_code 724 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 725 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 726 */ 727 virtual int setAttribute(const std::string& attributeName, double value); 728 729 /** @endcond */ 730 731 732 733 /** @cond doxygenLibsbmlInternal */ 734 735 /** 736 * Sets the value of the "attributeName" attribute of this CSGObject. 737 * 738 * @param attributeName, the name of the attribute to set. 739 * 740 * @param value, the value of the attribute to set. 741 * 742 * @copydetails doc_returns_success_code 743 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 744 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 745 */ 746 virtual int setAttribute(const std::string& attributeName, 747 unsigned int value); 748 749 /** @endcond */ 750 751 752 753 /** @cond doxygenLibsbmlInternal */ 754 755 /** 756 * Sets the value of the "attributeName" attribute of this CSGObject. 757 * 758 * @param attributeName, the name of the attribute to set. 759 * 760 * @param value, the value of the attribute to set. 761 * 762 * @copydetails doc_returns_success_code 763 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 764 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 765 */ 766 virtual int setAttribute(const std::string& attributeName, 767 const std::string& value); 768 769 /** @endcond */ 770 771 772 773 /** @cond doxygenLibsbmlInternal */ 774 775 /** 776 * Unsets the value of the "attributeName" attribute of this CSGObject. 777 * 778 * @param attributeName, the name of the attribute to query. 779 * 780 * @copydetails doc_returns_success_code 781 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 782 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 783 */ 784 virtual int unsetAttribute(const std::string& attributeName); 785 786 /** @endcond */ 787 788 789 790 /** @cond doxygenLibsbmlInternal */ 791 792 /** 793 * Creates and returns an new "elementName" object in this CSGObject. 794 * 795 * @param elementName, the name of the element to create. 796 * 797 * @return pointer to the element created. 798 */ 799 virtual SBase* createChildObject(const std::string& elementName); 800 801 /** @endcond */ 802 803 804 805 /** @cond doxygenLibsbmlInternal */ 806 807 /** 808 * Adds a new "elementName" object to this CSGObject. 809 * 810 * @param elementName, the name of the element to create. 811 * 812 * @param element, pointer to the element to be added. 813 * 814 * @copydetails doc_returns_success_code 815 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 816 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 817 */ 818 virtual int addChildObject(const std::string& elementName, 819 const SBase* element); 820 821 /** @endcond */ 822 823 824 825 /** @cond doxygenLibsbmlInternal */ 826 827 /** 828 * Removes and returns the new "elementName" object with the given id in this 829 * CSGObject. 830 * 831 * @param elementName, the name of the element to remove. 832 * 833 * @param id, the id of the element to remove. 834 * 835 * @return pointer to the element removed. 836 */ 837 virtual SBase* removeChildObject(const std::string& elementName, 838 const std::string& id); 839 840 /** @endcond */ 841 842 843 844 /** @cond doxygenLibsbmlInternal */ 845 846 /** 847 * Returns the number of "elementName" in this CSGObject. 848 * 849 * @param elementName, the name of the element to get number of. 850 * 851 * @return unsigned int number of elements. 852 */ 853 virtual unsigned int getNumObjects(const std::string& elementName); 854 855 /** @endcond */ 856 857 858 859 /** @cond doxygenLibsbmlInternal */ 860 861 /** 862 * Returns the nth object of "objectName" in this CSGObject. 863 * 864 * @param elementName, the name of the element to get number of. 865 * 866 * @param index, unsigned int the index of the object to retrieve. 867 * 868 * @return pointer to the object. 869 */ 870 virtual SBase* getObject(const std::string& elementName, unsigned int index); 871 872 /** @endcond */ 873 874 875 876 877 #endif /* !SWIG */ 878 879 880 /** 881 * Returns the first child element that has the given @p id in the model-wide 882 * SId namespace, or @c NULL if no such object is found. 883 * 884 * @param id a string representing the id attribute of the object to 885 * retrieve. 886 * 887 * @return a pointer to the SBase element with the given @p id. If no such 888 * object is found, this method returns @c NULL. 889 */ 890 virtual SBase* getElementBySId(const std::string& id); 891 892 893 /** 894 * Returns the first child element that has the given @p metaid, or @c NULL 895 * if no such object is found. 896 * 897 * @param metaid a string representing the metaid attribute of the object to 898 * retrieve. 899 * 900 * @return a pointer to the SBase element with the given @p metaid. If no 901 * such object is found this method returns @c NULL. 902 */ 903 virtual SBase* getElementByMetaId(const std::string& metaid); 904 905 906 /** 907 * Returns a List of all child SBase objects, including those nested to an 908 * arbitrary depth. 909 * 910 * @param filter an ElementFilter that may impose restrictions on the objects 911 * to be retrieved. 912 * 913 * @return a List pointer of pointers to all SBase child objects with any 914 * restriction imposed. 915 */ 916 virtual List* getAllElements(ElementFilter * filter = NULL); 917 918 919 protected: 920 921 922 /** @cond doxygenLibsbmlInternal */ 923 924 /** 925 * Creates a new object from the next XMLToken on the XMLInputStream 926 */ 927 virtual SBase* createObject(XMLInputStream& stream); 928 929 /** @endcond */ 930 931 932 933 /** @cond doxygenLibsbmlInternal */ 934 935 /** 936 * Adds the expected attributes for this element 937 */ 938 virtual void addExpectedAttributes(ExpectedAttributes& attributes); 939 940 /** @endcond */ 941 942 943 944 /** @cond doxygenLibsbmlInternal */ 945 946 /** 947 * Reads the expected attributes into the member data variables 948 */ 949 virtual void readAttributes(const XMLAttributes& attributes, 950 const ExpectedAttributes& expectedAttributes); 951 952 /** @endcond */ 953 954 955 956 /** @cond doxygenLibsbmlInternal */ 957 958 /** 959 * Writes the attributes to the stream 960 */ 961 virtual void writeAttributes(XMLOutputStream& stream) const; 962 963 /** @endcond */ 964 965 966 }; 967 968 969 970 LIBSBML_CPP_NAMESPACE_END 971 972 973 974 975 #endif /* __cplusplus */ 976 977 978 979 980 #ifndef SWIG 981 982 983 984 985 LIBSBML_CPP_NAMESPACE_BEGIN 986 987 988 989 990 BEGIN_C_DECLS 991 992 993 /** 994 * Creates a new CSGObject_t using the given SBML Level, Version and 995 * “spatial” package version. 996 * 997 * @param level an unsigned int, the SBML Level to assign to this CSGObject_t. 998 * 999 * @param version an unsigned int, the SBML Version to assign to this 1000 * CSGObject_t. 1001 * 1002 * @param pkgVersion an unsigned int, the SBML Spatial Version to assign to 1003 * this CSGObject_t. 1004 * 1005 * @copydetails doc_note_setting_lv_pkg 1006 * 1007 * @copydetails doc_returned_owned_pointer 1008 * 1009 * @memberof CSGObject_t 1010 */ 1011 LIBSBML_EXTERN 1012 CSGObject_t * 1013 CSGObject_create(unsigned int level, 1014 unsigned int version, 1015 unsigned int pkgVersion); 1016 1017 1018 /** 1019 * Creates and returns a deep copy of this CSGObject_t object. 1020 * 1021 * @param csgo the CSGObject_t structure. 1022 * 1023 * @return a (deep) copy of this CSGObject_t object. 1024 * 1025 * @copydetails doc_returned_owned_pointer 1026 * 1027 * @memberof CSGObject_t 1028 */ 1029 LIBSBML_EXTERN 1030 CSGObject_t* 1031 CSGObject_clone(const CSGObject_t* csgo); 1032 1033 1034 /** 1035 * Frees this CSGObject_t object. 1036 * 1037 * @param csgo the CSGObject_t structure. 1038 * 1039 * @memberof CSGObject_t 1040 */ 1041 LIBSBML_EXTERN 1042 void 1043 CSGObject_free(CSGObject_t* csgo); 1044 1045 1046 /** 1047 * Returns the value of the "id" attribute of this CSGObject_t. 1048 * 1049 * @param csgo the CSGObject_t structure whose id is sought. 1050 * 1051 * @return the value of the "id" attribute of this CSGObject_t as a pointer to 1052 * a string. 1053 * 1054 * @copydetails doc_returned_owned_char 1055 * 1056 * @memberof CSGObject_t 1057 */ 1058 LIBSBML_EXTERN 1059 char * 1060 CSGObject_getId(const CSGObject_t * csgo); 1061 1062 1063 /** 1064 * Returns the value of the "name" attribute of this CSGObject_t. 1065 * 1066 * @param csgo the CSGObject_t structure whose name is sought. 1067 * 1068 * @return the value of the "name" attribute of this CSGObject_t as a pointer 1069 * to a string. 1070 * 1071 * @copydetails doc_returned_owned_char 1072 * 1073 * @memberof CSGObject_t 1074 */ 1075 LIBSBML_EXTERN 1076 char * 1077 CSGObject_getName(const CSGObject_t * csgo); 1078 1079 1080 /** 1081 * Returns the value of the "domainType" attribute of this CSGObject_t. 1082 * 1083 * @param csgo the CSGObject_t structure whose domainType is sought. 1084 * 1085 * @return the value of the "domainType" attribute of this CSGObject_t as a 1086 * pointer to a string. 1087 * 1088 * @copydetails doc_returned_owned_char 1089 * 1090 * @memberof CSGObject_t 1091 */ 1092 LIBSBML_EXTERN 1093 char * 1094 CSGObject_getDomainType(const CSGObject_t * csgo); 1095 1096 1097 /** 1098 * Returns the value of the "ordinal" attribute of this CSGObject_t. 1099 * 1100 * @param csgo the CSGObject_t structure whose ordinal is sought. 1101 * 1102 * @return the value of the "ordinal" attribute of this CSGObject_t as a 1103 * integer. 1104 * 1105 * @memberof CSGObject_t 1106 */ 1107 LIBSBML_EXTERN 1108 int 1109 CSGObject_getOrdinal(const CSGObject_t * csgo); 1110 1111 1112 /** 1113 * Predicate returning @c 1 (true) if this CSGObject_t's "id" attribute is set. 1114 * 1115 * @param csgo the CSGObject_t structure. 1116 * 1117 * @return @c 1 (true) if this CSGObject_t's "id" attribute has been set, 1118 * otherwise @c 0 (false) is returned. 1119 * 1120 * @memberof CSGObject_t 1121 */ 1122 LIBSBML_EXTERN 1123 int 1124 CSGObject_isSetId(const CSGObject_t * csgo); 1125 1126 1127 /** 1128 * Predicate returning @c 1 (true) if this CSGObject_t's "name" attribute is 1129 * set. 1130 * 1131 * @param csgo the CSGObject_t structure. 1132 * 1133 * @return @c 1 (true) if this CSGObject_t's "name" attribute has been set, 1134 * otherwise @c 0 (false) is returned. 1135 * 1136 * @memberof CSGObject_t 1137 */ 1138 LIBSBML_EXTERN 1139 int 1140 CSGObject_isSetName(const CSGObject_t * csgo); 1141 1142 1143 /** 1144 * Predicate returning @c 1 (true) if this CSGObject_t's "domainType" attribute 1145 * is set. 1146 * 1147 * @param csgo the CSGObject_t structure. 1148 * 1149 * @return @c 1 (true) if this CSGObject_t's "domainType" attribute has been 1150 * set, otherwise @c 0 (false) is returned. 1151 * 1152 * @memberof CSGObject_t 1153 */ 1154 LIBSBML_EXTERN 1155 int 1156 CSGObject_isSetDomainType(const CSGObject_t * csgo); 1157 1158 1159 /** 1160 * Predicate returning @c 1 (true) if this CSGObject_t's "ordinal" attribute is 1161 * set. 1162 * 1163 * @param csgo the CSGObject_t structure. 1164 * 1165 * @return @c 1 (true) if this CSGObject_t's "ordinal" attribute has been set, 1166 * otherwise @c 0 (false) is returned. 1167 * 1168 * @memberof CSGObject_t 1169 */ 1170 LIBSBML_EXTERN 1171 int 1172 CSGObject_isSetOrdinal(const CSGObject_t * csgo); 1173 1174 1175 /** 1176 * Sets the value of the "id" attribute of this CSGObject_t. 1177 * 1178 * @param csgo the CSGObject_t structure. 1179 * 1180 * @param id const char * value of the "id" attribute to be set. 1181 * 1182 * @copydetails doc_returns_success_code 1183 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1184 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1185 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1186 * 1187 * Calling this function with @p id = @c NULL or an empty string is equivalent 1188 * to calling CSGObject_unsetId(). 1189 * 1190 * @memberof CSGObject_t 1191 */ 1192 LIBSBML_EXTERN 1193 int 1194 CSGObject_setId(CSGObject_t * csgo, const char * id); 1195 1196 1197 /** 1198 * Sets the value of the "name" attribute of this CSGObject_t. 1199 * 1200 * @param csgo the CSGObject_t structure. 1201 * 1202 * @param name const char * value of the "name" attribute to be set. 1203 * 1204 * @copydetails doc_returns_success_code 1205 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1206 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1207 * 1208 * Calling this function with @p name = @c NULL or an empty string is 1209 * equivalent to calling CSGObject_unsetName(). 1210 * 1211 * @memberof CSGObject_t 1212 */ 1213 LIBSBML_EXTERN 1214 int 1215 CSGObject_setName(CSGObject_t * csgo, const char * name); 1216 1217 1218 /** 1219 * Sets the value of the "domainType" attribute of this CSGObject_t. 1220 * 1221 * @param csgo the CSGObject_t structure. 1222 * 1223 * @param domainType const char * value of the "domainType" attribute to be 1224 * set. 1225 * 1226 * @copydetails doc_returns_success_code 1227 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1228 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1229 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1230 * 1231 * @memberof CSGObject_t 1232 */ 1233 LIBSBML_EXTERN 1234 int 1235 CSGObject_setDomainType(CSGObject_t * csgo, const char * domainType); 1236 1237 1238 /** 1239 * Sets the value of the "ordinal" attribute of this CSGObject_t. 1240 * 1241 * @param csgo the CSGObject_t structure. 1242 * 1243 * @param ordinal int value of the "ordinal" attribute to be set. 1244 * 1245 * @copydetails doc_returns_success_code 1246 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1247 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1248 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1249 * 1250 * @memberof CSGObject_t 1251 */ 1252 LIBSBML_EXTERN 1253 int 1254 CSGObject_setOrdinal(CSGObject_t * csgo, int ordinal); 1255 1256 1257 /** 1258 * Unsets the value of the "id" attribute of this CSGObject_t. 1259 * 1260 * @param csgo the CSGObject_t structure. 1261 * 1262 * @copydetails doc_returns_success_code 1263 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1264 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1265 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1266 * 1267 * @memberof CSGObject_t 1268 */ 1269 LIBSBML_EXTERN 1270 int 1271 CSGObject_unsetId(CSGObject_t * csgo); 1272 1273 1274 /** 1275 * Unsets the value of the "name" attribute of this CSGObject_t. 1276 * 1277 * @param csgo the CSGObject_t structure. 1278 * 1279 * @copydetails doc_returns_success_code 1280 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1281 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1282 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1283 * 1284 * @memberof CSGObject_t 1285 */ 1286 LIBSBML_EXTERN 1287 int 1288 CSGObject_unsetName(CSGObject_t * csgo); 1289 1290 1291 /** 1292 * Unsets the value of the "domainType" attribute of this CSGObject_t. 1293 * 1294 * @param csgo the CSGObject_t structure. 1295 * 1296 * @copydetails doc_returns_success_code 1297 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1298 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1299 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1300 * 1301 * @memberof CSGObject_t 1302 */ 1303 LIBSBML_EXTERN 1304 int 1305 CSGObject_unsetDomainType(CSGObject_t * csgo); 1306 1307 1308 /** 1309 * Unsets the value of the "ordinal" attribute of this CSGObject_t. 1310 * 1311 * @param csgo the CSGObject_t structure. 1312 * 1313 * @copydetails doc_returns_success_code 1314 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1315 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1316 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1317 * 1318 * @memberof CSGObject_t 1319 */ 1320 LIBSBML_EXTERN 1321 int 1322 CSGObject_unsetOrdinal(CSGObject_t * csgo); 1323 1324 1325 /** 1326 * Returns the value of the "csgNode" element of this CSGObject_t. 1327 * 1328 * @param csgo the CSGObject_t structure whose csgNode is sought. 1329 * 1330 * @return the value of the "csgNode" element of this CSGObject_t as a 1331 * CSGNode*. 1332 * 1333 * @memberof CSGObject_t 1334 */ 1335 LIBSBML_EXTERN 1336 const CSGNode_t* 1337 CSGObject_getCSGNode(const CSGObject_t * csgo); 1338 1339 1340 /** 1341 * Predicate returning @c 1 (true) if this CSGObject_t's "csgNode" element is 1342 * set. 1343 * 1344 * @param csgo the CSGObject_t structure. 1345 * 1346 * @return @c 1 (true) if this CSGObject_t's "csgNode" element has been set, 1347 * otherwise @c 0 (false) is returned. 1348 * 1349 * @memberof CSGObject_t 1350 */ 1351 LIBSBML_EXTERN 1352 int 1353 CSGObject_isSetCSGNode(const CSGObject_t * csgo); 1354 1355 1356 /** 1357 * Sets the value of the "csgNode" element of this CSGObject_t. 1358 * 1359 * @param csgo the CSGObject_t structure. 1360 * 1361 * @param csgNode CSGNode_t* value of the "csgNode" element to be set. 1362 * 1363 * @copydetails doc_returns_success_code 1364 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1365 * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t} 1366 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1367 * 1368 * @memberof CSGObject_t 1369 */ 1370 LIBSBML_EXTERN 1371 int 1372 CSGObject_setCSGNode(CSGObject_t * csgo, const CSGNode_t* csgNode); 1373 1374 1375 /** 1376 * Creates a new CSGPrimitive_t object, adds it to this CSGObject_t object and 1377 * returns the CSGPrimitive_t object created. 1378 * 1379 * @param csgo the CSGObject_t structure to which the CSGPrimitive_t should be 1380 * added. 1381 * 1382 * @return a new CSGPrimitive_t object instance. 1383 * 1384 * @memberof CSGObject_t 1385 */ 1386 LIBSBML_EXTERN 1387 CSGPrimitive_t* 1388 CSGObject_createCSGPrimitive(CSGObject_t* csgo); 1389 1390 1391 /** 1392 * Creates a new CSGTranslation_t object, adds it to this CSGObject_t object 1393 * and returns the CSGTranslation_t object created. 1394 * 1395 * @param csgo the CSGObject_t structure to which the CSGTranslation_t should 1396 * be added. 1397 * 1398 * @return a new CSGTranslation_t object instance. 1399 * 1400 * @memberof CSGObject_t 1401 */ 1402 LIBSBML_EXTERN 1403 CSGTranslation_t* 1404 CSGObject_createCSGTranslation(CSGObject_t* csgo); 1405 1406 1407 /** 1408 * Creates a new CSGRotation_t object, adds it to this CSGObject_t object and 1409 * returns the CSGRotation_t object created. 1410 * 1411 * @param csgo the CSGObject_t structure to which the CSGRotation_t should be 1412 * added. 1413 * 1414 * @return a new CSGRotation_t object instance. 1415 * 1416 * @memberof CSGObject_t 1417 */ 1418 LIBSBML_EXTERN 1419 CSGRotation_t* 1420 CSGObject_createCSGRotation(CSGObject_t* csgo); 1421 1422 1423 /** 1424 * Creates a new CSGScale_t object, adds it to this CSGObject_t object and 1425 * returns the CSGScale_t object created. 1426 * 1427 * @param csgo the CSGObject_t structure to which the CSGScale_t should be 1428 * added. 1429 * 1430 * @return a new CSGScale_t object instance. 1431 * 1432 * @memberof CSGObject_t 1433 */ 1434 LIBSBML_EXTERN 1435 CSGScale_t* 1436 CSGObject_createCSGScale(CSGObject_t* csgo); 1437 1438 1439 /** 1440 * Creates a new CSGHomogeneousTransformation_t object, adds it to this 1441 * CSGObject_t object and returns the CSGHomogeneousTransformation_t object 1442 * created. 1443 * 1444 * @param csgo the CSGObject_t structure to which the 1445 * CSGHomogeneousTransformation_t should be added. 1446 * 1447 * @return a new CSGHomogeneousTransformation_t object instance. 1448 * 1449 * @memberof CSGObject_t 1450 */ 1451 LIBSBML_EXTERN 1452 CSGHomogeneousTransformation_t* 1453 CSGObject_createCSGHomogeneousTransformation(CSGObject_t* csgo); 1454 1455 1456 /** 1457 * Creates a new CSGSetOperator_t object, adds it to this CSGObject_t object 1458 * and returns the CSGSetOperator_t object created. 1459 * 1460 * @param csgo the CSGObject_t structure to which the CSGSetOperator_t should 1461 * be added. 1462 * 1463 * @return a new CSGSetOperator_t object instance. 1464 * 1465 * @memberof CSGObject_t 1466 */ 1467 LIBSBML_EXTERN 1468 CSGSetOperator_t* 1469 CSGObject_createCSGSetOperator(CSGObject_t* csgo); 1470 1471 1472 /** 1473 * Unsets the value of the "csgNode" element of this CSGObject_t. 1474 * 1475 * @param csgo the CSGObject_t structure. 1476 * 1477 * @copydetails doc_returns_success_code 1478 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 1479 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 1480 * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t} 1481 * 1482 * @memberof CSGObject_t 1483 */ 1484 LIBSBML_EXTERN 1485 int 1486 CSGObject_unsetCSGNode(CSGObject_t * csgo); 1487 1488 1489 /** 1490 * Predicate returning @c 1 (true) if all the required attributes for this 1491 * CSGObject_t object have been set. 1492 * 1493 * @param csgo the CSGObject_t structure. 1494 * 1495 * @return @c 1 (true) to indicate that all the required attributes of this 1496 * CSGObject_t have been set, otherwise @c 0 (false) is returned. 1497 * 1498 * 1499 * @note The required attributes for the CSGObject_t object are: 1500 * @li "id" 1501 * @li "domainType" 1502 * 1503 * @memberof CSGObject_t 1504 */ 1505 LIBSBML_EXTERN 1506 int 1507 CSGObject_hasRequiredAttributes(const CSGObject_t * csgo); 1508 1509 1510 /** 1511 * Predicate returning @c 1 (true) if all the required elements for this 1512 * CSGObject_t object have been set. 1513 * 1514 * @param csgo the CSGObject_t structure. 1515 * 1516 * @return @c 1 (true) to indicate that all the required elements of this 1517 * CSGObject_t have been set, otherwise @c 0 (false) is returned. 1518 * 1519 * 1520 * @note The required elements for the CSGObject_t object are: 1521 * @li "csgNode" 1522 * 1523 * @memberof CSGObject_t 1524 */ 1525 LIBSBML_EXTERN 1526 int 1527 CSGObject_hasRequiredElements(const CSGObject_t * csgo); 1528 1529 1530 1531 1532 END_C_DECLS 1533 1534 1535 1536 1537 LIBSBML_CPP_NAMESPACE_END 1538 1539 1540 1541 1542 #endif /* !SWIG */ 1543 1544 1545 1546 1547 #endif /* !CSGObject_H__ */ 1548 1549 1550