1 /** 2 * @file RenderSBMLDocumentPlugin.h 3 * @brief Definition of the RenderSBMLDocumentPlugin 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 RenderSBMLDocumentPlugin 43 * @sbmlbrief{render} Extension of SBMLDocument. 44 * 45 * The RenderSBMLDocumentPlugin class inherits from the SBMLDocumentPlugin 46 * class, and codifies the extensions to the SBMLDocument class defined in 47 * the SBML Level 3 @ref render (“comp”) package. 48 * 49 * The RenderSBMLDocumentPlugin defines a 50 * required flag named <code>required</code>, which indicates whether 51 * “render” constructs can be used to change the core mathematics of the 52 * <code><model></code> child of the <code><sbml></code> element. 53 * Because they cannot, this attribute must be set @c false. 54 */ 55 56 57 #ifndef RenderSBMLDocumentPlugin_H__ 58 #define RenderSBMLDocumentPlugin_H__ 59 60 61 #include <sbml/common/extern.h> 62 63 64 #ifdef __cplusplus 65 66 67 #include <sbml/extension/SBMLDocumentPlugin.h> 68 #include <sbml/packages/render/extension/RenderExtension.h> 69 70 71 LIBSBML_CPP_NAMESPACE_BEGIN 72 73 74 class LIBSBML_EXTERN RenderSBMLDocumentPlugin : public SBMLDocumentPlugin 75 { 76 77 public: 78 79 /** 80 * Creates a new RenderSBMLDocumentPlugin using the given URI, prefix and 81 * package namespace. 82 * 83 * @param uri a string, representing the URI of the SBML Level 3 package 84 * implemented by this libSBML package extension. 85 * 86 * @param prefix a string, the XML namespace prefix being used for this 87 * package. 88 * 89 * @param renderns a pointer to the namesspaces object (RenderPkgNamespaces) 90 * for this package. 91 * 92 * @copydetails doc_what_are_xmlnamespaces 93 * 94 * @copydetails doc_what_are_sbmlnamespaces 95 */ 96 RenderSBMLDocumentPlugin(const std::string& uri, 97 const std::string& prefix, 98 RenderPkgNamespaces* renderns); 99 100 101 /** 102 * Copy constructor for RenderSBMLDocumentPlugin. 103 * 104 * @param orig the RenderSBMLDocumentPlugin instance to copy. 105 */ 106 RenderSBMLDocumentPlugin(const RenderSBMLDocumentPlugin& orig); 107 108 109 /** 110 * Assignment operator for RenderSBMLDocumentPlugin. 111 * 112 * @param rhs the RenderSBMLDocumentPlugin object whose values are to be used 113 * as the basis of the assignment. 114 */ 115 RenderSBMLDocumentPlugin& operator=(const RenderSBMLDocumentPlugin& rhs); 116 117 118 /** 119 * Creates and returns a deep copy of this RenderSBMLDocumentPlugin object. 120 * 121 * @return a (deep) copy of this RenderSBMLDocumentPlugin object. 122 */ 123 virtual RenderSBMLDocumentPlugin* clone() const; 124 125 126 /** 127 * Destructor for RenderSBMLDocumentPlugin. 128 */ 129 virtual ~RenderSBMLDocumentPlugin(); 130 131 132 133 /** @cond doxygenLibsbmlInternal */ 134 135 /** 136 * Accepts the given SBMLVisitor 137 */ 138 virtual bool accept(SBMLVisitor& v) const; 139 140 /** @endcond */ 141 142 143 144 /** @cond doxygenLibsbmlInternal */ 145 146 /** 147 * Predicate indicating whether 'comp' flattening has been implemented for 148 * the Render package. 149 */ 150 virtual bool isCompFlatteningImplemented() const; 151 152 /** @endcond */ 153 154 155 156 /** @cond doxygenLibsbmlInternal */ 157 158 /** 159 * Calls check consistency for any relevant Render validators. 160 */ 161 virtual unsigned int checkConsistency(); 162 163 /** @endcond */ 164 165 166 167 168 #ifndef SWIG 169 170 171 172 /** @cond doxygenLibsbmlInternal */ 173 174 /** 175 * Reads the Render attributes in the top-level element. 176 */ 177 virtual void readAttributes(const XMLAttributes& attributes, 178 const ExpectedAttributes& expectedAttributes); 179 180 /** @endcond */ 181 182 183 184 185 #endif /* !SWIG */ 186 187 188 189 190 #ifndef SWIG 191 192 193 194 /** @cond doxygenLibsbmlInternal */ 195 196 /** 197 * Returns the value of the "attributeName" attribute of this 198 * RenderSBMLDocumentPlugin. 199 * 200 * @param attributeName, the name of the attribute to retrieve. 201 * 202 * @param value, the address of the value to record. 203 * 204 * @copydetails doc_returns_success_code 205 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 206 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 207 */ 208 virtual int getAttribute(const std::string& attributeName, bool& value) 209 const; 210 211 /** @endcond */ 212 213 214 215 /** @cond doxygenLibsbmlInternal */ 216 217 /** 218 * Returns the value of the "attributeName" attribute of this 219 * RenderSBMLDocumentPlugin. 220 * 221 * @param attributeName, the name of the attribute to retrieve. 222 * 223 * @param value, the address of the value to record. 224 * 225 * @copydetails doc_returns_success_code 226 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 227 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 228 */ 229 virtual int getAttribute(const std::string& attributeName, int& value) const; 230 231 /** @endcond */ 232 233 234 235 /** @cond doxygenLibsbmlInternal */ 236 237 /** 238 * Returns the value of the "attributeName" attribute of this 239 * RenderSBMLDocumentPlugin. 240 * 241 * @param attributeName, the name of the attribute to retrieve. 242 * 243 * @param value, the address of the value to record. 244 * 245 * @copydetails doc_returns_success_code 246 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 247 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 248 */ 249 virtual int getAttribute(const std::string& attributeName, 250 double& value) const; 251 252 /** @endcond */ 253 254 255 256 /** @cond doxygenLibsbmlInternal */ 257 258 /** 259 * Returns the value of the "attributeName" attribute of this 260 * RenderSBMLDocumentPlugin. 261 * 262 * @param attributeName, the name of the attribute to retrieve. 263 * 264 * @param value, the address of the value to record. 265 * 266 * @copydetails doc_returns_success_code 267 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 268 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 269 */ 270 virtual int getAttribute(const std::string& attributeName, 271 unsigned int& value) const; 272 273 /** @endcond */ 274 275 276 277 /** @cond doxygenLibsbmlInternal */ 278 279 /** 280 * Returns the value of the "attributeName" attribute of this 281 * RenderSBMLDocumentPlugin. 282 * 283 * @param attributeName, the name of the attribute to retrieve. 284 * 285 * @param value, the address of the value to record. 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 getAttribute(const std::string& attributeName, 292 std::string& value) const; 293 294 /** @endcond */ 295 296 297 298 /** @cond doxygenLibsbmlInternal */ 299 300 /** 301 * Predicate returning @c true if this RenderSBMLDocumentPlugin's attribute 302 * "attributeName" is set. 303 * 304 * @param attributeName, the name of the attribute to query. 305 * 306 * @return @c true if this RenderSBMLDocumentPlugin's attribute 307 * "attributeName" has been set, otherwise @c false is returned. 308 */ 309 virtual bool isSetAttribute(const std::string& attributeName) const; 310 311 /** @endcond */ 312 313 314 315 /** @cond doxygenLibsbmlInternal */ 316 317 /** 318 * Sets the value of the "attributeName" attribute of this 319 * RenderSBMLDocumentPlugin. 320 * 321 * @param attributeName, the name of the attribute to set. 322 * 323 * @param value, the value of the attribute to set. 324 * 325 * @copydetails doc_returns_success_code 326 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 327 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 328 */ 329 virtual int setAttribute(const std::string& attributeName, bool value); 330 331 /** @endcond */ 332 333 334 335 /** @cond doxygenLibsbmlInternal */ 336 337 /** 338 * Sets the value of the "attributeName" attribute of this 339 * RenderSBMLDocumentPlugin. 340 * 341 * @param attributeName, the name of the attribute to set. 342 * 343 * @param value, the value of the attribute to set. 344 * 345 * @copydetails doc_returns_success_code 346 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 347 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 348 */ 349 virtual int setAttribute(const std::string& attributeName, int value); 350 351 /** @endcond */ 352 353 354 355 /** @cond doxygenLibsbmlInternal */ 356 357 /** 358 * Sets the value of the "attributeName" attribute of this 359 * RenderSBMLDocumentPlugin. 360 * 361 * @param attributeName, the name of the attribute to set. 362 * 363 * @param value, the value of the attribute to set. 364 * 365 * @copydetails doc_returns_success_code 366 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 367 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 368 */ 369 virtual int setAttribute(const std::string& attributeName, double value); 370 371 /** @endcond */ 372 373 374 375 /** @cond doxygenLibsbmlInternal */ 376 377 /** 378 * Sets the value of the "attributeName" attribute of this 379 * RenderSBMLDocumentPlugin. 380 * 381 * @param attributeName, the name of the attribute to set. 382 * 383 * @param value, the value of the attribute to set. 384 * 385 * @copydetails doc_returns_success_code 386 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 387 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 388 */ 389 virtual int setAttribute(const std::string& attributeName, 390 unsigned int value); 391 392 /** @endcond */ 393 394 395 396 /** @cond doxygenLibsbmlInternal */ 397 398 /** 399 * Sets the value of the "attributeName" attribute of this 400 * RenderSBMLDocumentPlugin. 401 * 402 * @param attributeName, the name of the attribute to set. 403 * 404 * @param value, the value of the attribute to set. 405 * 406 * @copydetails doc_returns_success_code 407 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 408 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 409 */ 410 virtual int setAttribute(const std::string& attributeName, 411 const std::string& value); 412 413 /** @endcond */ 414 415 416 417 /** @cond doxygenLibsbmlInternal */ 418 419 /** 420 * Unsets the value of the "attributeName" attribute of this 421 * RenderSBMLDocumentPlugin. 422 * 423 * @param attributeName, the name of the attribute to query. 424 * 425 * @copydetails doc_returns_success_code 426 * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t} 427 * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t} 428 */ 429 virtual int unsetAttribute(const std::string& attributeName); 430 431 /** @endcond */ 432 433 434 435 436 #endif /* !SWIG */ 437 438 439 protected: 440 441 }; 442 443 444 445 LIBSBML_CPP_NAMESPACE_END 446 447 448 449 450 #endif /* __cplusplus */ 451 452 453 454 455 #endif /* !RenderSBMLDocumentPlugin_H__ */ 456 457 458