diff --git a/docs/api_reference/c_api_index.rst b/docs/api_reference/c_api_index.rst index a5d45f3..90a7ce3 100644 --- a/docs/api_reference/c_api_index.rst +++ b/docs/api_reference/c_api_index.rst @@ -55,21 +55,21 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumGraphicalObjects(SBMLDocument* document, const char* id, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthGraphicalObjectId(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getGraphicalObjectId(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthGraphicalObjectMetaId(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getGraphicalObjectMetaId(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumCompartments(SBMLDocument* document) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthCompartmentId(SBMLDocument* document, int compartmentIndex) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getCompartmentId(SBMLDocument* document, int compartmentIndex) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumAllCompartmentGlyphs(SBMLDocument* document, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumCompartmentGlyphs(SBMLDocument* document, const char* compartmentId, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthCompartmentGlyphId(SBMLDocument* document, const char* compartmentId, int compartmentGlyphIndex, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getCompartmentGlyphId(SBMLDocument* document, const char* compartmentId, int compartmentGlyphIndex, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthCompartmentGlyphMetaId(SBMLDocument* document, const char* compartmentId, int compartmentGlyphIndex, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getCompartmentGlyphMetaId(SBMLDocument* document, const char* compartmentId, int compartmentGlyphIndex, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_isCompartmentGlyph(SBMLDocument* document, const char* compartmentId, int layoutIndex = 0) @@ -77,15 +77,15 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumSpecies(SBMLDocument* document) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthSpeciesId(SBMLDocument* document, int speciesIndex) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesId(SBMLDocument* document, int speciesIndex) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumAllSpeciesGlyphs(SBMLDocument* document, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumSpeciesGlyphs(SBMLDocument* document, const char* speciesId, int layoutIndex) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthSpeciesGlyphId(SBMLDocument* document, const char* speciesId, int speciesGlyphIndex, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesGlyphId(SBMLDocument* document, const char* speciesId, int speciesGlyphIndex, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthSpeciesGlyphMetaId(SBMLDocument* document, const char* speciesId, int speciesGlyphIndex, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesGlyphMetaId(SBMLDocument* document, const char* speciesId, int speciesGlyphIndex, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_EXTERN::c_api_getSpeciesGlyphIndex(SBMLDocument* document, const char* speciesId, const char* reactionId, int reactionGlyphIndex = 0, int layoutIndex = 0) @@ -93,15 +93,15 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumReactions(SBMLDocument* document) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthReactionId(SBMLDocument* document, int reactionIndex) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getReactionId(SBMLDocument* document, int reactionIndex) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumAllReactionGlyphs(SBMLDocument* document, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumReactionGlyphs(SBMLDocument* document, const char* reactionId, int layoutIndex) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthReactionGlyphId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getReactionGlyphId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthReactionGlyphMetaId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getReactionGlyphMetaId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_isReactionGlyph(SBMLDocument* document, const char* reactionId, int layoutIndex = 0) @@ -113,19 +113,19 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumModifiers(SBMLDocument* document, const char* reactionId) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthReactantId(SBMLDocument* document, const char* reactionId, int reactantIndex) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getReactantId(SBMLDocument* document, const char* reactionId, int reactantIndex) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthProductId(SBMLDocument* document, const char* reactionId, int productIndex) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getProductId(SBMLDocument* document, const char* reactionId, int productIndex) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthModifierId(SBMLDocument* document, const char* reactionId, int modifierIndex) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getModifierId(SBMLDocument* document, const char* reactionId, int modifierIndex) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumSpeciesReferenceGlyphs(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthSpeciesReferenceGlyphId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesReferenceGlyphId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthSpeciesReferenceGlyphMetaId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesReferenceGlyphMetaId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthSpeciesReferenceGlyphSpeciesReferenceId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesReferenceGlyphSpeciesReferenceId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesReferenceSpeciesId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0) @@ -193,9 +193,9 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumSpeciesReferenceBorderDashes(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesReferenceNthBorderDash(SBMLDocument* document, const char* reactionId, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesReferenceBorderDash(SBMLDocument* document, const char* reactionId, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_setSpeciesReferenceNthBorderDash(SBMLDocument* document, const char* reactionId, const int borderDash, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_setSpeciesReferenceBorderDash(SBMLDocument* document, const char* reactionId, const int borderDash, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_isSetSpeciesReferenceStartHead(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) @@ -337,9 +337,9 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumLocalColors(SBMLDocument* document, int renderIndex) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthGlobalColorId(SBMLDocument* document, int colorIndex, int renderIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getGlobalColorId(SBMLDocument* document, int colorIndex, int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthLocalColorId(SBMLDocument* document, int colorIndex, int renderIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getLocalColorId(SBMLDocument* document, int colorIndex, int renderIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_isSetColorValue(SBMLDocument* document, const char* id, int renderIndex = 0) @@ -353,9 +353,9 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumLocalGradients(SBMLDocument* document, int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthGlobalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getGlobalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthLocalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getLocalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_isLinearGradient(SBMLDocument* document, const char* id, int renderIndex = 0) @@ -441,9 +441,9 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumLocalLineEndings(SBMLDocument* document, int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthGlobalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getGlobalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthLocalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getLocalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getLineEndingBoundingBoxX(SBMLDocument* document, const char* id, int renderIndex = 0) @@ -515,17 +515,17 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumLineEndingBorderDashes(SBMLDocument* document, const char* id, int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getLineEndingNthBorderDash(SBMLDocument* document, const char* id, int borderDashIndex, int renderIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getLineEndingBorderDash(SBMLDocument* document, const char* id, int borderDashIndex, int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_setLineEndingNthBorderDash(SBMLDocument* document, const char* id, const int dash, int borderDashIndex, int renderIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_setLineEndingBorderDash(SBMLDocument* document, const char* id, const int dash, int borderDashIndex, int renderIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumSpeciesReferenceLineEndingBorderDashes(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesReferenceLineEndingNthBorderDash(SBMLDocument* document, const char* reactionId, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getSpeciesReferenceLineEndingBorderDash(SBMLDocument* document, const char* reactionId, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_setSpeciesReferenceLineEndingNthBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_setSpeciesReferenceLineEndingBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceGlyphIndex = 0, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_setReactionLineEndingNthBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int borderDashIndex, int reactionGlyphIndex = 0, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_setReactionLineEndingBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int borderDashIndex, int reactionGlyphIndex = 0, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_isSetLineEndingFillColor(SBMLDocument* document, const char* id, int renderIndex = 0) @@ -883,9 +883,9 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumBorderDashes(SBMLDocument* document, const char* id, int graphicalObjectIndex = 0, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthBorderDash(SBMLDocument* document, const char* id, int borderDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getBorderDash(SBMLDocument* document, const char* id, int borderDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_setNthBorderDash(SBMLDocument* document, const char* id, const int dash, int borderDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_setBorderDash(SBMLDocument* document, const char* id, const int dash, int borderDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_isSetFillColor(SBMLDocument* document, const char* id, int graphicalObjectIndex = 0, int layoutIndex = 0) @@ -1507,18 +1507,18 @@ Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumPredefinedStyles() -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthPredefinedStyleName(int index) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getPredefinedStyleName(int index) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumValidRoleValues() -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthValidRoleValue(int index) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getValidRoleValue(int index) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumValidAlignmentValues() -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthValidAlignmentValue(int index) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getValidAlignmentValue(int index) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumValidDistributionDirectionValues() -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNthValidDistributionDirectionValue(int index) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getValidDistributionDirectionValue(int index) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_getNumValidSpreadMethodValues() \ No newline at end of file diff --git a/docs/api_reference/cpp_api_index.rst b/docs/api_reference/cpp_api_index.rst index 2dd3f9c..3328767 100644 --- a/docs/api_reference/cpp_api_index.rst +++ b/docs/api_reference/cpp_api_index.rst @@ -55,19 +55,19 @@ SBMLDocument Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNumCompartments(SBMLDocument* document) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthCompartmentId(SBMLDocument* document, unsigned int index) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentId(SBMLDocument* document, unsigned int index) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getCompartment(SBMLDocument* document, const std::string& id) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNumSpecies(SBMLDocument* document) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthSpeciesId(SBMLDocument* document, unsigned int index) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesId(SBMLDocument* document, unsigned int index) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getSpecies(SBMLDocument* document, const std::string& id) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNumReactions(SBMLDocument* document) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthReactionId(SBMLDocument* document, unsigned int index) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getReactionId(SBMLDocument* document, unsigned int index) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getReaction(SBMLDocument* document, const std::string& id) @@ -79,11 +79,11 @@ SBMLDocument Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNumModifiers(SBMLDocument* document, const std::string& reactionId) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthReactantId(SBMLDocument* document, const std::string& reactionId, unsigned int index) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getReactantId(SBMLDocument* document, const std::string& reactionId, unsigned int index) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthProductId(SBMLDocument* document, const std::string& reactionId, unsigned int index) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getProductId(SBMLDocument* document, const std::string& reactionId, unsigned int index) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthModifierId(SBMLDocument* document, const std::string& reactionId, unsigned int index) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getModifierId(SBMLDocument* document, const std::string& reactionId, unsigned int index) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesReference(SBMLDocument* document, const std::string& reactionId, const std::string& speciesId) @@ -798,11 +798,11 @@ Render Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNumGlobalColorDefinitions(SBMLDocument* document, unsigned int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthGlobalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int colorIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getGlobalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int colorIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNumLocalColorDefinitions(SBMLDocument* document, unsigned int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthLocalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int colorIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getLocalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int colorIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getColorDefinition(SBMLDocument* document, const std::string& sid) @@ -826,9 +826,9 @@ Render Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNumLocalGradientDefinitions(SBMLDocument* document, unsigned int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthGlobalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int gradientIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getGlobalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int gradientIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthLocalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int gradientIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getLocalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int gradientIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getGradientDefinition(SBMLDocument* document, const std::string& sid) @@ -1092,9 +1092,9 @@ Render Functions .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNumLocalLineEndings(SBMLDocument* document, unsigned int renderIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthGlobalLineEndingId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int lineEndingIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getGlobalLineEndingId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int lineEndingIndex = 0) -.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getNthLocalLineEndingId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int lineEndingIndex = 0) +.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getLocalLineEndingId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int lineEndingIndex = 0) .. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::getLineEnding(SBMLDocument* document, const std::string& sid) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 157fb8c..dd8453b 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,7 +27,7 @@ set(SOURCES features/alias_elements/libsbmlnetwork_alias_element.cpp features/alias_elements/libsbmlnetwork_alias_species.cpp features/alias_elements/libsbmlnetwork_alias_reaction.cpp - features/hide_elements/libsbmlnetwork_hide_species.cpp + features/hide_elements/libsbmlnetwork_hide_elements.cpp features/align_elements/libsbmlnetwork_align_element.cpp features/align_elements/libsbmlnetwork_align_species.cpp features/fix_elements/libsbmlnetwork_fix_element_position.cpp @@ -63,7 +63,7 @@ set(HEADERS features/alias_elements/libsbmlnetwork_alias_element.h features/alias_elements/libsbmlnetwork_alias_species.h features/alias_elements/libsbmlnetwork_alias_reaction.h - features/hide_elements/libsbmlnetwork_hide_species.h + features/hide_elements/libsbmlnetwork_hide_elements.h features/align_elements/libsbmlnetwork_align_element.h features/align_elements/libsbmlnetwork_align_species.h features/fix_elements/libsbmlnetwork_fix_element_position.h diff --git a/src/bindings/python/ctypes/libsbmlnetwork.py.cmake b/src/bindings/python/ctypes/libsbmlnetwork.py.cmake index 9aa671a..a8f1fa6 100644 --- a/src/bindings/python/ctypes/libsbmlnetwork.py.cmake +++ b/src/bindings/python/ctypes/libsbmlnetwork.py.cmake @@ -37,7 +37,6 @@ class LibSBMLNetwork: self.sbml_object = None self.layout_is_added = False self.render_is_added = False - self.use_name_as_text_label = True self.display_compartments_text_label = True self.display_species_text_label = True self.display_reactions_text_label = False @@ -160,7 +159,7 @@ class LibSBMLNetwork: raise Exception("The fixed_position_nodes parameter should be a list of lists or a list of strings.") fixed_position_nodes_ptr[i] = fixed_position_node_ptr - return lib.c_api_autolayout(self.sbml_object, ctypes.c_int(max_num_connected_edges), self.use_name_as_text_label, reset_fixed_position_elements, fixed_position_nodes_ptr, len(fixed_position_nodes)) + return lib.c_api_autolayout(self.sbml_object, ctypes.c_int(max_num_connected_edges), reset_fixed_position_elements, fixed_position_nodes_ptr, len(fixed_position_nodes)) def autorender(self, max_num_connected_edges=3): """ @@ -307,7 +306,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumCompartments(self.sbml_object) - def getNthCompartmentId(self, index): + def getCompartmentId(self, index): """ Returns the id of the Compartment object with the given index in the given SBMLDocument @@ -319,8 +318,8 @@ class LibSBMLNetwork: a string that determines the id of the Compartment object with the given index in the given SBMLDocument """ - lib.c_api_getNthCompartmentId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthCompartmentId(self.sbml_object, index)).value.decode() + lib.c_api_getCompartmentId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getCompartmentId(self.sbml_object, index)).value.decode() def getNumSpecies(self): """ @@ -332,7 +331,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumSpecies(self.sbml_object) - def getNthSpeciesId(self, index): + def getSpeciesId(self, index): """ Returns the id of the Species object with the given index in the given SBMLDocument @@ -344,8 +343,8 @@ class LibSBMLNetwork: a string that determines the id of the Species object with the given index in the given SBMLDocument """ - lib.c_api_getNthSpeciesId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthSpeciesId(self.sbml_object, index)).value.decode() + lib.c_api_getSpeciesId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getSpeciesId(self.sbml_object, index)).value.decode() def getNumReactions(self): """ @@ -357,7 +356,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumReactions(self.sbml_object) - def getNthReactionId(self, index): + def getReactionId(self, index): """ Returns the id of the Reaction object with the given index in the given SBMLDocument @@ -369,8 +368,8 @@ class LibSBMLNetwork: a string that determines the id of the Reaction object with the given index in the given SBMLDocument """ - lib.c_api_getNthReactionId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthReactionId(self.sbml_object, index)).value.decode() + lib.c_api_getReactionId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getReactionId(self.sbml_object, index)).value.decode() def getNumLayouts(self): """ @@ -472,62 +471,207 @@ class LibSBMLNetwork: """ return lib.c_api_setSpeciesGlyphIndexInReactionGlyph(self.sbml_object, str(species_id).encode(), str(reaction_id).encode(), index, reaction_glyph_index, layout_index) - def makeSpeciesGlyphVisible(self, species_id, reaction_id, visible=True, reaction_glyph_index=0, layout_index=0): + def makeAllVisible(self, layout_index=0): """ - Makes the SpeciesGlyph of Species with the given species_id in the ReactionGlyph with the given reaction_id and reaction_glyph_index in the Layout object with the given index in the given SBMLDocument visible or invisible + Makes all the GraphicalObjects in the Layout object with the given index in the given SBMLDocument visible on the canvas :Parameters: - - species_id (string): a string that determines the id of the Species - - reaction_id (string): a string that determines the id of the Reaction - - visible = (boolean, optional): a boolean (default: True) that determines whether to make the SpeciesGlyph visible or invisible - - reaction_glyph_index (int, optional): an integer (default: 0) that determines the index of the ReactionGlyph in the given SBMLDocument - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument :Returns: - true on success and false if the SpeciesGlyph could not be hidden + true on success and false if the GraphicalObjects could not be made visible """ - return lib.c_api_makeSpeciesGlyphVisible(self.sbml_object, str(species_id).encode(), str(reaction_id).encode(), visible, reaction_glyph_index, layout_index) + return lib.c_api_makeAllVisible(self.sbml_object, layout_index) - def makeSpeciesGlyphsVisible(self, species=None, visible=True, layout_index=0): + def makeAllInvisible(self, layout_index=0): """ - Makes the SpeciesGlyphs of Species with the given species_ids in the Layout object with the given index in the given SBMLDocument visible or invisible + Makes all the GraphicalObjects in the Layout object with the given index in the given SBMLDocument invisible on the canvas :Parameters: - - species = (list of lists or list of strings, optional): a list (default: None) that determines the list of Species. The list contains: - - a list of lists where each list includes: - - 'id' (str): the ID of the Species - - 'reaction_id' (str): the ID of the Reaction - - 'reaction_glyph_index' (int, optional): the index (default: 0) of the ReactionGlyph in the given SBMLDocument - - visible = (boolean, optional): a boolean (default: True) that determines whether to make the SpeciesGlyphs visible or invisible - - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument - - :Returns: - - true on success and false if the SpeciesGlyphs could not be hidden - """ - species_ptr = None - if species is not None: - species_ptr = (ctypes.POINTER(ctypes.c_char_p) * len(species))() - for i in range(len(species)): - a_species_ptr = (ctypes.c_char_p * 3)() - if isinstance(species[i], list): - if len(species[i]) == 3: - print(species[i]) - a_species_ptr[0] = ctypes.c_char_p(str(species[i][0]).encode()) - a_species_ptr[1] = ctypes.c_char_p(str(species[i][1]).encode()) - a_species_ptr[2] = ctypes.c_char_p(str(species[i][2]).encode()) - elif len(species[i]) == 2: - a_species_ptr[0] = ctypes.c_char_p(str(species[i][0]).encode()) - a_species_ptr[1] = ctypes.c_char_p(str(species[i][1]).encode()) - a_species_ptr[2] = ctypes.c_char_p(str(0).encode()) - else: - raise Exception("The species parameter should be a list of lists with species id, reaction id, and reaction glyph index or a list of lists with species id and reaction id.") - species_ptr[i] = a_species_ptr + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the GraphicalObjects could not be made invisible + """ + return lib.c_api_makeAllInvisible(self.sbml_object, layout_index) + + def makeCompartmentsVisible(self, layout_index=0): + """ + Makes all the CompartmentGlyphs in the Layout object with the given index in the given SBMLDocument visible on the canvas + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the CompartmentGlyphs could not be made visible + """ + return lib.c_api_makeCompartmentsVisible(self.sbml_object, layout_index) + + def makeCompartmentsInvisible(self, layout_index=0): + """ + Makes all the CompartmentGlyphs in the Layout object with the given index in the given SBMLDocument invisible on the canvas + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the CompartmentGlyphs could not be made invisible + """ + return lib.c_api_makeCompartmentsInvisible(self.sbml_object, layout_index) + + def makeSpeciesVisible(self, layout_index=0): + """ + Makes all the SpeciesGlyphs in the Layout object with the given index in the given SBMLDocument visible on the canvas + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the SpeciesGlyphs could not be made visible + """ + return lib.c_api_makeSpeciesVisible(self.sbml_object, layout_index) + + def makeSpeciesInvisible(self, layout_index=0): + """ + Makes all the SpeciesGlyphs in the Layout object with the given index in the given SBMLDocument invisible on the canvas + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the SpeciesGlyphs could not be made invisible + """ + return lib.c_api_makeSpeciesInvisible(self.sbml_object, layout_index) + + def makeReactionsVisible(self, layout_index=0): + """ + Makes all the ReactionGlyphs in the Layout object with the given index in the given SBMLDocument visible on the canvas + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the ReactionGlyphs could not be made visible + """ + return lib.c_api_makeReactionsVisible(self.sbml_object, layout_index) + + def makeReactionsInvisible(self, layout_index=0): + """ + Makes all the ReactionGlyphs in the Layout object with the given index in the given SBMLDocument invisible on the canvas + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the ReactionGlyphs could not be made invisible + """ + return lib.c_api_makeReactionsInvisible(self.sbml_object, layout_index) + + def makeSpeciesReferencesVisible(self, layout_index=0): + """ + Makes all the SpeciesReferenceGlyphs in the Layout object with the given index in the given SBMLDocument visible on the canvas + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the SpeciesReferenceGlyphs could not be made visible + """ + return lib.c_api_makeSpeciesReferencesVisible(self.sbml_object, layout_index) + + def makeSpeciesReferencesInvisible(self, layout_index=0): + """ + Makes all the SpeciesReferenceGlyphs in the Layout object with the given index in the given SBMLDocument invisible on the canvas + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the SpeciesReferenceGlyphs could not be made invisible + """ + return lib.c_api_makeSpeciesReferencesInvisible(self.sbml_object, layout_index) + + def makeLineEndingsVisible(self, layout_index=0): + """ + Makes all the LineEndings in the Layout object with the given index in the given SBMLDocument visible on the canvas + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the LineEndings could not be made visible + """ + return lib.c_api_makeLineEndingsVisible(self.sbml_object, layout_index) + + def makeLineEndingsInvisible(self, layout_index=0): + """ + Makes all the LineEndings in the Layout object with the given index in the given SBMLDocument invisible on the canvas + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the LineEndings could not be made invisible + """ + return lib.c_api_makeLineEndingsInvisible(self.sbml_object, layout_index) + + def makeVisible(self, id, apply_to_connected_elements=True, graphical_object_index=0, layout_index=0): + """ + Makes the GraphicalObject with the given id in the Layout object with the given index in the given SBMLDocument visible on the canvas + + :Parameters: + + - id (string): a string that determines the id of the GraphicalObject + - apply_to_connected_elements (boolean, optional): a boolean (default: True) that determines whether to apply the visibility to the connected elements + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the GraphicalObject could not be made visible + """ + return lib.c_api_makeVisible(self.sbml_object, str(id).encode(), apply_to_connected_elements, graphical_object_index, layout_index) + + def makeInvisible(self, id, apply_to_connected_elements=True, graphical_object_index=0, layout_index=0): + """ + Makes the GraphicalObject with the given id in the Layout object with the given index in the given SBMLDocument invisible on the canvas + + :Parameters: + + - id (string): a string that determines the id of the GraphicalObject + - apply_to_connected_elements (boolean, optional): a boolean (default: True) that determines whether to apply the visibility to the connected elements + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: - return lib.c_api_makeSpeciesGlyphsVisible(self.sbml_object, species_ptr, len(species_ptr), visible, layout_index) + true on success and false if the GraphicalObject could not be made invisible + """ + return lib.c_api_makeInvisible(self.sbml_object, str(id).encode(), apply_to_connected_elements, graphical_object_index, layout_index) def getCanvasWidth(self, layout_index=0): """ @@ -619,118 +763,216 @@ class LibSBMLNetwork: """ return lib.c_api_getNumGraphicalObjects(self.sbml_object, str(id).encode(), layout_index) - def getNthGraphicalObjectId(self, id, index, layout_index=0): + def removeGraphicalObject(self, id, graphical_object_index=0, layout_index=0): """ - Returns the id of the GraphicalObject with the given index associated with the given id in the Layout object with the given index in the given SBMLDocument + Removes the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument :Parameters: - - id (string): a string that determines the id of the GraphicalObject - - index (int): an integer that determines the index of the GraphicalObject in the given SBMLDocument + - id (string): a string that determines the id of the model entity + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument :Returns: - a string that determines the id of the GraphicalObject with the given index associated with the given id in the Layout object with the given index in the given SBMLDocument + true on success and false if the GraphicalObject could not be removed """ - lib.c_api_getNthGraphicalObjectId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthGraphicalObjectId(self.sbml_object, str(id).encode(), index, layout_index)).value.decode() + return lib.c_api_removeGraphicalObject(self.sbml_object, str(id).encode(), graphical_object_index, layout_index) - def getNthGraphicalObjectMetaId(self, id, index, layout_index=0): + def isSetId(self, id, graphical_object_index=0, layout_index=0): """ - Returns the meta id of the GraphicalObject with the given index associated with the given id in the Layout object with the given index in the given SBMLDocument + Returns whether the id GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument is set :Parameters: - - id (string): a string that determines the id of the GraphicalObject - - index (int): an integer that determines the index of the GraphicalObject in the given SBMLDocument + - id (string): a string that determines the id of the model entity + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument :Returns: - a string that determines the meta id of the GraphicalObject with the given index associated with the given id in the Layout object with the given index in the given SBMLDocument + true if the id GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument is set and false otherwise """ - lib.c_api_getNthGraphicalObjectMetaId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthGraphicalObjectMetaId(self.sbml_object, str(id).encode(), index, layout_index)).value.decode() + return lib.c_api_isSetId(self.sbml_object, str(id).encode(), graphical_object_index, layout_index) - def getListOfCompartmentIds(self): + def getId(self, id, graphical_object_index=0, layout_index=0): """ - Returns the list of CompartmentGlyph ids in the Layout object with the given index in the given SBMLDocument + Returns the id of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument + + :Parameters: + + - id (string): a string that determines the id of the model entity + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument :Returns: - a list of strings that determines the list of Compartment ids in the given SBMLDocument + a string that determines the id of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument """ - lib.c_api_getNthCompartmentId.restype = ctypes.c_char_p - list_of_compartment_ids = [] - for n in range(lib.c_api_getNumCompartments(self.sbml_object)): - list_of_compartment_ids.append(ctypes.c_char_p(lib.c_api_getNthCompartmentId(self.sbml_object, n)).value.decode()) + lib.c_api_getId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getId(self.sbml_object, str(id).encode(), graphical_object_index, layout_index)).value.decode() - return list_of_compartment_ids + def setId(self, id, graphical_object_id, graphical_object_index=0, layout_index=0): + """ + Sets the id of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument + :Parameters: - def getNumAllCompartmentGlyphs(self, layout_index=0): + - id (string): a string that determines the id of the model entity + - graphical_object_id (string): a string to be set as the id of the GraphicalObject + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the id of the GraphicalObject could not be set """ - Returns the number of CompartmentGlyphs in the Layout object with the given index in the given SBMLDocument + return lib.c_api_setId(self.sbml_object, str(id).encode(), str(graphical_object_id).encode(), graphical_object_index, layout_index) + + def isSetMetaId(self, id, graphical_object_index=0, layout_index=0): + """ + Returns whether the meta id of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument is set :Parameters: + - id (string): a string that determines the id of the model entity + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument :Returns: - an integer that determines the number of CompartmentGlyphs in the Layout object with the given index in the given SBMLDocument + true if the meta id of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument is set and false otherwise """ - return lib.c_api_getNumAllCompartmentGlyphs(self.sbml_object, layout_index) + return lib.c_api_isSetMetaId(self.sbml_object, str(id).encode(), graphical_object_index, layout_index) - def getNumCompartmentGlyphs(self, compartment_id, layout_index=0): + def getMetaId(self, id, graphical_object_index=0, layout_index=0): """ - Returns the number of CompartmentGlyphs associated with the given compartment_id in the Layout object with the given index in the given SBMLDocument + Returns the meta id of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument :Parameters: - - compartment_id (string): a string that determines the id of the Compartment + - id (string): a string that determines the id of the model entity + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument :Returns: - an integer that determines the number of CompartmentGlyphs associated with the given compartment_id in the Layout object with the given index in the given SBMLDocument - """ - return lib.c_api_getNumCompartmentGlyphs(self.sbml_object, str(compartment_id).encode(), layout_index) + a string that determines the meta id of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument + """ + lib.c_api_getMetaId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getMetaId(self.sbml_object, str(id).encode(), graphical_object_index, layout_index)).value.decode() - def getNthCompartmentGlyphId(self, compartment_id, index, layout_index=0): + def setMetaId(self, id, meta_id, graphical_object_index=0, layout_index=0): """ - Returns the id of the CompartmentGlyph with the given index associated with the given compartment_id in the Layout object with the given index in the given SBMLDocument + Sets the meta id of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument :Parameters: - - compartment_id (string): a string that determines the id of the Compartment - - index (int): an integer that determines the index of the CompartmentGlyph in the given SBMLDocument + - id (string): a string that determines the id of the model entity + - meta_id (string): a string to be set as the meta id of the GraphicalObject + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument :Returns: - a string that determines the id of the CompartmentGlyph with the given index associated with the given compartment_id in the Layout object with the given index in the given SBMLDocument + true on success and false if the meta id of the GraphicalObject could not be set """ - lib.c_api_getNthCompartmentGlyphId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthCompartmentGlyphId(self.sbml_object, str(compartment_id).encode(), index, layout_index)).value.decode() + return lib.c_api_setMetaId(self.sbml_object, str(id).encode(), str(meta_id).encode(), graphical_object_index, layout_index) - def getNthCompartmentGlyphMetaId(self, compartment_id, index, layout_index=0): + def isSetName(self, id, graphical_object_index=0, layout_index=0): """ - Returns the meta id of the CompartmentGlyph with the given index associated with the given compartment_id in the Layout object with the given index in the given SBMLDocument + Returns whether the name of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument is set + + :Parameters: + + - id (string): a string that determines the id of the model entity + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true if the name of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument is set and false otherwise + """ + return lib.c_api_isSetName(self.sbml_object, str(id).encode(), graphical_object_index, layout_index) + + def getName(self, id, graphical_object_index=0, layout_index=0): + """ + Returns the name of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument + + :Parameters: + + - id (string): a string that determines the id of the model entity + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + a string that determines the name of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument + """ + lib.c_api_getName.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getName(self.sbml_object, str(id).encode(), graphical_object_index, layout_index)).value.decode() + + def setName(self, id, name, graphical_object_index=0, layout_index=0): + """ + Sets the name of the GraphicalObject with the given index associated with the model entity with the given id in the Layout object with the given index in the given SBMLDocument + + :Parameters: + + - id (string): a string that determines the id of the model entity + - name (string): a string to be set as the name of the GraphicalObject + - graphical_object_index (int, optional): an integer (default: 0) that determines the index of the GraphicalObject in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the name of the GraphicalObject could not be set + """ + return lib.c_api_setName(self.sbml_object, str(id).encode(), str(name).encode(), graphical_object_index, layout_index) + + def getListOfCompartmentIds(self): + """ + Returns the list of CompartmentGlyph ids in the Layout object with the given index in the given SBMLDocument + + :Returns: + + a list of strings that determines the list of Compartment ids in the given SBMLDocument + """ + lib.c_api_getCompartmentId.restype = ctypes.c_char_p + list_of_compartment_ids = [] + for n in range(lib.c_api_getNumCompartments(self.sbml_object)): + list_of_compartment_ids.append(ctypes.c_char_p(lib.c_api_getCompartmentId(self.sbml_object, n)).value.decode()) + + return list_of_compartment_ids + + + def getNumAllCompartmentGlyphs(self, layout_index=0): + """ + Returns the number of CompartmentGlyphs in the Layout object with the given index in the given SBMLDocument :Parameters: - - compartment_id (string): a string that determines the id of the Compartment - - index (int): an integer that determines the index of the CompartmentGlyph in the given SBMLDocument - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument :Returns: - a string that determines the meta id of the CompartmentGlyph with the given index associated with the given compartment_id in the Layout object with the given index in the given SBMLDocument + an integer that determines the number of CompartmentGlyphs in the Layout object with the given index in the given SBMLDocument """ - lib.c_api_getNthCompartmentGlyphMetaId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthCompartmentGlyphMetaId(self.sbml_object, str(compartment_id).encode(), index, layout_index)).value.decode() + return lib.c_api_getNumAllCompartmentGlyphs(self.sbml_object, layout_index) + + def getNumCompartmentGlyphs(self, compartment_id, layout_index=0): + """ + Returns the number of CompartmentGlyphs associated with the given compartment_id in the Layout object with the given index in the given SBMLDocument + + :Parameters: + + - compartment_id (string): a string that determines the id of the Compartment + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + an integer that determines the number of CompartmentGlyphs associated with the given compartment_id in the Layout object with the given index in the given SBMLDocument + """ + return lib.c_api_getNumCompartmentGlyphs(self.sbml_object, str(compartment_id).encode(), layout_index) def isCompartmentGlyph(self, compartment_id, layout_index=0): """ @@ -747,7 +989,7 @@ class LibSBMLNetwork: """ return lib.c_api_isCompartmentGlyph(self.sbml_object, str(compartment_id).encode(), layout_index) - def getCompartmentId(self, entity_id, graphical_object_id=0, layout_index=0): + def getGraphicalObjectCompartmentId(self, entity_id, graphical_object_id=0, layout_index=0): """ Returns the id of the Compartment associated with the given entity_id and graphical_object_id in the Layout object with the given index in the given SBMLDocument @@ -761,8 +1003,8 @@ class LibSBMLNetwork: a string that determines the id of the Compartment associated with the given entity_id and graphical_object_id in the Layout object with the given index in the given SBMLDocument """ - lib.c_api_getCompartmentId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getCompartmentId(self.sbml_object, str(entity_id).encode(), str(graphical_object_id).encode(), layout_index)).value.decode() + lib.c_api_getGraphicalObjectCompartmentId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getGraphicalObjectCompartmentId(self.sbml_object, str(entity_id).encode(), str(graphical_object_id).encode(), layout_index)).value.decode() def getListOfSpeciesIds(self): """ @@ -772,10 +1014,10 @@ class LibSBMLNetwork: a list of strings that determines the list of Species ids in the given SBMLDocument """ - lib.c_api_getNthSpeciesId.restype = ctypes.c_char_p + lib.c_api_getSpeciesId.restype = ctypes.c_char_p list_of_species_ids = [] for n in range(lib.c_api_getNumSpecies(self.sbml_object)): - list_of_species_ids.append(ctypes.c_char_p(lib.c_api_getNthSpeciesId(self.sbml_object, n)).value.decode()) + list_of_species_ids.append(ctypes.c_char_p(lib.c_api_getSpeciesId(self.sbml_object, n)).value.decode()) return list_of_species_ids @@ -808,40 +1050,6 @@ class LibSBMLNetwork: """ return lib.c_api_getNumSpeciesGlyphs(self.sbml_object, str(species_id).encode(), layout_index) - def getNthSpeciesGlyphId(self, species_id, index, layout_index=0): - """ - Returns the id of the SpeciesGlyph with the given index associated with the given species_id in the Layout object with the given index in the given SBMLDocument - - :Parameters: - - - species_id (string): a string that determines the id of the Species - - index (int): an integer that determines the index of the SpeciesGlyph in the given SBMLDocument - - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument - - :Returns: - - a string that determines the id of the SpeciesGlyph with the given index associated with the given species_id in the Layout object with the given index in the given SBMLDocument - """ - lib.c_api_getNthSpeciesGlyphId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthSpeciesGlyphId(self.sbml_object, str(species_id).encode(), index, layout_index)).value.decode() - - def getNthSpeciesGlyphMetaId(self, species_id, index, layout_index=0): - """ - Returns the meta id of the SpeciesGlyph with the given index associated with the given species_id in the Layout object with the given index in the given SBMLDocument - - :Parameters: - - - species_id (string): a string that determines the id of the Species - - index (int): an integer that determines the index of the SpeciesGlyph in the given SBMLDocument - - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument - - :Returns: - - a string that determines the meta id of the SpeciesGlyph with the given index associated with the given species_id in the Layout object with the given index in the given SBMLDocument - """ - lib.c_api_getNthSpeciesGlyphMetaId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthSpeciesGlyphMetaId(self.sbml_object, str(species_id).encode(), index, layout_index)).value.decode() - def getSpeciesGlyphIndex(self, species_id, reaction_id, reaction_glyph_index=0, layout_index=0): """ Returns the index of the SpeciesGlyph with the given species_id associated with the ReactionGlyph with the given reaction_id and reaction_glyph_index in the Layout object with the given index in the given SBMLDocument @@ -859,7 +1067,6 @@ class LibSBMLNetwork: """ return lib.c_api_getSpeciesGlyphIndex(self.sbml_object, str(species_id).encode(), str(reaction_id).encode(), reaction_glyph_index, layout_index) - def isSpeciesGlyph(self, species_id, layout_index=0): """ Returns whether the given species_id is associated with a SpeciesGlyph in the Layout object with the given index in the given SBMLDocument @@ -883,10 +1090,10 @@ class LibSBMLNetwork: a list of strings that determines the list of Reaction ids in the given SBMLDocument """ - lib.c_api_getNthReactionId.restype = ctypes.c_char_p + lib.c_api_getReactionId.restype = ctypes.c_char_p list_of_reaction_ids = [] for n in range(lib.c_api_getNumReactions(self.sbml_object)): - list_of_reaction_ids.append(ctypes.c_char_p(lib.c_api_getNthReactionId(self.sbml_object, n)).value.decode()) + list_of_reaction_ids.append(ctypes.c_char_p(lib.c_api_getReactionId(self.sbml_object, n)).value.decode()) return list_of_reaction_ids @@ -920,40 +1127,6 @@ class LibSBMLNetwork: return lib.c_api_getNumReactionGlyphs(self.sbml_object, str(reaction_id).encode(), layout_index) - def getNthReactionGlyphId(self, reaction_id, index, layout_index=0): - """ - Returns the id of the ReactionGlyph with the given index associated with the given reaction_id in the Layout object with the given index in the given SBMLDocument - - :Parameters: - - - reaction_id (string): a string that determines the id of the Reaction - - index (int): an integer that determines the index of the ReactionGlyph in the given SBMLDocument - - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument - - :Returns: - - a string that determines the id of the ReactionGlyph with the given index associated with the given reaction_id in the Layout object with the given index in the given SBMLDocument - """ - lib.c_api_getNthReactionGlyphId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthReactionGlyphId(self.sbml_object, str(reaction_id).encode(), index, layout_index)).value.decode() - - def getNthReactionGlyphMetaId(self, reaction_id, index, layout_index=0): - """ - Returns the meta id of the ReactionGlyph with the given index associated with the given reaction_id in the Layout object with the given index in the given SBMLDocument - - :Parameters: - - - reaction_id (string): a string that determines the id of the Reaction - - index (int): an integer that determines the index of the ReactionGlyph in the given SBMLDocument - - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument - - :Returns: - - a string that determines the meta id of the ReactionGlyph with the given index associated with the given reaction_id in the Layout object with the given index in the given SBMLDocument - """ - lib.c_api_getNthReactionGlyphMetaId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthReactionGlyphMetaId(self.sbml_object, str(reaction_id).encode(), index, layout_index)).value.decode() - def isReactionGlyph(self, reaction_id, layout_index=0): """ Returns whether the given reaction_id is associated with a ReactionGlyph in the Layout object with the given index in the given SBMLDocument @@ -1002,7 +1175,7 @@ class LibSBMLNetwork: """ lib.c_api_getSpeciesReferenceId.restype = ctypes.c_char_p return ctypes.c_char_p(lib.c_api_getSpeciesReferenceId(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index)).value.decode() - + def getSpeciesReferenceSpeciesId(self, reaction_id, reaction_glyph_index=0, species_reference_index=0, layout_index=0): """ Returns the species id of the SpeciesReference with the given reaction_id, reaction_glyph_index, species_reference_index, and layout_index in the given SBMLDocument @@ -1144,39 +1317,91 @@ class LibSBMLNetwork: """ return lib.c_api_getNumSpeciesReferenceAssociatedWithSpecies(self.sbml_object, str(species_id).encode(), str(reaction_id).encode(), reaction_glyph_index) - def getSpeciesReferenceIndexAssociatedWithSpecies(self, species_id, reaction_id, reaction_glyph_index = 0, n = 0): + def getSpeciesReferenceIndexAssociatedWithSpecies(self, species_id, reaction_id, reaction_glyph_index = 0, n = 0): + """ + Returns the index of the SpeciesReference associated with the given species_id in the given SBMLDocument + + :Parameters: + + - species_id (string): a string that determines the id of the Species + - reaction_id (string): a string that determines the id of the Reaction + - reaction_glyph_index (int, optional): an integer (default: 0) that determines the index of the ReactionGlyph in the given SBMLDocument + - n (int, optional): an integer (default: 0) that determines the index of the SpeciesReference among the associated SpeciesReferences to the given species_id in the given SBMLDocument + + :Returns: + + an integer that determines the index of the SpeciesReference associated with the given species_id in the given SBMLDocument + """ + return lib.c_api_getSpeciesReferenceIndexAssociatedWithSpecies(self.sbml_object, str(species_id).encode(), str(reaction_id).encode(), reaction_glyph_index, n) + + def getNumSpeciesReferenceCurveSegments(self, reaction_id, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + """ + Returns the number of CurveSegments associated with the given reaction_id, reaction_glyph_index, species_reference_index, and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction + - reaction_glyph_index (int): an integer that determines the index of the ReactionGlyph in the given SBMLDocument + - species_reference_index (int): an integer that determines the index of the SpeciesReference in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + an integer that determines the number of CurveSegments associated with the given reaction_id, reaction_glyph_index, species_reference_index, and layout_index in the given SBMLDocument + """ + return lib.c_api_getNumSpeciesReferenceCurveSegments(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index) + + def addSpeciesReferenceLineCurveSegment(self, reaction_id, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + """ + Adds a LineSegment to the Curve of the SpeciesReference with the given reaction_id, reaction_glyph_index, species_reference_index, and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction + - reaction_glyph_index (int): an integer that determines the index of the ReactionGlyph in the given SBMLDocument + - species_reference_index (int): an integer that determines the index of the SpeciesReference in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the LineSegment could not be added to the Curve of the SpeciesReference + """ + return lib.c_api_addSpeciesReferenceLineCurveSegment(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index) + + def addSpeciesReferenceCubicBezierCurveSegment(self, reaction_id, reaction_glyph_index=0, species_reference_index=0, layout_index=0): """ - Returns the index of the SpeciesReference associated with the given species_id in the given SBMLDocument + Adds a CubicBezier to the Curve of the SpeciesReference with the given reaction_id, reaction_glyph_index, species_reference_index, and layout_index in the given SBMLDocument :Parameters: - - species_id (string): a string that determines the id of the Species - reaction_id (string): a string that determines the id of the Reaction - - reaction_glyph_index (int, optional): an integer (default: 0) that determines the index of the ReactionGlyph in the given SBMLDocument - - n (int, optional): an integer (default: 0) that determines the index of the SpeciesReference among the associated SpeciesReferences to the given species_id in the given SBMLDocument + - reaction_glyph_index (int): an integer that determines the index of the ReactionGlyph in the given SBMLDocument + - species_reference_index (int): an integer that determines the index of the SpeciesReference in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument :Returns: - an integer that determines the index of the SpeciesReference associated with the given species_id in the given SBMLDocument - """ - return lib.c_api_getSpeciesReferenceIndexAssociatedWithSpecies(self.sbml_object, str(species_id).encode(), str(reaction_id).encode(), reaction_glyph_index, n) + true on success and false if the CubicBezier could not be added to the Curve of the SpeciesReference + """ + return lib.c_api_addSpeciesReferenceCubicBezierCurveSegment(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index) - def getNumSpeciesReferenceCurveSegments(self, reaction_id, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + def removeSpeciesReferenceCurveSegment(self, reaction_id, reaction_glyph_index=0, species_reference_index=0, curve_segment_index=0, layout_index=0): """ - Returns the number of CurveSegments associated with the given reaction_id, reaction_glyph_index, species_reference_index, and layout_index in the given SBMLDocument + Removes the CurveSegment with the given reaction_id, reaction_glyph_index, species_reference_index, curve_segment_index, and layout_index in the given SBMLDocument :Parameters: - reaction_id (string): a string that determines the id of the Reaction - reaction_glyph_index (int): an integer that determines the index of the ReactionGlyph in the given SBMLDocument - species_reference_index (int): an integer that determines the index of the SpeciesReference in the given SBMLDocument + - curve_segment_index (int): an integer that determines the index of the CurveSegment in the given SBMLDocument - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument :Returns: - an integer that determines the number of CurveSegments associated with the given reaction_id, reaction_glyph_index, species_reference_index, and layout_index in the given SBMLDocument - """ - return lib.c_api_getNumSpeciesReferenceCurveSegments(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index) + true on success and false if the CurveSegment could not be removed + """ + return lib.c_api_removeSpeciesReferenceCurveSegment(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, curve_segment_index, layout_index) def isSpeciesReferenceCurveSegmentCubicBezier(self, reaction_id, reaction_glyph_index=0, species_reference_index=0, curve_segment_index=0, layout_index=0): """ @@ -1625,7 +1850,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumSpeciesReferenceLineDashes(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index) - def getSpeciesReferenceNthLineDash(self, reaction_id, dash_index, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + def getSpeciesReferenceLineDash(self, reaction_id, dash_index, reaction_glyph_index=0, species_reference_index=0, layout_index=0): """ Returns the dash at the given dash_index of the SpeciesReference with the given reaction_id, reaction_glyph_index, species_reference_index, and layout_index in the given SBMLDocument @@ -1641,9 +1866,9 @@ class LibSBMLNetwork: an int that determines the dash at the given dash_index of the SpeciesReference with the given reaction_id, reaction_glyph_index, species_reference_index, and layout_index in the given SBMLDocument """ - return lib.c_api_getSpeciesReferenceNthLineDash(self.sbml_object, str(reaction_id).encode(), dash_index, reaction_glyph_index, species_reference_index, layout_index) + return lib.c_api_getSpeciesReferenceLineDash(self.sbml_object, str(reaction_id).encode(), dash_index, reaction_glyph_index, species_reference_index, layout_index) - def setSpeciesReferenceNthLineDash(self, reaction_id, dash, dash_index, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + def setSpeciesReferenceLineDash(self, reaction_id, dash, dash_index, reaction_glyph_index=0, species_reference_index=0, layout_index=0): """ Sets the dash at the given dash_index of the SpeciesReference with the given reaction_id, reaction_glyph_index, species_reference_index, and layout_index in the given SBMLDocument @@ -1660,7 +1885,7 @@ class LibSBMLNetwork: true on success and false if the dash at the given dash_index of the SpeciesReference could not be set """ - return lib.c_api_setSpeciesReferenceNthLineDash(self.sbml_object, str(reaction_id).encode(), dash, dash_index, reaction_glyph_index, species_reference_index, layout_index) + return lib.c_api_setSpeciesReferenceLineDash(self.sbml_object, str(reaction_id).encode(), dash, dash_index, reaction_glyph_index, species_reference_index, layout_index) def isSetSpeciesReferenceStartHead(self, reaction_id, reaction_glyph_index=0, species_reference_index=0, layout_index=0): """ @@ -1798,7 +2023,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumTextGlyphs(self.sbml_object, str(id).encode(), graphical_object_index, layout_index) - def getText(self, id, graphical_object_index=0, text_glyph_index=0, layout_index=0, use_name_as_text_label=True): + def getText(self, id, graphical_object_index=0, text_glyph_index=0, layout_index=0): """ Returns the text of the TextGlyph associated with the GraphicalObject associated with the given id, text_glyph_index, and layout_index in the given SBMLDocument @@ -1808,14 +2033,13 @@ class LibSBMLNetwork: - graphical_object_index (int): an integer that determines the index of the GraphicalObject in the given SBMLDocument - text_glyph_index (int): an integer that determines the index of the TextGlyph in the given SBMLDocument - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument - - use_name_as_text_label (bool, optional): a boolean (default: True) that determines whether the name of the model entity should be used as the text label of the TextGlyph :Returns: a string that determines the text of the TextGlyph associated with the GraphicalObject associated with the given id, text_glyph_index, and layout_index in the given SBMLDocument """ lib.c_api_getText.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getText(self.sbml_object, str(id).encode(), graphical_object_index, text_glyph_index, layout_index, use_name_as_text_label)).value.decode() + return ctypes.c_char_p(lib.c_api_getText(self.sbml_object, str(id).encode(), graphical_object_index, text_glyph_index, layout_index)).value.decode() def setText(self, id, text, graphical_object_index=0, text_glyph_index=0, layout_index=0): """ @@ -1869,6 +2093,66 @@ class LibSBMLNetwork: """ return lib.c_api_removeText(self.sbml_object, str(id).encode(), graphical_object_index, text_glyph_index, layout_index) + def getNumAllAdditionalGraphicalObjects(self, layout_index=0): + """ + Returns the number of AdditionalGraphicalObjects in the Layout object with the given index in the given SBMLDocument + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + an integer that determines the number of AdditionalGraphicalObjects in the Layout object with the given index in the given SBMLDocument + """ + return lib.c_api_getNumAllAdditionalGraphicalObjects(self.sbml_object, layout_index) + + def getAdditionalGraphicalObjectId(self, additional_graphical_object_index=0, layout_index=0): + """ + Returns the id of the AdditionalGraphicalObject with the given additional_graphical_object_index and layout_index in the given SBMLDocument + + :Parameters: + + - additional_graphical_object_index (int): an integer that determines the index of the AdditionalGraphicalObject in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + a string that determines the id of the AdditionalGraphicalObject with the given additional_graphical_object_index and layout_index in the given SBMLDocument + """ + lib.c_api_getAdditionalGraphicalObjectId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getAdditionalGraphicalObjectId(self.sbml_object, additional_graphical_object_index, layout_index)).value.decode() + + def addAdditionalGraphicalObject(self, id, layout_index=0): + """ + Adds an AdditionalGraphicalObject with the given id and layout_index to the given SBMLDocument + + :Parameters: + + - id (string): a string that determines the id of the AdditionalGraphicalObject + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the AdditionalGraphicalObject could not be added + """ + return lib.c_api_addAdditionalGraphicalObject(self.sbml_object, str(id).encode(), layout_index) + + def removeAdditionalGraphicalObject(self, additional_graphical_object_index=0, layout_index=0): + """ + Removes the AdditionalGraphicalObject with the given additional_graphical_object_index and layout_index from the given SBMLDocument + + :Parameters: + + - additional_graphical_object_index (int): an integer that determines the index of the AdditionalGraphicalObject in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the AdditionalGraphicalObject could not be removed + """ + return lib.c_api_removeAdditionalGraphicalObject(self.sbml_object, additional_graphical_object_index, layout_index) + def getX(self, id, graphical_object_index=0, layout_index=0): """ Returns the x-coordinate of the GraphicalObject associated with the given id, graphical_object_index, and layout_index in the given SBMLDocument @@ -2416,6 +2700,55 @@ class LibSBMLNetwork: """ return lib.c_api_getNumCurveSegments(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, layout_index) + def addLineCurveSegment(self, reaction_id, reaction_glyph_index=0, layout_index=0): + """ + Adds a LineSegment to the Curve of the ReactionGlyph with the given reaction_id, reaction_glyph_index, and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction + - reaction_glyph_index (int): an integer that determines the index of the ReactionGlyph in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the LineSegment could not be added to the Curve of the ReactionGlyph + """ + return lib.c_api_addLineCurveSegment(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, layout_index) + + def addCubicBezierCurveSegment(self, reaction_id, reaction_glyph_index=0, layout_index=0): + """ + Adds a CubicBezier to the Curve of the ReactionGlyph with the given reaction_id, reaction_glyph_index, and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction + - reaction_glyph_index (int): an integer that determines the index of the ReactionGlyph in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the CubicBezier could not be added to the Curve of the ReactionGlyph + """ + return lib.c_api_addCubicBezierCurveSegment(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, layout_index) + + def removeCurveSegment(self, reaction_id, reaction_glyph_index=0, curve_segment_index=0, layout_index=0): + """ + Removes the CurveSegment with the given reaction_id, reaction_glyph_index, curve_segment_index, and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction + - reaction_glyph_index (int): an integer that determines the index of the ReactionGlyph in the given SBMLDocument + - curve_segment_index (int): an integer that determines the index of the CurveSegment in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the CurveSegment could not be removed + """ + return lib.c_api_removeCurveSegment(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, curve_segment_index, layout_index) + def isCurveSegmentCubicBezier(self, reaction_id, reaction_glyph_index=0, curve_segment_index=0, layout_index=0): """ Returns whether the CurveSegment with the given reaction_id, reaction_glyph_index, curve_segment_index, and layout_index in the given SBMLDocument is a CubicBezier @@ -2859,13 +3192,13 @@ class LibSBMLNetwork: a list of strings that determines the list of ColorDefinition ids in the RenderInformation object with the given index in the given SBMLDocument """ - lib.c_api_getNthGlobalColorId.restype = ctypes.c_char_p - lib.c_api_getNthLocalColorId.restype = ctypes.c_char_p + lib.c_api_getGlobalColorId.restype = ctypes.c_char_p + lib.c_api_getLocalColorId.restype = ctypes.c_char_p list_of_color_ids = [] for n in range(lib.c_api_getNumGlobalColors(self.sbml_object, render_index)): - list_of_color_ids.append(ctypes.c_char_p(lib.c_api_getNthGlobalColorId(self.sbml_object, n, render_index)).value.decode()) + list_of_color_ids.append(ctypes.c_char_p(lib.c_api_getGlobalColorId(self.sbml_object, n, render_index)).value.decode()) for n in range(lib.c_api_getNumLocalColors(self.sbml_object, render_index)): - list_of_color_ids.append(ctypes.c_char_p(lib.c_api_getNthLocalColorId(self.sbml_object, n, render_index)).value.decode()) + list_of_color_ids.append(ctypes.c_char_p(lib.c_api_getLocalColorId(self.sbml_object, n, render_index)).value.decode()) return list_of_color_ids @@ -2911,7 +3244,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumLocalColors(self.sbml_object, render_index) - def getNthGlobalColorId(self, index, render_index=0): + def getGlobalColorId(self, index, render_index=0): """ Returns the id of the ColorDefinition object with the given index in the GlobalRenderInformation object with the given index in the given SBMLDocument @@ -2924,10 +3257,10 @@ class LibSBMLNetwork: a string that determines the id of the ColorDefinition object with the given index in the GlobalRenderInformation object with the given index in the given SBMLDocument """ - lib.c_api_getNthGlobalColorId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthGlobalColorId(self.sbml_object, index, render_index)).value.decode() + lib.c_api_getGlobalColorId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getGlobalColorId(self.sbml_object, index, render_index)).value.decode() - def getNthLocalColorId(self, index, render_index=0): + def getLocalColorId(self, index, render_index=0): """ Returns the id of the ColorDefinition object with the given index in the LocalRenderInformation object with the given index in the given SBMLDocument @@ -2940,8 +3273,8 @@ class LibSBMLNetwork: a string that determines the id of the ColorDefinition object with the given index in the LocalRenderInformation object with the given index in the given SBMLDocument """ - lib.c_api_getNthLocalColorId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthLocalColorId(self.sbml_object, index, render_index)).value.decode() + lib.c_api_getLocalColorId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getLocalColorId(self.sbml_object, index, render_index)).value.decode() def isSetColorValue(self, color_id, render_index=0): """ @@ -3002,13 +3335,13 @@ class LibSBMLNetwork: a list of strings that determines the list of GradientDefinition ids in the RenderInformation object with the given index in the given SBMLDocument """ - lib.c_api_getNthGlobalGradientId.restype = ctypes.c_char_p - lib.c_api_getNthLocalGradientId.restype = ctypes.c_char_p + lib.c_api_getGlobalGradientId.restype = ctypes.c_char_p + lib.c_api_getLocalGradientId.restype = ctypes.c_char_p list_of_gradient_ids = [] for n in range(lib.c_api_getNumGlobalGradients(self.sbml_object, render_index)): - list_of_gradient_ids.append(ctypes.c_char_p(lib.c_api_getNthGlobalGradientId(self.sbml_object, n, render_index)).value.decode()) + list_of_gradient_ids.append(ctypes.c_char_p(lib.c_api_getGlobalGradientId(self.sbml_object, n, render_index)).value.decode()) for n in range(lib.c_api_getNumLocalGradients(self.sbml_object, render_index)): - list_of_gradient_ids.append(ctypes.c_char_p(lib.c_api_getNthLocalGradientId(self.sbml_object, n, render_index)).value.decode()) + list_of_gradient_ids.append(ctypes.c_char_p(lib.c_api_getLocalGradientId(self.sbml_object, n, render_index)).value.decode()) return list_of_gradient_ids @@ -3024,13 +3357,13 @@ class LibSBMLNetwork: a list of strings that determines the list of GradientDefinition ids in the RenderInformation object with the given index in the given SBMLDocument """ - lib.c_api_getNthGlobalGradientId.restype = ctypes.c_char_p - lib.c_api_getNthLocalGradientId.restype = ctypes.c_char_p + lib.c_api_getGlobalGradientId.restype = ctypes.c_char_p + lib.c_api_getLocalGradientId.restype = ctypes.c_char_p list_of_gradient_ids = [] for n in range(lib.c_api_getNumGlobalGradients(self.sbml_object, render_index)): - list_of_gradient_ids.append(ctypes.c_char_p(lib.c_api_getNthGlobalGradientId(self.sbml_object, n, render_index)).value.decode()) + list_of_gradient_ids.append(ctypes.c_char_p(lib.c_api_getGlobalGradientId(self.sbml_object, n, render_index)).value.decode()) for n in range(lib.c_api_getNumLocalGradients(self.sbml_object, render_index)): - list_of_gradient_ids.append(ctypes.c_char_p(lib.c_api_getNthLocalGradientId(self.sbml_object, n, render_index)).value.decode()) + list_of_gradient_ids.append(ctypes.c_char_p(lib.c_api_getLocalGradientId(self.sbml_object, n, render_index)).value.decode()) return list_of_gradient_ids @@ -3076,7 +3409,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumLocalGradients(self.sbml_object, render_index) - def getNthGlobalGradientId(self, index, render_index=0): + def getGlobalGradientId(self, index, render_index=0): """ Returns the id of the GradientDefinition object with the given index in the GlobalRenderInformation object with the given index in the given SBMLDocument @@ -3089,10 +3422,10 @@ class LibSBMLNetwork: a string that determines the id of the GradientDefinition object with the given index in the GlobalRenderInformation object with the given index in the given SBMLDocument """ - lib.c_api_getNthGlobalGradientId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthGlobalGradientId(self.sbml_object, index, render_index)).value.decode() + lib.c_api_getGlobalGradientId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getGlobalGradientId(self.sbml_object, index, render_index)).value.decode() - def getNthLocalGradientId(self, index, render_index=0): + def getLocalGradientId(self, index, render_index=0): """ Returns the id of the GradientDefinition object with the given index in the LocalRenderInformation object with the given index in the given SBMLDocument @@ -3105,8 +3438,8 @@ class LibSBMLNetwork: a string that determines the id of the GradientDefinition object with the given index in the LocalRenderInformation object with the given index in the given SBMLDocument """ - lib.c_api_getNthLocalGradientId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthLocalGradientId(self.sbml_object, index, render_index)).value.decode() + lib.c_api_getLocalGradientId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getLocalGradientId(self.sbml_object, index, render_index)).value.decode() def isLinearGradient(self, gradient_id, render_index=0): """ @@ -3735,13 +4068,13 @@ class LibSBMLNetwork: a list of strings that determines the list of LineEnding ids in the RenderInformation object with the given index in the given SBMLDocument """ - lib.c_api_getNthGlobalLineEndingId.restype = ctypes.c_char_p - lib.c_api_getNthLocalLineEndingId.restype = ctypes.c_char_p + lib.c_api_getGlobalLineEndingId.restype = ctypes.c_char_p + lib.c_api_getLocalLineEndingId.restype = ctypes.c_char_p list_of_line_ending_ids = [] for n in range(lib.c_api_getNumGlobalLineEndings(self.sbml_object, render_index)): - list_of_line_ending_ids.append(ctypes.c_char_p(lib.c_api_getNthGlobalLineEndingId(self.sbml_object, n, render_index)).value.decode()) + list_of_line_ending_ids.append(ctypes.c_char_p(lib.c_api_getGlobalLineEndingId(self.sbml_object, n, render_index)).value.decode()) for n in range(lib.c_api_getNumLocalLineEndings(self.sbml_object, render_index)): - list_of_line_ending_ids.append(ctypes.c_char_p(lib.c_api_getNthLocalLineEndingId(self.sbml_object, n, render_index)).value.decode()) + list_of_line_ending_ids.append(ctypes.c_char_p(lib.c_api_getLocalLineEndingId(self.sbml_object, n, render_index)).value.decode()) return list_of_line_ending_ids @@ -3787,7 +4120,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumLocalLineEndings(self.sbml_object, render_index) - def getNthGlobalLineEndingId(self, index, render_index=0): + def getGlobalLineEndingId(self, index, render_index=0): """ Returns the id of the LineEnding object with the given index in the GlobalRenderInformation object with the given index in the given SBMLDocument @@ -3800,10 +4133,10 @@ class LibSBMLNetwork: a string that determines the id of the LineEnding object with the given index in the GlobalRenderInformation object with the given index in the given SBMLDocument """ - lib.c_api_getNthGlobalLineEndingId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthGlobalLineEndingId(self.sbml_object, index, render_index)).value.decode() + lib.c_api_getGlobalLineEndingId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getGlobalLineEndingId(self.sbml_object, index, render_index)).value.decode() - def getNthLocalLineEndingId(self, index, render_index=0): + def getLocalLineEndingId(self, index, render_index=0): """ Returns the id of the LineEnding object with the given index in the LocalRenderInformation object with the given index in the given SBMLDocument @@ -3816,8 +4149,8 @@ class LibSBMLNetwork: a string that determines the id of the LineEnding object with the given index in the LocalRenderInformation object with the given index in the given SBMLDocument """ - lib.c_api_getNthLocalLineEndingId.restype = ctypes.c_char_p - return ctypes.c_char_p(lib.c_api_getNthLocalLineEndingId(self.sbml_object, index, render_index)).value.decode() + lib.c_api_getLocalLineEndingId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getLocalLineEndingId(self.sbml_object, index, render_index)).value.decode() def getLineEndingBoundingBoxX(self, line_ending_id, render_index=0): """ @@ -4408,7 +4741,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumLineEndingBorderDashes(self.sbml_object, str(line_ending_id).encode(), render_index) - def getLineEndingNthBorderDash(self, line_ending_id, index, render_index=0): + def getLineEndingBorderDash(self, line_ending_id, index, render_index=0): """ Returns the border dash with the given index of the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument @@ -4423,9 +4756,9 @@ class LibSBMLNetwork: an integer that determines the border dash with the given index of the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument """ - return lib.c_api_getLineEndingNthBorderDash(self.sbml_object, str(line_ending_id).encode(), index, render_index) + return lib.c_api_getLineEndingBorderDash(self.sbml_object, str(line_ending_id).encode(), index, render_index) - def setLineEndingNthBorderDash(self, line_ending_id, index, border_dash, render_index=0): + def setLineEndingBorderDash(self, line_ending_id, index, border_dash, render_index=0): """ Sets the border dash with the given index of the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument @@ -4440,7 +4773,7 @@ class LibSBMLNetwork: true on success and false if the border dash of the LineEnding object could not be set """ - return lib.c_api_setLineEndingNthBorderDash(self.sbml_object, str(line_ending_id).encode(), index, border_dash, render_index) + return lib.c_api_setLineEndingBorderDash(self.sbml_object, str(line_ending_id).encode(), index, border_dash, render_index) def getNumSpeciesReferenceLineEndingBorderDashes(self, reaction_id, reaction_glyph_index=0, species_reference_index=0, layout_index=0): """ @@ -4459,7 +4792,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumSpeciesReferenceLineEndingBorderDashes(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index) - def getSpeciesReferenceLineEndingNthBorderDash(self, reaction_id, index, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + def getSpeciesReferenceLineEndingBorderDash(self, reaction_id, index, reaction_glyph_index=0, species_reference_index=0, layout_index=0): """ Returns the border dash with the given index of the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument @@ -4475,9 +4808,9 @@ class LibSBMLNetwork: an integer that determines the border dash with the given index of the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument """ - return lib.c_api_getSpeciesReferenceLineEndingNthBorderDash(self.sbml_object, str(reaction_id).encode(), index, reaction_glyph_index, species_reference_index, layout_index) + return lib.c_api_getSpeciesReferenceLineEndingBorderDash(self.sbml_object, str(reaction_id).encode(), index, reaction_glyph_index, species_reference_index, layout_index) - def setSpeciesReferenceLineEndingNthBorderDash(self, reaction_id, index, border_dash, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + def setSpeciesReferenceLineEndingBorderDash(self, reaction_id, index, border_dash, reaction_glyph_index=0, species_reference_index=0, layout_index=0): """ Sets the border dash with the given index of the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument @@ -4494,9 +4827,9 @@ class LibSBMLNetwork: true on success and false if the border dash of the LineEnding object of the SpeciesReference object could not be set """ - return lib.c_api_setSpeciesReferenceLineEndingNthBorderDash(self.sbml_object, str(reaction_id).encode(), index, border_dash, reaction_glyph_index, species_reference_index, layout_index) + return lib.c_api_setSpeciesReferenceLineEndingBorderDash(self.sbml_object, str(reaction_id).encode(), index, border_dash, reaction_glyph_index, species_reference_index, layout_index) - def setReactionLineEndingNthBorderDash(self, reaction_id, index, border_dash, reaction_glyph_index=0, layout_index=0): + def setReactionLineEndingBorderDash(self, reaction_id, index, border_dash, reaction_glyph_index=0, layout_index=0): """ Sets the border dash with the given index of the LineEnding object of the Reaction object with the given reaction_id, reaction_glyph_index and layout_index in the given SBMLDocument @@ -4512,7 +4845,7 @@ class LibSBMLNetwork: true on success and false if the border dash of the LineEnding object of the Reaction object could not be set """ - return lib.c_api_setReactionLineEndingNthBorderDash(self.sbml_object, str(reaction_id).encode(), index, border_dash, reaction_glyph_index, layout_index) + return lib.c_api_setReactionLineEndingBorderDash(self.sbml_object, str(reaction_id).encode(), index, border_dash, reaction_glyph_index, layout_index) def isSetLineEndingFillColor(self, line_ending_id, render_index=0): """ @@ -4837,6 +5170,216 @@ class LibSBMLNetwork: """ return lib.c_api_getNumSpeciesReferenceLineEndingGeometricShapes(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index) + def addLineEndingGeometricShape(self, line_ending_id, geometric_shape_type, render_index=0): + """ + Adds a GeometricShape object to the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument + + :Parameters: + + - line_ending_id (string): a string that determines the id of the LineEnding object + - geometric_shape_type (string): a string that determines the type of the GeometricShape object + - render_index (int, optional): an integer (default: 0) that determines the index of the RenderInformation object in the given SBMLDocument + + :Returns: + + true on success and false if the GeometricShape object could not be added to the LineEnding object + """ + return lib.c_api_addLineEndingGeometricShape(self.sbml_object, str(line_ending_id).encode(), str(geometric_shape_type).encode(), render_index) + + def addSpeciesReferenceLineEndingGeometricShape(self, reaction_id, geometric_shape_type, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + """ + Adds a GeometricShape object to the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction object + - geometric_shape_type (string): a string that determines the type of the GeometricShape object + - reaction_glyph_index (int, optional): an integer (default: 0) that determines the index of the ReactionGlyph object in the given SBMLDocument + - species_reference_index (int, optional): an integer (default: 0) that determines the index of the SpeciesReference object in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the GeometricShape object could not be added to the LineEnding object of the SpeciesReference object + """ + return lib.c_api_addSpeciesReferenceLineEndingGeometricShape(self.sbml_object, str(reaction_id).encode(), str(geometric_shape_type).encode(), reaction_glyph_index, species_reference_index, layout_index) + + def removeLineEndingGeometricShape(self, line_ending_id, index, render_index=0): + """ + Removes the GeometricShape object with the given index from the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument + + :Parameters: + + - line_ending_id (string): a string that determines the id of the LineEnding object + - index (int): an integer that determines the index of the GeometricShape object in the LineEnding object + - render_index (int, optional): an integer (default: 0) that determines the index of the RenderInformation object in the given SBMLDocument + + :Returns: + + true on success and false if the GeometricShape object could not be removed from the LineEnding object + """ + return lib.c_api_removeLineEndingGeometricShape(self.sbml_object, str(line_ending_id).encode(), index, render_index) + + def removeSpeciesReferenceLineEndingGeometricShape(self, reaction_id, index, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + """ + Removes the GeometricShape object with the given index from the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction object + - index (int): an integer that determines the index of the GeometricShape object in the LineEnding object of the SpeciesReference object + - reaction_glyph_index (int, optional): an integer (default: 0) that determines the index of the ReactionGlyph object in the given SBMLDocument + - species_reference_index (int, optional): an integer (default: 0) that determines the index of the SpeciesReference object in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the GeometricShape object could not be removed from the LineEnding object of the SpeciesReference object + """ + return lib.c_api_removeSpeciesReferenceLineEndingGeometricShape(self.sbml_object, str(reaction_id).encode(), index, reaction_glyph_index, species_reference_index, layout_index) + + def getLineEndingGeometricShapeType(self, line_ending_id, index, render_index=0): + """ + Returns the type of the GeometricShape object with the given index in the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument + + :Parameters: + + - line_ending_id (string): a string that determines the id of the LineEnding object + - index (int): an integer that determines the index of the GeometricShape object in the LineEnding object + - render_index (int, optional): an integer (default: 0) that determines the index of the RenderInformation object in the given SBMLDocument + + :Returns: + + a string that determines the type of the GeometricShape object with the given index in the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument + """ + lib.c_api_getLineEndingGeometricShapeType.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getLineEndingGeometricShapeType(self.sbml_object, str(line_ending_id).encode(), index, render_index)).value.decode() + + def getSpeciesReferenceLineEndingGeometricShapeType(self, reaction_id, index, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + """ + Returns the type of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction object + - index (int): an integer that determines the index of the GeometricShape object in the LineEnding object of the SpeciesReference object + - reaction_glyph_index (int, optional): an integer (default: 0) that determines the index of the ReactionGlyph object in the given SBMLDocument + - species_reference_index (int, optional): an integer (default: 0) that determines the index of the SpeciesReference object in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + a string that determines the type of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument + """ + lib.c_api_getSpeciesReferenceLineEndingGeometricShapeType.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getSpeciesReferenceLineEndingGeometricShapeType(self.sbml_object, str(reaction_id).encode(), index, reaction_glyph_index, species_reference_index, layout_index)).value.decode() + + def setLineEndingGeometricShapeType(self, line_ending_id, geometric_shape_type, render_index=0): + """ + Sets the type of the GeometricShape object of the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument + + :Parameters: + + - line_ending_id (string): a string that determines the id of the LineEnding object + - geometric_shape_type (string): a string that determines the type of the GeometricShape object + - render_index (int, optional): an integer (default: 0) that determines the index of the RenderInformation object in the given SBMLDocument + + :Returns: + + true on success and false if the type of the GeometricShape object could not be set + """ + return lib.c_api_setLineEndingGeometricShapeType(self.sbml_object, str(line_ending_id).encode(), str(geometric_shape_type).encode(), render_index) + + def setSpeciesReferenceLineEndingGeometricShapeType(self, reaction_id, geometric_shape_type, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + """ + Sets the type of the GeometricShape object of the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction object + - geometric_shape_type (string): a string that determines the type of the GeometricShape object + - reaction_glyph_index (int, optional): an integer (default: 0) that determines the index of the ReactionGlyph object in the given SBMLDocument + - species_reference_index (int, optional): an integer (default: 0) that determines the index of the SpeciesReference object in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the type of the GeometricShape object could not be set + """ + return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeType(self.sbml_object, str(reaction_id).encode(), str(geometric_shape_type).encode(), reaction_glyph_index, species_reference_index, layout_index) + + def getLineEndingGeometricShapeId(self, line_ending_id, index, render_index=0): + """ + Returns the id of the GeometricShape object with the given index in the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument + + :Parameters: + + - line_ending_id (string): a string that determines the id of the LineEnding object + - index (int): an integer that determines the index of the GeometricShape object in the LineEnding object + - render_index (int, optional): an integer (default: 0) that determines the index of the RenderInformation object in the given SBMLDocument + + :Returns: + + a string that determines the id of the GeometricShape object with the given index in the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument + """ + lib.c_api_getLineEndingGeometricShapeId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getLineEndingGeometricShapeId(self.sbml_object, str(line_ending_id).encode(), index, render_index)).value.decode() + + def getSpeciesReferenceLineEndingGeometricShapeId(self, reaction_id, index, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + """ + Returns the id of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction object + - index (int): an integer that determines the index of the GeometricShape object in the LineEnding object of the SpeciesReference object + - reaction_glyph_index (int, optional): an integer (default: 0) that determines the index of the ReactionGlyph object in the given SBMLDocument + - species_reference_index (int, optional): an integer (default: 0) that determines the index of the SpeciesReference object in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + a string that determines the id of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument + """ + lib.c_api_getSpeciesReferenceLineEndingGeometricShapeId.restype = ctypes.c_char_p + return ctypes.c_char_p(lib.c_api_getSpeciesReferenceLineEndingGeometricShapeId(self.sbml_object, str(reaction_id).encode(), index, reaction_glyph_index, species_reference_index, layout_index)).value.decode() + + def setLineEndingGeometricShapeId(self, line_ending_id, index, geometric_shape_id, render_index=0): + """ + Sets the id of the GeometricShape object with the given index in the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument + + :Parameters: + + - line_ending_id (string): a string that determines the id of the LineEnding object + - index (int): an integer that determines the index of the GeometricShape object in the LineEnding object + - geometric_shape_id (string): a string that determines the id of the GeometricShape object + - render_index (int, optional): an integer (default: 0) that determines the index of the RenderInformation object in the given SBMLDocument + + :Returns: + + true on success and false if the id of the GeometricShape object could not be set + """ + return lib.c_api_setLineEndingGeometricShapeId(self.sbml_object, str(line_ending_id).encode(), index, str(geometric_shape_id).encode(), render_index) + + def setSpeciesReferenceLineEndingGeometricShapeId(self, reaction_id, index, geometric_shape_id, reaction_glyph_index=0, species_reference_index=0, layout_index=0): + """ + Sets the id of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument + + :Parameters: + + - reaction_id (string): a string that determines the id of the Reaction object + - index (int): an integer that determines the index of the GeometricShape object in the LineEnding object of the SpeciesReference object + - geometric_shape_id (string): a string that determines the id of the GeometricShape object + - reaction_glyph_index (int, optional): an integer (default: 0) that determines the index of the ReactionGlyph object in the given SBMLDocument + - species_reference_index (int, optional): an integer (default: 0) that determines the index of the SpeciesReference object in the given SBMLDocument + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + true on success and false if the id of the GeometricShape object could not be set + """ + return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeId(self.sbml_object, str(reaction_id).encode(), index, str(geometric_shape_id).encode(), reaction_glyph_index, species_reference_index, layout_index) + def isLineEndingRectangle(self, line_ending_id, index=0, render_index=0): """ Returns whether the GeometricShape object with the given index in the LineEnding object with the given line_ending_id and render_index in the given SBMLDocument is a rectangle @@ -6473,7 +7016,7 @@ class LibSBMLNetwork: true if the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument is a cubic bezier segment and false otherwise """ - return lib.c_api_isSpeciesReferenceLineEndingGeometricShapeSegmentCubicBezier(self.sbml_object, str(reaction_id).encode(), segment_index, reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_isSpeciesReferenceLineEndingGeometricShapeSegmentCubicBezier(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) def getLineEndingGeometricShapeSegmentX(self, line_ending_id, segment_index, index=0, render_index=0): """ @@ -6529,9 +7072,9 @@ class LibSBMLNetwork: a float that determines the x-coordinate of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument """ lib.c_api_getSpeciesReferenceLineEndingGeometricShapeSegmentX.restype = ctypes.c_double - return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeSegmentX(self.sbml_object, str(reaction_id).encode(), segment_index, reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeSegmentX(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setSpeciesReferenceLineEndingGeometricShapeSegmentX(self, reaction_id, segment_index, x, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): + def setSpeciesReferenceLineEndingGeometricShapeSegmentX(self, reaction_id, x, segment_index, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): """ Sets the x-coordinate of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument @@ -6549,9 +7092,9 @@ class LibSBMLNetwork: true on success and false if the x-coordinate of the segment could not be set """ - return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeSegmentX(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(x), reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeSegmentX(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(x), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setReactionLineEndingGeometricShapeSegmentX(self, reaction_id, segment_index, x, reaction_glyph_index=0, layout_index=0, index=0): + def setReactionLineEndingGeometricShapeSegmentX(self, reaction_id, x, segment_index, reaction_glyph_index=0, layout_index=0, index=0): """ Sets the x-coordinate of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the Reaction object with the given reaction_id, reaction_glyph_index and layout_index in the given SBMLDocument @@ -6568,7 +7111,7 @@ class LibSBMLNetwork: true on success and false if the x-coordinate of the segment could not be set """ - return lib.c_api_setReactionLineEndingGeometricShapeSegmentX(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(x), reaction_glyph_index, layout_index, index) + return lib.c_api_setReactionLineEndingGeometricShapeSegmentX(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(x), reaction_glyph_index, layout_index, segment_index, index) def getLineEndingGeometricShapeSegmentY(self, line_ending_id, segment_index, index=0, render_index=0): """ @@ -6624,9 +7167,9 @@ class LibSBMLNetwork: a float that determines the y-coordinate of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument """ lib.c_api_getSpeciesReferenceLineEndingGeometricShapeSegmentY.restype = ctypes.c_double - return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeSegmentY(self.sbml_object, str(reaction_id).encode(), segment_index, reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeSegmentY(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setSpeciesReferenceLineEndingGeometricShapeSegmentY(self, reaction_id, segment_index, y, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): + def setSpeciesReferenceLineEndingGeometricShapeSegmentY(self, reaction_id, y, segment_index, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): """ Sets the y-coordinate of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument @@ -6644,9 +7187,9 @@ class LibSBMLNetwork: true on success and false if the y-coordinate of the segment could not be set """ - return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeSegmentY(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(y), reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeSegmentY(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(y), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setReactionLineEndingGeometricShapeSegmentY(self, reaction_id, segment_index, y, reaction_glyph_index=0, layout_index=0, index=0): + def setReactionLineEndingGeometricShapeSegmentY(self, reaction_id, y, segment_index, reaction_glyph_index=0, layout_index=0, index=0): """ Sets the y-coordinate of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the Reaction object with the given reaction_id, reaction_glyph_index and layout_index in the given SBMLDocument @@ -6663,7 +7206,7 @@ class LibSBMLNetwork: true on success and false if the y-coordinate of the segment could not be set """ - return lib.c_api_setReactionLineEndingGeometricShapeSegmentY(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(y), reaction_glyph_index, layout_index, index) + return lib.c_api_setReactionLineEndingGeometricShapeSegmentY(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(y), reaction_glyph_index, layout_index, segment_index, index) def getLineEndingGeometricShapeBasePoint1X(self, line_ending_id, segment_index, index=0, render_index=0): """ @@ -6719,9 +7262,9 @@ class LibSBMLNetwork: a float that determines the x-coordinate of the first base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument """ lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint1X.restype = ctypes.c_double - return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint1X(self.sbml_object, str(reaction_id).encode(), segment_index, reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint1X(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setSpeciesReferenceLineEndingGeometricShapeBasePoint1X(self, reaction_id, segment_index, x, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): + def setSpeciesReferenceLineEndingGeometricShapeBasePoint1X(self, reaction_id, x, segment_index, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): """ Sets the x-coordinate of the first base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument @@ -6739,9 +7282,9 @@ class LibSBMLNetwork: true on success and false if the x-coordinate of the first base point of the segment could not be set """ - return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeBasePoint1X(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(x), reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeBasePoint1X(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(x), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setReactionLineEndingGeometricShapeBasePoint1X(self, reaction_id, segment_index, x, reaction_glyph_index=0, layout_index=0, index=0): + def setReactionLineEndingGeometricShapeBasePoint1X(self, reaction_id, x, segment_index, reaction_glyph_index=0, layout_index=0, index=0): """ Sets the x-coordinate of the first base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the Reaction object with the given reaction_id, reaction_glyph_index and layout_index in the given SBMLDocument @@ -6758,7 +7301,7 @@ class LibSBMLNetwork: true on success and false if the x-coordinate of the first base point of the segment could not be set """ - return lib.c_api_setReactionLineEndingGeometricShapeBasePoint1X(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(x), reaction_glyph_index, layout_index, index) + return lib.c_api_setReactionLineEndingGeometricShapeBasePoint1X(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(x), reaction_glyph_index, layout_index, segment_index, index) def getLineEndingGeometricShapeBasePoint1Y(self, line_ending_id, segment_index, index=0, render_index=0): """ @@ -6814,9 +7357,9 @@ class LibSBMLNetwork: a float that determines the y-coordinate of the first base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument """ lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint1Y.restype = ctypes.c_double - return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint1Y(self.sbml_object, str(reaction_id).encode(), segment_index, reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint1Y(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setSpeciesReferenceLineEndingGeometricShapeBasePoint1Y(self, reaction_id, segment_index, y, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): + def setSpeciesReferenceLineEndingGeometricShapeBasePoint1Y(self, reaction_id, y, segment_index, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): """ Sets the y-coordinate of the first base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument @@ -6832,11 +7375,11 @@ class LibSBMLNetwork: :Returns: - true on success and false if the y-coordinate of the first base point of the segment could not be set - """ - return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeBasePoint1Y(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(y), reaction_glyph_index, species_reference_index, layout_index, index) + true on success and false if the y-coordinate of the first base point of the segment could not be set + """ + return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeBasePoint1Y(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(y), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setReactionLineEndingGeometricShapeBasePoint1Y(self, reaction_id, segment_index, y, reaction_glyph_index=0, layout_index=0, index=0): + def setReactionLineEndingGeometricShapeBasePoint1Y(self, reaction_id, y, segment_index, reaction_glyph_index=0, layout_index=0, index=0): """ Sets the y-coordinate of the first base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the Reaction object with the given reaction_id, reaction_glyph_index and layout_index in the given SBMLDocument @@ -6853,7 +7396,7 @@ class LibSBMLNetwork: true on success and false if the y-coordinate of the first base point of the segment could not be set """ - return lib.c_api_setReactionLineEndingGeometricShapeBasePoint1Y(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(y), reaction_glyph_index, layout_index, index) + return lib.c_api_setReactionLineEndingGeometricShapeBasePoint1Y(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(y), reaction_glyph_index, layout_index, segment_index, index) def getLineEndingGeometricShapeBasePoint2X(self, line_ending_id, segment_index, index=0, render_index=0): """ @@ -6909,9 +7452,9 @@ class LibSBMLNetwork: a float that determines the x-coordinate of the second base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument """ lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint2X.restype = ctypes.c_double - return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint2X(self.sbml_object, str(reaction_id).encode(), segment_index, reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint2X(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setSpeciesReferenceLineEndingGeometricShapeBasePoint2X(self, reaction_id, segment_index, x, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): + def setSpeciesReferenceLineEndingGeometricShapeBasePoint2X(self, reaction_id, x, segment_index, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): """ Sets the x-coordinate of the second base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument @@ -6929,9 +7472,9 @@ class LibSBMLNetwork: true on success and false if the x-coordinate of the second base point of the segment could not be set """ - return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeBasePoint2X(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(x), reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeBasePoint2X(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(x), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setReactionLineEndingGeometricShapeBasePoint2X(self, reaction_id, segment_index, x, reaction_glyph_index=0, layout_index=0, index=0): + def setReactionLineEndingGeometricShapeBasePoint2X(self, reaction_id, x, segment_index, reaction_glyph_index=0, layout_index=0, index=0): """ Sets the x-coordinate of the second base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the Reaction object with the given reaction_id, reaction_glyph_index and layout_index in the given SBMLDocument @@ -6948,7 +7491,7 @@ class LibSBMLNetwork: true on success and false if the x-coordinate of the second base point of the segment could not be set """ - return lib.c_api_setReactionLineEndingGeometricShapeBasePoint2X(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(x), reaction_glyph_index, layout_index, index) + return lib.c_api_setReactionLineEndingGeometricShapeBasePoint2X(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(x), reaction_glyph_index, layout_index, segment_index, index) def getLineEndingGeometricShapeBasePoint2Y(self, line_ending_id, segment_index, index=0, render_index=0): """ @@ -7004,9 +7547,9 @@ class LibSBMLNetwork: a float that determines the y-coordinate of the second base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument """ lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint2Y.restype = ctypes.c_double - return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint2Y(self.sbml_object, str(reaction_id).encode(), segment_index, reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_getSpeciesReferenceLineEndingGeometricShapeBasePoint2Y(self.sbml_object, str(reaction_id).encode(), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setSpeciesReferenceLineEndingGeometricShapeBasePoint2Y(self, reaction_id, segment_index, y, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): + def setSpeciesReferenceLineEndingGeometricShapeBasePoint2Y(self, reaction_id, y, segment_index, reaction_glyph_index=0, species_reference_index=0, layout_index=0, index=0): """ Sets the y-coordinate of the second base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the SpeciesReference object with the given reaction_id, reaction_glyph_index, species_reference_index and layout_index in the given SBMLDocument @@ -7024,9 +7567,9 @@ class LibSBMLNetwork: true on success and false if the y-coordinate of the second base point of the segment could not be set """ - return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeBasePoint2Y(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(y), reaction_glyph_index, species_reference_index, layout_index, index) + return lib.c_api_setSpeciesReferenceLineEndingGeometricShapeBasePoint2Y(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(y), reaction_glyph_index, species_reference_index, layout_index, segment_index, index) - def setReactionLineEndingGeometricShapeBasePoint2Y(self, reaction_id, segment_index, y, reaction_glyph_index=0, layout_index=0, index=0): + def setReactionLineEndingGeometricShapeBasePoint2Y(self, reaction_id, y, segment_index, reaction_glyph_index=0, layout_index=0, index=0): """ Sets the y-coordinate of the second base point of the segment with the given segment_index of the GeometricShape object with the given index in the LineEnding object of the Reaction object with the given reaction_id, reaction_glyph_index and layout_index in the given SBMLDocument @@ -7043,7 +7586,7 @@ class LibSBMLNetwork: true on success and false if the y-coordinate of the second base point of the segment could not be set """ - return lib.c_api_setReactionLineEndingGeometricShapeBasePoint2Y(self.sbml_object, str(reaction_id).encode(), segment_index, ctypes.c_double(y), reaction_glyph_index, layout_index, index) + return lib.c_api_setReactionLineEndingGeometricShapeBasePoint2Y(self.sbml_object, str(reaction_id).encode(), ctypes.c_double(y), reaction_glyph_index, layout_index, segment_index, index) def isSetBorderColor(self, id, graphical_object_index=0, layout_index=0): """ @@ -7518,7 +8061,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumBorderDashes(self.sbml_object, str(id).encode(), graphical_object_index, layout_index) - def getNthBorderDash(self, id, border_dash_index, graphical_object_index=0, layout_index=0): + def getBorderDash(self, id, border_dash_index, graphical_object_index=0, layout_index=0): """ Returns the border dash with the given border_dash_index of the GraphicalObject associated with the model entity with the given id, graphical_object_index, and layout_index in the given SBMLDocument @@ -7533,9 +8076,9 @@ class LibSBMLNetwork: an integer that determines the border dash with the given border_dash_index of the GraphicalObject associated with the model entity with the given id, graphical_object_index, and layout_index in the given SBMLDocument """ - return lib.c_api_getNthBorderDash(self.sbml_object, str(id).encode(), border_dash_index, graphical_object_index, layout_index) + return lib.c_api_getBorderDash(self.sbml_object, str(id).encode(), border_dash_index, graphical_object_index, layout_index) - def setNthBorderDash(self, id, dash, border_dash_index, graphical_object_index=0, layout_index=0): + def setBorderDash(self, id, dash, border_dash_index, graphical_object_index=0, layout_index=0): """ Sets the border dash with the given border_dash_index of the GraphicalObject associated with the model entity with the given id, graphical_object_index, and layout_index in the given SBMLDocument @@ -7551,7 +8094,7 @@ class LibSBMLNetwork: true on success and false if the border dash could not be set """ - return lib.c_api_setNthBorderDash(self.sbml_object, str(id).encode(), dash, border_dash_index, graphical_object_index, layout_index) + return lib.c_api_setBorderDash(self.sbml_object, str(id).encode(), dash, border_dash_index, graphical_object_index, layout_index) def getNumLineDashes(self, id, graphical_object_index=0, layout_index=0): """ @@ -7569,7 +8112,7 @@ class LibSBMLNetwork: """ return lib.c_api_getNumLineDashes(self.sbml_object, str(id).encode(), graphical_object_index, layout_index) - def getNthLineDash(self, id, line_dash_index, graphical_object_index=0, layout_index=0): + def getLineDash(self, id, line_dash_index, graphical_object_index=0, layout_index=0): """ Returns the line dash with the given line_dash_index of the GraphicalObject (ReactionGlyph) associated with the model entity with the given id, graphical_object_index, and layout_index in the given SBMLDocument @@ -7584,9 +8127,9 @@ class LibSBMLNetwork: an integer that determines the line dash with the given line_dash_index of the GraphicalObject associated with the model entity with the given id, graphical_object_index, and layout_index in the given SBMLDocument """ - return lib.c_api_getNthLineDash(self.sbml_object, str(id).encode(), line_dash_index, graphical_object_index, layout_index) + return lib.c_api_getLineDash(self.sbml_object, str(id).encode(), line_dash_index, graphical_object_index, layout_index) - def setNthLineDash(self, id, dash, line_dash_index, graphical_object_index=0, layout_index=0): + def setLineDash(self, id, dash, line_dash_index, graphical_object_index=0, layout_index=0): """ Sets the line dash with the given line_dash_index of the GraphicalObject (ReactionGlyph) associated with the model entity with the given id, graphical_object_index, and layout_index in the given SBMLDocument @@ -7602,7 +8145,7 @@ class LibSBMLNetwork: true on success and false if the line dash could not be set """ - return lib.c_api_setNthLineDash(self.sbml_object, str(id).encode(), dash, line_dash_index, graphical_object_index, layout_index) + return lib.c_api_setLineDash(self.sbml_object, str(id).encode(), dash, line_dash_index, graphical_object_index, layout_index) def isSetFillColor(self, id, graphical_object_index=0, layout_index=0): """ @@ -12271,10 +12814,10 @@ class LibSBMLNetwork: a list of strings that determines the valid SpeciesReference roles in the given SBMLDocument """ - lib.c_api_getNthValidRoleValue.restype = ctypes.c_char_p + lib.c_api_getValidRoleValue.restype = ctypes.c_char_p list_of_roles = [] for n in range(lib.c_api_getNumValidRoleValues()): - list_of_roles.append(ctypes.c_char_p(lib.c_api_getNthValidRoleValue(n)).value.decode()) + list_of_roles.append(ctypes.c_char_p(lib.c_api_getValidRoleValue(n)).value.decode()) return list_of_roles @@ -12287,10 +12830,10 @@ class LibSBMLNetwork: a list of strings that determines the valid GraphicalObject alignments in the given SBMLDocument """ - lib.c_api_getNthValidAlignmentValue.restype = ctypes.c_char_p + lib.c_api_getValidAlignmentValue.restype = ctypes.c_char_p list_of_alignments = [] for n in range(lib.c_api_getNumValidAlignmentValues()): - list_of_alignments.append(ctypes.c_char_p(lib.c_api_getNthValidAlignmentValue(n)).value.decode()) + list_of_alignments.append(ctypes.c_char_p(lib.c_api_getValidAlignmentValue(n)).value.decode()) return list_of_alignments @@ -12303,10 +12846,10 @@ class LibSBMLNetwork: a list of strings that determines the valid GraphicalObject distribution directions in the given SBMLDocument """ - lib.c_api_getNthValidDistributionDirectionValue.restype = ctypes.c_char_p + lib.c_api_getValidDistributionDirectionValue.restype = ctypes.c_char_p list_of_distribution_directions = [] for n in range(lib.c_api_getNumValidDistributionDirectionValues()): - list_of_distribution_directions.append(ctypes.c_char_p(lib.c_api_getNthValidDistributionDirectionValue(n)).value.decode()) + list_of_distribution_directions.append(ctypes.c_char_p(lib.c_api_getValidDistributionDirectionValue(n)).value.decode()) return list_of_distribution_directions @@ -12354,10 +12897,10 @@ class LibSBMLNetwork: a list of strings that determines the valid GradientBase spread methods in the given SBMLDocument """ - lib.c_api_getNthValidSpreadMethodValue.restype = ctypes.c_char_p + lib.c_api_getValidSpreadMethodValue.restype = ctypes.c_char_p list_of_spread_methods = [] for n in range(lib.c_api_getNumValidSpreadMethodValues()): - list_of_spread_methods.append(ctypes.c_char_p(lib.c_api_getNthValidSpreadMethodValue(n)).value.decode()) + list_of_spread_methods.append(ctypes.c_char_p(lib.c_api_getValidSpreadMethodValue(n)).value.decode()) return list_of_spread_methods @@ -12370,10 +12913,10 @@ class LibSBMLNetwork: a list of strings that determines the valid GraphicalObject font weights in the given SBMLDocument """ - lib.c_api_getNthValidFontWeightValue.restype = ctypes.c_char_p + lib.c_api_getValidFontWeightValue.restype = ctypes.c_char_p list_of_font_weights = [] for n in range(lib.c_api_getNumValidFontWeightValues()): - list_of_font_weights.append(ctypes.c_char_p(lib.c_api_getNthValidFontWeightValue(n)).value.decode()) + list_of_font_weights.append(ctypes.c_char_p(lib.c_api_getValidFontWeightValue(n)).value.decode()) return list_of_font_weights @@ -12386,10 +12929,10 @@ class LibSBMLNetwork: a list of strings that determines the valid GraphicalObject font styles in the given SBMLDocument """ - lib.c_api_getNthValidFontStyleValue.restype = ctypes.c_char_p + lib.c_api_getValidFontStyleValue.restype = ctypes.c_char_p list_of_font_styles = [] for n in range(lib.c_api_getNumValidFontStyleValues()): - list_of_font_styles.append(ctypes.c_char_p(lib.c_api_getNthValidFontStyleValue(n)).value.decode()) + list_of_font_styles.append(ctypes.c_char_p(lib.c_api_getValidFontStyleValue(n)).value.decode()) return list_of_font_styles @@ -12402,10 +12945,10 @@ class LibSBMLNetwork: a list of strings that determines the valid GraphicalObject horizontal text alignments in the given SBMLDocument """ - lib.c_api_getNthValidHorizontalTextAlignmentValue.restype = ctypes.c_char_p + lib.c_api_getValidHorizontalTextAlignmentValue.restype = ctypes.c_char_p list_of_horizontal_text_alignments = [] for n in range(lib.c_api_getNumValidHorizontalTextAlignmentValues()): - list_of_horizontal_text_alignments.append(ctypes.c_char_p(lib.c_api_getNthValidHorizontalTextAlignmentValue(n)).value.decode()) + list_of_horizontal_text_alignments.append(ctypes.c_char_p(lib.c_api_getValidHorizontalTextAlignmentValue(n)).value.decode()) return list_of_horizontal_text_alignments @@ -12418,10 +12961,10 @@ class LibSBMLNetwork: a list of strings that determines the valid GraphicalObject vertical text alignments in the given SBMLDocument """ - lib.c_api_getNthValidVerticalTextAlignmentValue.restype = ctypes.c_char_p + lib.c_api_getValidVerticalTextAlignmentValue.restype = ctypes.c_char_p list_of_vertical_text_alignments = [] for n in range(lib.c_api_getNumValidVerticalTextAlignmentValues()): - list_of_vertical_text_alignments.append(ctypes.c_char_p(lib.c_api_getNthValidVerticalTextAlignmentValue(n)).value.decode()) + list_of_vertical_text_alignments.append(ctypes.c_char_p(lib.c_api_getValidVerticalTextAlignmentValue(n)).value.decode()) return list_of_vertical_text_alignments @@ -12434,10 +12977,10 @@ class LibSBMLNetwork: a list of strings that determines the valid GraphicalObject fill rules in the given SBMLDocument """ - lib.c_api_getNthValidFillRuleValue.restype = ctypes.c_char_p + lib.c_api_getValidFillRuleValue.restype = ctypes.c_char_p list_of_fill_rules = [] for n in range(lib.c_api_getNumValidFillRuleValues()): - list_of_fill_rules.append(ctypes.c_char_p(lib.c_api_getNthValidFillRuleValue(n)).value.decode()) + list_of_fill_rules.append(ctypes.c_char_p(lib.c_api_getValidFillRuleValue(n)).value.decode()) return list_of_fill_rules @@ -12450,25 +12993,39 @@ class LibSBMLNetwork: a list of strings that determines the valid GeometricShape types in the given SBMLDocument """ - lib.c_api_getNthValidGeometricShapeValue.restype = ctypes.c_char_p + lib.c_api_getValidGeometricShapeValue.restype = ctypes.c_char_p list_of_geometric_shapes = [] for n in range(lib.c_api_getNumValidGeometricShapeValues()): - list_of_geometric_shapes.append(ctypes.c_char_p(lib.c_api_getNthValidGeometricShapeValue(n)).value.decode()) + list_of_geometric_shapes.append(ctypes.c_char_p(lib.c_api_getValidGeometricShapeValue(n)).value.decode()) return list_of_geometric_shapes - def setNamesAsTextLabels(self, use_name_as_text_label): + def getUseNameAsTextLabel(self, layout_index=0): + """ + Returns the flag to use the name of the model entity as the text label of the GraphicalObject associated with the model entity in the layout with the given layout_index + + :Parameters: + + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument + + :Returns: + + a boolean that determines whether to use the name of the model entity as the text label of the GraphicalObject associated with the model entity in the layout + + """ + return lib.c_api_getUseNameAsTextLabel(self.sbml_object, layout_index) + + def setUseNameAsTextLabel(self, use_name_as_text_label, layout_index=0): """ - Set the flag to use the name of the model entity as the text label of the GraphicalObject associated with the model entity + Set the flag to use the name of the model entity as the text label of the GraphicalObject associated with the model entities in the layout with the given layout_index :Parameters: - - use_name_as_text_label (bool): a boolean that determines whether to use the name of the model entity as the text label of the GraphicalObject associated with the model entity + - use_name_as_text_label (bool): a boolean that determines whether to use the name of the model entity as the text label of the GraphicalObject associated with the model entities in the layout + - layout_index (int, optional): an integer (default: 0) that determines the index of the Layout object in the given SBMLDocument """ - self.use_name_as_text_label = use_name_as_text_label - if self.layout_is_added: - self.autolayout(fixed_position_nodes=self.getListOfSpeciesIds()) + return lib.c_api_setUseNameAsTextLabel(self.sbml_object, use_name_as_text_label, layout_index) def enableDisplayCompartmentsTextLabel(self, display_compartments_text_label): """ @@ -12514,10 +13071,10 @@ class LibSBMLNetwork: a list of strings that determines the available style names """ - lib.c_api_getNthPredefinedStyleName.restype = ctypes.c_char_p + lib.c_api_getPredefinedStyleName.restype = ctypes.c_char_p list_of_styles = [] for n in range(lib.c_api_getNumPredefinedStyles()): - list_of_styles.append(ctypes.c_char_p(lib.c_api_getNthPredefinedStyleName(n)).value.decode()) + list_of_styles.append(ctypes.c_char_p(lib.c_api_getPredefinedStyleName(n)).value.decode()) return list_of_styles diff --git a/src/bindings/python/ctypes/sbmlnetwork/src/sbmlnetwork/sbmlnetwork.py b/src/bindings/python/ctypes/sbmlnetwork/src/sbmlnetwork/sbmlnetwork.py index b9802af..f1712e8 100644 --- a/src/bindings/python/ctypes/sbmlnetwork/src/sbmlnetwork/sbmlnetwork.py +++ b/src/bindings/python/ctypes/sbmlnetwork/src/sbmlnetwork/sbmlnetwork.py @@ -16,12 +16,12 @@ def draw(self, file_name=""): :param file_name: """ if file_name: - networkinfotranslator.import_sbml_export_figure(self, file_name, self.use_name_as_text_label, + networkinfotranslator.import_sbml_export_figure(self, file_name, self.display_compartments_text_label, self.display_species_text_label, self.display_reactions_text_label) else: - display(networkinfotranslator.import_sbml_export_pil_image(self, self.use_name_as_text_label, + display(networkinfotranslator.import_sbml_export_pil_image(self, self.display_compartments_text_label, self.display_species_text_label, self.display_reactions_text_label)) diff --git a/src/bindings/python/ctypes/sbmlnetwork/tests/test_sbml_network.py b/src/bindings/python/ctypes/sbmlnetwork/tests/test_sbml_network.py index 3ad260f..515a43f 100644 --- a/src/bindings/python/ctypes/sbmlnetwork/tests/test_sbml_network.py +++ b/src/bindings/python/ctypes/sbmlnetwork/tests/test_sbml_network.py @@ -740,7 +740,7 @@ def _check_set_dimensions_of_ellipse_geometric_shape(self, network, entity_id): @staticmethod def _get_associated_compartment_id(network, element_id): - compartment_id = network.getCompartmentId(element_id) + compartment_id = network.getGraphicalObjectCompartmentId(element_id) if not compartment_id: list_of_compartment_ids = network.getListOfCompartmentIds() if len(list_of_compartment_ids) == 1: diff --git a/src/c_api/libsbmlnetwork_c_api.cpp b/src/c_api/libsbmlnetwork_c_api.cpp index 216d917..d5c31d8 100644 --- a/src/c_api/libsbmlnetwork_c_api.cpp +++ b/src/c_api/libsbmlnetwork_c_api.cpp @@ -55,7 +55,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return isSetModel(document); } - int c_api_autolayout(SBMLDocument *document, const int maxNumConnectedEdges, bool useNameAsTextLabel, bool resetFixedPositionElements, const char ***fixedPositionNodes, const int fixedPositionNodesSize) { + int c_api_autolayout(SBMLDocument *document, const int maxNumConnectedEdges, bool resetFixedPositionElements, const char ***fixedPositionNodes, const int fixedPositionNodesSize) { std::set > fixedPositionNodesSet = std::set >(); if (fixedPositionNodes) { for (int i = 0; i < fixedPositionNodesSize; i++) { @@ -66,7 +66,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { } } - return autolayout(document, maxNumConnectedEdges, useNameAsTextLabel, resetFixedPositionElements, fixedPositionNodesSet); + return autolayout(document, maxNumConnectedEdges, resetFixedPositionElements, fixedPositionNodesSet); } int c_api_autorender(SBMLDocument *document, const int maxNumConnectedEdges) { @@ -100,6 +100,62 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return distribute(document, nodesSet, direction, spacing); } + int c_api_makeAllVisible(SBMLDocument* document, int layoutIndex) { + return makeVisible(document, layoutIndex); + } + + int c_api_makeAllInvisible(SBMLDocument* document, int layoutIndex) { + return makeInvisible(document, layoutIndex); + } + + int c_api_makeCompartmentsVisible(SBMLDocument* document, int layoutIndex) { + return makeCompartmentVisible(document, layoutIndex); + } + + int c_api_makeCompartmentsInvisible(SBMLDocument* document, int layoutIndex) { + return makeCompartmentInvisible(document, layoutIndex); + } + + int c_api_makeSpeciesVisible(SBMLDocument* document, int layoutIndex) { + return makeSpeciesVisible(document, layoutIndex); + } + + int c_api_makeSpeciesInvisible(SBMLDocument* document, int layoutIndex) { + return makeSpeciesInvisible(document, layoutIndex); + } + + int c_api_makeReactionsVisible(SBMLDocument* document, int layoutIndex) { + return makeReactionVisible(document, layoutIndex); + } + + int c_api_makeReactionsInvisible(SBMLDocument* document, int layoutIndex) { + return makeReactionInvisible(document, layoutIndex); + } + + int c_api_makeSpeciesReferencesVisible(SBMLDocument* document, int layoutIndex) { + return makeSpeciesReferenceVisible(document, layoutIndex); + } + + int c_api_makeSpeciesReferencesInvisible(SBMLDocument* document, int layoutIndex) { + return makeSpeciesReferenceInvisible(document, layoutIndex); + } + + int c_api_makeLineEndingsVisible(SBMLDocument* document, int layoutIndex) { + return makeLineEndingVisible(document, layoutIndex); + } + + int c_api_makeLineEndingsInvisible(SBMLDocument* document, int layoutIndex) { + return makeLineEndingInvisible(document, layoutIndex); + } + + int c_api_makeVisible(SBMLDocument* document, const char* id, bool applyToConnectedElements, int graphicalObjectIndex, int layoutIndex) { + return makeVisible(document, getGraphicalObject(document, layoutIndex, id, graphicalObjectIndex), applyToConnectedElements); + } + + int c_api_makeInvisible(SBMLDocument* document, const char* id, bool applyToConnectedElements, int graphicalObjectIndex, int layoutIndex) { + return makeInvisible(document, getGraphicalObject(document, layoutIndex, id, graphicalObjectIndex), applyToConnectedElements); + } + const int c_api_getNumLayouts(SBMLDocument* document) { return getNumLayouts(document); } @@ -112,8 +168,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return createDefaultLayoutFeatures(document, maxNumConnectedEdges); } - int c_api_createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges, - bool useNameAsTextLabel, bool resetFixedPositionElements, + int c_api_createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges, bool resetFixedPositionElements, const char ***fixedPositionNodes, const int fixedPositionNodesSize) { std::set > fixedPositionNodesSet = std::set >(); for (int i = 0; i < fixedPositionNodesSize; i++) { @@ -123,34 +178,23 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { fixedPositionNodesSet.insert(std::make_pair(id, index)); } - return createDefaultLayoutLocations(document, maxNumConnectedEdges, useNameAsTextLabel, resetFixedPositionElements, fixedPositionNodesSet); + return createDefaultLayoutLocations(document, maxNumConnectedEdges, resetFixedPositionElements, fixedPositionNodesSet); } - int c_api_createAliasSpeciesGlyph(SBMLDocument* document, const char* speciesId, const char* reactionId, int reactionGlyphIndex, int layoutIndex) { - return createAliasSpeciesGlyph(document, layoutIndex, speciesId, reactionId, reactionGlyphIndex); + bool c_api_getUseNameAsTextLabel(SBMLDocument* document, int layoutIndex) { + return getUseNameAsTextLabel(document, layoutIndex); } - int c_api_createAliasReactionGlyph(SBMLDocument* document, const char* reactionId, int layoutIndex) { - return createAliasReactionGlyph(document, layoutIndex, reactionId); + int c_api_setUseNameAsTextLabel(SBMLDocument* document, bool useNameAsTextLabels, int layoutIndex) { + return setUseNameAsTextLabel(document, layoutIndex, useNameAsTextLabels); } - int c_api_makeSpeciesGlyphVisible(SBMLDocument* document, const char* speciesId, const char* reactionId, bool visible, int reactionGlyphIndex, int layoutIndex) { - return makeSpeciesGlyphVisible(document, layoutIndex, speciesId, reactionId, reactionGlyphIndex, visible); + int c_api_createAliasSpeciesGlyph(SBMLDocument* document, const char* speciesId, const char* reactionId, int reactionGlyphIndex, int layoutIndex) { + return createAliasSpeciesGlyph(document, layoutIndex, speciesId, reactionId, reactionGlyphIndex); } - int c_api_makeSpeciesGlyphsVisible(SBMLDocument* document, const char ***species, const int speciesSize, const bool visible, int layoutIndex) { - std::set > speciesSet = std::set >(); - if (species) { - for (int i = 0; i < speciesSize; i++) { - const char **aSpecies = species[i]; - const char *speciesId = aSpecies[0]; - const char *reactionId = aSpecies[1]; - int reactionGlyphIndex = atoi(aSpecies[2]); - speciesSet.insert(std::make_tuple(speciesId, reactionId, reactionGlyphIndex)); - } - } - - return makeSpeciesGlyphsVisible(document, layoutIndex, speciesSet, visible); + int c_api_createAliasReactionGlyph(SBMLDocument* document, const char* reactionId, int layoutIndex) { + return createAliasReactionGlyph(document, layoutIndex, reactionId); } double c_api_getCanvasWidth(SBMLDocument* document, int layoutIndex) { @@ -177,68 +221,76 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumGraphicalObjects(document, layoutIndex, id); } - const char* c_api_getNthGraphicalObjectId(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex) { - GraphicalObject* graphicalObject = getGraphicalObject(document, layoutIndex, entityId, graphicalObjectIndex); - if (graphicalObject) - return strdup(graphicalObject->getId().c_str()); + int c_api_removeGraphicalObject(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex) { + return removeGraphicalObject(document, layoutIndex, id, graphicalObjectIndex); + } - return ""; + bool c_api_isSetId(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex) { + return isSetId(document, layoutIndex, entityId, graphicalObjectIndex); } - const char* c_api_getNthGraphicalObjectMetaId(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex) { - GraphicalObject* graphicalObject = getGraphicalObject(document, layoutIndex, entityId, graphicalObjectIndex); - if (graphicalObject) - return strdup(graphicalObject->getMetaId().c_str()); + const char* c_api_getId(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex) { + return strdup(getId(document, layoutIndex, entityId, graphicalObjectIndex).c_str()); + } - return ""; + int c_api_setId(SBMLDocument* document, const char* entityId, const char* graphicalObjectId, int graphicalObjectIndex, int layoutIndex) { + return setId(document, layoutIndex, entityId, graphicalObjectIndex, graphicalObjectId); } - const int c_api_getNumCompartments(SBMLDocument* document) { - return getNumCompartments(document); + bool c_api_isSetMetaId(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex) { + return isSetMetaId(document, layoutIndex, entityId, graphicalObjectIndex); } - const char* c_api_getNthCompartmentId(SBMLDocument* document, int compartmentIndex) { - return strdup(getNthCompartmentId(document, compartmentIndex).c_str()); + const char* c_api_getMetaId(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex) { + return strdup(getId(document, layoutIndex, entityId, graphicalObjectIndex).c_str()); } - const int c_api_getNumAllCompartmentGlyphs(SBMLDocument* document, int layoutIndex) { - return getNumCompartmentGlyphs(document, layoutIndex); + int c_api_setMetaId(SBMLDocument* document, const char* entityId, const char* metaId, int graphicalObjectIndex, int layoutIndex) { + return setMetaId(document, layoutIndex, entityId, graphicalObjectIndex, metaId); } - const int c_api_getNumCompartmentGlyphs(SBMLDocument* document, const char* compartmentId, int layoutIndex) { - return getNumCompartmentGlyphs(document, layoutIndex, compartmentId); + bool c_api_isSetName(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex) { + return isSetName(document, layoutIndex, entityId, graphicalObjectIndex); } - const char* c_api_getNthCompartmentGlyphId(SBMLDocument* document, const char* compartmentId, int compartmentGlyphIndex, int layoutIndex) { - CompartmentGlyph* compartmentGlyph = getCompartmentGlyph(document, layoutIndex, compartmentId, compartmentGlyphIndex); - if (compartmentGlyph) - return strdup(compartmentGlyph->getId().c_str()); + const char* c_api_getName(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex) { + return strdup(getName(document, layoutIndex, entityId, graphicalObjectIndex).c_str()); + } - return ""; + int c_api_setName(SBMLDocument* document, const char* entityId, const char* name, int graphicalObjectIndex, int layoutIndex) { + return setName(document, layoutIndex, entityId, graphicalObjectIndex, name); + } + + const int c_api_getNumCompartments(SBMLDocument* document) { + return getNumCompartments(document); } - const char* c_api_getNthCompartmentGlyphMetaId(SBMLDocument* document, const char* compartmentId, int compartmentGlyphIndex, int layoutIndex) { - CompartmentGlyph* compartmentGlyph = getCompartmentGlyph(document, layoutIndex, compartmentId, compartmentGlyphIndex); - if (compartmentGlyph) - return strdup(compartmentGlyph->getMetaId().c_str()); + const char* c_api_getCompartmentId(SBMLDocument* document, int compartmentIndex) { + return strdup(getCompartmentId(document, compartmentIndex).c_str()); + } - return ""; + const int c_api_getNumAllCompartmentGlyphs(SBMLDocument* document, int layoutIndex) { + return getNumCompartmentGlyphs(document, layoutIndex); + } + + const int c_api_getNumCompartmentGlyphs(SBMLDocument* document, const char* compartmentId, int layoutIndex) { + return getNumCompartmentGlyphs(document, layoutIndex, compartmentId); } bool c_api_isCompartmentGlyph(SBMLDocument* document, const char* compartmentId, int layoutIndex) { return isCompartmentGlyph(document, layoutIndex, compartmentId); } - const char* c_api_getCompartmentId(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex) { - return strdup(getCompartmentId(document, layoutIndex, id, graphicalObjectIndex).c_str()); + const char* c_api_getGraphicalObjectCompartmentId(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex) { + return strdup(getGraphicalObjectCompartmentId(document, layoutIndex, id, graphicalObjectIndex).c_str()); } const int c_api_getNumSpecies(SBMLDocument* document) { return getNumSpecies(document); } - const char* c_api_getNthSpeciesId(SBMLDocument* document, int speciesIndex) { - return strdup(getNthSpeciesId(document, speciesIndex).c_str()); + const char* c_api_getSpeciesId(SBMLDocument* document, int speciesIndex) { + return strdup(getSpeciesId(document, speciesIndex).c_str()); } const int c_api_getNumAllSpeciesGlyphs(SBMLDocument* document, int layoutIndex) { @@ -249,22 +301,6 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumSpeciesGlyphs(document, layoutIndex, speciesId); } - const char* c_api_getNthSpeciesGlyphId(SBMLDocument* document, const char* speciesId, int speciesGlyphIndex, int layoutIndex) { - SpeciesGlyph* speciesGlyph = getSpeciesGlyph(document, layoutIndex, speciesId, speciesGlyphIndex); - if (speciesGlyph) - return strdup(speciesGlyph->getId().c_str()); - - return ""; - } - - const char* c_api_getNthSpeciesGlyphMetaId(SBMLDocument* document, const char* speciesId, int speciesGlyphIndex, int layoutIndex) { - SpeciesGlyph* speciesGlyph = getSpeciesGlyph(document, layoutIndex, speciesId, speciesGlyphIndex); - if (speciesGlyph) - return strdup(speciesGlyph->getMetaId().c_str()); - - return ""; - } - const int c_api_setSpeciesGlyphIndexInReactionGlyph(SBMLDocument* document, const char* speciesId, const char* reactionId, int index, int reactionGlyphIndex, int layoutIndex) { return setSpeciesGlyphIndexInReactionGlyph(document, layoutIndex, speciesId, reactionId, reactionGlyphIndex, index); } @@ -281,8 +317,8 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumReactions(document); } - const char* c_api_getNthReactionId(SBMLDocument* document, int reactionIndex) { - return strdup(getNthReactionId(document, reactionIndex).c_str()); + const char* c_api_getReactionId(SBMLDocument* document, int reactionIndex) { + return strdup(getReactionId(document, reactionIndex).c_str()); } const int c_api_getNumAllReactionGlyphs(SBMLDocument* document, int layoutIndex) { @@ -293,22 +329,6 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumReactionGlyphs(document, layoutIndex, reactionId); } - const char* c_api_getNthReactionGlyphId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int layoutIndex) { - ReactionGlyph* reactionGlyph = getReactionGlyph(document, layoutIndex, reactionId, reactionGlyphIndex); - if (reactionGlyph) - return strdup(reactionGlyph->getId().c_str()); - - return ""; - } - - const char* c_api_getNthReactionGlyphMetaId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int layoutIndex) { - ReactionGlyph* reactionGlyph = getReactionGlyph(document, layoutIndex, reactionId, reactionGlyphIndex); - if (reactionGlyph) - return strdup(reactionGlyph->getMetaId().c_str()); - - return ""; - } - bool c_api_isReactionGlyph(SBMLDocument* document, const char* reactionId, int layoutIndex) { return isReactionGlyph(document, layoutIndex, reactionId); } @@ -325,16 +345,16 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumModifiers(document, reactionId); } - const char* c_api_getNthReactantId(SBMLDocument* document, const char* reactionId, int reactantIndex) { - return strdup(getNthReactantId(document, reactionId, reactantIndex).c_str()); + const char* c_api_getReactantId(SBMLDocument* document, const char* reactionId, int reactantIndex) { + return strdup(getReactantId(document, reactionId, reactantIndex).c_str()); } - const char* c_api_getNthProductId(SBMLDocument* document, const char* reactionId, int productIndex) { - return strdup(getNthProductId(document, reactionId, productIndex).c_str()); + const char* c_api_getProductId(SBMLDocument* document, const char* reactionId, int productIndex) { + return strdup(getProductId(document, reactionId, productIndex).c_str()); } - const char* c_api_getNthModifierId(SBMLDocument* document, const char* reactionId, int modifierIndex) { - return strdup(getNthModifierId(document, reactionId, modifierIndex).c_str()); + const char* c_api_getModifierId(SBMLDocument* document, const char* reactionId, int modifierIndex) { + return strdup(getModifierId(document, reactionId, modifierIndex).c_str()); } const int c_api_getNumSpeciesReferences(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int layoutIndex) { @@ -385,6 +405,18 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumSpeciesReferenceCurveSegments(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex); } + int c_api_addSpeciesReferenceLineCurveSegment(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex) { + return addSpeciesReferenceLineCurveSegment(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex); + } + + int c_api_addSpeciesReferenceCubicBezierCurveSegment(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex) { + return addSpeciesReferenceCubicBezierCurveSegment(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex); + } + + int c_api_removeSpeciesReferenceCurveSegment(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int curveSegmentIndex, int layoutIndex) { + return removeSpeciesReferenceCurveSegment(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, curveSegmentIndex); + } + bool c_api_isSpeciesReferenceCurveSegmentCubicBezier(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int curveSegmentIndex, int layoutIndex) { return isSpeciesReferenceCurveSegmentCubicBezier(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, curveSegmentIndex); } @@ -481,11 +513,11 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumStrokeDashes(document, getSpeciesReference(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)); } - const int c_api_getSpeciesReferenceNthLineDash(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int lineDashIndex, int layoutIndex) { + const int c_api_getSpeciesReferenceLineDash(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int lineDashIndex, int layoutIndex) { return getStrokeDash(document, getSpeciesReference(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex), lineDashIndex); } - int c_api_setSpeciesReferenceNthLineDash(SBMLDocument* document, const char* reactionId, const int dash, int reactionGlyphIndex, int speciesReferenceIndex, int lineDashIndex, int layoutIndex) { + int c_api_setSpeciesReferenceLineDash(SBMLDocument* document, const char* reactionId, const int dash, int reactionGlyphIndex, int speciesReferenceIndex, int lineDashIndex, int layoutIndex) { return setStrokeDash(document, getSpeciesReference(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex), lineDashIndex, dash); } @@ -521,8 +553,8 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumTextGlyphs(document, layoutIndex, id, graphicalObjectIndex); } - const char* c_api_getText(SBMLDocument* document, const char* id, int graphicalObjectIndex, int textGlyphIndex, int layoutIndex, bool useNameAsTextLabel) { - return strdup(getText(document, layoutIndex, id, graphicalObjectIndex, textGlyphIndex, useNameAsTextLabel).c_str()); + const char* c_api_getText(SBMLDocument* document, const char* id, int graphicalObjectIndex, int textGlyphIndex, int layoutIndex) { + return strdup(getText(document, layoutIndex, id, graphicalObjectIndex, textGlyphIndex).c_str()); } int c_api_setText(SBMLDocument* document, const char* id, const char* text, int graphicalObjectIndex, int textGlyphIndex, int layoutIndex) { @@ -537,6 +569,22 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return removeText(document, layoutIndex, id, graphicalObjectIndex, textGlyphIndex); } + const int c_api_getNumAllAdditionalGraphicalObjects(SBMLDocument* document, int layoutIndex) { + return getNumAdditionalGraphicalObjects(document, layoutIndex); + } + + const char* c_api_getAdditionalGraphicalObjectId(SBMLDocument* document, int additionalGraphicalObjectIndex, int layoutIndex) { + return strdup(getAdditionalGraphicalObjectId(document, layoutIndex, additionalGraphicalObjectIndex).c_str()); + } + + int c_api_addAdditionalGraphicalObject(SBMLDocument* document, const char* id, int layoutIndex) { + return addAdditionalGraphicalObject(document, layoutIndex, id); + } + + int c_api_removeAdditionalGraphicalObject(SBMLDocument* document, int additionalGraphicalObjectIndex, int layoutIndex) { + return removeAdditionalGraphicalObject(document, layoutIndex, additionalGraphicalObjectIndex); + } + const double c_api_getX(SBMLDocument* document, const char* id, const int graphicalObjectIndex, int layoutIndex) { return getPositionX(document, layoutIndex, id, graphicalObjectIndex); } @@ -657,6 +705,18 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumCurveSegments(document, layoutIndex, id, graphicalObjectIndex); } + int c_api_addLineCurveSegment(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex) { + return addLineCurveSegment(document, layoutIndex, id, graphicalObjectIndex); + } + + int c_api_addCubicBezierCurveSegment(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex) { + return addCubicBezierCurveSegment(document, layoutIndex, id, graphicalObjectIndex); + } + + int c_api_removeCurveSegment(SBMLDocument* document, const char* id, int graphicalObjectIndex, int curveSegmentIndex, int layoutIndex) { + return removeCurveSegment(document, layoutIndex, id, graphicalObjectIndex, curveSegmentIndex); + } + bool c_api_isCurveSegmentCubicBezier(SBMLDocument* document, const char* id, int graphicalObjectIndex, int curveSegmentIndex, int layoutIndex) { return isCubicBezier(document, layoutIndex, id, graphicalObjectIndex, curveSegmentIndex); } @@ -777,12 +837,12 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumLocalColorDefinitions(document, renderIndex); } - const char* c_api_getNthGlobalColorId(SBMLDocument* document, int colorIndex, int renderIndex) { - return strdup(getNthGlobalColorDefinitionId(document, renderIndex, colorIndex).c_str()); + const char* c_api_getGlobalColorId(SBMLDocument* document, int colorIndex, int renderIndex) { + return strdup(getGlobalColorDefinitionId(document, renderIndex, colorIndex).c_str()); } - const char* c_api_getNthLocalColorId(SBMLDocument* document, int colorIndex, int renderIndex) { - return strdup(getNthLocalColorDefinitionId(document, renderIndex, colorIndex).c_str()); + const char* c_api_getLocalColorId(SBMLDocument* document, int colorIndex, int renderIndex) { + return strdup(getLocalColorDefinitionId(document, renderIndex, colorIndex).c_str()); } bool c_api_isSetColorValue(SBMLDocument* document, const char* id, int renderIndex) { @@ -809,12 +869,12 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumLocalGradientDefinitions(document, renderIndex); } - const char* c_api_getNthGlobalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex) { - return strdup(getNthGlobalGradientDefinitionId(document, renderIndex, gradientIndex).c_str()); + const char* c_api_getGlobalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex) { + return strdup(getGlobalGradientDefinitionId(document, renderIndex, gradientIndex).c_str()); } - const char* c_api_getNthLocalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex) { - return strdup(getNthLocalGradientDefinitionId(document, renderIndex, gradientIndex).c_str()); + const char* c_api_getLocalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex) { + return strdup(getLocalGradientDefinitionId(document, renderIndex, gradientIndex).c_str()); } bool c_api_isLinearGradient(SBMLDocument* document, const char* id, int renderIndex) { @@ -985,12 +1045,12 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumLocalLineEndings(document, renderIndex); } - const char* c_api_getNthGlobalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex) { - return strdup(getNthGlobalLineEndingId(document, renderIndex, lineEndingIndex).c_str()); + const char* c_api_getGlobalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex) { + return strdup(getGlobalLineEndingId(document, renderIndex, lineEndingIndex).c_str()); } - const char* c_api_getNthLocalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex) { - return strdup(getNthLocalLineEndingId(document, renderIndex, lineEndingIndex).c_str()); + const char* c_api_getLocalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex) { + return strdup(getLocalLineEndingId(document, renderIndex, lineEndingIndex).c_str()); } const double c_api_getLineEndingBoundingBoxX(SBMLDocument* document, const char* id, int renderIndex) { @@ -1133,11 +1193,11 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumLineEndingStrokeDashes(document, renderIndex, id); } - const int c_api_getLineEndingNthBorderDash(SBMLDocument* document, const char* id, int dashIndex, int renderIndex) { + const int c_api_getLineEndingBorderDash(SBMLDocument* document, const char* id, int dashIndex, int renderIndex) { return getLineEndingStrokeDash(document, renderIndex, id, dashIndex); } - int c_api_setLineEndingNthBorderDash(SBMLDocument* document, const char* id, const int dash, int dashIndex, int renderIndex) { + int c_api_setLineEndingBorderDash(SBMLDocument* document, const char* id, const int dash, int dashIndex, int renderIndex) { return setLineEndingStrokeDash(document, renderIndex, id, dashIndex, dash); } @@ -1145,15 +1205,15 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumSpeciesReferenceLineEndingStrokeDashes(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex); } - const int c_api_getSpeciesReferenceLineEndingNthBorderDash(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int dashIndex, int layoutIndex) { + const int c_api_getSpeciesReferenceLineEndingBorderDash(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int dashIndex, int layoutIndex) { return getSpeciesReferenceLineEndingStrokeDash(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, dashIndex); } - int c_api_setSpeciesReferenceLineEndingNthBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int reactionGlyphIndex, int speciesReferenceIndex, int dashIndex, int layoutIndex) { + int c_api_setSpeciesReferenceLineEndingBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int reactionGlyphIndex, int speciesReferenceIndex, int dashIndex, int layoutIndex) { return setSpeciesReferenceLineEndingStrokeDash(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, dashIndex, dash); } - int c_api_setReactionLineEndingNthBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int reactionGlyphIndex, int dashIndex, int layoutIndex) { + int c_api_setReactionLineEndingBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int reactionGlyphIndex, int dashIndex, int layoutIndex) { return setReactionLineEndingStrokeDash(document, layoutIndex, reactionId, reactionGlyphIndex, dashIndex, dash); } @@ -1245,6 +1305,54 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumSpeciesReferenceLineEndingGeometricShapes(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex); } + int c_api_addLineEndingGeometricShape(SBMLDocument* document, const char* id, const char* shape, int renderIndex) { + return addLineEndingGeometricShape(document, renderIndex, id, shape); + } + + int c_api_addSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, const char* reactionId, const char* shape, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex) { + return addSpeciesReferenceLineEndingGeometricShape(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, shape); + } + + int c_api_removeLineEndingGeometricShape(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { + return removeLineEndingGeometricShape(document, renderIndex, id, geometricShapeIndex); + } + + int c_api_removeSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, const char* reactionId, int geometricShapeIndex, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex) { + return removeSpeciesReferenceLineEndingGeometricShape(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex); + } + + const char* c_api_getLineEndingGeometricShapeType(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { + return strdup(getLineEndingGeometricShapeType(document, renderIndex, id, geometricShapeIndex).c_str()); + } + + const char* c_api_getSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, const char* reactionId, int geometricShapeIndex, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex) { + return strdup(getSpeciesReferenceLineEndingGeometricShapeType(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex).c_str()); + } + + int c_api_setLineEndingGeometricShapeType(SBMLDocument* document, const char* id, const char* shape, int renderIndex) { + return setLineEndingGeometricShapeType(document, renderIndex, id, shape); + } + + int c_api_setSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, const char* reactionId, const char* shape, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex) { + return setSpeciesReferenceLineEndingGeometricShapeType(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, shape); + } + + const char* c_api_getLineEndingGeometricShapeId(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { + return strdup(getLineEndingGeometricShapeId(document, renderIndex, id, geometricShapeIndex).c_str()); + } + + const char* c_api_getSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return strdup(getSpeciesReferenceLineEndingGeometricShapeId(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex).c_str()); + } + + int c_api_setLineEndingGeometricShapeId(SBMLDocument* document, const char* id, const char* shapeId, int geometricShapeIndex, int renderIndex) { + return setLineEndingGeometricShapeId(document, renderIndex, id, geometricShapeIndex, shapeId); + } + + int c_api_setSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, const char* reactionId, const char* id, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return setSpeciesReferenceLineEndingGeometricShapeId(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex, id); + } + bool c_api_isLineEndingRectangle(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { return isLineEndingRectangle(document, renderIndex, id, geometricShapeIndex); } @@ -1293,6 +1401,94 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return isSpeciesReferenceLineEndingText(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex); } + bool c_api_isSetLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { + return isSetLineEndingGeometricShapeStrokeColor(document, renderIndex, id, geometricShapeIndex); + } + + bool c_api_isSetSpeciesReferenceLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return isSetSpeciesReferenceLineEndingGeometricShapeStrokeColor(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex); + } + + const char* c_api_getLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { + return strdup(getLineEndingGeometricShapeStrokeColor(document, renderIndex, id, geometricShapeIndex).c_str()); + } + + const char* c_api_getSpeciesReferenceLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return strdup(getSpeciesReferenceLineEndingGeometricShapeStrokeColor(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex).c_str()); + } + + int c_api_setLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* id, const char* borderColor, int geometricShapeIndex, int renderIndex) { + return setLineEndingGeometricShapeStrokeColor(document, renderIndex, id, geometricShapeIndex, borderColor); + } + + int c_api_setSpeciesReferenceLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* reactionId, const char* borderColor, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return setSpeciesReferenceLineEndingGeometricShapeStrokeColor(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex, borderColor); + } + + bool c_api_isSetLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { + return isSetLineEndingGeometricShapeStrokeWidth(document, renderIndex, id, geometricShapeIndex); + } + + bool c_api_isSetSpeciesReferenceLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return isSetSpeciesReferenceLineEndingGeometricShapeStrokeWidth(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex); + } + + const double c_api_getLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { + return getLineEndingGeometricShapeStrokeWidth(document, renderIndex, id, geometricShapeIndex); + } + + const double c_api_getSpeciesReferenceLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return getSpeciesReferenceLineEndingGeometricShapeStrokeWidth(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex); + } + + int c_api_setLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* id, const double borderWidth, int geometricShapeIndex, int renderIndex) { + return setLineEndingGeometricShapeStrokeWidth(document, renderIndex, id, geometricShapeIndex, borderWidth); + } + + int c_api_setSpeciesReferenceLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* reactionId, const double borderWidth, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return setSpeciesReferenceLineEndingGeometricShapeStrokeWidth(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex, borderWidth); + } + + bool c_api_isSetLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { + return isSetLineEndingGeometricShapeFillColor(document, renderIndex, id, geometricShapeIndex); + } + + bool c_api_isSetSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return isSetSpeciesReferenceLineEndingGeometricShapeFillColor(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex); + } + + const char* c_api_getLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { + return strdup(getLineEndingGeometricShapeFillColor(document, renderIndex, id, geometricShapeIndex).c_str()); + } + + const char* c_api_getSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return strdup(getSpeciesReferenceLineEndingGeometricShapeFillColor(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex).c_str()); + } + + int c_api_setLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* id, const char* fillColor, int geometricShapeIndex, int renderIndex) { + return setLineEndingGeometricShapeFillColor(document, renderIndex, id, geometricShapeIndex, fillColor); + } + + int c_api_setSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* reactionId, const char* fillColor, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + return setSpeciesReferenceLineEndingGeometricShapeFillColor(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex, fillColor); + } + + int c_api_setLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, const char* id, const char* gradientType, const char** stopColors, const double* stopOffsets, const int stopsSize, int geometricShapeIndex, int renderIndex) { + std::vector> stopsVector; + for (int i = 0; i < stopsSize; i++) + stopsVector.push_back(std::make_pair(stopColors[i], stopOffsets[i])); + + return setLineEndingGeometricShapeFillColorAsGradient(document, renderIndex, id, geometricShapeIndex, gradientType, stopsVector); + } + + int c_api_setSpeciesReferenceLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, const char* reactionId, const char* gradientType, const char** stopColors, const double* stopOffsets, const int stopsSize, int reactionGlyphIndex, int speciesReferenceIndex, int layoutIndex, int geometricShapeIndex) { + std::vector> stopsVector; + for (int i = 0; i < stopsSize; i++) + stopsVector.push_back(std::make_pair(stopColors[i], stopOffsets[i])); + + return setSpeciesReferenceLineEndingGeometricShapeFillColorAsGradient(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex, gradientType, stopsVector); + } + bool c_api_isSetLineEndingGeometricShapeX(SBMLDocument* document, const char* id, int geometricShapeIndex, int renderIndex) { return isSetLineEndingGeometricShapeX(document, renderIndex, id, geometricShapeIndex); } @@ -1937,11 +2133,11 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getNumStrokeDashes(document, getGraphicalObject(document, layoutIndex, id, graphicalObjectIndex)); } - const int c_api_getNthBorderDash(SBMLDocument* document, const char* id, int dashIndex, int graphicalObjectIndex, int layoutIndex) { + const int c_api_getBorderDash(SBMLDocument* document, const char* id, int dashIndex, int graphicalObjectIndex, int layoutIndex) { return getStrokeDash(document, getGraphicalObject(document, layoutIndex, id, graphicalObjectIndex), dashIndex); } - int c_api_setNthBorderDash(SBMLDocument* document, const char* id, const int dash, int dashIndex, int graphicalObjectIndex, int layoutIndex) { + int c_api_setBorderDash(SBMLDocument* document, const char* id, const int dash, int dashIndex, int graphicalObjectIndex, int layoutIndex) { return setStrokeDash(document, getGraphicalObject(document, layoutIndex, id, graphicalObjectIndex), dashIndex, dash); } @@ -1952,14 +2148,14 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return -1; } - const int c_api_getNthLineDash(SBMLDocument* document, const char* id, int dashIndex, int graphicalObjectIndex, int layoutIndex) { + const int c_api_getLineDash(SBMLDocument* document, const char* id, int dashIndex, int graphicalObjectIndex, int layoutIndex) { if (isReactionGlyph(document, layoutIndex, id)) return getStrokeDash(document, getGraphicalObject(document, layoutIndex, id, graphicalObjectIndex), dashIndex); return -1; } - int c_api_setNthLineDash(SBMLDocument* document, const char* id, const int dash, int dashIndex, int graphicalObjectIndex, int layoutIndex) { + int c_api_setLineDash(SBMLDocument* document, const char* id, const int dash, int dashIndex, int graphicalObjectIndex, int layoutIndex) { if (isReactionGlyph(document, layoutIndex, id)) { for (unsigned int i = 0; i < getNumSpeciesReferences(document, layoutIndex, id, graphicalObjectIndex); i++) setStrokeDash(document, getSpeciesReference(document, layoutIndex, id, graphicalObjectIndex, i), dash); @@ -3269,7 +3465,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getPredefinedStyleNames().size(); } - const char* c_api_getNthPredefinedStyleName(int index) { + const char* c_api_getPredefinedStyleName(int index) { if (index >= 0 && index < c_api_getNumPredefinedStyles()) return strdup(getPredefinedStyleNames().at(index).c_str()); @@ -3280,7 +3476,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getValidRoleValues().size(); } - const char* c_api_getNthValidRoleValue(int index) { + const char* c_api_getValidRoleValue(int index) { if (index >= 0 && index < c_api_getNumValidRoleValues()) return strdup(getValidRoleValues().at(index).c_str()); @@ -3291,7 +3487,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return align_elements_getValidAlignmentValues().size(); } - const char* c_api_getNthValidAlignmentValue(int index) { + const char* c_api_getValidAlignmentValue(int index) { if (index >= 0 && index < c_api_getNumValidAlignmentValues()) return strdup(align_elements_getValidAlignmentValues().at(index).c_str()); @@ -3302,7 +3498,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return align_elements_getValidDistributionDirectionValues().size(); } - const char* c_api_getNthValidDistributionDirectionValue(int index) { + const char* c_api_getValidDistributionDirectionValue(int index) { if (index >= 0 && index < c_api_getNumValidDistributionDirectionValues()) return strdup(align_elements_getValidDistributionDirectionValues().at(index).c_str()); @@ -3313,7 +3509,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getValidSpreadMethodValues().size(); } - const char* c_api_getNthValidSpreadMethodValue(int index) { + const char* c_api_getValidSpreadMethodValue(int index) { if (index >= 0 && index < c_api_getNumValidSpreadMethodValues()) return strdup(getValidSpreadMethodValues().at(index).c_str()); @@ -3324,7 +3520,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getValidFontWeightValues().size(); } - const char* c_api_getNthValidFontWeightValue(int index) { + const char* c_api_getValidFontWeightValue(int index) { if (index >= 0 && index < c_api_getNumValidFontWeightValues()) return strdup(getValidFontWeightValues().at(index).c_str()); @@ -3335,7 +3531,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getValidFontStyleValues().size(); } - const char* c_api_getNthValidFontStyleValue(int index) { + const char* c_api_getValidFontStyleValue(int index) { if (index >= 0 && index < c_api_getNumValidFontStyleValues()) return strdup(getValidFontStyleValues().at(index).c_str()); @@ -3346,7 +3542,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getValidTextAnchorValues().size(); } - const char* c_api_getNthValidHorizontalTextAlignmentValue(int index) { + const char* c_api_getValidHorizontalTextAlignmentValue(int index) { if (index >= 0 && index < c_api_getNumValidHorizontalTextAlignmentValues()) return strdup(getValidTextAnchorValues().at(index).c_str()); @@ -3357,7 +3553,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getValidVTextAnchorValues().size(); } - const char* c_api_getNthValidVerticalTextAlignmentValue(int index) { + const char* c_api_getValidVerticalTextAlignmentValue(int index) { if (index >= 0 && index < c_api_getNumValidVerticalTextAlignmentValues()) return strdup(getValidVTextAnchorValues().at(index).c_str()); @@ -3368,7 +3564,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getValidFillRuleValues().size(); } - const char* c_api_getNthValidFillRuleValue(int index) { + const char* c_api_getValidFillRuleValue(int index) { if (index >= 0 && index < c_api_getNumValidFillRuleValues()) return strdup(getValidFillRuleValues().at(index).c_str()); @@ -3379,7 +3575,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return getValidGeometricShapeNameValues().size(); } - const char* c_api_getNthValidGeometricShapeValue(int index) { + const char* c_api_getValidGeometricShapeValue(int index) { if (index >= 0 && index < c_api_getNumValidGeometricShapeValues()) return strdup(getValidGeometricShapeNameValues().at(index).c_str()); diff --git a/src/c_api/libsbmlnetwork_c_api.h b/src/c_api/libsbmlnetwork_c_api.h index b5d193d..9e6e7db 100644 --- a/src/c_api/libsbmlnetwork_c_api.h +++ b/src/c_api/libsbmlnetwork_c_api.h @@ -74,12 +74,11 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// to the the SBML document, and set all the necessary features for them. /// @param document a pointer to the SBMLDocument object. /// @param maxNumConnectedEdges the maximum number of connected edges to a species glyph. - /// @param useNameAsTextLabel a variable that determines whether to use the name of the nodes as text labels in the autolayout algorithm. /// @param resetFixedPositionElements a variable that determines whether to reset the fixed position elements in the autolayout algorithm. /// @param fixedPositionNodeIds an array of strings containing the ids of the nodes and the indices of their associated graphical objects that must have fixed position in the autolayout algorithm. /// @param fixedPositionNodesSize the size of fixedPositionNodeIds /// @return integer value indicating success/failure of the function. - LIBSBMLNETWORK_EXTERN int c_api_autolayout(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, + LIBSBMLNETWORK_EXTERN int c_api_autolayout(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool resetFixedPositionElements = false, const char ***fixedPositionNodes = NULL, const int fixedPositionNodesSize = 0); /// @brief Create a Render object, add it to the the SBML document, and set all the necessary features for it. @@ -106,6 +105,96 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return integer value indicating success/failure of the function. LIBSBMLNETWORK_EXTERN int c_api_distribute(SBMLDocument* document, const char ***nodes, const int nodesSize, const char* direction, const double spacing = -1.0); + /// @brief Make all the elements in the Layout object with the given index of the SBML document visible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeAllVisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the elements in the Layout object with the given index of the SBML document invisible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeAllInvisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the compartments in the Layout object with the given index of the SBML document visible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeCompartmentsVisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the compartments in the Layout object with the given index of the SBML document invisible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeAllCompartmentsInvisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the species in the Layout object with the given index of the SBML document visible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeSpeciesVisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the species in the Layout object with the given index of the SBML document invisible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeSpeciesInvisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the reactions in the Layout object with the given index of the SBML document visible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeReactionsVisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the reactions in the Layout object with the given index of the SBML document invisible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeReactionsInvisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the species references in the Layout object with the given index of the SBML document visible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeSpeciesReferencesVisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the species references in the Layout object with the given index of the SBML document invisible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeSpeciesReferencesInvisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the line endings in the Layout object with the given index of the SBML document visible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeLineEndingsVisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make all the line endings in the Layout object with the given index of the SBML document invisible. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeLineEndingsInvisible(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Make the graphical object with the given index associated with the entered model in the layout object with the given index of the SBML document visible. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the graphical object to make visible. + /// @param applyToConnectedElements a variable that determines whether to apply the visibility change to the connected elements. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeVisible(SBMLDocument* document, const char* id, bool applyToConnectedElements = true, int graphicalObjectIndex = 0, int layoutIndex = 0); + + /// @brief Make the graphical object with the given index associated with the entered model in the layout object with the given index of the SBML document invisible. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the graphical object to make invisible. + /// @param applyToConnectedElements a variable that determines whether to apply the visibility change to the connected elements. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_makeInvisible(SBMLDocument* document, const char* id, bool applyToConnectedElements = true, int graphicalObjectIndex = 0, int layoutIndex = 0); + /// @brief Returns the number of items in the ListOfLayouts of this SBML document. /// @param document a pointer to the SBMLDocument object. /// @return the number of items in of this SBML document, or @c 0 if the object is @c NULL @@ -127,14 +216,15 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param maxNumConnectedEdges the maximum number of connected edges to a species glyph. /// @param useMagnetism a variable that determines whether to use magnetism in the autolayout algorithm. /// @param useGrid a variable that determines whether to use grid restriction in the autolayout algorithm. - /// @param useNameAsTextLabel a variable that determines whether to use the name of the nodes as text labels in the autolayout algorithm. /// @param resetFixedPositionElements a variable that determines whether to reset the fixed position elements in the autolayout algorithm. /// @param fixedPositionNodesSize the size of fixedPositionNodeIds /// @param fixedPositionNodeIds an array of strings containing the ids of the nodes that must have fixed position in the autolayout algorithm. /// @return integer value indicating success/failure of the function. - LIBSBMLNETWORK_EXTERN int c_api_createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel= true, + LIBSBMLNETWORK_EXTERN int c_api_createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool resetFixedPositionElements = false, const char*** fixedPositionNodeIds = NULL, const int fixedPositionNodesSize = 0); + LIBSBMLNETWORK_EXTERN int c_api_setUseNameAsTextLabel(SBMLDocument* document, bool useNameAsTextLabel, int layoutIndex); + /// @brief Create an alias SpeciesGlyph object for Species with the given id and connect all the SpeciesReferences in the ReactionGlyph object with the given id and index that contain Species as a participant to the alias SpeciesGlyph in the Layout object with the given index in the ListOfLayouts of the SBMLDocument. /// @param document a pointer to the SBMLDocument object. /// @param speciesId the id of the species to create an alias SpeciesGlyph for. @@ -151,25 +241,6 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return integer value indicating success/failure of the function. LIBSBMLNETWORK_EXTERN int c_api_createAliasReactionGlyph(SBMLDocument* document, const char* reactionId, int layoutIndex); - /// @brief Hide the SpeciesGlyph with the given species Id which is a participant of the reaction with the given Id and index in the Layout object with the given index in the ListOfLayouts of the SBML document. - /// @param document a pointer to the SBMLDocument object. - /// @param speciesId the id of the species to hide the SpeciesGlyph for. - /// @param reactionId the id of the reaction to hide the SpeciesGlyph for. - /// @param visible a boolean value to determine whether make SpeciesGlyph visible or invisible. - /// @reactionGlyphIndex the index of the ReactionGlyph object. - /// @param layoutIndex the index number of the Layout to return. - /// @return integer value indicating success/failure of the function. - LIBSBMLNETWORK_EXTERN int c_api_makeSpeciesGlyphVisible(SBMLDocument* document, const char* speciesId, const char* reactionId, bool visible = true, int reactionGlyphIndex = 0, int layoutIndex = 0); - - /// @brief Hide the SpeciesGlyphs with the given species Ids in the Layout object with the given index in the ListOfLayouts of the SBML document. - /// @param document a pointer to the SBMLDocument object. - /// @param species an array of strings containing the ids of the species, ids of the reactions, and the indices of the reaction glyphs that the species are participants of. - /// @param speciesIdsSize the size of speciesIds - /// @param visible a boolean value to determine whether make SpeciesGlyph visible or invisible. - /// @param layoutIndex the index number of the Layout to return. - /// @return integer value indicating success/failure of the function. - LIBSBMLNETWORK_EXTERN int c_api_makeSpeciesGlyphsVisible(SBMLDocument* document, const char ***species, const int speciesSize, const bool visible, int layoutIndex); - /// @brief Returns the value of the "width" attribute of the Dimensions object of the Layout object /// with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -212,32 +283,93 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// or @c 0 if the object is @c NULL or has no associated GraphicalObject objects LIBSBMLNETWORK_EXTERN const int c_api_getNumGraphicalObjects(SBMLDocument* document, const char* id, int layoutIndex = 0); - /// @brief Returns the id of the nth GraphicalObject associated with the given model entity id of the Layout object with the given index in the ListOfLayouts of the SBML document. + LIBSBMLNETWORK_EXTERN int c_api_removeGraphicalObject(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex); + + /// @brief Predicate returning true if the id of the GraphicalObject with the given id in the Layout object with the given index of the SBML document associated with the entered model entity id is set. + /// @param document a pointer to the SBMLDocument object. + /// @param entityId the id of the model entity. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return @c true if the id of the GraphicalObject is set, false otherwise + LIBSBMLNETWORK_EXTERN bool c_api_isSetId(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex); + + /// @brief Returns the id of the GraphicalObject with the given id in the Layout object with the given index of the SBML document associated with the entered model entity id. + /// @param document a pointer to the SBMLDocument object. + /// @param entityId the id of the model entity. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return the id of the GraphicalObject, or @c "" if the id is not set or the object does not exists. + LIBSBMLNETWORK_EXTERN const char* c_api_getId(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex); + + /// @brief Sets the id of the GraphicalObject with the given id in the Layout object with the given index of the SBML document associated with the entered model entity id. + /// @param document a pointer to the SBMLDocument object. + /// @param entityId the id of the model entity. + /// @param graphicalObjectId the id of the GraphicalObject. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_setId(SBMLDocument* document, const char* entityId, const char* graphicalObjectId, int graphicalObjectIndex, int layoutIndex); + + /// @brief Predicate returning true if the meta id of the GraphicalObject with the given id in the Layout object with the given index of the SBML document associated with the entered model entity id is set. + /// @param document a pointer to the SBMLDocument object. + /// @param entityId the id of the model entity. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return @c true if the meta id of the GraphicalObject is set, false otherwise + LIBSBMLNETWORK_EXTERN bool c_api_isSetMetaId(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex); + + /// @brief Returns the meta id of the GraphicalObject with the given id in the Layout object with the given index of the SBML document associated with the entered model entity id. + /// @param document a pointer to the SBMLDocument object. + /// @param entityId the id of the model entity. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return the meta id of the GraphicalObject, or @c "" if the meta id is not set or the object does not exists. + LIBSBMLNETWORK_EXTERN const char* c_api_getMetaId(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex); + + /// @brief Sets the meta id of the GraphicalObject with the given id in the Layout object with the given index of the SBML document associated with the entered model entity id. + /// @param document a pointer to the SBMLDocument object. + /// @param entityId the id of the model entity. + /// @param metaId the meta id of the GraphicalObject. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_setMetaId(SBMLDocument* document, const char* entityId, const char* metaId, int graphicalObjectIndex, int layoutIndex); + + /// @brief Predicate returning true if the name of the GraphicalObject with the given id in the Layout object with the given index of the SBML document associated with the entered model entity id is set. /// @param document a pointer to the SBMLDocument object. - /// @param id the id of the model entity the id of the GraphicalObject associated with it is going to be returned. - /// @param graphicalObjectIndex the index of the GraphicalObject. + /// @param entityId the id of the model entity. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return @c true if the name of the GraphicalObject is set, false otherwise + LIBSBMLNETWORK_EXTERN bool c_api_isSetName(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex); + + /// @brief Returns the name of the GraphicalObject with the given id in the Layout object with the given index of the SBML document associated with the entered model entity id. + /// @param document a pointer to the SBMLDocument object. + /// @param entityId the id of the model entity. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. /// @param layoutIndex the index number of the Layout to return. - /// @return the id of the nth GraphicalObject associated with the given model entity id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthGraphicalObjectId(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex = 0); + /// @return the name of the GraphicalObject, or @c "" if the name is not set or the object does not exists. + LIBSBMLNETWORK_EXTERN const char* c_api_getName(SBMLDocument* document, const char* entityId, int graphicalObjectIndex, int layoutIndex); - /// @brief Returns the meta id of the nth GraphicalObject associated with the given model entity id of the Layout object with the given index in the ListOfLayouts of the SBML document. + /// @brief Sets the name of the GraphicalObject with the given id in the Layout object with the given index of the SBML document associated with the entered model entity id. /// @param document a pointer to the SBMLDocument object. - /// @param id the id of the model entity the id of the GraphicalObject associated with it is going to be returned. - /// @param graphicalObjectIndex the index of the GraphicalObject. + /// @param entityId the id of the model entity. + /// @param name the name of the GraphicalObject. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. /// @param layoutIndex the index number of the Layout to return. - /// @return the meta id of the nth GraphicalObject associated with the given model entity id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthGraphicalObjectMetaId(SBMLDocument* document, const char* id, int graphicalObjectIndex, int layoutIndex = 0); + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_setName(SBMLDocument* document, const char* entityId, const char* name, int graphicalObjectIndex, int layoutIndex); /// @brief Returns the number of Compartment objects in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @return the number of Compartment objects in the given SBML document. LIBSBMLNETWORK_EXTERN const int c_api_getNumCompartments(SBMLDocument* document); - /// @brief Returns the id of the nth Compartment object in the given SBML document. + /// @brief Returns the id of the Compartment object with the given index in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @param compartmentIndex the index of the Compartment object. - /// @return the id of the nth Compartment object in the given SBML document, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthCompartmentId(SBMLDocument* document, int compartmentIndex); + /// @return the id of the Compartment object with the given index in the given SBML document, or @c "" if the object does not exists. + LIBSBMLNETWORK_EXTERN const char* c_api_getCompartmentId(SBMLDocument* document, int compartmentIndex); /// @brief Returns the number of CompartmentGlyphs of the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -254,22 +386,6 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// or @c 0 if the object is @c NULL or has no associated CompartmentGlyph objects LIBSBMLNETWORK_EXTERN const int c_api_getNumCompartmentGlyphs(SBMLDocument* document, const char* compartmentId, int layoutIndex = 0); - /// @brief Returns the id of the nth CompartmentGlyph associated with the given compartment id of the Layout object with the given index in the ListOfLayouts of the SBML document. - /// @param document a pointer to the SBMLDocument object. - /// @param compartmentId the id of the compartment the id of the CompartmentGlyph object associated with it is going to be returned. - /// @param compartmentGlyphIndex the index of the CompartmentGlyph object. - /// @param layoutIndex the index number of the Layout to return. - /// @return the id of the nth CompartmentGlyph associated with the given compartment id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthCompartmentGlyphId(SBMLDocument* document, const char* compartmentId, int compartmentGlyphIndex, int layoutIndex = 0); - - /// @brief Returns the meta id of the nth CompartmentGlyph associated with the given compartment id of the Layout object with the given index in the ListOfLayouts of the SBML document. - /// @param document a pointer to the SBMLDocument object. - /// @param compartmentId the id of the compartment the id of the CompartmentGlyph object associated with it is going to be returned. - /// @param compartmentGlyphIndex the index of the CompartmentGlyph object. - /// @param layoutIndex the index number of the Layout to return. - /// @return the meta id of the nth CompartmentGlyph associated with the given compartment id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthCompartmentGlyphMetaId(SBMLDocument* document, const char* compartmentId, int compartmentGlyphIndex, int layoutIndex = 0); - /// @brief Predicate returning true if the abstract GraphicalObject with the given id in the Layout object with the given index of the SBML document is of type CompartmentGlyph. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout to return. @@ -283,18 +399,18 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param graphicalObjectIndex the index number of the GraphicalObject to return. /// @param layoutIndex the index number of the Layout to return. /// @return the id of the compartment associated with the given GraphicalObject, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getCompartmentId(SBMLDocument* document, const char* id, int graphicalObjectIndex = 0, int layoutIndex = 0); + LIBSBMLNETWORK_EXTERN const char* c_api_getCGraphicalObjectCompartmentId(SBMLDocument* document, const char* id, int graphicalObjectIndex = 0, int layoutIndex = 0); /// @brief Returns the number of Species objects in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @return the number of Species objects in the given SBML document. LIBSBMLNETWORK_EXTERN const int c_api_getNumSpecies(SBMLDocument* document); - /// @brief Returns the id of the nth Species object in the given SBML document. + /// @brief Returns the id of the Species object wtih the given index in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @param speciesIndex the index of the Species object. - /// @return the id of the nth Species object in the given SBML document, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthSpeciesId(SBMLDocument* document, int speciesIndex); + /// @return the id of the Species object wtih the given index in the given SBML document, or @c "" if the object does not exists. + LIBSBMLNETWORK_EXTERN const char* c_api_getSpeciesId(SBMLDocument* document, int speciesIndex); /// @brief Returns the number of SpeciesGlyphs of the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -311,22 +427,6 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// or @c 0 if the object is @c NULL or has no associated SpeciesGlyph objects LIBSBMLNETWORK_EXTERN const int c_api_getNumSpeciesGlyphs(SBMLDocument* document, const char* speciesId, int layoutIndex); - /// @brief Returns the id of the nth SpeciesGlyph object associated with the given species id of the Layout object with the given index in the ListOfLayouts of the SBML document. - /// @param document a pointer to the SBMLDocument object. - /// @param speciesId the id of the species the id of the SpeciesGlyph object associated with it is going to be returned. - /// @param speciesGlyphIndex the index of the SpeciesGlyph object. - /// @param layoutIndex the index number of the Layout to return. - /// @return the id of the nth SpeciesGlyph associated with the given species id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthSpeciesGlyphId(SBMLDocument* document, const char* speciesId, int speciesGlyphIndex, int layoutIndex = 0); - - /// @brief Returns the meta id of the nth SpeciesGlyph object associated with the given species id of the Layout object with the given index in the ListOfLayouts of the SBML document. - /// @param document a pointer to the SBMLDocument object. - /// @param speciesId the id of the species the id of the SpeciesGlyph object associated with it is going to be returned. - /// @param speciesGlyphIndex the index of the SpeciesGlyph object. - /// @param layoutIndex the index number of the Layout to return. - /// @return the meta id of the nth SpeciesGlyph associated with the given species id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthSpeciesGlyphMetaId(SBMLDocument* document, const char* speciesId, int speciesGlyphIndex, int layoutIndex = 0); - /// @brief Sets which SpeciesGlyph of Species with the given id to be assigned to the ReactionGlyph with the given id and index in the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param speciesId the id of the species the SpeciesGlyph object associated with it is going to be set. @@ -357,11 +457,11 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return the number of Reaction objects in the given SBML document. LIBSBMLNETWORK_EXTERN const int c_api_getNumReactions(SBMLDocument* document); - /// @brief Returns the id of the nth Reaction object in the given SBML document. + /// @brief Returns the id of the Reaction object with the given index in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @param reactionIndex the index of the Reaction object. - /// @return the id of the nth Reaction object in the given SBML document, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthReactionId(SBMLDocument* document, int reactionIndex); + /// @return the id of the Reaction object with the given index in the given SBML document, or @c "" if the object does not exists. + LIBSBMLNETWORK_EXTERN const char* c_api_getReactionId(SBMLDocument* document, int reactionIndex); /// @brief Returns the number of ReactionGlyphs of the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -378,22 +478,6 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// or @c 0 if the object is @c NULL or has no associated ReactionGlyph objects LIBSBMLNETWORK_EXTERN const int c_api_getNumReactionGlyphs(SBMLDocument* document, const char* reactionId, int layoutIndex); - /// @brief Returns the id of the nth ReactionGlyph object associated with the given reaction id of the Layout object with the given index in the ListOfLayouts of the SBML document. - /// @param document a pointer to the SBMLDocument object. - /// @param reactionId the id of the reaction the id of the ReactionGlyph object associated with it is going to be returned. - /// @param reactionGlyphIndex the index of the ReactionGlyph object. - /// @param layoutIndex the index number of the Layout to return. - /// @return the id of the nth ReactionGlyph associated with the given reaction id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthReactionGlyphId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int layoutIndex = 0); - - /// @brief Returns the meta id of the nth ReactionGlyph object associated with the given reaction id of the Layout object with the given index in the ListOfLayouts of the SBML document. - /// @param document a pointer to the SBMLDocument object. - /// @param reactionId the id of the reaction the id of the ReactionGlyph object associated with it is going to be returned. - /// @param reactionGlyphIndex the index of the ReactionGlyph object. - /// @param layoutIndex the index number of the Layout to return. - /// @return the meta id of the nth ReactionGlyph associated with the given reaction id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthReactionGlyphMetaId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex, int layoutIndex = 0); - /// @brief Predicate returning true if the abstract GraphicalObject with the given id in the Layout object with the given index of the SBML document is of type SpeciesGlyph. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout to return. @@ -419,26 +503,26 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return the number of Modifier objects of the Reaction object with the given id, or @c 0 if the object is @c NULL LIBSBMLNETWORK_EXTERN const int c_api_getNumModifiers(SBMLDocument* document, const char* reactionId); - /// @brief Returns the id of nth Reactant of the Reaction object with the given id in the SBML document. + /// @brief Returns the id of Reactant object with the given index of the Reaction object with the given id in the SBML document. /// @param document a pointer to the SBMLDocument object. - /// @param reactionId the id of the reaction the id of the nth Reactant object associated with it is going to be returned. + /// @param reactionId the id of the reaction the id of the Reactant object with the given index associated with it is going to be returned. /// @param reactantIndex the index of the Reactant object. - /// @return the id of the nth Reactant object of the Reaction object with the given id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthReactantId(SBMLDocument* document, const char* reactionId, int reactantIndex); + /// @return the id of the Reactant object with the given index of the Reaction object with the given id, or @c "" if the object does not exists. + LIBSBMLNETWORK_EXTERN const char* c_api_getReactantId(SBMLDocument* document, const char* reactionId, int reactantIndex); - /// @brief Returns the id of nth Product of the Reaction object with the given id in the SBML document. + /// @brief Returns the id of Product object with the given index of the Reaction object with the given id in the SBML document. /// @param document a pointer to the SBMLDocument object. - /// @param reactionId the id of the reaction the id of the nth Product object associated with it is going to be returned. + /// @param reactionId the id of the reaction the id of the Product object with the givne index associated with it is going to be returned. /// @param productIndex the index of the Product object. - /// @return the id of the nth Product object of the Reaction object with the given id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthProductId(SBMLDocument* document, const char* reactionId, int productIndex); + /// @return the id of the Product object with the given index of the Reaction object with the given id, or @c "" if the object does not exists. + LIBSBMLNETWORK_EXTERN const char* c_api_getProductId(SBMLDocument* document, const char* reactionId, int productIndex); - /// @brief Returns the id of nth Modifier of the Reaction object with the given id in the SBML document. + /// @brief Returns the id of Modifier object with the given index of the Reaction object with the given id in the SBML document. /// @param document a pointer to the SBMLDocument object. - /// @param reactionId the id of the reaction the id of the nth Modifier object associated with it is going to be returned. + /// @param reactionId the id of the reaction the id of the Modifier object with the given index associated with it is going to be returned. /// @param modifierIndex the index of the Modifier object. - /// @return the id of the nth Modifier object of the Reaction object with the given id, or @c "" if the object does not exists. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthModifierId(SBMLDocument* document, const char* reactionId, int modifierIndex); + /// @return the id of the Modifier object with the given index of the Reaction object with the given id, or @c "" if the object does not exists. + LIBSBMLNETWORK_EXTERN const char* c_api_getModifierId(SBMLDocument* document, const char* reactionId, int modifierIndex); /// @brief Returns the number of SpeciesReference objects of the ReactionGlyph object with the given index associated with the entered reaction id /// of the Layout object with the given index in the ListOfLayouts of the SBML document. @@ -541,14 +625,14 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// or @c 0 if the object is @c NULL or has no associated SpeciesReference objects. LIBSBMLNETWORK_EXTERN const int c_api_getNumSpeciesReferenceAssociatedWithSpecies(SBMLDocument* document, const char* speciesId, const char* reactionId, int reactionGlyphIndex = 0, int layoutIndex = 0); - /// @brief Returns the index of the nth SpeciesReference object associated with the given species id in the ReactionGlyph object with the given index associated with the entered reaction id in the Layout object with the given index in the ListOfLayouts of the SBML document. + /// @brief Returns the index of the SpeciesReference object with the given index associated with the given species id in the ReactionGlyph object with the given index associated with the entered reaction id in the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param speciesId the id of the species the index of the SpeciesReference object associated with it is going to be returned. /// @param reactionId the id of the reaction the SpeciesReference object of which to be returned. /// @param reactionGlyphIndex the index of the ReactionGlyph. /// @param n the index of the SpeciesReference. /// @param layoutIndex the index number of the Layout to return. - /// @return the index of the nth SpeciesReference object associated with the given species id, or @c -1 if the object does not exists. + /// @return the index of the SpeciesReference object with the given index associated with the given species id, or @c -1 if the object does not exists. LIBSBMLNETWORK_EXTERN const int c_api_getSpeciesReferenceIndexAssociatedWithSpecies(SBMLDocument* document, const char* speciesId, const char* reactionId, int reactionGlyphIndex = 0, int n = 0, int layoutIndex = 0); /// @brief Returns the number of curve segments of the Curve object of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id @@ -562,6 +646,37 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// the SpeciesReference object does not exits or the object is @c NULL LIBSBMLNETWORK_EXTERN const int c_api_getNumSpeciesReferenceCurveSegments(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + /// @brief Adds a LineSegment to the Curve object of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id + /// of the Layout object with the given index in the ListOfLayouts of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction the SpeciesReference object of which to be returned. + /// @param reactionGlyphIndex the index of the ReactionGlyph. + /// @param speciesReferenceIndex the index of the SpeciesReference. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_addSpeciesReferenceLineCurveSegment(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + + /// @brief Adds a CubicBezier to the Curve object of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id + /// of the Layout object with the given index in the ListOfLayouts of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction the SpeciesReference object of which to be returned. + /// @param reactionGlyphIndex the index of the ReactionGlyph. + /// @param speciesReferenceIndex the index of the SpeciesReference. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_addSpeciesReferenceCubicBezierCurveSegment(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + + /// @brief Removes the curve segment with the given index of the Curve of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id + /// of the Layout object with the given index in the ListOfLayouts of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction the SpeciesReference object of which to be returned. + /// @param reactionGlyphIndex the index of the ReactionGlyph. + /// @param speciesReferenceIndex the index of the SpeciesReference. + /// @param curveSegmentIndex the index of the CurveSegment. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_removeSpeciesReferenceCurveSegment(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int curveSegmentIndex = 0, int layoutIndex = 0); + /// @breif Predicate returning true if the curve segment with the given index of the Curve of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id /// of the Layout object with the given index in the ListOfLayouts is of type CubicBezier. /// @param document a pointer to the SBMLDocument object. @@ -851,7 +966,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param layoutIndex the index number of the Layout to return. /// @return the value of the "stroke-dasharray" attribute of the SpeciesReference object with the given index, or @c "" if /// the SpeciesReference does not exits or the object is @c NULL - LIBSBMLNETWORK_EXTERN const int c_api_getSpeciesReferenceNthLineDash(SBMLDocument* document, const char* reactionId, int lineDashIndex, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + LIBSBMLNETWORK_EXTERN const int c_api_getSpeciesReferenceLineDash(SBMLDocument* document, const char* reactionId, int lineDashIndex, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); /// @brief Sets the dash at the given index of the "stroke-dasharray" attribute of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id /// of the Layout object with the given index in the ListOfLayouts of the SBML document at the given index. @@ -863,7 +978,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param speciesReferenceIndex the index of the SpeciesReference. /// @param layoutIndex the index number of the Layout to return. /// @return integer value indicating success/failure of the function. - LIBSBMLNETWORK_EXTERN int c_api_setSpeciesReferenceNthLineDash(SBMLDocument* document, const char* reactionId, const int lineDash, int lineDashIndex, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + LIBSBMLNETWORK_EXTERN int c_api_setSpeciesReferenceLineDash(SBMLDocument* document, const char* reactionId, const int lineDash, int lineDashIndex, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); /// @brief Predicates returning @c true if the "startHead" attribute of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id /// of the Layout object with the given index in the ListOfLayouts of the SBML document is set. @@ -952,10 +1067,9 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param graphicalObjectIndex the index number of the GraphicalObject to return. /// @param textGlyphIndex the index of the TextGlyph to return. /// @param layoutIndex the index number of the Layout to return. - /// @package checkForName a boolean value to indicate whether the function should check for the "name" attribute of the TextGlyph object. /// @return the "text" attribute of this TextGlyph object or @c empty string if either the "text" attribute is not set /// , TextGlyph does not exits or the object is @c NULL. - LIBSBMLNETWORK_EXTERN const char* c_api_getText(SBMLDocument* document, const char* id, int graphicalObjectIndex = 0, int textGlyphIndex = 0, int layoutIndex = 0, bool checkForName = true); + LIBSBMLNETWORK_EXTERN const char* c_api_getText(SBMLDocument* document, const char* id, int graphicalObjectIndex = 0, int textGlyphIndex = 0, int layoutIndex = 0); /// @brief Sets the "text" attribute of the TextGlyph object with the given index associated with the given id in /// the Layout object with the given index of the SBML document. @@ -968,6 +1082,51 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return integer value indicating success/failure of the function. LIBSBMLNETWORK_EXTERN int c_api_setText(SBMLDocument* document, const char* id, const char* text, int graphicalObjectIndex = 0, int textGlyphIndex = 0, int layoutIndex = 0); + /// @brief Adds a new TextGlyph object associated with the graphical object with the given index of the model entity with the given id in the Layout object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the model entity the TextGlyph object to be added. + /// @param text a string value to be set as "text" attribute of the TextGlyph object. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + int c_api_addText(SBMLDocument* document, const char* id, const char* text, int graphicalObjectIndex = 0, int layoutIndex = 0); + + /// @brief Removes the TextGlyph object with the given index associated with the graphical object with the given index of the model entity with the given id in the Layout object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the model entity the TextGlyph object to be removed. + /// @param graphicalObjectIndex the index number of the GraphicalObject to return. + /// @param textGlyphIndex the index of the TextGlyph to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + int c_api_removeText(SBMLDocument* document, const char* id, int graphicalObjectIndex, int textGlyphIndex = 0, int layoutIndex = 0); + + /// @brief Returns the number of additional graphical objects of the Layout object with the given index in the ListOfLayouts of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param layoutIndex the index number of the Layout to return. + /// @return the number of additional graphical objects of this Layout object, or @c 0 if the object is @c NULL + const int c_api_getNumAllAdditionalGraphicalObjects(SBMLDocument* document, int layoutIndex = 0); + + /// @brief Returns the id of the additional graphical object with the given index of the Layout object with the given index in the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param additionalGraphicalObjectIndex the index of the additional graphical object to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return the id of the additional graphical object with the given index, or @c NULL if the object is @c NULL + const char* c_api_getAdditionalGraphicalObjectId(SBMLDocument* document, int additionalGraphicalObjectIndex = 0, int layoutIndex = 0); + + /// @brief Adds a new additional graphical object to the Layout object with the given index in the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the additional graphical object to be added. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + int c_api_addAdditionalGraphicalObject(SBMLDocument* document, const char* id, int layoutIndex = 0); + + /// @brief Removes the additional graphical object with the given index of the Layout object with the given index in the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param additionalGraphicalObjectIndex the index of the additional graphical object to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + int c_api_removeAdditionalGraphicalObject(SBMLDocument* document, int additionalGraphicalObjectIndex, int layoutIndex = 0); + /// @brief Returns the value of the "x" attribute of the bounding box of the GraphicalObject with the given index associated with /// the model entity with the given id of the Layout object with the given index in the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -1229,6 +1388,31 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// or does not have a curve LIBSBMLNETWORK_EXTERN const int c_api_getNumCurveSegments(SBMLDocument* document, const char* id, int graphicalObjectIndex = 0, int layoutIndex = 0); + /// @brief Adds a LineSemgent to the Curve of the GraphicalObject with the given index associated with the model entity with the given id of the Layout object with the given index in the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. + /// @param graphicalObjectIndex the index of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_addLineCurveSegment(SBMLDocument* document, const char* id, int graphicalObjectIndex = 0, int layoutIndex = 0); + + /// @brief Adds a CubicBezier to the Curve of the GraphicalObject with the given index associated with the model entity with the given id of the Layout object with the given index in the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. + /// @param graphicalObjectIndex the index of the GraphicalObject to return. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_addCubicBezierCurveSegment(SBMLDocument* document, const char* id, int graphicalObjectIndex = 0, int layoutIndex = 0); + + /// @brief Removes the curve segment with the given index of the Curve of the GraphicalObject with the given index associated with the model entity with the given id of the Layout object with the given index in the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. + /// @param graphicalObjectIndex the index of the GraphicalObject to return. + /// @param curveSegmentIndex an int representing the index of the curve segment to remove. + /// @param layoutIndex the index number of the Layout to return. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_removeCurveSegment(SBMLDocument* document, const char* id, int graphicalObjectIndex = 0, int curveSegmentIndex = 0, int layoutIndex = 0); + /// @brief Predicate returning true if the curve segment with the given index of the Curve of the GraphicalObject /// with the given index associated with the model entity with the given id of the Layout object with the given index in the SBML document is of type CubicBezier. /// @param document a pointer to the SBMLDocument object. @@ -1493,19 +1677,19 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return the number of ColorDefinitions of this LocalRenderInformation object, or @c 0 if the object is @c NULL LIBSBMLNETWORK_EXTERN const int c_api_getNumLocalColors(SBMLDocument* document, int renderIndex); - /// @brief Returns the id of the nth Global ColorDefinition object in the given SBML document. + /// @brief Returns the id of the Global ColorDefinition object with the given index in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @param colorIndex the index of the ColorDefinition to return. /// @param renderIndex the index number of the GlobalRenderInformation object. - /// @return the id of the nth ColorDefinition object, or @c "" if the object is @c NULL - LIBSBMLNETWORK_EXTERN const char* c_api_getNthGlobalColorId(SBMLDocument* document, int colorIndex, int renderIndex = 0); + /// @return the id of the ColorDefinition object with the given index, or @c "" if the object is @c NULL + LIBSBMLNETWORK_EXTERN const char* c_api_getGlobalColorId(SBMLDocument* document, int colorIndex, int renderIndex = 0); - /// @brief Returns the id of the nth Local ColorDefinition object in the given SBML document. + /// @brief Returns the id of the Local ColorDefinition object with the given index in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @param colorIndex the index of the ColorDefinition to return. /// @param renderIndex the index number of the LocalRenderInformation object. - /// @return the id of the nth ColorDefinition object, or @c "" if the object is @c NULL - LIBSBMLNETWORK_EXTERN const char* c_api_getNthLocalColorId(SBMLDocument* document, int colorIndex, int renderIndex = 0); + /// @return the id of the ColorDefinition object with the given index, or @c "" if the object is @c NULL + LIBSBMLNETWORK_EXTERN const char* c_api_getLocalColorId(SBMLDocument* document, int colorIndex, int renderIndex = 0); /// @brief Predicates returning @c true if the "value" attribute of the ColorDefinition with the given identifier /// in the RenderInformationBase with the given index is set. @@ -1549,19 +1733,19 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return the number of GradientDefinitions of this LocalRenderInformation object, or @c 0 if the object is @c NULL LIBSBMLNETWORK_EXTERN const int c_api_getNumLocalGradients(SBMLDocument* document, int renderIndex = 0); - /// @brief Returns the id of the nth GradientDefinition object in the given SBML document. + /// @brief Returns the id of the GradientDefinition object with the given index in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @param gradientIndex the index of the GradientDefinition to return. /// @param renderIndex the index number of the GlobalRenderInformation object. - /// @return the id of the nth GradientDefinition object, or @c "" if the object is @c NULL - LIBSBMLNETWORK_EXTERN const char* c_api_getNthGlobalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex = 0); + /// @return the id of the GradientDefinition object with the given index, or @c "" if the object is @c NULL + LIBSBMLNETWORK_EXTERN const char* c_api_getGlobalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex = 0); - /// @brief Returns the id of the nth GradientDefinition object in the given SBML document. + /// @brief Returns the id of the GradientDefinition object with the given index in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @param gradientIndex the index of the GradientDefinition to return. /// @param renderIndex the index number of the LocalRenderInformation object. - /// @return the id of the nth GradientDefinition object, or @c "" if the object is @c NULL - LIBSBMLNETWORK_EXTERN const char* c_api_getNthLocalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex = 0); + /// @return the id of the GradientDefinition object with the given index, or @c "" if the object is @c NULL + LIBSBMLNETWORK_EXTERN const char* c_api_getLocalGradientId(SBMLDocument* document, int gradientIndex, int renderIndex = 0); /// @brief Predicate returning true if the GradientDefinition with the given identifier in the RenderInformationBase with the given index is of type LinearGradient. /// @param document a pointer to the SBMLDocument object. @@ -1890,19 +2074,19 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return the number of LineEnding objects of this LocalRenderInformation object, or @c 0 if the object is @c NULL LIBSBMLNETWORK_EXTERN const int c_api_getNumLocalLineEndings(SBMLDocument* document, int renderIndex = 0); - /// @brief Returns the id of the nth LineEnding object in the given SBML document. + /// @brief Returns the id of the LineEnding object with the given index in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @param lineEndingIndex the index of the LineEnding to return. /// @param renderIndex the index number of the GlobalRenderInformation object. - /// @return the id of the nth LineEnding object, or @c "" if the object is @c NULL - LIBSBMLNETWORK_EXTERN const char* c_api_getNthGlobalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex = 0); + /// @return the id of the LineEnding object with the given index, or @c "" if the object is @c NULL + LIBSBMLNETWORK_EXTERN const char* c_api_getGlobalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex = 0); - /// @brief Returns the id of the nth LineEnding object in the given SBML document. + /// @brief Returns the id of the LineEnding object with the given index in the given SBML document. /// @param document a pointer to the SBMLDocument object. /// @param lineEndingIndex the index of the LineEnding to return. /// @param renderIndex the index number of the LocalRenderInformation object. - /// @return the id of the nth LineEnding object, or @c "" if the object is @c NULL - LIBSBMLNETWORK_EXTERN const char* c_api_getNthLocalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex = 0); + /// @return the id of the LineEnding object with the given index, or @c "" if the object is @c NULL + LIBSBMLNETWORK_EXTERN const char* c_api_getLocalLineEndingId(SBMLDocument* document, int lineEndingIndex, int renderIndex = 0); /// @brief Returns the value of the "x" attribute of the bounding box of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -2206,7 +2390,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param document a pointer to the SBMLDocument object. /// @param id the id of a model entity. /// @param renderIndex the index number of the RenderInformationBase object. - LIBSBMLNETWORK_EXTERN const int c_api_getLineEndingNthBorderDash(SBMLDocument* document, const char* id, int borderDashIndex, int renderIndex = 0); + LIBSBMLNETWORK_EXTERN const int c_api_getLineEndingBorderDash(SBMLDocument* document, const char* id, int borderDashIndex, int renderIndex = 0); /// @brief Sets the dash at the given index of the 'stroke-dasharray' attribute of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -2214,7 +2398,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param borderDashes a double array to use as the value of the "stroke-dasharray" attribute of the RenderGroup of the LineEnding object. /// @param numBorderDashes the number of elements in the borderDashes array. /// @param renderIndex the index number of the RenderInformationBase object. - LIBSBMLNETWORK_EXTERN int c_api_setLineEndingNthBorderDash(SBMLDocument* document, const char* id, const int dash, int borderDashIndex, int renderIndex = 0); + LIBSBMLNETWORK_EXTERN int c_api_setLineEndingBorderDash(SBMLDocument* document, const char* id, const int dash, int borderDashIndex, int renderIndex = 0); /// @brief Returns the size of the "stroke-dasharray" attribute of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -2233,7 +2417,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param speciesReferenceIndex the index of the species reference glyph. /// @param layoutIndex the index of the layout. /// @return the value of the dash at the given index of the "stroke-dasharray" attribute of the RenderGroup of the LineEnding object, or @c 0 if the object is @c NULL. - LIBSBMLNETWORK_EXTERN const int c_api_getSpeciesReferenceLineEndingNthBorderDash(SBMLDocument* document, const char* reactionId, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + LIBSBMLNETWORK_EXTERN const int c_api_getSpeciesReferenceLineEndingBorderDash(SBMLDocument* document, const char* reactionId, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); /// @brief Sets the dash at the given index of the "stroke-dasharray" attribute of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -2244,7 +2428,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param speciesReferenceIndex the index of the species reference glyph. /// @param layoutIndex the index of the layout. /// @return integer value indicating success/failure of the function. - LIBSBMLNETWORK_EXTERN int c_api_setSpeciesReferenceLineEndingNthBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + LIBSBMLNETWORK_EXTERN int c_api_setSpeciesReferenceLineEndingBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int borderDashIndex, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); /// @brief Sets the dash at the given index of the "stroke-dasharray" attribute of the RenderGroup of the LineEnding object associated with the given reaction glyph of the given layout of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -2254,7 +2438,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param reactionGlyphIndex the index of the reaction glyph. /// @param layoutIndex the index of the layout. /// @return integer value indicating success/failure of the function. - LIBSBMLNETWORK_EXTERN int c_api_setReactionLineEndingNthBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int borderDashIndex, int reactionGlyphIndex = 0, int layoutIndex = 0); + LIBSBMLNETWORK_EXTERN int c_api_setReactionLineEndingBorderDash(SBMLDocument* document, const char* reactionId, const int dash, int borderDashIndex, int reactionGlyphIndex = 0, int layoutIndex = 0); /// @breif Predicates returning @c true if the "fill" attribute of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is set. /// @param document a pointer to the SBMLDocument object. @@ -2419,8 +2603,126 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return the number of Transformation2D objects in the RenderGroup of the LineEnding object, or @c 0 if the object is @c NULL LIBSBMLNETWORK_EXTERN const int c_api_getNumLineEndingGeometricShapes(SBMLDocument* document, const char* id, int renderIndex = 0); + /// @brief Returns number of Transformation2D objects in the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + //// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @return the number of Transformation2D objects in the RenderGroup of the LineEnding object, or @c 0 if the object is @c NULL. LIBSBMLNETWORK_EXTERN const int c_api_getNumSpeciesReferenceLineEndingGeometricShapes(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + /// @brief Adds a Transformation2D object to the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param shape a string value to use as the value of the "shape" attribute of the Transformation2D object. + /// @param geometricShapeIndex an int representing the index of the Transformation2D to add. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return integer value indicating success/failure of the function. + int c_api_addLineEndingGeometricShape(SBMLDocument* document, const char* id, const char* shape, int renderIndex = 0); + + /// @brief Adds a Transformation2D object to the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param shape a string value to use as the value of the "shape" attribute of the Transformation2D object. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @return integer value indicating success/failure of the function. + int c_api_addSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, const char* reactionId, const char* shape, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + + /// @brief Removes the Transformation2D object at the given index from the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param geometricShapeIndex the index of the Transformation2D object to remove. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return integer value indicating success/failure of the function. + int c_api_removeLineEndingGeometricShape(SBMLDocument* document, const char* id, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Removes the Transformation2D object at the given index from the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param geometricShapeIndex the index of the Transformation2D object to remove. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @return integer value indicating success/failure of the function. + int c_api_removeSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, const char* reactionId, int geometricShapeIndex = 0, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + + /// @brief Returns the type of the Transformation2D object at the given index from the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return the type of the Transformation2D object, or @c "" if the object is @c NULL. + const char* c_api_getLineEndingGeometricShapeType(SBMLDocument* document, const char* id, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Returns the type of the Transformation2D object at the given index from the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @return the type of the Transformation2D object, or @c "" if the object is @c NULL. + const char* c_api_getSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, const char* reactionId, int geometricShapeIndex = 0, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + + /// @brief Sets the type of the Transformation2D object at the given index in the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param shape a string value to use as the type of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return integer value indicating success/failure of the function. + int c_api_setLineEndingGeometricShapeType(SBMLDocument* document, const char* id, const char* shape, int renderIndex = 0); + + /// @brief Sets the type of the Transformation2D object at the given index in the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param shape a string value to use as the type of the Transformation2D object. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @return integer value indicating success/failure of the function. + int c_api_setSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, const char* reactionId, const char* shape, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0); + + /// @brief Returns the id of the Transformation2D object at the given index from the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return the id of the Transformation2D object, or @c "" if the object is @c NULL. + const char* c_api_getLineEndingGeometricShapeId(SBMLDocument* document, const char* id, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Returns the id of the Transformation2D object at the given index from the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @return the id of the Transformation2D object, or @c "" if the object is @c NULL. + const char* c_api_getSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + + /// @brief Sets the id of the Transformation2D object at the given index in the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param shapeId a string value to use as the id of the Transformation2D object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return integer value indicating success/failure of the function. + int c_api_setLineEndingGeometricShapeId(SBMLDocument* document, const char* id, const char* shapeId, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Sets the id of the Transformation2D object at the given index in the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param id a string value to use as the id of the Transformation2D object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @return integer value indicating success/failure of the function. + int c_api_setSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, const char* reactionId, const char* id, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + /// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is of type Rectangle. /// @param document a pointer to the SBMLDocument object. /// @param id the id of the LineEnding object. @@ -2535,6 +2837,187 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return @c true if the Transformation2D at the given index of the RenderGroup of the LineEnding object is of type Text, @c false if either the Transformation2D object is not of type Text or the object is @c NULL. LIBSBMLNETWORK_EXTERN bool c_api_isSpeciesReferenceLineEndingText(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + /// @brief Predicates returning @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is set. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object is set, @c false if either the "stroke" + /// attribute is not set or the object is @c NULL. + LIBSBMLNETWORK_EXTERN bool c_api_isSetLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* id, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Predicates returning @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document is set. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @return @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object is set, @c false if either the "stroke" attribute is not set or the object is @c NULL. + LIBSBMLNETWORK_EXTERN bool c_api_isSetSpeciesReferenceLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + + /// @brief Returns the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object, or @c "" if the object is @c NULL. + LIBSBMLNETWORK_EXTERN const char* c_api_getLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* id, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Returns the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @return the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object, or @c "" if the object is @c NULL. + LIBSBMLNETWORK_EXTERN const char* c_api_getSpeciesReferenceLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + + /// @brief Sets the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param borderColor a string value to use as the value of the "stroke" attribute of the Transformation2D object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_setLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* id, const char* borderColor, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Sets the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param borderColor a string value to use as the value of the "stroke" attribute of the Transformation2D object. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_setSpeciesReferenceLineEndingGeometricShapeBorderColor(SBMLDocument* document, const char* reactionId, const char* borderColor, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + + /// @brief Predicates returning @c true if the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is set. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return @c true if the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object is set, @c false if either the "stroke-width" attribute is not set or the object is @c NULL. + LIBSBMLNETWORK_EXTERN bool c_api_isSetLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* id, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Predicates returning @c true if the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document is set. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @return @c true if the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object is set, @c false if either the "stroke-width" attribute is not set or the object is @c NULL. + LIBSBMLNETWORK_EXTERN bool c_api_isSetSpeciesReferenceLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + + /// @brief Returns the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object, or @c 0 if the object is @c NULL. + LIBSBMLNETWORK_EXTERN const double c_api_getLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* id, int geometricShapeIndex = 0 , int renderIndex = 0); + + /// @brief Returns the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @return the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object, or @c 0 if the object is @c NULL. + LIBSBMLNETWORK_EXTERN const double c_api_getSpeciesReferenceLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + + /// @brief Sets the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param borderWidth a double value to use as the value of the "stroke-width" attribute of the Transformation2D object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_setLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* id, const double borderWidth, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Sets the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param borderWidth a double value to use as the value of the "stroke-width" attribute of the Transformation2D object. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_setSpeciesReferenceLineEndingGeometricShapeBorderWidth(SBMLDocument* document, const char* reactionId, const double borderWidth, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + + /// @brief Predicates returning @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is set. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object is set, @c false if either the "fill" attribute is not set or the object is @c NULL. + LIBSBMLNETWORK_EXTERN bool c_api_isSetLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* id, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Predicates returning @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document is set. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @return @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object is set, @c false if either the "fill" attribute is not set or the object is @c NULL. + LIBSBMLNETWORK_EXTERN bool c_api_isSetSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + + /// @brief Returns the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object, or @c "" if the object is @c NULL. + LIBSBMLNETWORK_EXTERN const char* c_api_getLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* id, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Returns the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @return the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object, or @c "" if the object is @c NULL. + LIBSBMLNETWORK_EXTERN const char* c_api_getSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* reactionId, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + + /// @brief Sets the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param id the id of the LineEnding object. + /// @param fillColor a string value to use as the value of the "fill" attribute of the Transformation2D object. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @param renderIndex the index number of the RenderInformationBase object. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_setLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* id, const char* fillColor, int geometricShapeIndex = 0, int renderIndex = 0); + + /// @brief Sets the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object associated with the given species reference glyph of the given reaction glyph of the given layout of the SBML document. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param fillColor a string value to use as the value of the "fill" attribute of the Transformation2D object. + /// @param reactionGlyphIndex the index of the reaction glyph. + /// @param speciesReferenceIndex the index of the species reference glyph. + /// @param layoutIndex the index of the layout. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_setSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const char* reactionId, const char* fillColor, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + + /// @brief Sets the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document as a gradient. + /// @param document a pointer to the SBMLDocument object. + /// @param reactionId the id of the reaction. + /// @param gradientType the type of the gradient. + /// @param stopColors an array of strings representing the colors of the gradient stops. + /// @param stopOffsets an array of doubles representing the offsets of the gradient stops. + /// @param stopsSize the size of the stopColors and stopOffsets arrays. + /// @param layoutIndex the index of the layout. + /// @param geometricShapeIndex the index of the Transformation2D object. + /// @return integer value indicating success/failure of the function. + LIBSBMLNETWORK_EXTERN int c_api_setSpeciesReferenceLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, const char* reactionId, const char* gradientType, const char** stopColors, const double* stopOffsets, const int stopsSize, int reactionGlyphIndex = 0, int speciesReferenceIndex = 0, int layoutIndex = 0, int geometricShapeIndex = 0); + /// @brief Predicates returning @c true if the "x" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is set. /// @param document a pointer to the SBMLDocument object. /// @param id the id of the LineEnding object. @@ -3938,7 +4421,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param graphicalObjectIndex the index of the GraphicalObject to return. /// @param layoutIndex the index number of the Layout to return. /// @return the stroke dash at the given index of "stroke-dasharray" attribute of the RenderGroup of the Style for this GraphicalObject object, @c 0 if the object is @c NULL - LIBSBMLNETWORK_EXTERN const int c_api_getNthBorderDash(SBMLDocument* document, const char* id, int borderDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); + LIBSBMLNETWORK_EXTERN const int c_api_getBorderDash(SBMLDocument* document, const char* id, int borderDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); /// @brief Sets the dash at the given index of the 'stroke-dasharray' attribute of the RenderGroup of the Style that matches this id of model entity associated with the GraphicalObject. /// @param document a pointer to the SBMLDocument object. @@ -3948,7 +4431,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param graphicalObjectIndex the index of the GraphicalObject to return. /// @param layoutIndex the index number of the Layout to return. /// @return integer value indicating success/failure of the function. - LIBSBMLNETWORK_EXTERN int c_api_setNthBorderDash(SBMLDocument* document, const char* id, const int dash, int borderDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); + LIBSBMLNETWORK_EXTERN int c_api_setBorderDash(SBMLDocument* document, const char* id, const int dash, int borderDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); /// @brief Returns the size of the "stroke-dasharray" attribute of the RenderGroup of the Style of all CompartmentGlyph objects in this Layout object. /// @param document a pointer to the SBMLDocument object. @@ -3964,7 +4447,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param lineDashIndex an int representing the index of the stroke dash to retrieve. /// @param graphicalObjectIndex the index of the GraphicalObject to return. /// @param layoutIndex the index number of the Layout to return. - LIBSBMLNETWORK_EXTERN const int c_api_getNthLineDash(SBMLDocument* document, const char* id, int lineDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); + LIBSBMLNETWORK_EXTERN const int c_api_getLineDash(SBMLDocument* document, const char* id, int lineDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); /// @brief Sets the dash at the given index of the 'stroke-dasharray' attribute of the RenderGroup of the Style of all CompartmentGlyph objects in this Layout object. /// @param document a pointer to the SBMLDocument object. @@ -3974,7 +4457,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param graphicalObjectIndex the index of the GraphicalObject to return. /// @param layoutIndex the index number of the Layout to return. /// @return integer value indicating success/failure of the function. - LIBSBMLNETWORK_EXTERN int c_api_setNthLineDash(SBMLDocument* document, const char* id, const int dash, int lineDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); + LIBSBMLNETWORK_EXTERN int c_api_setLineDash(SBMLDocument* document, const char* id, const int dash, int lineDashIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); /// @brief Predicates returning @c true if the "fill" attribute of the RenderGroup of the Style that matches this id of model entity associated with the GraphicalObject. /// @param document a pointer to the SBMLDocument object. @@ -5832,7 +6315,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. /// @param graphicalObjectIndex an int representing the index of the GraphicalObject to retrieve. /// @param layoutIndex an int representing the index of the Layout to retrieve. - /// @return the "x" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if + /// @return the "x" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double c_api_getGeometricShapeSegmentX(SBMLDocument* document, const char* id, int segmentIndex = 0, int geometricShapeIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); @@ -5902,7 +6385,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. /// @param graphicalObjectIndex an int representing the index of the GraphicalObject to retrieve. /// @param layoutIndex an int representing the index of the Layout to retrieve. - /// @return the "y" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if + /// @return the "y" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double c_api_getGeometricShapeSegmentY(SBMLDocument* document, const char* id, int segmentIndex = 0, int geometricShapeIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); @@ -5972,7 +6455,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. /// @param graphicalObjectIndex an int representing the index of the GraphicalObject to retrieve. /// @param layoutIndex an int representing the index of the Layout to retrieve. - /// @return the "x" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if + /// @return the "x" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double c_api_getGeometricShapeSegmentBasePoint1X(SBMLDocument* document, const char* id, int segmentIndex = 0, int geometricShapeIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); @@ -6041,7 +6524,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. /// @param graphicalObjectIndex an int representing the index of the GraphicalObject to retrieve. /// @param layoutIndex an int representing the index of the Layout to retrieve. - /// @return the "y" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if + /// @return the "y" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double c_api_getGeometricShapeSegmentBasePoint1Y(SBMLDocument* document, const char* id, int segmentIndex = 0, int geometricShapeIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); @@ -6110,7 +6593,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. /// @param graphicalObjectIndex an int representing the index of the GraphicalObject to retrieve. /// @param layoutIndex an int representing the index of the Layout to retrieve. - /// @return the "x" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if + /// @return the "x" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double c_api_getGeometricShapeSegmentBasePoint2X(SBMLDocument* document, const char* id, int segmentIndex = 0, int geometricShapeIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); @@ -6179,7 +6662,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. /// @param graphicalObjectIndex an int representing the index of the GraphicalObject to retrieve. /// @param layoutIndex an int representing the index of the Layout to retrieve. - /// @return the "y" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if + /// @return the "y" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c 0.0 if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double c_api_getGeometricShapeSegmentBasePoint2Y(SBMLDocument* document, const char* id, int segmentIndex = 0, int geometricShapeIndex = 0, int graphicalObjectIndex = 0, int layoutIndex = 0); @@ -6336,90 +6819,90 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { /// @return the number of predefined styles. LIBSBMLNETWORK_EXTERN int c_api_getNumPredefinedStyles(); - /// @brief Returns the nth predefined style name that can be used in for c_api_setStyle function. + /// @brief Returns the predefined style name with the given index that can be used in for c_api_setStyle function. /// @param index an int representing the index of the predefined style name to retrieve. - /// @return the nth predefined style name. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthPredefinedStyleName(int index); + /// @return the predefined style name with the given index. + LIBSBMLNETWORK_EXTERN const char* c_api_getPredefinedStyleName(int index); /// @brief Returns the number of valid values for the "role" attribute that can be used in for c_api_SetSpeciesReferenceRole function. /// @return the number of valid values for the "role" attribute. LIBSBMLNETWORK_EXTERN int c_api_getNumValidRoleValues(); - /// @brief Returns the nth valid value for the "role" attribute that can be used in for c_api_SetSpeciesReferenceRole function. + /// @brief Returns the valid value with the given index for the "role" attribute that can be used in for c_api_SetSpeciesReferenceRole function. /// @param index an int representing the index of the valid value to retrieve. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthValidRoleValue(int index); + LIBSBMLNETWORK_EXTERN const char* c_api_getValidRoleValue(int index); /// @brief Returns the number of valid values for the "alignment" attribute that can be used in for c_api_align function. /// @return the number of valid values for the "alignment" attribute. LIBSBMLNETWORK_EXTERN int c_api_getNumValidAlignmentValues(); - /// @brief Returns the nth valid value for the "alignment" attribute that can be used in for c_api_align function. + /// @brief Returns the valid value with the given index for the "alignment" attribute that can be used in for c_api_align function. /// @param index an int representing the index of the valid value to retrieve. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthValidAlignmentValue(int index); + LIBSBMLNETWORK_EXTERN const char* c_api_getValidAlignmentValue(int index); /// @brief Returns the number of valid values for the "distribution" direction attribute that can be used in for c_api_setDistribution function /// @return the number of valid values for the "distribution" direction attribute. LIBSBMLNETWORK_EXTERN int c_api_getNumValidDistributionDirectionValues(); - /// @brief Returns the nth valid value for the "distribution" direction attribute that can be used in for c_api_setDistribution function + /// @brief Returns the valid value with the given index for the "distribution" direction attribute that can be used in for c_api_setDistribution function /// @param index an int representing the index of the valid value to retrieve. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthValidDistributionDirectionValue(int index); + LIBSBMLNETWORK_EXTERN const char* c_api_getValidDistributionDirectionValue(int index); /// @brief Returns the number of valid values for the "spread-method" attribute that can be used in for c_api_setGradientSpreadMethod function. /// @return the number of valid values for the "spread-method" attribute. LIBSBMLNETWORK_EXTERN int c_api_getNumValidSpreadMethodValues(); - /// @brief Returns the nth valid value for the "spread-method" attribute that can be used in for c_api_setGradientSpreadMethod function. + /// @brief Returns the valid value with the given index for the "spread-method" attribute that can be used in for c_api_setGradientSpreadMethod function. /// @param index an int representing the index of the valid value to retrieve. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthValidSpreadMethodValue(int index); + LIBSBMLNETWORK_EXTERN const char* c_api_getValidSpreadMethodValue(int index); /// @brief Returns the number of valid values for the "font-weight" attribute that can be used in for all set font weight functions. /// @return the number of valid values for the "font-weight" attribute. LIBSBMLNETWORK_EXTERN int c_api_getNumValidFontWeightValues(); - /// @brief Returns the nth valid value for the "font-weight" attribute that can be used in for all set font weight functions. + /// @brief Returns the valid value with the given index for the "font-weight" attribute that can be used in for all set font weight functions. /// @param index an int representing the index of the valid value to retrieve. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthValidFontWeightValue(int index); + LIBSBMLNETWORK_EXTERN const char* c_api_getValidFontWeightValue(int index); /// @brief Returns the number of valid values for the "font-style" attribute that can be used in for all set font style functions. /// @return the number of valid values for the "font-style" attribute. LIBSBMLNETWORK_EXTERN int c_api_getNumValidFontStyleValues(); - /// @brief Returns the nth valid value for the "font-style" attribute that can be used in for all set font style functions. + /// @brief Returns the valid value with the given index for the "font-style" attribute that can be used in for all set font style functions. /// @param index an int representing the index of the valid value to retrieve. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthValidFontStyleValue(int index); + LIBSBMLNETWORK_EXTERN const char* c_api_getValidFontStyleValue(int index); /// @brief Returns the number of valid values for the "text-anchor" attribute that can be used in for all set text anchor functions. /// @return the number of valid values for the "text-anchor" attribute. LIBSBMLNETWORK_EXTERN int c_api_getNumValidHorizontalTextAlignmentValues(); - /// @brief Returns the nth valid value for the "text-anchor" attribute that can be used in for all set text anchor functions. + /// @brief Returns the valid value with the given index for the "text-anchor" attribute that can be used in for all set text anchor functions. /// @param index an int representing the index of the valid value to retrieve. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthValidHorizontalTextAlignmentValue(int index); + LIBSBMLNETWORK_EXTERN const char* c_api_getValidHorizontalTextAlignmentValue(int index); /// @brief Returns the number of valid values for the "vtext-anchor" attribute that can be used in for all set vertical text alignment functions. /// @return the number of valid values for the "vtext-anchor" attribute. LIBSBMLNETWORK_EXTERN int c_api_getNumValidVerticalTextAlignmentValues(); - /// @brief Returns the nth valid value for the "vtext-anchor" attribute that can be used in for all set vertical text alignment functions. + /// @brief Returns the valid value with the given index for the "vtext-anchor" attribute that can be used in for all set vertical text alignment functions. /// @param index an int representing the index of the valid value to retrieve. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthValidVerticalTextAlignmentValue(int index); + LIBSBMLNETWORK_EXTERN const char* c_api_getValidVerticalTextAlignmentValue(int index); /// @brief Returns the number of valid values for the "fill-rule" attribute that can be used in for c_api_setFillRule function. /// @return the number of valid values for the "fill-rule" attribute. LIBSBMLNETWORK_EXTERN int c_api_getNumValidFillRuleValues(); - /// @brief Returns the nth valid value for the "fill-rule" attribute that can be used in for c_api_setFillRule function. + /// @brief Returns the valid value with the given index for the "fill-rule" attribute that can be used in for c_api_setFillRule function. /// @param index an int representing the index of the valid value to retrieve. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthValidFillRuleValue(int index); + LIBSBMLNETWORK_EXTERN const char* c_api_getValidFillRuleValue(int index); /// @brief Returns the number of valid values for the "shape" attribute that can be sued in for c_api_setGeometricShape function. /// @return the number of valid values for the "shape" attribute. LIBSBMLNETWORK_EXTERN int c_api_getNumValidGeometricShapeValues(); - /// @brief Returns the nth valid value for the "shape" attribute that can be used in for c_api_setGeometricShape function. + /// @brief Returns the valid value with the given index for the "shape" attribute that can be used in for c_api_setGeometricShape function. /// @param index an int representing the index of the valid value to retrieve. - LIBSBMLNETWORK_EXTERN const char* c_api_getNthValidGeometricShapeValue(int index); + LIBSBMLNETWORK_EXTERN const char* c_api_getValidGeometricShapeValue(int index); } #ifdef __cplusplus diff --git a/src/features/alias_elements/libsbmlnetwork_alias_reaction.cpp b/src/features/alias_elements/libsbmlnetwork_alias_reaction.cpp index a558104..5100683 100644 --- a/src/features/alias_elements/libsbmlnetwork_alias_reaction.cpp +++ b/src/features/alias_elements/libsbmlnetwork_alias_reaction.cpp @@ -10,18 +10,19 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { int alias_element_createAliasReactionGlyph(SBMLDocument* document, Layout* layout, ReactionGlyph* reactionGlyph) { if (document && reactionGlyph) { - ReactionGlyph* aliasReactionGlyph = alias_element_createAliasReactionGlyph(layout, reactionGlyph); - return alias_element_createAliasSpeciesReferenceGlyphs(document, layout, reactionGlyph, aliasReactionGlyph); + double padding = getReactionGlyphs(layout, reactionGlyph->getReactionId()).size() * defaults_getAliasReactionGlyphPadding(); + ReactionGlyph* aliasReactionGlyph = alias_element_createAliasReactionGlyph(layout, reactionGlyph, padding); + return alias_element_createAliasSpeciesReferenceGlyphs(document, layout, reactionGlyph, aliasReactionGlyph, padding); } return -1; } - ReactionGlyph* alias_element_createAliasReactionGlyph(Layout* layout, ReactionGlyph* reactionGlyph) { + ReactionGlyph* alias_element_createAliasReactionGlyph(Layout* layout, ReactionGlyph* reactionGlyph, const double& padding) { ReactionGlyph* aliasReactionGlyph = NULL; if (reactionGlyph) { aliasReactionGlyph = set_layout_features_createReactionGlyph(layout, reactionGlyph->getReactionId()); - alias_element_setAliasGraphicalObjectPosition(aliasReactionGlyph, reactionGlyph, defaults_getAliasReactionGlyphPadding()); + alias_element_setAliasGraphicalObjectPosition(aliasReactionGlyph, reactionGlyph, padding); alias_element_setAliasReactionGlyphTextGlyph(layout, aliasReactionGlyph, reactionGlyph); } @@ -36,7 +37,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { } } - int alias_element_createAliasSpeciesReferenceGlyphs(SBMLDocument* document, Layout* layout, ReactionGlyph* referenceReactionGlyph, ReactionGlyph* reactionGlyph) { + int alias_element_createAliasSpeciesReferenceGlyphs(SBMLDocument* document, Layout* layout, ReactionGlyph* referenceReactionGlyph, ReactionGlyph* reactionGlyph, const double& padding) { std::map speciesGlyphAliasSpeciesGlyphIds; for (unsigned int i = 0; i < referenceReactionGlyph->getNumSpeciesReferenceGlyphs(); i++) { SpeciesReferenceGlyph *speciesReferenceGlyph = referenceReactionGlyph->getSpeciesReferenceGlyph(i); @@ -44,7 +45,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { if (speciesGlyph) { SpeciesGlyph *connectedSpeciesGlyph = NULL; if (speciesGlyphAliasSpeciesGlyphIds.find(speciesGlyph->getId()) == speciesGlyphAliasSpeciesGlyphIds.end()) - connectedSpeciesGlyph = alias_element_createAliasSpeciesGlyph(layout, speciesGlyph); + connectedSpeciesGlyph = alias_element_createAliasSpeciesGlyph(layout, speciesGlyph, padding); else connectedSpeciesGlyph = layout->getSpeciesGlyph( speciesGlyphAliasSpeciesGlyphIds[speciesGlyph->getId()]); @@ -54,20 +55,20 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { findSpeciesReference(document->getModel(), layout, referenceReactionGlyph, speciesGlyph)); for (unsigned int stoichiometryIndex = 0; stoichiometryIndex < stoichiometry; stoichiometryIndex++) alias_element_createAliasSpeciesReferenceGlyph(reactionGlyph, speciesReferenceGlyph, - connectedSpeciesGlyph->getId(), stoichiometryIndex); - - return 0; + connectedSpeciesGlyph->getId(), stoichiometryIndex, padding); } } + else + return -1; } - return -1; + return 0; } - SpeciesReferenceGlyph* alias_element_createAliasSpeciesReferenceGlyph(ReactionGlyph* reactionGlyph, SpeciesReferenceGlyph* referenceSpeciesReferenceGlyph, const std::string& speciesGlyphId, unsigned int stoichiometryIndex) { + SpeciesReferenceGlyph* alias_element_createAliasSpeciesReferenceGlyph(ReactionGlyph* reactionGlyph, SpeciesReferenceGlyph* referenceSpeciesReferenceGlyph, const std::string& speciesGlyphId, unsigned int stoichiometryIndex, const double& padding) { SpeciesReferenceGlyph* aliasSpeciesReferenceGlyph = set_layout_features_createSpeciesReferenceGlyph(reactionGlyph, speciesGlyphId, stoichiometryIndex); aliasSpeciesReferenceGlyph->setRole(referenceSpeciesReferenceGlyph->getRole()); - set_layout_features_setSpeciesReferenceGlyphCurve(aliasSpeciesReferenceGlyph, referenceSpeciesReferenceGlyph); + set_layout_features_setSpeciesReferenceGlyphCurve(aliasSpeciesReferenceGlyph, referenceSpeciesReferenceGlyph, padding); return aliasSpeciesReferenceGlyph; } diff --git a/src/features/alias_elements/libsbmlnetwork_alias_reaction.h b/src/features/alias_elements/libsbmlnetwork_alias_reaction.h index d86c58b..aed4739 100644 --- a/src/features/alias_elements/libsbmlnetwork_alias_reaction.h +++ b/src/features/alias_elements/libsbmlnetwork_alias_reaction.h @@ -12,13 +12,13 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { int alias_element_createAliasReactionGlyph(SBMLDocument* document, Layout* layout, ReactionGlyph* reactionGlyph); -ReactionGlyph* alias_element_createAliasReactionGlyph(Layout* layout, ReactionGlyph* reactionGlyph); +ReactionGlyph* alias_element_createAliasReactionGlyph(Layout* layout, ReactionGlyph* reactionGlyph, const double& padding = 0.0); void alias_element_setAliasReactionGlyphTextGlyph(Layout* layout, ReactionGlyph* aliasReactionGlyph, ReactionGlyph* reactionGlyph); -int alias_element_createAliasSpeciesReferenceGlyphs(SBMLDocument* document, Layout* layout, ReactionGlyph* referenceReactionGlyph, ReactionGlyph* reactionGlyph); +int alias_element_createAliasSpeciesReferenceGlyphs(SBMLDocument* document, Layout* layout, ReactionGlyph* referenceReactionGlyph, ReactionGlyph* reactionGlyph, const double& padding = 0.0); -SpeciesReferenceGlyph* alias_element_createAliasSpeciesReferenceGlyph(ReactionGlyph* reactionGlyph, SpeciesReferenceGlyph* referenceSpeciesReferenceGlyph, const std::string& speciesGlyphId, unsigned int stoichiometryIndex = 0); +SpeciesReferenceGlyph* alias_element_createAliasSpeciesReferenceGlyph(ReactionGlyph* reactionGlyph, SpeciesReferenceGlyph* referenceSpeciesReferenceGlyph, const std::string& speciesGlyphId, unsigned int stoichiometryIndex = 0, const double& padding = 0.0); } diff --git a/src/features/alias_elements/libsbmlnetwork_alias_species.cpp b/src/features/alias_elements/libsbmlnetwork_alias_species.cpp index a5715e6..5be4cb2 100644 --- a/src/features/alias_elements/libsbmlnetwork_alias_species.cpp +++ b/src/features/alias_elements/libsbmlnetwork_alias_species.cpp @@ -24,11 +24,11 @@ int alias_element_createAliasSpeciesGlyph(Layout* layout, const std::string spec return -1; } -SpeciesGlyph* alias_element_createAliasSpeciesGlyph(Layout* layout, SpeciesGlyph* speciesGlyph) { +SpeciesGlyph* alias_element_createAliasSpeciesGlyph(Layout* layout, SpeciesGlyph* speciesGlyph, const double& padding) { SpeciesGlyph* aliasSpeciesGlyph = NULL; if (speciesGlyph) { aliasSpeciesGlyph = set_layout_features_createSpeciesGlyph(layout, speciesGlyph->getSpeciesId()); - alias_element_setAliasGraphicalObjectPosition(aliasSpeciesGlyph, speciesGlyph, defaults_getAliasSpeciesGlyphPadding()); + alias_element_setAliasGraphicalObjectPosition(aliasSpeciesGlyph, speciesGlyph, padding); alias_element_setAliasSpeciesGlyphDimensions(aliasSpeciesGlyph, speciesGlyph); alias_element_setAliasSpeciesGlyphTextGlyph(layout, aliasSpeciesGlyph); } diff --git a/src/features/alias_elements/libsbmlnetwork_alias_species.h b/src/features/alias_elements/libsbmlnetwork_alias_species.h index ee11abc..46db2b4 100644 --- a/src/features/alias_elements/libsbmlnetwork_alias_species.h +++ b/src/features/alias_elements/libsbmlnetwork_alias_species.h @@ -12,7 +12,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { int alias_element_createAliasSpeciesGlyph(Layout* layout, const std::string speciesId, ReactionGlyph* reactionGlyph); -SpeciesGlyph* alias_element_createAliasSpeciesGlyph(Layout* layout, SpeciesGlyph* speciesGlyph); +SpeciesGlyph* alias_element_createAliasSpeciesGlyph(Layout* layout, SpeciesGlyph* speciesGlyph, const double& padding = 0.0); SpeciesGlyph* alias_element_createAliasSpeciesGlyph(Layout* layout, const std::string& speciesId, std::vector speciesGlyphReferences); diff --git a/src/features/autolayout/libsbmlnetwork_autolayout.cpp b/src/features/autolayout/libsbmlnetwork_autolayout.cpp index b28fc9f..b17f9d7 100755 --- a/src/features/autolayout/libsbmlnetwork_autolayout.cpp +++ b/src/features/autolayout/libsbmlnetwork_autolayout.cpp @@ -12,7 +12,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { -void autolayout_locateGlyphs(Model *model, Layout *layout, const bool &useNameAsTextLabel) { +void autolayout_locateGlyphs(Model *model, Layout *layout) { double stiffness = autolayout_getStiffness(layout); double gravity = autolayout_getGravity(layout); bool useMagnetism = false; @@ -20,7 +20,7 @@ void autolayout_locateGlyphs(Model *model, Layout *layout, const bool &useNameAs std::srand(time(0)); autolayout_randomizeGlyphsLocations(model, layout); FruchtermanReingoldAlgorithmBase *autoLayoutAlgorithm = new FruchtermanReingoldAutoLayoutAlgorithm(); - autoLayoutAlgorithm->setElements(model, layout, useNameAsTextLabel); + autoLayoutAlgorithm->setElements(model, layout); autoLayoutAlgorithm->setStiffness(stiffness); autoLayoutAlgorithm->setGravity(gravity); autoLayoutAlgorithm->setUseMagnetism(useMagnetism); @@ -37,20 +37,20 @@ void autolayout_locateGlyphs(Model *model, Layout *layout, const bool &useNameAs if (autolayout_autolayoutMayStillConverge(layout)) { autolayout_updateGravity(layout); autolayout_updateStiffness(layout); - autolayout_locateGlyphs(model, layout, useNameAsTextLabel); + autolayout_locateGlyphs(model, layout); } else error_log_addErrorToLog(layout, "Auto-layout fails to converge with the given layout dimensions. Please adjust layout width and height and try again."); } } -void autolayout_locateReactions(Model *model, Layout *layout, const bool &useNameAsTextLabel) { +void autolayout_locateReactions(Model *model, Layout *layout) { double stiffness = autolayout_getStiffness(layout); double gravity = autolayout_getGravity(layout); bool useMagnetism = false; bool useGrid = false; FruchtermanReingoldAlgorithmBase* autoLayoutAlgorithm = new FruchtermanReingoldUpdateCurvesAlgorithm(); - autoLayoutAlgorithm->setElements(model, layout, useNameAsTextLabel); + autoLayoutAlgorithm->setElements(model, layout); autoLayoutAlgorithm->setStiffness(stiffness); autoLayoutAlgorithm->setGravity(gravity); autoLayoutAlgorithm->setUseMagnetism(useMagnetism); diff --git a/src/features/autolayout/libsbmlnetwork_autolayout.h b/src/features/autolayout/libsbmlnetwork_autolayout.h index 100096a..e7c0267 100755 --- a/src/features/autolayout/libsbmlnetwork_autolayout.h +++ b/src/features/autolayout/libsbmlnetwork_autolayout.h @@ -10,9 +10,9 @@ using namespace libsbml; namespace LIBSBMLNETWORK_CPP_NAMESPACE { -void autolayout_locateGlyphs(Model* model, Layout* layout, const bool& useNameAsTextLabel = true); +void autolayout_locateGlyphs(Model* model, Layout* layout); -void autolayout_locateReactions(Model *model, Layout *layout, const bool& useNameAsTextLabel = false); +void autolayout_locateReactions(Model *model, Layout *layout); const double autolayout_getStiffness(Layout *layout); diff --git a/src/features/autolayout/libsbmlnetwork_autolayout_connection.cpp b/src/features/autolayout/libsbmlnetwork_autolayout_connection.cpp index 549dd12..43ce2a3 100644 --- a/src/features/autolayout/libsbmlnetwork_autolayout_connection.cpp +++ b/src/features/autolayout/libsbmlnetwork_autolayout_connection.cpp @@ -2,9 +2,9 @@ #include "libsbmlnetwork_autolayout_node.h" #include "libsbmlnetwork_autolayout_curve.h" -AutoLayoutConnection::AutoLayoutConnection(Model* model, Layout* layout, ReactionGlyph* reactionGlyph, const bool& useNameAsTextLabel) : AutoLayoutObjectBase(model, layout) { +AutoLayoutConnection::AutoLayoutConnection(Model* model, Layout* layout, ReactionGlyph* reactionGlyph) : AutoLayoutObjectBase(model, layout) { _reactionGlyph = reactionGlyph; - setCentroidNode(useNameAsTextLabel); + setCentroidNode(); setCurves(); } @@ -22,8 +22,8 @@ void AutoLayoutConnection::updateFixedPositionStatus() {; ((AutoLayoutCurve*)_curves.at(i))->updateFixedPositionStatus(); } -void AutoLayoutConnection::setCentroidNode(const bool& useNameAsTextLabel) { - _centroidNode = new AutoLayoutCentroidNode(_model, _layout, _reactionGlyph, useNameAsTextLabel); +void AutoLayoutConnection::setCentroidNode() { + _centroidNode = new AutoLayoutCentroidNode(_model, _layout, _reactionGlyph); } AutoLayoutObjectBase* AutoLayoutConnection::getCentroidNode() { diff --git a/src/features/autolayout/libsbmlnetwork_autolayout_connection.h b/src/features/autolayout/libsbmlnetwork_autolayout_connection.h index eb8fe48..0038ffe 100644 --- a/src/features/autolayout/libsbmlnetwork_autolayout_connection.h +++ b/src/features/autolayout/libsbmlnetwork_autolayout_connection.h @@ -6,7 +6,7 @@ class AutoLayoutConnection : public AutoLayoutObjectBase { public: - AutoLayoutConnection(Model* model, Layout* layout, ReactionGlyph* reactionGlyph, const bool& useNameAsTextLabel); + AutoLayoutConnection(Model* model, Layout* layout, ReactionGlyph* reactionGlyph); ~AutoLayoutConnection(); @@ -14,7 +14,7 @@ class AutoLayoutConnection : public AutoLayoutObjectBase { void updateFixedPositionStatus(); - void setCentroidNode(const bool& useNameAsTextLabel); + void setCentroidNode(); AutoLayoutObjectBase* getCentroidNode(); diff --git a/src/features/autolayout/libsbmlnetwork_autolayout_node.cpp b/src/features/autolayout/libsbmlnetwork_autolayout_node.cpp index 4274af7..353d408 100644 --- a/src/features/autolayout/libsbmlnetwork_autolayout_node.cpp +++ b/src/features/autolayout/libsbmlnetwork_autolayout_node.cpp @@ -6,9 +6,9 @@ // AutoLayoutNodeBase -AutoLayoutNodeBase::AutoLayoutNodeBase(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& useNameAsTextLabel, const bool& positionFixed) : AutoLayoutObjectBase(model, layout) { +AutoLayoutNodeBase::AutoLayoutNodeBase(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& positionFixed) : AutoLayoutObjectBase(model, layout) { _degree = 0; - _useNameAsTextLabel = useNameAsTextLabel; + _useNameAsTextLabel = LIBSBMLNETWORK_CPP_NAMESPACE::user_data_getUserData(layout, "use_name_as_text_label") != "false"; _graphicalObject = graphicalObject; setPositionFixed(positionFixed); } @@ -73,7 +73,7 @@ void AutoLayoutNodeBase::updateFixedPositionStatus() {; // AutoLayoutNode -AutoLayoutNode::AutoLayoutNode(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& useNameAsTextLabel, const bool& positionFixed) : AutoLayoutNodeBase(model, layout, graphicalObject, useNameAsTextLabel, positionFixed) { +AutoLayoutNode::AutoLayoutNode(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& positionFixed) : AutoLayoutNodeBase(model, layout, graphicalObject, positionFixed) { } @@ -155,7 +155,7 @@ const double AutoLayoutNode::calculateHeight() { // AutoLayoutCentroidNode -AutoLayoutCentroidNode::AutoLayoutCentroidNode(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& useNameAsTextLabel, const bool& positionFixed) : AutoLayoutNodeBase(model, layout, graphicalObject, useNameAsTextLabel, positionFixed) { +AutoLayoutCentroidNode::AutoLayoutCentroidNode(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& positionFixed) : AutoLayoutNodeBase(model, layout, graphicalObject, positionFixed) { } diff --git a/src/features/autolayout/libsbmlnetwork_autolayout_node.h b/src/features/autolayout/libsbmlnetwork_autolayout_node.h index ba209d3..83e7808 100644 --- a/src/features/autolayout/libsbmlnetwork_autolayout_node.h +++ b/src/features/autolayout/libsbmlnetwork_autolayout_node.h @@ -7,7 +7,7 @@ class AutoLayoutNodeBase : public AutoLayoutObjectBase { public: - AutoLayoutNodeBase(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& useNameAsTextLabel, const bool& positionFixed = false); + AutoLayoutNodeBase(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& positionFixed = false); virtual GraphicalObject* getGraphicalObject() = 0; @@ -76,7 +76,7 @@ class AutoLayoutNodeBase : public AutoLayoutObjectBase { class AutoLayoutNode : public AutoLayoutNodeBase { public: - AutoLayoutNode(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& useNameAsTextLabel, const bool& positionFixed = false); + AutoLayoutNode(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& positionFixed = false); const std::string getId() override; @@ -112,7 +112,7 @@ class AutoLayoutNode : public AutoLayoutNodeBase { class AutoLayoutCentroidNode : public AutoLayoutNodeBase { public: - AutoLayoutCentroidNode(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& useNameAsTextLabel, const bool& positionFixed = false); + AutoLayoutCentroidNode(Model* model, Layout* layout, GraphicalObject* graphicalObject, const bool& positionFixed = false); const std::string getId() override; diff --git a/src/features/autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.cpp b/src/features/autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.cpp index c46067c..1246b53 100644 --- a/src/features/autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.cpp +++ b/src/features/autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.cpp @@ -38,15 +38,15 @@ void FruchtermanReingoldAlgorithmBase::clearConnections() { _connections.clear(); } -void FruchtermanReingoldAlgorithmBase::setElements(Model* model, Layout* layout, const bool& useNameAsTextLabel) { - setConnections(model, layout, useNameAsTextLabel); - setNodes(model, layout, useNameAsTextLabel); +void FruchtermanReingoldAlgorithmBase::setElements(Model* model, Layout* layout) { + setConnections(model, layout); + setNodes(model, layout); setNodesDegrees(); } -void FruchtermanReingoldAlgorithmBase::setConnections(Model* model, Layout* layout, const bool& useNameAsTextLabel) { +void FruchtermanReingoldAlgorithmBase::setConnections(Model* model, Layout* layout) { for (int i = 0; i < layout->getNumReactionGlyphs(); i++) - _connections.push_back(new AutoLayoutConnection(model, layout, layout->getReactionGlyph(i), useNameAsTextLabel)); + _connections.push_back(new AutoLayoutConnection(model, layout, layout->getReactionGlyph(i))); } void FruchtermanReingoldAlgorithmBase::setNodesDegrees() { @@ -530,9 +530,9 @@ FruchtermanReingoldAutoLayoutAlgorithm::FruchtermanReingoldAutoLayoutAlgorithm() } -void FruchtermanReingoldAutoLayoutAlgorithm::setNodes(Model* model, Layout* layout, const bool& useNameAsTextLabel) { +void FruchtermanReingoldAutoLayoutAlgorithm::setNodes(Model* model, Layout* layout) { for (int i = 0; i < layout->getNumSpeciesGlyphs(); i++) - _nodes.push_back(new AutoLayoutNode(model, layout, layout->getSpeciesGlyph(i), useNameAsTextLabel, false)); + _nodes.push_back(new AutoLayoutNode(model, layout, layout->getSpeciesGlyph(i), false)); for (int i = 0; i < _connections.size(); i++) _nodes.push_back(((AutoLayoutConnection*)_connections.at(i))->getCentroidNode()); } @@ -543,9 +543,9 @@ FruchtermanReingoldUpdateCurvesAlgorithm::FruchtermanReingoldUpdateCurvesAlgorit } -void FruchtermanReingoldUpdateCurvesAlgorithm::setNodes(Model* model, Layout* layout, const bool& useNameAsTextLabel) { +void FruchtermanReingoldUpdateCurvesAlgorithm::setNodes(Model* model, Layout* layout) { for (int i = 0; i < layout->getNumSpeciesGlyphs(); i++) - _nodes.push_back(new AutoLayoutNode(model, layout, layout->getSpeciesGlyph(i), useNameAsTextLabel, true)); + _nodes.push_back(new AutoLayoutNode(model, layout, layout->getSpeciesGlyph(i), true)); for (int i = 0; i < _connections.size(); i++) _nodes.push_back(((AutoLayoutConnection*)_connections.at(i))->getCentroidNode()); } diff --git a/src/features/autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.h b/src/features/autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.h index e69e57f..32797a6 100644 --- a/src/features/autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.h +++ b/src/features/autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.h @@ -24,7 +24,7 @@ class FruchtermanReingoldAlgorithmBase { void clearConnections(); - void setElements(Model* model, Layout* layout, const bool& useNameAsTextLabel); + void setElements(Model* model, Layout* layout); void setWidth(Layout* layout); @@ -94,9 +94,9 @@ class FruchtermanReingoldAlgorithmBase { protected: - void setConnections(Model* model, Layout* layout, const bool& useNameAsTextLabel); + void setConnections(Model* model, Layout* layout); - virtual void setNodes(Model* model, Layout* layout, const bool& useNameAsTextLabel) = 0; + virtual void setNodes(Model* model, Layout* layout) = 0; void setNodesDegrees(); @@ -130,7 +130,7 @@ class FruchtermanReingoldAutoLayoutAlgorithm : public FruchtermanReingoldAlgorit protected: - void setNodes(Model* model, Layout* layout, const bool& useNameAsTextLabel); + void setNodes(Model* model, Layout* layout); }; @@ -142,7 +142,7 @@ class FruchtermanReingoldUpdateCurvesAlgorithm : public FruchtermanReingoldAlgor protected: - void setNodes(Model* model, Layout* layout, const bool& useNameAsTextLabel); + void setNodes(Model* model, Layout* layout); }; const double calculateEuclideanDistance(AutoLayoutPoint point1, AutoLayoutPoint point2); diff --git a/src/features/colors/libsbmlnetwork_colors.cpp b/src/features/colors/libsbmlnetwork_colors.cpp index 45b6d6e..7b61ed4 100644 --- a/src/features/colors/libsbmlnetwork_colors.cpp +++ b/src/features/colors/libsbmlnetwork_colors.cpp @@ -4,279 +4,331 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { - const std::map* colorData() { - static std::map colors = { - {"aliceblue", "#F0F8FF"}, - {"antiquewhite", "#FAEBD7"}, - {"aqua", "#00FFFF"}, - {"aquamarine", "#7FFFD4"}, - {"apricot", "#EB9373"}, - {"arapawa", "#1A2421"}, - {"azure", "#F0FFFF"}, - {"azureradiance", "#007FFF"}, - {"aquaisland", "#A1DAD7"}, - {"bayofmany", "#273A3E"}, - {"beige", "#F5F5DC"}, - {"bisque", "#FFE4C4"}, - {"black", "#000000"}, - {"blanchedalmond", "#FFEBCD"}, - {"blue", "#0000FF"}, - {"blueribbon", "#0066FF"}, - {"blueviolet", "#8A2BE2"}, - {"brown", "#A52A2A"}, - {"burlywood", "#DEB887"}, - {"buttercup", "#F3AD16"}, - {"cadetblue", "#5F9EA0"}, - {"cannonpink", "#8E5164"}, - {"carnation", "#F95A61"}, - {"carrotorange", "#ED9121"}, - {"casal", "#2E2F30"}, - {"ceruleanblue", "#2A52BE"}, - {"chartreuse", "#7FFF00"}, - {"chino", "#D2B7AD"}, - {"chocolate", "#D2691E"}, - {"christine", "#E1634F"}, - {"coral", "#FF7F50"}, - {"cornflowerblue", "#6495ED"}, - {"cornsilk", "#FFF8DC"}, - {"creamcan", "#F5C71A"}, - {"crimson", "#DC143C"}, - {"cyan", "#00FFFF"}, - {"daisybush", "#4F2398"}, - {"darkblue", "#00008B"}, - {"darkcyan", "#008B8B"}, - {"darkfern", "#0A6906"}, - {"darkgoldenrod", "#B8860B"}, - {"darkgray", "#A9A9A9"}, - {"darkgrey", "#A9A9A9"}, - {"darkgreen", "#006400"}, - {"darkindigo", "#4B0082"}, - {"darkkhaki", "#BDB76B"}, - {"darkmagenta", "#8B008B"}, - {"darkolivegreen", "#556B2F"}, - {"darkorange", "#FF8C00"}, - {"darkorchid", "#9932CC"}, - {"darkred", "#8B0000"}, - {"darksalmon", "#E9967A"}, - {"darkseagreen", "#8FBC8F"}, - {"darkslateblue", "#483D8B"}, - {"darkslategray", "#2F4F4F"}, - {"darkslategrey", "#2F4F4F"}, - {"darkturquoise", "#00CED1"}, - {"darkviolet", "#9400D3"}, - {"deeppink", "#FF1493"}, - {"deepskyblue", "#00BFFF"}, - {"dimgray", "#696969"}, - {"dimgrey", "#696969"}, - {"diserria", "#DAA520"}, - {"dodgerblue", "#1E90FF"}, - {"domino", "#8A2008"}, - {"dulllavender", "#A899E6"}, - {"eastside", "#AC91CE"}, - {"elm", "#027877"}, - {"everglade", "#1A2421"}, - {"fern", "#4F7942"}, - {"firebrick", "#B22222"}, - {"fieryorange", "#A24510"}, - {"floralwhite", "#FFFAF0"}, - {"forestgreen", "#228B22"}, - {"frenchrose", "#F64A8A"}, - {"fruitsalad", "#4F9D5D"}, - {"fuchsia", "#FF00FF"}, - {"gainsboro", "#DCDCDC"}, - {"ghostwhite", "#F8F8FF"}, - {"gladegreen", "#4A6B4E"}, - {"gold", "#FFD700"}, - {"goldengrass", "#D9B612"}, - {"goldenrod", "#DAA520"}, - {"gondola", "#211916"}, - {"gray", "#808080"}, - {"grey", "#808080"}, - {"grannysmithapple", "#A8E4A0"}, - {"green", "#008000"}, - {"greenyellow", "#ADFF2F"}, - {"gunsmoke", "#828685"}, - {"hawaiiantan", "#9D5616"}, - {"hemlock", "#5E5D3B"}, - {"hibiscus", "#AE4560"}, - {"honeydew", "#F0FFF0"}, - {"hopbush", "#D5853E"}, - {"hotpink", "#FF69B4"}, - {"indianred", "#CD5C5C"}, - {"indigo", "#4B0082"}, - {"ivory", "#FFFFF0"}, - {"jaffa", "#EF8633"}, - {"java", "#32303D"}, - {"khaki", "#F0E68C"}, - {"lavender", "#E6E6FA"}, - {"lavenderblush", "#FFF0F5"}, - {"lawngreen", "#7CFC00"}, - {"lemonchiffon", "#FFFACD"}, - {"lightblue", "#ADD8E6"}, - {"lightcoral", "#F08080"}, - {"lightcyan", "#E0FFFF"}, - {"lightgoldenrodyellow", "#FAFAD2"}, - {"lightgray", "#D3D3D3"}, - {"lightgrey", "#D3D3D3"}, - {"lightgreen", "#90EE90"}, - {"lightorchid", "#E29CD2"}, - {"lightpink", "#FFB6C1"}, - {"lightsalmon", "#FFA07A"}, - {"lightseagreen", "#20B2AA"}, - {"lightskyblue", "#87CEFA"}, - {"lightslategray", "#778899"}, - {"lightslategrey", "#778899"}, - {"lightsteelblue", "#B0C4DE"}, - {"lightyellow", "#FFFFE0"}, - {"lime", "#00FF00"}, - {"limegreen", "#32CD32"}, - {"linen", "#FAF0E6"}, - {"lunargreen", "#3A7D02"}, - {"luckypoint", "#202078"}, - {"magenta", "#FF00FF"}, - {"mandy", "#D57C6B"}, - {"maroon", "#800000"}, - {"mediumaquamarine", "#66CDAA"}, - {"mediumblue", "#0000CD"}, - {"mediumorchid", "#BA55D3"}, - {"mediumpurple", "#9370DB"}, - {"mediumseagreen", "#3CB371"}, - {"mediumslateblue", "#7B68EE"}, - {"mediumspringgreen", "#00FA9A"}, - {"mediumturquoise", "#48D1CC"}, - {"mediumvioletred", "#C71585"}, - {"mexicanred", "#A72525"}, - {"midnightblue", "#191970"}, - {"mintcream", "#F5FFFA"}, - {"mineshaft", "#323232"}, - {"mistyrose", "#FFE4E1"}, - {"moccasin", "#FFE4B5"}, - {"mondo", "#4A3C30"}, - {"montecarlo", "#78A39C"}, - {"nandor", "#4B3D2A"}, - {"navajowhite", "#FFDEAD"}, - {"navy", "#000080"}, - {"ochre", "#C77434"}, - {"oldlace", "#FDF5E6"}, - {"olive", "#808000"}, - {"olivedrab", "#6B8E23"}, - {"orange", "#FFA500"}, - {"orangepeel", "#FFA500"}, - {"orangered", "#FF4500"}, - {"orchid", "#DA70D"}, - {"palegoldenrod", "#EEE8AA"}, - {"palegreen", "#98FB98"}, - {"paleturquoise", "#AFEEEE"}, - {"palevioletred", "#DB7093"}, - {"papayawhip", "#FFEFD5"}, - {"paradiso", "#35A793"}, - {"peachpuff", "#FFDAB9"}, - {"perano", "#7F7F7F"}, - {"peru", "#CD853F"}, - {"pewter", "#96A8A1"}, - {"pictonblue", "#45B1E8"}, - {"pink", "#FFC0CB"}, - {"plum", "#DDA0DD"}, - {"powderblue", "#B0E0E6"}, - {"puertorico", "#3B69D6"}, - {"pumice", "#C2CAC4"}, - {"purple", "#800080"}, - {"purpleheart", "#69359C"}, - {"rebeccapurple", "#663399"}, - {"red", "#FF0000"}, - {"reddamask", "#DA6A41"}, - {"riptide", "#8BE6D8"}, - {"riverbed", "#434A59"}, - {"rosybrown", "#BC8F8F"}, - {"royalblue", "#4169E1"}, - {"royalpurple", "#6B3FA0"}, - {"saddlebrown", "#8B4513"}, - {"sage", "#9EAD3D"}, - {"salmon", "#FA8072"}, - {"sandybrown", "#F4A460"}, - {"sanjuan", "#334E75"}, - {"seagreen", "#2E8B57"}, - {"seashell", "#FFF5EE"}, - {"seance", "#721757"}, - {"shiraz", "#B52D42"}, - {"sienna", "#A0522D"}, - {"silver", "#C0C0C0"}, - {"skyblue", "#87CEEB"}, - {"slateblue", "#6A5ACD"}, - {"slategray", "#708090"}, - {"slategrey", "#708090"}, - {"snow", "#FFFAFA"}, - {"springgreen", "#00FF7F"}, - {"steelblue", "#4682B4"}, - {"studio", "#714AB2"}, - {"sunglo", "#E16865"}, - {"tan", "#D2B48C"}, - {"teal", "#008080"}, - {"terracotta", "#E2725B"}, - {"thistle", "#D8BFD8"}, - {"thunderbird", "#C02B18"}, - {"tiamaria", "#C1440E"}, - {"tobaccobrown", "#715D47"}, - {"gladegreen", "#4A6B4E"}, - {"tomato", "#FF6347"}, - {"tomthumb", "#273E33"}, - {"totempole", "#991B07"}, - {"turquoise", "#40E0D0"}, - {"vesuvius", "#AD975A"}, - {"violet", "#EE82EE"}, - {"waikawagray", "#5D7291"}, - {"waikawagrey", "#5D7291"}, - {"wheat", "#F5DEB3"}, - {"white", "#FFFFFF"}, - {"whitesmoke", "#F5F5F5"}, - {"yuma", "#CFAB7A"}, - {"yellow", "#FFFF00"}, - {"yellowgreen", "#9ACD32"}}; +const std::map* colorData() { + static std::map colors = { + {"aliceblue", "#F0F8FF"}, + {"antiquewhite", "#FAEBD7"}, + {"aqua", "#00FFFF"}, + {"aquamarine", "#7FFFD4"}, + {"apricot", "#EB9373"}, + {"arapawa", "#1A2421"}, + {"azure", "#F0FFFF"}, + {"azureradiance", "#007FFF"}, + {"aquaisland", "#A1DAD7"}, + {"bayofmany", "#273A3E"}, + {"beige", "#F5F5DC"}, + {"bisque", "#FFE4C4"}, + {"black", "#000000"}, + {"blanchedalmond", "#FFEBCD"}, + {"blue", "#0000FF"}, + {"blueribbon", "#0066FF"}, + {"blueviolet", "#8A2BE2"}, + {"brown", "#A52A2A"}, + {"burlywood", "#DEB887"}, + {"buttercup", "#F3AD16"}, + {"cadetblue", "#5F9EA0"}, + {"cannonpink", "#8E5164"}, + {"carnation", "#F95A61"}, + {"carrotorange", "#ED9121"}, + {"casal", "#2E2F30"}, + {"ceruleanblue", "#2A52BE"}, + {"chartreuse", "#7FFF00"}, + {"chino", "#D2B7AD"}, + {"chocolate", "#D2691E"}, + {"christine", "#E1634F"}, + {"coral", "#FF7F50"}, + {"cornflowerblue", "#6495ED"}, + {"cornsilk", "#FFF8DC"}, + {"creamcan", "#F5C71A"}, + {"crimson", "#DC143C"}, + {"cyan", "#00FFFF"}, + {"daisybush", "#4F2398"}, + {"darkblue", "#00008B"}, + {"darkcyan", "#008B8B"}, + {"darkfern", "#0A6906"}, + {"darkgoldenrod", "#B8860B"}, + {"darkgray", "#A9A9A9"}, + {"darkgrey", "#A9A9A9"}, + {"darkgreen", "#006400"}, + {"darkindigo", "#4B0082"}, + {"darkkhaki", "#BDB76B"}, + {"darkmagenta", "#8B008B"}, + {"darkolivegreen", "#556B2F"}, + {"darkorange", "#FF8C00"}, + {"darkorchid", "#9932CC"}, + {"darkred", "#8B0000"}, + {"darksalmon", "#E9967A"}, + {"darkseagreen", "#8FBC8F"}, + {"darkslateblue", "#483D8B"}, + {"darkslategray", "#2F4F4F"}, + {"darkslategrey", "#2F4F4F"}, + {"darkturquoise", "#00CED1"}, + {"darkviolet", "#9400D3"}, + {"deeppink", "#FF1493"}, + {"deepskyblue", "#00BFFF"}, + {"dimgray", "#696969"}, + {"dimgrey", "#696969"}, + {"diserria", "#DAA520"}, + {"dodgerblue", "#1E90FF"}, + {"domino", "#8A2008"}, + {"dulllavender", "#A899E6"}, + {"eastside", "#AC91CE"}, + {"elm", "#027877"}, + {"everglade", "#1A2421"}, + {"fern", "#4F7942"}, + {"firebrick", "#B22222"}, + {"fieryorange", "#A24510"}, + {"floralwhite", "#FFFAF0"}, + {"forestgreen", "#228B22"}, + {"frenchrose", "#F64A8A"}, + {"fruitsalad", "#4F9D5D"}, + {"fuchsia", "#FF00FF"}, + {"gainsboro", "#DCDCDC"}, + {"ghostwhite", "#F8F8FF"}, + {"gladegreen", "#4A6B4E"}, + {"gold", "#FFD700"}, + {"goldengrass", "#D9B612"}, + {"goldenrod", "#DAA520"}, + {"gondola", "#211916"}, + {"gray", "#808080"}, + {"grey", "#808080"}, + {"grannysmithapple", "#A8E4A0"}, + {"green", "#008000"}, + {"greenyellow", "#ADFF2F"}, + {"gunsmoke", "#828685"}, + {"hawaiiantan", "#9D5616"}, + {"hemlock", "#5E5D3B"}, + {"hibiscus", "#AE4560"}, + {"honeydew", "#F0FFF0"}, + {"hopbush", "#D5853E"}, + {"hotpink", "#FF69B4"}, + {"indianred", "#CD5C5C"}, + {"indigo", "#4B0082"}, + {"ivory", "#FFFFF0"}, + {"jaffa", "#EF8633"}, + {"java", "#32303D"}, + {"khaki", "#F0E68C"}, + {"lavender", "#E6E6FA"}, + {"lavenderblush", "#FFF0F5"}, + {"lawngreen", "#7CFC00"}, + {"lemonchiffon", "#FFFACD"}, + {"lightblue", "#ADD8E6"}, + {"lightcoral", "#F08080"}, + {"lightcyan", "#E0FFFF"}, + {"lightgoldenrodyellow", "#FAFAD2"}, + {"lightgray", "#D3D3D3"}, + {"lightgrey", "#D3D3D3"}, + {"lightgreen", "#90EE90"}, + {"lightorchid", "#E29CD2"}, + {"lightpink", "#FFB6C1"}, + {"lightsalmon", "#FFA07A"}, + {"lightseagreen", "#20B2AA"}, + {"lightskyblue", "#87CEFA"}, + {"lightslategray", "#778899"}, + {"lightslategrey", "#778899"}, + {"lightsteelblue", "#B0C4DE"}, + {"lightyellow", "#FFFFE0"}, + {"lime", "#00FF00"}, + {"limegreen", "#32CD32"}, + {"linen", "#FAF0E6"}, + {"lunargreen", "#3A7D02"}, + {"luckypoint", "#202078"}, + {"magenta", "#FF00FF"}, + {"mandy", "#D57C6B"}, + {"maroon", "#800000"}, + {"mediumaquamarine", "#66CDAA"}, + {"mediumblue", "#0000CD"}, + {"mediumorchid", "#BA55D3"}, + {"mediumpurple", "#9370DB"}, + {"mediumseagreen", "#3CB371"}, + {"mediumslateblue", "#7B68EE"}, + {"mediumspringgreen", "#00FA9A"}, + {"mediumturquoise", "#48D1CC"}, + {"mediumvioletred", "#C71585"}, + {"mexicanred", "#A72525"}, + {"midnightblue", "#191970"}, + {"mintcream", "#F5FFFA"}, + {"mineshaft", "#323232"}, + {"mistyrose", "#FFE4E1"}, + {"moccasin", "#FFE4B5"}, + {"mondo", "#4A3C30"}, + {"montecarlo", "#78A39C"}, + {"nandor", "#4B3D2A"}, + {"navajowhite", "#FFDEAD"}, + {"navy", "#000080"}, + {"ochre", "#C77434"}, + {"oldlace", "#FDF5E6"}, + {"olive", "#808000"}, + {"olivedrab", "#6B8E23"}, + {"orange", "#FFA500"}, + {"orangepeel", "#FFA500"}, + {"orangered", "#FF4500"}, + {"orchid", "#DA70D"}, + {"palegoldenrod", "#EEE8AA"}, + {"palegreen", "#98FB98"}, + {"paleturquoise", "#AFEEEE"}, + {"palevioletred", "#DB7093"}, + {"papayawhip", "#FFEFD5"}, + {"paradiso", "#35A793"}, + {"peachpuff", "#FFDAB9"}, + {"perano", "#7F7F7F"}, + {"peru", "#CD853F"}, + {"pewter", "#96A8A1"}, + {"pictonblue", "#45B1E8"}, + {"pink", "#FFC0CB"}, + {"plum", "#DDA0DD"}, + {"powderblue", "#B0E0E6"}, + {"puertorico", "#3B69D6"}, + {"pumice", "#C2CAC4"}, + {"purple", "#800080"}, + {"purpleheart", "#69359C"}, + {"rebeccapurple", "#663399"}, + {"red", "#FF0000"}, + {"reddamask", "#DA6A41"}, + {"riptide", "#8BE6D8"}, + {"riverbed", "#434A59"}, + {"rosybrown", "#BC8F8F"}, + {"royalblue", "#4169E1"}, + {"royalpurple", "#6B3FA0"}, + {"saddlebrown", "#8B4513"}, + {"sage", "#9EAD3D"}, + {"salmon", "#FA8072"}, + {"sandybrown", "#F4A460"}, + {"sanjuan", "#334E75"}, + {"seagreen", "#2E8B57"}, + {"seashell", "#FFF5EE"}, + {"seance", "#721757"}, + {"shiraz", "#B52D42"}, + {"sienna", "#A0522D"}, + {"silver", "#C0C0C0"}, + {"skyblue", "#87CEEB"}, + {"slateblue", "#6A5ACD"}, + {"slategray", "#708090"}, + {"slategrey", "#708090"}, + {"snow", "#FFFAFA"}, + {"springgreen", "#00FF7F"}, + {"steelblue", "#4682B4"}, + {"studio", "#714AB2"}, + {"sunglo", "#E16865"}, + {"tan", "#D2B48C"}, + {"teal", "#008080"}, + {"terracotta", "#E2725B"}, + {"thistle", "#D8BFD8"}, + {"thunderbird", "#C02B18"}, + {"tiamaria", "#C1440E"}, + {"tobaccobrown", "#715D47"}, + {"gladegreen", "#4A6B4E"}, + {"tomato", "#FF6347"}, + {"tomthumb", "#273E33"}, + {"totempole", "#991B07"}, + {"transparent", "#FFFFFF00"}, + {"turquoise", "#40E0D0"}, + {"vesuvius", "#AD975A"}, + {"violet", "#EE82EE"}, + {"waikawagray", "#5D7291"}, + {"waikawagrey", "#5D7291"}, + {"wheat", "#F5DEB3"}, + {"white", "#FFFFFF"}, + {"whitesmoke", "#F5F5F5"}, + {"yuma", "#CFAB7A"}, + {"yellow", "#FFFF00"}, + {"yellowgreen", "#9ACD32"}}; - return &colors; - } + return &colors; +} - const std::string getHexColorCodeFromHtmlColorName(const std::string& htmlColorName) { - const std::map* colors = colorData(); - auto color = colors->find(htmlColorName.c_str()); - if (color == colors->end()) { - return ""; - } - return color->second; +const std::string getHexColorCodeFromHtmlColorName(const std::string& htmlColorName) { + const std::map* colors = colorData(); + if (isTransparentColorName(htmlColorName)) { + if (colors->find(removeTransparencyFromColorName(htmlColorName))->second.empty()) + return colors->find("transparent")->second; + + return addTransparencyToColorValue(colors->find(removeTransparencyFromColorName(htmlColorName))->second); } + auto color = colors->find(htmlColorName.c_str()); + if (color == colors->end()) { + return ""; + } + return color->second; +} - const std::string getHtmlColorNameFromHexColorCode(const std::string& hexColorCode) { - const std::map* colors = colorData(); - for (auto color = colors->begin(); color != colors->end(); color++) { - if (stringCompare(color->second, hexColorCode)) { - return color->first; - } +const std::string getHtmlColorNameFromHexColorCode(const std::string& hexColorCode) { + const std::map* colors = colorData(); + for (auto color = colors->begin(); color != colors->end(); color++) { + if (stringCompare(color->second, hexColorCode)) { + return color->first; } - return ""; } + return ""; +} - const bool isValidHexColorCode(const std::string& value) { - if ((value.size() != 7 && value.size() != 9) || value.at(0) != '#') - return false; +const bool isTransparentColorName(const std::string& colorName) { + if (colorName.rfind("_transparent") != std::string::npos) + return true; - for (unsigned int i = 1; i < value.size(); i++) { - if (!isxdigit(value.at(i))) - return false; - } + return false; +} +const bool isTransparentColorValue(const std::string& colorValue) { + if (colorValue.size() == 9 && colorValue.at(0) == '#' && colorValue.substr(7, 2) == "00") { return true; } - const bool isxdigit(const char& c) { - return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); + return false; +} + +const std::string addTransparencyToColorName(const std::string& colorName) { + if (isTransparentColorName(colorName)) + return colorName; + + return colorName + "_transparent"; +} + +const std::string addTransparencyToColorValue(const std::string& colorValue) { + if (isTransparentColorValue(colorValue)) + return colorValue; + else if (isValidHexColorCode(colorValue) && colorValue.size() == 7) + return colorValue + "00"; + + return ""; +} + +const std::string removeTransparencyFromColorName(const std::string& colorName) { + if (!isTransparentColorName(colorName)) + return colorName; + + return colorName.substr(0, colorName.size() - 12); +} + +const std::string removeTransparencyFromColorValue(const std::string& colorValue) { + if (!isTransparentColorValue(colorValue)) + return colorValue; + + return colorValue.substr(0, 7); +} + +const bool isValidHexColorCode(const std::string& value) { + if ((value.size() != 7 && value.size() != 9) || value.at(0) != '#') + return false; + + for (unsigned int i = 1; i < value.size(); i++) { + if (!isxdigit(value.at(i))) + return false; } - const bool isValidColorValue(const std::string& value) { - const std::map* colors = colorData(); - if (colors->find(value.c_str()) != colors->end()) { - return true; - } - return isValidHexColorCode(value); + return true; +} + +const bool isxdigit(const char& c) { + return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); +} + +const bool isValidColorValue(const std::string& value) { + const std::map* colors = colorData(); + if (colors->find(value.c_str()) != colors->end()) { + return true; } + return isValidHexColorCode(value); +} } \ No newline at end of file diff --git a/src/features/colors/libsbmlnetwork_colors.h b/src/features/colors/libsbmlnetwork_colors.h index d44494a..3158c8d 100644 --- a/src/features/colors/libsbmlnetwork_colors.h +++ b/src/features/colors/libsbmlnetwork_colors.h @@ -8,17 +8,30 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { - const std::map* colorData(); +const std::map* colorData(); - const std::string getHexColorCodeFromHtmlColorName(const std::string& htmlColorName); +const std::string getHexColorCodeFromHtmlColorName(const std::string& htmlColorName); - const std::string getHtmlColorNameFromHexColorCode(const std::string& hexColorCode); +const std::string getHtmlColorNameFromHexColorCode(const std::string& hexColorCode); - const bool isValidHexColorCode(const std::string& value); +const bool isTransparentColorName(const std::string& colorName); - const bool isxdigit(const char& c); +const bool isTransparentColorValue(const std::string& colorValue); + +const std::string addTransparencyToColorName(const std::string& colorName); + +const std::string addTransparencyToColorValue(const std::string& colorValue); + +const std::string removeTransparencyFromColorName(const std::string& colorName); + +const std::string removeTransparencyFromColorValue(const std::string& colorValue); + +const bool isValidHexColorCode(const std::string& value); + +const bool isxdigit(const char& c); + +const bool isValidColorValue(const std::string& value); - const bool isValidColorValue(const std::string& value); } #endif diff --git a/src/features/defaults/libsbmlnetwork_defaults_render.cpp b/src/features/defaults/libsbmlnetwork_defaults_render.cpp index 216a8c5..d00e712 100644 --- a/src/features/defaults/libsbmlnetwork_defaults_render.cpp +++ b/src/features/defaults/libsbmlnetwork_defaults_render.cpp @@ -19,6 +19,11 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { addColor(globalRenderInformation, "silver"); } + void defaults_addColorsOfDefaultGeometricShapes(SBMLDocument* document, LineEnding* lineEnding) { + addColor(document, lineEnding, "white"); + addColor(document, lineEnding, "black"); + } + void defaults_addColorsOfDefaultGeometricShapes(SBMLDocument* document, Style* style) { addColor(document, style, "white"); addColor(document, style, "black"); diff --git a/src/features/defaults/libsbmlnetwork_defaults_render.h b/src/features/defaults/libsbmlnetwork_defaults_render.h index 30ccd5d..4b170aa 100644 --- a/src/features/defaults/libsbmlnetwork_defaults_render.h +++ b/src/features/defaults/libsbmlnetwork_defaults_render.h @@ -12,6 +12,8 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { void defaults_addDefaultColors(GlobalRenderInformation* globalRenderInformation); + void defaults_addColorsOfDefaultGeometricShapes(SBMLDocument* document, LineEnding* lineEnding); + void defaults_addColorsOfDefaultGeometricShapes(SBMLDocument* document, Style* style); void defaults_addColorsOfDefaultGeometricShapes(GlobalRenderInformation* globalRenderInformation); diff --git a/src/features/hide_elements/libsbmlnetwork_hide_elements.cpp b/src/features/hide_elements/libsbmlnetwork_hide_elements.cpp new file mode 100644 index 0000000..7cce985 --- /dev/null +++ b/src/features/hide_elements/libsbmlnetwork_hide_elements.cpp @@ -0,0 +1,512 @@ +#include "libsbmlnetwork_hide_elements.h" +#include "../../libsbmlnetwork_sbmldocument_layout.h" +#include "../../libsbmlnetwork_layout.h" +#include "../../libsbmlnetwork_sbmldocument_render.h" +#include "../../libsbmlnetwork_render.h" +#include "../../libsbmlnetwork_render_helpers.h" +#include "../../features/colors/libsbmlnetwork_colors.h" +#include "../../features/set_layout_features/libsbmlnetwork_set_layout_features.h" + +namespace LIBSBMLNETWORK_CPP_NAMESPACE { + +int hide_elements_makeVisible(SBMLDocument* document, unsigned int layoutIndex) { + if (hide_elements_makeCompartmentVisible(document, layoutIndex)) + return -1; + if (hide_elements_makeSpeciesVisible(document, layoutIndex)) + return -1; + if (hide_elements_makeReactionVisible(document, layoutIndex)) + return -1; + + return 0; +} + +int hide_elements_makeInvisible(SBMLDocument* document, unsigned int layoutIndex) { + if (hide_elements_makeCompartmentInvisible(document, layoutIndex)) + return -1; + if (hide_elements_makeSpeciesInvisible(document, layoutIndex)) + return -1; + if (hide_elements_makeReactionInvisible(document, layoutIndex)) + return -1; + + return 0; +} + +int hide_elements_makeCompartmentVisible(SBMLDocument* document, unsigned int layoutIndex) { + if (hide_elements_make2DGraphicalObjectVisible(document, getStyleByType(getGlobalRenderInformation(document), getCompartmentGlyphStyleType())) || + hide_elements_makeTextVisible(document, getStyleByType(getGlobalRenderInformation(document), getCompartmentGlyphTextGlyphStyleType()))) + return -1; + + Layout* layout = getLayout(document, layoutIndex); + LocalRenderInformation* localRenderInformation = getLocalRenderInformation(document, layoutIndex); + if (layout && localRenderInformation) { + for (unsigned int i = 0; i < layout->getNumCompartmentGlyphs(); i++) + hide_elements_makeGraphicalObjectLocalStyleVisible(document, localRenderInformation, layout->getCompartmentGlyph(i)); + } + + return 0; +} + +int hide_elements_makeCompartmentInvisible(SBMLDocument* document, unsigned int layoutIndex) { + if (hide_elements_make2DGraphicalObjectInvisible(document, getStyleByType(getGlobalRenderInformation(document), getCompartmentGlyphStyleType())) || + hide_elements_makeTextInvisible(document, getStyleByType(getGlobalRenderInformation(document), getCompartmentGlyphTextGlyphStyleType()))) + return -1; + + Layout* layout = getLayout(document, layoutIndex); + LocalRenderInformation* localRenderInformation = getLocalRenderInformation(document, layoutIndex); + if (layout && localRenderInformation) { + for (unsigned int i = 0; i < layout->getNumCompartmentGlyphs(); i++) + hide_elements_makeGraphicalObjectLocalStyleInvisible(document, localRenderInformation, layout->getCompartmentGlyph(i)); + } + + return 0; +} + +int hide_elements_makeSpeciesVisible(SBMLDocument* document, unsigned int layoutIndex) { + if (hide_elements_make2DGraphicalObjectVisible(document, getStyleByType(getGlobalRenderInformation(document), getSpeciesGlyphStyleType())) || + hide_elements_makeTextVisible(document, getStyleByType(getGlobalRenderInformation(document), getSpeciesGlyphTextGlyphStyleType()))) + return -1; + + Layout* layout = getLayout(document, layoutIndex); + LocalRenderInformation* localRenderInformation = getLocalRenderInformation(document, layoutIndex); + if (layout && localRenderInformation) { + for (unsigned int i = 0; i < layout->getNumSpeciesGlyphs(); i++) + hide_elements_makeGraphicalObjectLocalStyleVisible(document, localRenderInformation, layout->getSpeciesGlyph(i)); + } + + return 0; +} + +int hide_elements_makeSpeciesInvisible(SBMLDocument* document, unsigned int layoutIndex) { + if (hide_elements_make2DGraphicalObjectInvisible(document, getStyleByType(getGlobalRenderInformation(document), getSpeciesGlyphStyleType())) || + hide_elements_makeTextInvisible(document, getStyleByType(getGlobalRenderInformation(document), getSpeciesGlyphTextGlyphStyleType()))) + return -1; + + Layout* layout = getLayout(document, layoutIndex); + LocalRenderInformation* localRenderInformation = getLocalRenderInformation(document, layoutIndex); + if (layout && localRenderInformation) { + for (unsigned int i = 0; i < layout->getNumSpeciesGlyphs(); i++) + hide_elements_makeGraphicalObjectLocalStyleInvisible(document, localRenderInformation, layout->getSpeciesGlyph(i)); + } + + return 0; +} + +int hide_elements_makeReactionVisible(SBMLDocument* document, unsigned int layoutIndex) { + if (hide_elements_make2DGraphicalObjectVisible(document, getStyleByType(getGlobalRenderInformation(document), getReactionGlyphStyleType()))) + return -1; + hide_elements_makeTextVisible(document, getStyleByType(getGlobalRenderInformation(document), getReactionGlyphTextGlyphStyleType())); + + Layout* layout = getLayout(document, layoutIndex); + LocalRenderInformation* localRenderInformation = getLocalRenderInformation(document, layoutIndex); + if (layout && localRenderInformation) { + for (unsigned int i = 0; i < layout->getNumReactionGlyphs(); i++) + hide_elements_makeGraphicalObjectLocalStyleVisible(document, localRenderInformation, layout->getReactionGlyph(i)); + } + + return hide_elements_makeSpeciesReferenceVisible(document, layoutIndex); +} + +int hide_elements_makeReactionInvisible(SBMLDocument* document, unsigned int layoutIndex) { + if (hide_elements_make2DGraphicalObjectInvisible(document, getStyleByType(getGlobalRenderInformation(document), getReactionGlyphStyleType()))) + return -1; + hide_elements_makeTextInvisible(document, getStyleByType(getGlobalRenderInformation(document), getReactionGlyphTextGlyphStyleType())); + + Layout* layout = getLayout(document, layoutIndex); + LocalRenderInformation* localRenderInformation = getLocalRenderInformation(document, layoutIndex); + if (layout && localRenderInformation) { + for (unsigned int i = 0; i < layout->getNumReactionGlyphs(); i++) + hide_elements_makeGraphicalObjectLocalStyleInvisible(document, localRenderInformation, layout->getReactionGlyph(i)); + } + + return hide_elements_makeSpeciesReferenceInvisible(document, layoutIndex); +} + +int hide_elements_makeSpeciesReferenceVisible(SBMLDocument* document, unsigned int layoutIndex) { + hide_elements_make1DGraphicalObjectVisible(document, getStyleByType(getGlobalRenderInformation(document), getSpeciesReferenceGlyphStyleType())); + std::vector> styleRoles = getStyleRoles(); + for (std::vector>::const_iterator styleRoleIt = styleRoles.cbegin(); styleRoleIt != styleRoles.cend(); styleRoleIt++) + hide_elements_make1DGraphicalObjectVisible(document, getStyleByRole(getGlobalRenderInformation(document), styleRoleIt->second)); + + Layout* layout = getLayout(document, layoutIndex); + LocalRenderInformation* localRenderInformation = getLocalRenderInformation(document, layoutIndex); + if (layout && localRenderInformation) { + for (unsigned int i = 0; i < layout->getNumReactionGlyphs(); i++) { + for (unsigned int j = 0; j < layout->getReactionGlyph(i)->getNumSpeciesReferenceGlyphs(); j++) + hide_elements_makeGraphicalObjectLocalStyleVisible(document, localRenderInformation, layout->getReactionGlyph(i)->getSpeciesReferenceGlyph(j)); + } + } + + return hide_elements_makeLineEndingVisible(document, layoutIndex); +} + +int hide_elements_makeSpeciesReferenceInvisible(SBMLDocument* document, unsigned int layoutIndex) { + hide_elements_make1DGraphicalObjectInvisible(document, getStyleByType(getGlobalRenderInformation(document), getSpeciesReferenceGlyphStyleType())); + std::vector> styleRoles = getStyleRoles(); + for (std::vector>::const_iterator styleRoleIt = styleRoles.cbegin(); styleRoleIt != styleRoles.cend(); styleRoleIt++) + hide_elements_make1DGraphicalObjectInvisible(document, getStyleByRole(getGlobalRenderInformation(document), + styleRoleIt->second)); + + Layout* layout = getLayout(document, layoutIndex); + LocalRenderInformation* localRenderInformation = getLocalRenderInformation(document, layoutIndex); + if (layout && localRenderInformation) { + for (unsigned int i = 0; i < layout->getNumReactionGlyphs(); i++) { + for (unsigned int j = 0; j < layout->getReactionGlyph(i)->getNumSpeciesReferenceGlyphs(); j++) + hide_elements_makeGraphicalObjectLocalStyleInvisible(document, localRenderInformation, layout->getReactionGlyph(i)->getSpeciesReferenceGlyph(j)); + } + } + + return hide_elements_makeLineEndingInvisible(document, layoutIndex); +} + +int hide_elements_makeLineEndingVisible(SBMLDocument* document, unsigned int layoutIndex) { + for (unsigned int renderIndex = 0; renderIndex < getNumLocalRenderInformation(document, layoutIndex); renderIndex++) { + for (unsigned int lineEndingIndex = 0; lineEndingIndex < getNumLineEndings(getLocalRenderInformation(document, lineEndingIndex, renderIndex)); lineEndingIndex++) { + if (hide_elements_makeLineEndingVisible(document, getLineEnding(getLocalRenderInformation(document, lineEndingIndex, renderIndex), lineEndingIndex))) + return -1; + } + } + for (unsigned int renderIndex = 0; renderIndex < getNumGlobalRenderInformation(document); renderIndex++) { + for (unsigned int lineEndingIndex = 0; lineEndingIndex < getNumLineEndings(getGlobalRenderInformation(document, renderIndex)); lineEndingIndex++) { + if (hide_elements_makeLineEndingVisible(document, getLineEnding(getGlobalRenderInformation(document, renderIndex), lineEndingIndex))) + return -1; + } + } + + return 0; +} + +int hide_elements_makeLineEndingInvisible(SBMLDocument* document, unsigned int layoutIndex) { + for (unsigned int renderIndex = 0; renderIndex < getNumLocalRenderInformation(document, layoutIndex); renderIndex++) { + for (unsigned int lineEndingIndex = 0; lineEndingIndex < getNumLineEndings(getLocalRenderInformation(document, lineEndingIndex, renderIndex)); lineEndingIndex++) { + if (hide_elements_makeLineEndingInvisible(document, getLineEnding(getLocalRenderInformation(document, lineEndingIndex, renderIndex), lineEndingIndex))) + return -1; + } + } + for (unsigned int renderIndex = 0; renderIndex < getNumGlobalRenderInformation(document); renderIndex++) { + for (unsigned int lineEndingIndex = 0; lineEndingIndex < getNumLineEndings(getGlobalRenderInformation(document, renderIndex)); lineEndingIndex++) { + if (hide_elements_makeLineEndingInvisible(document, getLineEnding(getGlobalRenderInformation(document, renderIndex), lineEndingIndex))) + return -1; + } + } + + return 0; +} + +int hide_elements_makeGraphicalObjectLocalStyleVisible(SBMLDocument* document, LocalRenderInformation* localRenderInformation, GraphicalObject* graphicalObject) { + Style* style = getStyleById(localRenderInformation, graphicalObject); + if (style) { + if (isSpeciesReferenceGlyph(graphicalObject)) { + if (hide_elements_make1DGraphicalObjectVisible(document, style)) + return -1; + } + else { + if (hide_elements_make2DGraphicalObjectVisible(document, style)) + return -1; + } + } + std::vector textGlyphs = getTextGlyphs(getLayout(document), graphicalObject); + for (unsigned int j = 0; j < textGlyphs.size(); j++) { + style = getStyleById(localRenderInformation, textGlyphs.at(j)); + if (style) { + if (hide_elements_makeTextVisible(document, style)) + return -1; + } + } + + return 0; +} + +int hide_elements_makeGraphicalObjectLocalStyleInvisible(SBMLDocument* document, LocalRenderInformation* localRenderInformation, GraphicalObject* graphicalObject) { + Style* style = getStyleById(localRenderInformation, graphicalObject); + if (style) { + if (isSpeciesReferenceGlyph(graphicalObject)) { + if (hide_elements_make1DGraphicalObjectInvisible(document, style)) + return -1; + } + else { + if (hide_elements_make2DGraphicalObjectInvisible(document, style)) + return -1; + } + } + std::vector textGlyphs = getTextGlyphs(getLayout(document), graphicalObject); + for (unsigned int j = 0; j < textGlyphs.size(); j++) { + style = getStyleById(localRenderInformation, textGlyphs.at(j)); + if (style) { + if (hide_elements_makeTextInvisible(document, style)) + return -1; + } + } + + return 0; +} + +int hide_elements_makeVisible(SBMLDocument* document, GraphicalObject* graphicalObject, const bool& applyToConnectedElements) { + if (isCompartmentGlyph(graphicalObject)) + return hide_elements_makeCompartmentGlyphVisible(document, (CompartmentGlyph*)graphicalObject); + else if (isSpeciesGlyph(graphicalObject)) + return hide_elements_makeSpeciesGlyphVisible(document, (SpeciesGlyph*)graphicalObject, applyToConnectedElements); + else if (isReactionGlyph(graphicalObject)) + return hide_elements_makeReactionGlyphVisible(document, (ReactionGlyph*)graphicalObject, applyToConnectedElements); + + return -1; +} + +int hide_elements_makeInvisible(SBMLDocument* document, GraphicalObject* graphicalObject, const bool& applyToConnectedElements) { + if (isCompartmentGlyph(graphicalObject)) + return hide_elements_makeCompartmentGlyphInvisible(document, (CompartmentGlyph*)graphicalObject); + else if (isSpeciesGlyph(graphicalObject)) + return hide_elements_makeSpeciesGlyphInvisible(document, (SpeciesGlyph*)graphicalObject, applyToConnectedElements); + else if (isReactionGlyph(graphicalObject)) + return hide_elements_makeReactionGlyphInvisible(document, (ReactionGlyph*)graphicalObject, applyToConnectedElements); + + return -1; +} + +int hide_elements_makeCompartmentGlyphVisible(SBMLDocument* document, CompartmentGlyph* compartmentGlyph) { + if (compartmentGlyph) { + Style* style = getLocalStyle(document, compartmentGlyph); + if (!style) + style = createLocalStyle(document, compartmentGlyph); + hide_elements_make2DGraphicalObjectVisible(document, style); + std::vector textGlyphs = getTextGlyphs(getLayout(document), compartmentGlyph); + for (std::vector::const_iterator textGlyphIt = textGlyphs.cbegin(); textGlyphIt != textGlyphs.cend(); textGlyphIt++) + hide_elements_makeTextGlyphVisible(document, *textGlyphIt, compartmentGlyph); + return 0; + } + + return -1; +} + +int hide_elements_makeCompartmentGlyphInvisible(SBMLDocument* document, CompartmentGlyph* compartmentGlyph) { + if (compartmentGlyph) { + Style* style = getLocalStyle(document, compartmentGlyph); + if (!style) + style = createLocalStyle(document, compartmentGlyph); + hide_elements_make2DGraphicalObjectInvisible(document, style); + std::vector textGlyphs = getTextGlyphs(getLayout(document), compartmentGlyph); + for (std::vector::const_iterator textGlyphIt = textGlyphs.cbegin(); textGlyphIt != textGlyphs.cend(); textGlyphIt++) + hide_elements_makeTextGlyphInvisible(document, *textGlyphIt, compartmentGlyph); + return 0; + } + + return -1; +} + +int hide_elements_makeSpeciesGlyphVisible(SBMLDocument* document, SpeciesGlyph* speciesGlyph, const bool applyToConnectedElements) { + if (speciesGlyph) { + Style* style = getLocalStyle(document, speciesGlyph); + if (!style) + style = createLocalStyle(document, speciesGlyph); + hide_elements_make2DGraphicalObjectVisible(document, style); + std::vector textGlyphs = getTextGlyphs(getLayout(document), speciesGlyph); + for (std::vector::const_iterator textGlyphIt = textGlyphs.cbegin(); textGlyphIt != textGlyphs.cend(); textGlyphIt++) + hide_elements_makeTextGlyphVisible(document, *textGlyphIt, speciesGlyph); + if (applyToConnectedElements) { + std::vector speciesReferenceGlyphs = set_layout_features_getConnectedSpeciesGlyphReferences(getLayout(document), speciesGlyph); + for (std::vector::const_iterator speciesReferenceGlyphIt = speciesReferenceGlyphs.cbegin(); speciesReferenceGlyphIt != speciesReferenceGlyphs.cend(); speciesReferenceGlyphIt++) { + if (hide_elements_makeSpeciesReferenceGlyphVisible(document, *speciesReferenceGlyphIt)) + return -1; + } + } + + return 0; + } + + return -1; +} + +int hide_elements_makeSpeciesGlyphInvisible(SBMLDocument* document, SpeciesGlyph* speciesGlyph, const bool applyToConnectedElements) { + if (speciesGlyph) { + Style* style = getLocalStyle(document, speciesGlyph); + if (!style) + style = createLocalStyle(document, speciesGlyph); + hide_elements_make2DGraphicalObjectInvisible(document, style); + std::vector textGlyphs = getTextGlyphs(getLayout(document), speciesGlyph); + for (std::vector::const_iterator textGlyphIt = textGlyphs.cbegin(); textGlyphIt != textGlyphs.cend(); textGlyphIt++) + hide_elements_makeTextGlyphInvisible(document, *textGlyphIt, speciesGlyph); + if (applyToConnectedElements) { + std::vector speciesReferenceGlyphs = set_layout_features_getConnectedSpeciesGlyphReferences(getLayout(document), speciesGlyph); + for (std::vector::const_iterator speciesReferenceGlyphIt = speciesReferenceGlyphs.cbegin(); speciesReferenceGlyphIt != speciesReferenceGlyphs.cend(); speciesReferenceGlyphIt++) { + if (hide_elements_makeSpeciesReferenceGlyphInvisible(document, *speciesReferenceGlyphIt)) + return -1; + } + } + + return 0; + } + + return -1; +} + +int hide_elements_makeReactionGlyphVisible(SBMLDocument* document, ReactionGlyph* reactionGlyph, const bool applyToConnectedElements) { + if (reactionGlyph) { + Style* style = getLocalStyle(document, reactionGlyph); + if (!style) + style = createLocalStyle(document, reactionGlyph); + hide_elements_make2DGraphicalObjectVisible(document, style); + std::vector textGlyphs = getTextGlyphs(getLayout(document), reactionGlyph); + for (std::vector::const_iterator textGlyphIt = textGlyphs.cbegin(); textGlyphIt != textGlyphs.cend(); textGlyphIt++) + hide_elements_makeTextGlyphVisible(document, *textGlyphIt, reactionGlyph); + if (applyToConnectedElements) { + for (unsigned int i = 0; i < reactionGlyph->getNumSpeciesReferenceGlyphs(); i++) + if (hide_elements_makeSpeciesReferenceGlyphVisible(document, reactionGlyph->getSpeciesReferenceGlyph(i))) + return -1; + } + + return 0; + } + + return -1; +} + +int hide_elements_makeReactionGlyphInvisible(SBMLDocument* document, ReactionGlyph* reactionGlyph, const bool applyToConnectedElements) { + if (reactionGlyph) { + Style* style = getLocalStyle(document, reactionGlyph); + if (!style) + style = createLocalStyle(document, reactionGlyph); + hide_elements_make2DGraphicalObjectInvisible(document, style); + std::vector textGlyphs = getTextGlyphs(getLayout(document), reactionGlyph); + for (std::vector::const_iterator textGlyphIt = textGlyphs.cbegin(); textGlyphIt != textGlyphs.cend(); textGlyphIt++) + hide_elements_makeTextGlyphInvisible(document, *textGlyphIt, reactionGlyph); + if (applyToConnectedElements) { + for (unsigned int i = 0; i < reactionGlyph->getNumSpeciesReferenceGlyphs(); i++) + if (hide_elements_makeSpeciesReferenceGlyphInvisible(document, reactionGlyph->getSpeciesReferenceGlyph(i))) + return -1; + } + + return 0; + } + + return -1; +} + +int hide_elements_makeSpeciesReferenceGlyphVisible(SBMLDocument* document, SpeciesReferenceGlyph* speciesReferenceGlyph) { + if (speciesReferenceGlyph) { + Style* style = getLocalStyle(document, speciesReferenceGlyph); + if (!style) + style = createLocalStyle(document, speciesReferenceGlyph); + hide_elements_make1DGraphicalObjectVisible(document, style); + hide_elements_makeLineEndingVisible(document, getSpeciesReferenceLocalLineEnding(document, speciesReferenceGlyph)); + return 0; + } + + return -1; +} + +int hide_elements_makeSpeciesReferenceGlyphInvisible(SBMLDocument* document, SpeciesReferenceGlyph* speciesReferenceGlyph) { + if (speciesReferenceGlyph) { + Style* style = getLocalStyle(document, speciesReferenceGlyph); + if (!style) + style = createLocalStyle(document, speciesReferenceGlyph); + hide_elements_make1DGraphicalObjectInvisible(document, style); + hide_elements_makeLineEndingInvisible(document, getSpeciesReferenceLocalLineEnding(document, speciesReferenceGlyph)); + return 0; + } + + return -1; +} + +int hide_elements_makeTextGlyphVisible(SBMLDocument* document, TextGlyph* textGlyph, GraphicalObject* graphicalObject) { + if (textGlyph) { + Style* style = getLocalStyle(document, textGlyph); + if (!style) + style = createLocalStyle(document, textGlyph, graphicalObject); + hide_elements_makeTextVisible(document, style); + return 0; + } + + return -1; +} + +int hide_elements_makeTextGlyphInvisible(SBMLDocument* document, TextGlyph* textGlyph, GraphicalObject* graphicalObject) { + if (textGlyph) { + Style* style = getLocalStyle(document, textGlyph); + if (!style) + style = createLocalStyle(document, textGlyph, graphicalObject); + hide_elements_makeTextInvisible(document, style); + return 0; + } + + return -1; +} + +int hide_elements_makeLineEndingVisible(SBMLDocument* document, LineEnding* lineEnding) { + if (lineEnding) { + hide_elements_make2DGraphicalObjectVisible(document, lineEnding); + return 0; + } + + return -1; +} + +int hide_elements_makeLineEndingInvisible(SBMLDocument* document, LineEnding* lineEnding) { + if (lineEnding) { + hide_elements_make2DGraphicalObjectInvisible(document, lineEnding); + return 0; + } + + return -1; +} + +int hide_elements_make2DGraphicalObjectVisible(SBMLDocument* document, Style* style) { + hide_elements_make1DGraphicalObjectVisible(document, style); + std::string colorWithoutTransparency = removeTransparencyFromColorName(getFillColor(style)); + if (getGradientDefinition(document, colorWithoutTransparency)) { + return setFillColorAsGradient(style, colorWithoutTransparency); + } + std::string fillColorId = addColor(document, style, colorWithoutTransparency); + return setFillColor(style, fillColorId, getValue(document, fillColorId)); +} + +int hide_elements_make2DGraphicalObjectInvisible(SBMLDocument* document, Style* style) { + hide_elements_make1DGraphicalObjectInvisible(document, style); + std::string fillColorId = addColor(document, style, addTransparencyToColorName(getFillColor(style))); + return setFillColor(style, fillColorId, getValue(document, fillColorId)); +} + +int hide_elements_make2DGraphicalObjectVisible(SBMLDocument* document, LineEnding* lineEnding) { + hide_elements_make1DGraphicalObjectVisible(document, lineEnding); + std::string colorWithoutTransparency = removeTransparencyFromColorName(getFillColor(getRenderGroup(lineEnding))); + if (getGradientDefinition(document, colorWithoutTransparency)) + return setFillColorAsGradient(getRenderGroup(lineEnding), colorWithoutTransparency); + std::string fillColorId = addColor(document, lineEnding, colorWithoutTransparency); + return setFillColor(getRenderGroup(lineEnding), fillColorId, getValue(document, fillColorId)); +} + +int hide_elements_make2DGraphicalObjectInvisible(SBMLDocument* document, LineEnding* lineEnding) { + hide_elements_make1DGraphicalObjectInvisible(document, lineEnding); + std::string fillColorId = addColor(document, lineEnding, addTransparencyToColorName(getFillColor(getRenderGroup(lineEnding)))); + return setFillColor(getRenderGroup(lineEnding), fillColorId, getValue(document, fillColorId)); +} + +int hide_elements_make1DGraphicalObjectVisible(SBMLDocument* document, Style* style) { + std::string strokeColorId = addColor(document, style, removeTransparencyFromColorName(getStrokeColor(style))); + return setStrokeColor(style, strokeColorId, getValue(document, strokeColorId)); +} + +int hide_elements_make1DGraphicalObjectInvisible(SBMLDocument* document, Style* style) { + std::string strokeColorId = addColor(document, style, addTransparencyToColorName(getStrokeColor(style))); + return setStrokeColor(style, strokeColorId, getValue(document, strokeColorId)); +} + +int hide_elements_make1DGraphicalObjectVisible(SBMLDocument* document, LineEnding* lineEnding) { + std::string strokeColorId = addColor(document, lineEnding, removeTransparencyFromColorName(getStrokeColor(getRenderGroup(lineEnding)))); + return setStrokeColor(getRenderGroup(lineEnding), strokeColorId, getValue(document, strokeColorId)); +} + +int hide_elements_make1DGraphicalObjectInvisible(SBMLDocument* document, LineEnding* lineEnding) { + std::string strokeColorId = addColor(document, lineEnding, addTransparencyToColorName(getStrokeColor(getRenderGroup(lineEnding)))); + return setStrokeColor(getRenderGroup(lineEnding), strokeColorId, getValue(document, strokeColorId)); +} + +int hide_elements_makeTextVisible(SBMLDocument* document, Style* style) { + std::string fontColorId = addColor(document, style, removeTransparencyFromColorName(getFontColor(style))); + return setFontColor(style, fontColorId, getValue(document, fontColorId)); +} + +int hide_elements_makeTextInvisible(SBMLDocument* document, Style* style) { + std::string fontColorId = addColor(document, style, addTransparencyToColorName(getFontColor(style))); + return setFontColor(style, fontColorId, getValue(document, fontColorId)); +} + +} diff --git a/src/features/hide_elements/libsbmlnetwork_hide_elements.h b/src/features/hide_elements/libsbmlnetwork_hide_elements.h new file mode 100644 index 0000000..b20c7df --- /dev/null +++ b/src/features/hide_elements/libsbmlnetwork_hide_elements.h @@ -0,0 +1,96 @@ +#ifndef __LIBSBMLNETWORK_HIDE_ELEMENTS_H +#define __LIBSBMLNETWORK_HIDE_ELEMENTS_H + +#ifndef SWIG +#include "sbml/SBMLTypes.h" +#include "sbml/packages/layout/common/LayoutExtensionTypes.h" +#include "sbml/packages/render/common/RenderExtensionTypes.h" +#endif + +using namespace libsbml; + +namespace LIBSBMLNETWORK_CPP_NAMESPACE { + +int hide_elements_makeVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeInvisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeCompartmentVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeCompartmentInvisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeSpeciesVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeSpeciesInvisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeReactionVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeReactionInvisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeSpeciesReferenceVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeSpeciesReferenceInvisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeLineEndingVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeLineEndingInvisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +int hide_elements_makeGraphicalObjectLocalStyleVisible(SBMLDocument* document, LocalRenderInformation* localRenderInformation, GraphicalObject* graphicalObject); + +int hide_elements_makeGraphicalObjectLocalStyleInvisible(SBMLDocument* document, LocalRenderInformation* localRenderInformation, GraphicalObject* graphicalObject); + +int hide_elements_makeVisible(SBMLDocument* document, GraphicalObject* graphicalObject, const bool& applyToConnectedElements = true); + +int hide_elements_makeInvisible(SBMLDocument* document, GraphicalObject* graphicalObject, const bool& applyToConnectedElements = true); + +int hide_elements_makeCompartmentGlyphVisible(SBMLDocument* document, CompartmentGlyph* compartmentGlyph); + +int hide_elements_makeCompartmentGlyphInvisible(SBMLDocument* document, CompartmentGlyph* compartmentGlyph); + +int hide_elements_makeSpeciesGlyphVisible(SBMLDocument* document, SpeciesGlyph* speciesGlyph, const bool applyToConnectedElements = true); + +int hide_elements_makeSpeciesGlyphInvisible(SBMLDocument* document, SpeciesGlyph* speciesGlyph, const bool applyToConnectedElements = true); + +int hide_elements_makeReactionGlyphVisible(SBMLDocument* document, ReactionGlyph* reactionGlyph, const bool applyToConnectedElements = true); + +int hide_elements_makeReactionGlyphInvisible(SBMLDocument* document, ReactionGlyph* reactionGlyph, const bool applyToConnectedElements = true); + +int hide_elements_makeSpeciesReferenceGlyphVisible(SBMLDocument* document, SpeciesReferenceGlyph* speciesReferenceGlyph); + +int hide_elements_makeSpeciesReferenceGlyphInvisible(SBMLDocument* document, SpeciesReferenceGlyph* speciesReferenceGlyph); + +int hide_elements_makeTextGlyphVisible(SBMLDocument* document, TextGlyph* textGlyph, GraphicalObject* graphicalObject); + +int hide_elements_makeTextGlyphInvisible(SBMLDocument* document, TextGlyph* textGlyph, GraphicalObject* graphicalObject); + +int hide_elements_makeLineEndingVisible(SBMLDocument* document, LineEnding* lineEnding); + +int hide_elements_makeLineEndingInvisible(SBMLDocument* document, LineEnding* lineEnding); + +int hide_elements_make2DGraphicalObjectVisible(SBMLDocument* document, Style* style); + +int hide_elements_make2DGraphicalObjectInvisible(SBMLDocument* document, Style* style); + +int hide_elements_make2DGraphicalObjectVisible(SBMLDocument* document, LineEnding* lineEnding); + +int hide_elements_make2DGraphicalObjectInvisible(SBMLDocument* document, LineEnding* lineEnding); + +int hide_elements_make2DGraphicalObjectVisible(SBMLDocument* document, Style* style); + +int hide_elements_make2DGraphicalObjectInvisible(SBMLDocument* document, Style* style); + +int hide_elements_make1DGraphicalObjectVisible(SBMLDocument* document, LineEnding* lineEnding); + +int hide_elements_make1DGraphicalObjectInvisible(SBMLDocument* document, LineEnding* lineEnding); + +int hide_elements_make1DGraphicalObjectVisible(SBMLDocument* document, Style* style); + +int hide_elements_make1DGraphicalObjectInvisible(SBMLDocument* document, Style* style); + +int hide_elements_makeTextVisible(SBMLDocument* document, Style* style); + +int hide_elements_makeTextInvisible(SBMLDocument* document, Style* style); + +} + +#endif diff --git a/src/features/hide_elements/libsbmlnetwork_hide_species.cpp b/src/features/hide_elements/libsbmlnetwork_hide_species.cpp deleted file mode 100644 index f2a9c06..0000000 --- a/src/features/hide_elements/libsbmlnetwork_hide_species.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "libsbmlnetwork_hide_species.h" -#include "../../libsbmlnetwork_layout.h" -#include "../../libsbmlnetwork_layout_helpers.h" -#include "../../features/user_data/libsbmlnetwork_user_data.h" - -namespace LIBSBMLNETWORK_CPP_NAMESPACE { - -int hide_elements_makeSpeciesGlyphsVisible(Model* model, Layout* layout, std::set > species, bool visible) { - for (std::set >::const_iterator speciesIt = species.cbegin(); speciesIt != species.cend(); speciesIt++) { - if (hide_elements_makeSpeciesGlyphVisible(getReactionGlyph(layout, std::get<1>(*speciesIt), std::get<2>(*speciesIt)), std::get<0>(*speciesIt), visible)) - return -1; - } - - return 0; -} - -int hide_elements_makeSpeciesGlyphVisible(ReactionGlyph* reactionGlyph, const std::string speciesId, bool visible) { - if (!visible) - return hide_elements_hideSpeciesGlyph(reactionGlyph, speciesId); - else - return hide_elements_unHideSpeciesGlyph(reactionGlyph, speciesId); -} - -int hide_elements_hideSpeciesGlyph(SBase* sBase, const std::string speciesId) { - if (sBase) { - std::string hiddenSpeciesIds = user_data_getUserData(sBase, "hidden_species_ids"); - if (hiddenSpeciesIds.find(speciesId) == std::string::npos) { - if (hiddenSpeciesIds.size()) - hiddenSpeciesIds += ","; - hiddenSpeciesIds += speciesId; - if (isGraphicalObject(sBase)) - user_data_setUserData((GraphicalObject*)sBase, "hidden_species_ids", hiddenSpeciesIds); - else - user_data_setUserData(sBase, "hidden_species_ids", hiddenSpeciesIds); - } - - return 0; - } - - return -1; -} - -int hide_elements_unHideSpeciesGlyph(SBase* sBase, const std::string speciesId) { - if (sBase) { - std::string hiddenSpeciesIds = user_data_getUserData(sBase, "hidden_species_ids"); - size_t found = hiddenSpeciesIds.find(speciesId); - if (found != std::string::npos) { - hiddenSpeciesIds.erase(found, speciesId.size()); - if (hiddenSpeciesIds.back() == ',') - hiddenSpeciesIds.pop_back(); - if (isGraphicalObject(sBase)) - user_data_setUserData((GraphicalObject*)sBase, "hidden_species_ids", hiddenSpeciesIds); - else - user_data_setUserData(sBase, "hidden_species_ids", hiddenSpeciesIds); - } - - return 0; - } - - return -1; -} - -const bool hide_elements_isSpeciesGlyphHidden(Layout* layout, ReactionGlyph* reactionGlyph, const std::string speciesId) { - return user_data_getUserData(layout, "hidden_species_ids").find(speciesId) != std::string::npos || user_data_getUserData(reactionGlyph, "hidden_species_ids").find(speciesId) != std::string::npos; -} - -} diff --git a/src/features/hide_elements/libsbmlnetwork_hide_species.h b/src/features/hide_elements/libsbmlnetwork_hide_species.h deleted file mode 100644 index e474fdb..0000000 --- a/src/features/hide_elements/libsbmlnetwork_hide_species.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef __LIBSBMLNETWORK_HIDE_SPECIES_H -#define __LIBSBMLNETWORK_HIDE_SPECIES_H - -#ifndef SWIG -#include "sbml/SBMLTypes.h" -#include "sbml/packages/layout/common/LayoutExtensionTypes.h" -#include "sbml/packages/render/common/RenderExtensionTypes.h" -#endif - -using namespace libsbml; - -namespace LIBSBMLNETWORK_CPP_NAMESPACE { - -int hide_elements_makeSpeciesGlyphsVisible(Model* model, Layout* layout, std::set > species, bool visible = true); - -int hide_elements_makeSpeciesGlyphVisible(ReactionGlyph* reactionGlyph, const std::string speciesId, bool visible = true); - -int hide_elements_hideSpeciesGlyph(SBase* sBase, const std::string speciesId); - -int hide_elements_unHideSpeciesGlyph(SBase* sBase, const std::string speciesId); - -const bool hide_elements_isSpeciesGlyphHidden(Layout* layout, ReactionGlyph* reactionGlyph, const std::string speciesId); - -} - -#endif diff --git a/src/features/set_layout_features/libsbmlnetwork_set_layout_features.cpp b/src/features/set_layout_features/libsbmlnetwork_set_layout_features.cpp index ed4b3d0..fef338d 100644 --- a/src/features/set_layout_features/libsbmlnetwork_set_layout_features.cpp +++ b/src/features/set_layout_features/libsbmlnetwork_set_layout_features.cpp @@ -4,7 +4,6 @@ #include "../../features/autolayout/libsbmlnetwork_autolayout.h" #include "../../features/user_data/libsbmlnetwork_user_data.h" #include "../../features/defaults/libsbmlnetwork_defaults_layout.h" -#include "../../features/hide_elements/libsbmlnetwork_hide_species.h" #include "../../features/fix_elements/libsbmlnetwork_fix_element_position.h" namespace LIBSBMLNETWORK_CPP_NAMESPACE { @@ -19,6 +18,7 @@ int set_layout_features_setDefaultLayoutFeatures(SBMLDocument* document, Layout* set_layout_features_setCompartmentGlyphs(model, layout); set_layout_features_setReactionGlyphs(model, layout, maxNumConnectedEdges); set_layout_features_setTextGlyphs(layout); + user_data_setUserData(layout, "max_num_connected_edges", std::to_string(maxNumConnectedEdges)); return 0; } } @@ -26,7 +26,7 @@ int set_layout_features_setDefaultLayoutFeatures(SBMLDocument* document, Layout* return -1; } -int set_layout_features_setDefaultLayoutLocations(SBMLDocument* document, Layout* layout, const int maxNumConnectedEdges, bool useNameAsTextLabel, +int set_layout_features_setDefaultLayoutLocations(SBMLDocument* document, Layout* layout, const int maxNumConnectedEdges, bool resetFixedPositionElements, const std::set > fixedPositionNodesSet) { if (document && layout) { defaults_setDefaultLayoutId(layout); @@ -38,8 +38,9 @@ int set_layout_features_setDefaultLayoutLocations(SBMLDocument* document, Layout set_layout_features_clearGraphicalObjects(layout); set_layout_features_setCompartmentGlyphs(model, layout, userData); set_layout_features_setReactionGlyphs(model, layout, maxNumConnectedEdges, userData); - autolayout_locateGlyphs(model, layout, useNameAsTextLabel); + autolayout_locateGlyphs(model, layout); set_layout_features_setTextGlyphs(layout); + user_data_setUserData(layout, "max_num_connected_edges", std::to_string(maxNumConnectedEdges)); return 0; } } @@ -52,6 +53,7 @@ void set_layout_features_clearGraphicalObjects(Layout* layout) { set_layout_features_clearSpeciesGlyphs(layout); set_layout_features_clearReactionGlyphs(layout); set_layout_features_clearTextGlyphs(layout); + set_layout_clearAdditionalGraphicalObjects(layout); } void set_layout_features_clearCompartmentGlyphs(Layout* layout) { @@ -102,6 +104,13 @@ void set_layout_features_clearReactionTextGlyphs(Layout* layout) { } } +void set_layout_clearAdditionalGraphicalObjects(Layout* layout) { + for (unsigned int i = 0; i < layout->getNumAdditionalGraphicalObjects(); i++) { + user_data_freeUserData(layout->getAdditionalGraphicalObject(i)); + delete layout->removeAdditionalGraphicalObject(i); + } +} + void set_layout_features_setCompartmentGlyphs(Model* model, Layout* layout, const std::vector>& userData) { for (unsigned int i = 0; i < model->getNumCompartments(); i++) { Compartment *compartment = model->getCompartment(i); @@ -124,12 +133,10 @@ void set_layout_features_setReactionGlyphs(Model* model, Layout* layout, const i void set_layout_features_setReactantGlyphs(Layout* layout, Reaction* reaction, ReactionGlyph* reactionGlyph, const int maxNumConnectedEdges, const std::vector>& userData) { for (unsigned int i = 0; i < reaction->getNumReactants(); i++) { SimpleSpeciesReference* speciesReference = reaction->getReactant(i); - if (!hide_elements_isSpeciesGlyphHidden(layout, reactionGlyph, speciesReference->getSpecies())) { - int stoichiometry = getStoichiometryAsInteger(speciesReference); - for (unsigned int stoichiometryIndex = 0; stoichiometryIndex < stoichiometry; stoichiometryIndex++) { - SpeciesReferenceGlyph *speciesReferenceGlyph = set_layout_features_createSpeciesReferenceGlyph(layout, reactionGlyph, speciesReference->getSpecies(), stoichiometryIndex, maxNumConnectedEdges, userData); - speciesReferenceGlyph->setRole(SPECIES_ROLE_SUBSTRATE); - } + int stoichiometry = getStoichiometryAsInteger(speciesReference); + for (unsigned int stoichiometryIndex = 0; stoichiometryIndex < stoichiometry; stoichiometryIndex++) { + SpeciesReferenceGlyph *speciesReferenceGlyph = set_layout_features_createSpeciesReferenceGlyph(layout, reactionGlyph, speciesReference->getSpecies(), stoichiometryIndex, maxNumConnectedEdges, userData); + speciesReferenceGlyph->setRole(SPECIES_ROLE_SUBSTRATE); } } } @@ -137,12 +144,10 @@ void set_layout_features_setReactantGlyphs(Layout* layout, Reaction* reaction, R void set_layout_features_setProductGlyphs(Layout* layout, Reaction* reaction, ReactionGlyph* reactionGlyph, const int maxNumConnectedEdges, const std::vector>& userData) { for (unsigned int i = 0; i < reaction->getNumProducts(); i++) { SimpleSpeciesReference* speciesReference = reaction->getProduct(i); - if (!hide_elements_isSpeciesGlyphHidden(layout, reactionGlyph, speciesReference->getSpecies())) { - int stoichiometry = getStoichiometryAsInteger(speciesReference); - for (unsigned int stoichiometryIndex = 0; stoichiometryIndex < stoichiometry; stoichiometryIndex++) { - SpeciesReferenceGlyph* speciesReferenceGlyph = set_layout_features_createSpeciesReferenceGlyph(layout, reactionGlyph, speciesReference->getSpecies(), stoichiometryIndex, maxNumConnectedEdges, userData); - speciesReferenceGlyph->setRole(SPECIES_ROLE_PRODUCT); - } + int stoichiometry = getStoichiometryAsInteger(speciesReference); + for (unsigned int stoichiometryIndex = 0; stoichiometryIndex < stoichiometry; stoichiometryIndex++) { + SpeciesReferenceGlyph* speciesReferenceGlyph = set_layout_features_createSpeciesReferenceGlyph(layout, reactionGlyph, speciesReference->getSpecies(), stoichiometryIndex, maxNumConnectedEdges, userData); + speciesReferenceGlyph->setRole(SPECIES_ROLE_PRODUCT); } } } @@ -150,13 +155,11 @@ void set_layout_features_setProductGlyphs(Layout* layout, Reaction* reaction, Re void set_layout_features_setModifierGlyphs(Layout* layout, Reaction* reaction, ReactionGlyph* reactionGlyph, const int maxNumConnectedEdges, const std::vector>& userData) { for (unsigned int i = 0; i < reaction->getNumModifiers(); i++) { SimpleSpeciesReference* speciesReference = reaction->getModifier(i); - if (!hide_elements_isSpeciesGlyphHidden(layout, reactionGlyph, speciesReference->getSpecies())) { - SpeciesReferenceGlyph* speciesReferenceGlyph = set_layout_features_createSpeciesReferenceGlyph(layout, reactionGlyph, speciesReference->getSpecies(), 0, maxNumConnectedEdges, userData); - if (speciesReference->getSBOTermID() == "SBO:0000020") - speciesReferenceGlyph->setRole(SPECIES_ROLE_INHIBITOR); - else - speciesReferenceGlyph->setRole(SPECIES_ROLE_MODIFIER); - } + SpeciesReferenceGlyph* speciesReferenceGlyph = set_layout_features_createSpeciesReferenceGlyph(layout, reactionGlyph, speciesReference->getSpecies(), 0, maxNumConnectedEdges, userData); + if (speciesReference->getSBOTermID() == "SBO:0000020") + speciesReferenceGlyph->setRole(SPECIES_ROLE_INHIBITOR); + else + speciesReferenceGlyph->setRole(SPECIES_ROLE_MODIFIER); } } @@ -297,6 +300,31 @@ SpeciesReferenceGlyph* set_layout_features_createSpeciesReferenceGlyph(ReactionG return speciesReferenceGlyph; } +GraphicalObject* set_layout_features_createAdditionalGraphicalObject(Layout* layout, const std::string& id) { + GraphicalObject* graphicalObject = layout->createAdditionalGraphicalObject(); + graphicalObject->setId(id); + set_layout_features_setGraphicalObjectBoundingBox(graphicalObject); + + return graphicalObject; +} + +int set_layout_features_removeAdditionalGraphicalObject(Layout* layout, const std::string& id) { + if (layout->removeAdditionalGraphicalObject(id)) + return 0; + + return -1; +} + +int set_layout_features_removeAdditionalGraphicalObject(Layout* layout, const unsigned int graphicalObjectIndex) { + if (layout && graphicalObjectIndex < layout->getNumAdditionalGraphicalObjects()) { + user_data_freeUserData(layout->getAdditionalGraphicalObject(graphicalObjectIndex)); + delete layout->removeAdditionalGraphicalObject(graphicalObjectIndex); + return 0; + } + + return -1; +} + std::vector set_layout_features_getConnectedSpeciesGlyphReferences(Layout* layout, SpeciesGlyph* speciesGlyph) { std::vector speciesGlyphReferences; for (unsigned int i = 0; i < layout->getNumReactionGlyphs(); i++) { @@ -397,12 +425,12 @@ void set_layout_features_setGraphicalObjectBoundingBox(GraphicalObject* graphica graphicalObject->getBoundingBox()->setId(graphicalObject->getId() + "_bb"); } -void set_layout_features_setSpeciesReferenceGlyphCurve(SpeciesReferenceGlyph* speciesReferenceGlyph, SpeciesReferenceGlyph* referenceSpeciesReferenceGlyph) { +void set_layout_features_setSpeciesReferenceGlyphCurve(SpeciesReferenceGlyph* speciesReferenceGlyph, SpeciesReferenceGlyph* referenceSpeciesReferenceGlyph, const double& padding) { if (referenceSpeciesReferenceGlyph->isSetCurve()) { Curve* referenceCurve = referenceSpeciesReferenceGlyph->getCurve(); Curve* curve = speciesReferenceGlyph->getCurve(); for (unsigned int i = 0; i < referenceCurve->getNumCurveSegments(); i++) - set_layout_features_addCurveSegment(curve, referenceCurve->getCurveSegment(i), defaults_getAliasReactionGlyphPadding()); + set_layout_features_addCurveSegment(curve, referenceCurve->getCurveSegment(i), padding); } } diff --git a/src/features/set_layout_features/libsbmlnetwork_set_layout_features.h b/src/features/set_layout_features/libsbmlnetwork_set_layout_features.h index 8bcd5a4..808deb9 100644 --- a/src/features/set_layout_features/libsbmlnetwork_set_layout_features.h +++ b/src/features/set_layout_features/libsbmlnetwork_set_layout_features.h @@ -14,7 +14,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { int set_layout_features_setDefaultLayoutFeatures(SBMLDocument* document, Layout* layout, const int maxNumConnectedEdges); -int set_layout_features_setDefaultLayoutLocations(SBMLDocument* document, Layout* layout, const int maxNumConnectedEdges, bool useNameAsTextLabel, +int set_layout_features_setDefaultLayoutLocations(SBMLDocument* document, Layout* layout, const int maxNumConnectedEdges, bool resetFixedPositionElements, const std::set > fixedPositionNodesSet); void set_layout_features_clearGraphicalObjects(Layout* layout); @@ -27,6 +27,8 @@ void set_layout_features_clearReactionGlyphs(Layout* layout); void set_layout_features_clearReactionGlyphSpeciesReferenceGlyphs(ReactionGlyph* reactionGlyph); +void set_layout_clearAdditionalGraphicalObjects(Layout* layout); + void set_layout_features_setCompartmentGlyphs(Model* model, Layout* layout, const std::vector>& userData = {}); void set_layout_features_setReactionGlyphs(Model* model, Layout* layout, const int maxNumConnectedEdges, const std::vector>& userData = {}); @@ -73,6 +75,12 @@ SpeciesReferenceGlyph* set_layout_features_createSpeciesReferenceGlyph(Layout* l SpeciesReferenceGlyph* set_layout_features_createSpeciesReferenceGlyph(ReactionGlyph* reactionGlyph, const std::string& speciesId, unsigned int stoichiometryIndex); +GraphicalObject* set_layout_features_createAdditionalGraphicalObject(Layout* layout, const std::string& id); + +int set_layout_features_removeAdditionalGraphicalObject(Layout* layout, const std::string& id); + +int set_layout_features_removeAdditionalGraphicalObject(Layout* layout, const unsigned int index); + std::vector set_layout_features_getConnectedSpeciesGlyphReferences(Layout* layout, SpeciesGlyph* speciesGlyph); const std::string set_layout_features_getTextGlyphUniqueId(Layout* layout, GraphicalObject* graphicalObject); @@ -87,7 +95,7 @@ const std::string set_layout_features_getSpeciesReferenceGlyphId(ReactionGlyph* void set_layout_features_setGraphicalObjectBoundingBox(GraphicalObject* graphicalObject); -void set_layout_features_setSpeciesReferenceGlyphCurve(SpeciesReferenceGlyph* speciesReferenceGlyph, SpeciesReferenceGlyph* referenceSpeciesReferenceGlyph); +void set_layout_features_setSpeciesReferenceGlyphCurve(SpeciesReferenceGlyph* speciesReferenceGlyph, SpeciesReferenceGlyph* referenceSpeciesReferenceGlyph, const double& padding=0.0); void set_layout_features_setSpeciesReferenceGlyphCurve(SpeciesReferenceGlyph* speciesReferenceGlyph); diff --git a/src/features/update_curves/libsbmlnetwork_update_curves.cpp b/src/features/update_curves/libsbmlnetwork_update_curves.cpp index ffc0730..3c9251f 100644 --- a/src/features/update_curves/libsbmlnetwork_update_curves.cpp +++ b/src/features/update_curves/libsbmlnetwork_update_curves.cpp @@ -9,7 +9,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { Model* model = document->getModel(); if (model) { set_layout_features_clearReactionTextGlyphs(layout); - autolayout_locateReactions(model, layout, true); + autolayout_locateReactions(model, layout); set_layout_features_setReactionTextGlyphs(layout); return 0; } diff --git a/src/features/user_data/libsbmlnetwork_user_data.cpp b/src/features/user_data/libsbmlnetwork_user_data.cpp index 87d55e3..d3fab39 100644 --- a/src/features/user_data/libsbmlnetwork_user_data.cpp +++ b/src/features/user_data/libsbmlnetwork_user_data.cpp @@ -5,17 +5,22 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { -void user_data_freeUserData(SBMLDocument* document) { +int user_data_freeUserData(SBMLDocument* document) { if (document) { ListOfLayouts* listOfLayouts = getListOfLayouts(document); - user_data_freeUserData(listOfLayouts); + if (user_data_freeUserData(listOfLayouts)) + return -1; const int numLayouts = getNumLayouts(document); - for (int i = 0; i < numLayouts; i++) - user_data_freeUserData(getLayout(document, i)); + for (int i = 0; i < numLayouts; i++) { + if (user_data_freeUserData(getLayout(document, i))) + return -1; + } } + + return 0; } -void user_data_freeUserData(Layout* layout) { +int user_data_freeUserData(Layout* layout) { if (layout->isSetUserData()) { auto userData = (std::map*)layout->getUserData(); if (userData) { @@ -25,25 +30,25 @@ void user_data_freeUserData(Layout* layout) { user_data_freeUserData(layout->getDimensions()); for (unsigned int i = 0; i < layout->getNumCompartmentGlyphs(); i++) { CompartmentGlyph* compartmentGlyph = layout->getCompartmentGlyph(i); - user_data_freeUserData(compartmentGlyph); - user_data_freeUserData(compartmentGlyph->getBoundingBox()); + if (user_data_freeUserData(compartmentGlyph) || user_data_freeUserData(compartmentGlyph->getBoundingBox())) + return -1; } for (unsigned int i = 0; i < layout->getNumSpeciesGlyphs(); i++) { SpeciesGlyph* speciesGlyph = layout->getSpeciesGlyph(i); - user_data_freeUserData(speciesGlyph); - user_data_freeUserData(speciesGlyph->getBoundingBox()); + if (user_data_freeUserData(speciesGlyph) || user_data_freeUserData(speciesGlyph->getBoundingBox())) + return -1; } for (unsigned int i = 0; i < layout->getNumReactionGlyphs(); i++) { ReactionGlyph* reactionGlyph = layout->getReactionGlyph(i); - user_data_freeUserData(reactionGlyph); - user_data_freeUserData(reactionGlyph->getBoundingBox()); - user_data_freeUserData(reactionGlyph->getCurve()); + if (user_data_freeUserData(reactionGlyph) || user_data_freeUserData(reactionGlyph->getBoundingBox()) || user_data_freeUserData(reactionGlyph->getCurve())) + return -1; for (unsigned int j = 0; j < reactionGlyph->getNumSpeciesReferenceGlyphs(); j++) { - SpeciesReferenceGlyph* speciesReferenceGlyph = reactionGlyph->getSpeciesReferenceGlyph(j); - user_data_freeUserData(speciesReferenceGlyph); - user_data_freeUserData(speciesReferenceGlyph->getCurve()); + if (user_data_freeUserData(reactionGlyph->getSpeciesReferenceGlyph(j)) || user_data_freeUserData(reactionGlyph->getSpeciesReferenceGlyph(j)->getCurve())) + return -1; } } + + return 0; } std::vector> user_data_getUserData(Layout* layout) { @@ -72,27 +77,37 @@ std::vector> user_data_getUserData(Layout* la return userData; } -void user_data_setUserData(GraphicalObject* graphicalObject, const std::string& key, const std::string& value) { - if (!graphicalObject->isSetUserData()) { - graphicalObject->setUserData(new std::map()); - user_data_setUserData(graphicalObject, "id", graphicalObject->getId()); - user_data_setUserData(graphicalObject, "entity_id", getEntityId(graphicalObject)); +int user_data_setUserData(GraphicalObject* graphicalObject, const std::string& key, const std::string& value) { + if (graphicalObject) { + if (!graphicalObject->isSetUserData()) { + graphicalObject->setUserData(new std::map()); + user_data_setUserData(graphicalObject, "id", graphicalObject->getId()); + user_data_setUserData(graphicalObject, "entity_id", getEntityId(graphicalObject)); + } + auto userData = (std::map*)graphicalObject->getUserData(); + (*userData)[key] = value; + + return 0; } - auto userData = (std::map*)graphicalObject->getUserData(); - (*userData)[key] = value; + + return -1; } -void user_data_setPositionData(GraphicalObject* graphicalObject) { - user_data_setUserData(graphicalObject, "x", std::to_string(getPositionX(graphicalObject))); - user_data_setUserData(graphicalObject, "y", std::to_string(getPositionY(graphicalObject))); +int user_data_setPositionData(GraphicalObject* graphicalObject) { + if (user_data_setUserData(graphicalObject, "x", std::to_string(getPositionX(graphicalObject))) || user_data_setUserData(graphicalObject, "y", std::to_string(getPositionY(graphicalObject)))) + return -1; + + return 0; } -void user_data_unsetPositionData(GraphicalObject* graphicalObject) { - user_data_setUserData(graphicalObject, "x", ""); - user_data_setUserData(graphicalObject, "y", ""); +int user_data_unsetPositionData(GraphicalObject* graphicalObject) { + if (user_data_setUserData(graphicalObject, "x", "") || user_data_setUserData(graphicalObject, "y", "")) + return -1; + + return 0; } -void user_data_setPositionData(SpeciesReferenceGlyph* speciesReferenceGlyph) { +int user_data_setPositionData(SpeciesReferenceGlyph* speciesReferenceGlyph) { if (speciesReferenceGlyph) { Curve* curve = getCurve(speciesReferenceGlyph); for (unsigned int i = 0; i < getNumCurveSegments(curve); i++) { @@ -107,10 +122,14 @@ void user_data_setPositionData(SpeciesReferenceGlyph* speciesReferenceGlyph) { user_data_setUserData(speciesReferenceGlyph, std::to_string(i) + ":b2_y", std::to_string(getCurveSegmentBasePoint2Y(curve, i))); } } + + return 0; } + + return -1; } -void user_data_unsetPositionData(SpeciesReferenceGlyph* speciesReferenceGlyph) { +int user_data_unsetPositionData(SpeciesReferenceGlyph* speciesReferenceGlyph) { if (speciesReferenceGlyph) { Curve* curve = getCurve(speciesReferenceGlyph); for (unsigned int i = 0; i < getNumCurveSegments(curve); i++) { @@ -123,38 +142,60 @@ void user_data_unsetPositionData(SpeciesReferenceGlyph* speciesReferenceGlyph) { user_data_setUserData(curve, std::to_string(i) + ":b2_x", ""); user_data_setUserData(curve, std::to_string(i) + ":b2_y", ""); } + + return 0; } + + return -1; } -void user_data_setGraphicalObjectUserData(GraphicalObject* graphicalObject, const std::vector>& userData) { +int user_data_setGraphicalObjectUserData(GraphicalObject* graphicalObject, const std::vector>& userData) { for (unsigned int i = 0; i < userData.size(); i++) { if (userData.at(i).find("id") != userData.at(i).end() && userData.at(i).at("id") == graphicalObject->getId()) { - for (auto it = userData.at(i).begin(); it != userData.at(i).end(); it++) - user_data_setUserData(graphicalObject, it->first, it->second); - break; + for (auto it = userData.at(i).begin(); it != userData.at(i).end(); it++) { + if (user_data_setUserData(graphicalObject, it->first, it->second)) + return -1; + } + + return 0; } } + + return -1; } -void user_data_freeUserData(RenderInformationBase* renderInformation) { - for (unsigned int i = 0; i < renderInformation->getNumColorDefinitions(); i++) - user_data_freeUserData(renderInformation->getColorDefinition(i)); +int user_data_freeUserData(RenderInformationBase* renderInformation) { + for (unsigned int i = 0; i < renderInformation->getNumColorDefinitions(); i++) { + if (user_data_freeUserData(renderInformation->getColorDefinition(i))) + return -1; + } for (unsigned int i = 0; i < renderInformation->getNumGradientDefinitions(); i++) { GradientBase* gradientBase = renderInformation->getGradientDefinition(i); - user_data_freeUserData(gradientBase); - for (unsigned int j = 0; j < gradientBase->getNumGradientStops(); j++) - user_data_freeUserData(gradientBase->getGradientStop(j)); + if (user_data_freeUserData(gradientBase)) + return -1; + for (unsigned int j = 0; j < gradientBase->getNumGradientStops(); j++) { + if (user_data_freeUserData(gradientBase->getGradientStop(j))) + return -1; + } + } + for (unsigned int i = 0; i < renderInformation->getNumLineEndings(); i++) { + if (user_data_freeUserData(renderInformation->getLineEnding(i))) + return -1; } - for (unsigned int i = 0; i < renderInformation->getNumLineEndings(); i++) - user_data_freeUserData(renderInformation->getLineEnding(i)); if (renderInformation->isGlobalRenderInformation()) { - for (unsigned int i = 0; i < ((GlobalRenderInformation*)renderInformation)->getNumGlobalStyles(); i++) - user_data_freeUserData(((GlobalRenderInformation*)renderInformation)->getGlobalStyle(i)); + for (unsigned int i = 0; i < ((GlobalRenderInformation*)renderInformation)->getNumGlobalStyles(); i++) { + if (user_data_freeUserData(((GlobalRenderInformation*)renderInformation)->getGlobalStyle(i))) + return -1; + } } else if (renderInformation->isLocalRenderInformation()) { - for (unsigned int i = 0; i < ((LocalRenderInformation*)renderInformation)->getNumLocalStyles(); i++) - user_data_freeUserData(((LocalRenderInformation*)renderInformation)->getLocalStyle(i)); + for (unsigned int i = 0; i < ((LocalRenderInformation*)renderInformation)->getNumLocalStyles(); i++) { + if (user_data_freeUserData(((LocalRenderInformation*)renderInformation)->getLocalStyle(i))) + return -1; + } } + + return 0; } std::vector> user_data_getUserData(RenderInformationBase* renderInformation) { @@ -193,7 +234,7 @@ std::vector> user_data_getUserData(RenderInfo } const std::string user_data_getUserData(SBase* sBase, const std::string& key) { - if (sBase->isSetUserData()) { + if (sBase && sBase->isSetUserData()) { auto userData = (std::map*)sBase->getUserData(); if (userData->find(key) != userData->end()) return (*userData)[key]; @@ -202,21 +243,31 @@ const std::string user_data_getUserData(SBase* sBase, const std::string& key) { return ""; } -void user_data_setUserData(SBase* sBase, const std::string& key, const std::string& value) { - if (!sBase->isSetUserData()) - sBase->setUserData(new std::map()); - auto userData = (std::map*)sBase->getUserData(); - (*userData)[key] = value; +int user_data_setUserData(SBase* sBase, const std::string& key, const std::string& value) { + if (sBase) { + if (!sBase->isSetUserData()) + sBase->setUserData(new std::map()); + auto userData = (std::map*)sBase->getUserData(); + (*userData)[key] = value; + + return 0; + } + + return -1; } -void user_data_freeUserData(SBase* sBase) { +int user_data_freeUserData(SBase* sBase) { if (sBase) { if (sBase->isSetUserData()) { auto userData = (std::map*)sBase->getUserData(); delete userData; sBase->unsetUserData(); } + + return 0; } + + return -1; } } diff --git a/src/features/user_data/libsbmlnetwork_user_data.h b/src/features/user_data/libsbmlnetwork_user_data.h index 1f2c1d7..f0b10b7 100644 --- a/src/features/user_data/libsbmlnetwork_user_data.h +++ b/src/features/user_data/libsbmlnetwork_user_data.h @@ -11,35 +11,35 @@ using namespace libsbml; namespace LIBSBMLNETWORK_CPP_NAMESPACE { -void user_data_freeUserData(SBMLDocument* document); +int user_data_freeUserData(SBMLDocument* document); -void user_data_freeUserData(Layout* layout); +int user_data_freeUserData(Layout* layout); std::vector> user_data_getUserData(Layout* layout); -void user_data_setUserData(GraphicalObject* graphicalObject, const std::string& key, const std::string& value); +int user_data_setUserData(GraphicalObject* graphicalObject, const std::string& key, const std::string& value); -void user_data_setPositionData(GraphicalObject* graphicalObject); +int user_data_setPositionData(GraphicalObject* graphicalObject); -void user_data_unsetPositionData(GraphicalObject* graphicalObject); +int user_data_unsetPositionData(GraphicalObject* graphicalObject); -void user_data_setPositionData(SpeciesReferenceGlyph* speciesReferenceGlyph); +int user_data_setPositionData(SpeciesReferenceGlyph* speciesReferenceGlyph); -void user_data_unsetPositionData(SpeciesReferenceGlyph* speciesReferenceGlyph); +int user_data_unsetPositionData(SpeciesReferenceGlyph* speciesReferenceGlyph); -void user_data_setGraphicalObjectUserData(GraphicalObject* graphicalObject, const std::vector>& userData); +int user_data_setGraphicalObjectUserData(GraphicalObject* graphicalObject, const std::vector>& userData); -void user_data_freeUserData(RenderInformationBase* renderInformation); +int user_data_freeUserData(RenderInformationBase* renderInformation); std::vector> user_data_getUserData(RenderInformationBase* renderInformationBase); const std::string user_data_getUserData(SBase* sbase, const std::string& key); -void user_data_setUserData(SBase* sBase, const std::string& key, const std::string& value); +int user_data_setUserData(SBase* sBase, const std::string& key, const std::string& value); -void user_data_freeUserData(SBMLDocument* document); +int user_data_freeUserData(SBMLDocument* document); -void user_data_freeUserData(SBase* sbase); +int user_data_freeUserData(SBase* sBase); } diff --git a/src/libsbmlnetwork_layout.cpp b/src/libsbmlnetwork_layout.cpp index e661c2a..55af22c 100755 --- a/src/libsbmlnetwork_layout.cpp +++ b/src/libsbmlnetwork_layout.cpp @@ -3,6 +3,7 @@ #include "features/user_data/libsbmlnetwork_user_data.h" #include "features/fix_elements/libsbmlnetwork_fix_element_position.h" #include "features/fix_elements/libsbmlnetwork_fix_element_dimensions.h" +#include "features/set_layout_features/libsbmlnetwork_set_layout_features.h" namespace LIBSBMLNETWORK_CPP_NAMESPACE { @@ -92,6 +93,9 @@ std::vector getGraphicalObjects(Layout* layout, const std::str graphicalObjects.insert(graphicalObjects.end(), speciesGlyphs.begin(), speciesGlyphs.end()); std::vector reactionGlyphs = getReactionGlyphs(layout, id); graphicalObjects.insert(graphicalObjects.end(), reactionGlyphs.begin(), reactionGlyphs.end()); + GraphicalObject* graphicalObject = getGraphicalObjectUsingItsOwnId(layout, id); + if (graphicalObject) + graphicalObjects.push_back(graphicalObject); } return graphicalObjects; @@ -101,12 +105,93 @@ GraphicalObject* getGraphicalObject(Layout* layout, const std::string& id, const std::vector graphicalObjects = getGraphicalObjects(layout, id); if (graphicalObjectIndex < graphicalObjects.size()) return graphicalObjects.at(graphicalObjectIndex); - else if (graphicalObjectIndex == 0) - return getGraphicalObjectUsingItsOwnId(layout, id); return NULL; } +int removeGraphicalObject(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex) { + std::vector graphicalObjects = getGraphicalObjects(layout, id); + if (graphicalObjectIndex < graphicalObjects.size()) { + user_data_freeUserData(graphicalObjects.at(graphicalObjectIndex)); + delete graphicalObjects.at(graphicalObjectIndex); + return 0; + } + + return -1; +} + +bool isSetId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex) { + GraphicalObject* graphicalObject = getGraphicalObject(layout, id, graphicalObjectIndex); + if (graphicalObject) + return graphicalObject->isSetId(); + + return false; +} + +const std::string getId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex) { + GraphicalObject* graphicalObject = getGraphicalObject(layout, id, graphicalObjectIndex); + if (graphicalObject) + return graphicalObject->getId(); + + return ""; +} + +int setId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex, const std::string& graphicalObjectId) { + return updateGraphicalObjectId(layout, getGraphicalObject(layout, id, graphicalObjectIndex), graphicalObjectId); +} + +bool isSetMetaId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex) { + GraphicalObject* graphicalObject = getGraphicalObject(layout, id, graphicalObjectIndex); + if (graphicalObject) + return graphicalObject->isSetMetaId(); + + return false; +} + +const std::string getMetaId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex) { + GraphicalObject* graphicalObject = getGraphicalObject(layout, id, graphicalObjectIndex); + if (graphicalObject) + return graphicalObject->getMetaId(); + + return ""; +} + +int setMetaId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex, const std::string& graphicalObjectMetaId) { + GraphicalObject* graphicalObject = getGraphicalObject(layout, id, graphicalObjectIndex); + if (graphicalObject) { + graphicalObject->setMetaId(graphicalObjectMetaId); + return 0; + } + + return -1; +} + +bool isSetName(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex) { + GraphicalObject* graphicalObject = getGraphicalObject(layout, id, graphicalObjectIndex); + if (graphicalObject) + return graphicalObject->isSetName(); + + return false; +} + +const std::string getName(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex) { + GraphicalObject* graphicalObject = getGraphicalObject(layout, id, graphicalObjectIndex); + if (graphicalObject) + return graphicalObject->getName(); + + return ""; +} + +int setName(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex, const std::string& name) { + GraphicalObject* graphicalObject = getGraphicalObject(layout, id, graphicalObjectIndex); + if (graphicalObject) { + graphicalObject->setName(name); + return 0; + } + + return -1; +} + const unsigned int getNumCompartmentGlyphs(Layout* layout) { if (layout) return layout->getNumCompartmentGlyphs(); @@ -684,6 +769,36 @@ bool isTextGlyph(GraphicalObject* graphicalObject) { return false; } +const unsigned int getNumAdditionalGraphicalObjects(Layout* layout) { + if (layout) + return layout->getNumAdditionalGraphicalObjects(); + + return 0; +} + +GraphicalObject* getAdditionalGraphicalObject(Layout* layout, const unsigned int additionalGraphicalObjectIndex) { + if (layout && additionalGraphicalObjectIndex < getNumAdditionalGraphicalObjects(layout)) + return layout->getAdditionalGraphicalObject(additionalGraphicalObjectIndex); + + return NULL; +} + +const std::string getAdditionalGraphicalObjectId(Layout* layout, const unsigned int additionalGraphicalObjectIndex) { + GraphicalObject* graphicalObject = getAdditionalGraphicalObject(layout, additionalGraphicalObjectIndex); + if (graphicalObject) + return graphicalObject->getId(); + + return ""; +} + +GraphicalObject* addAdditionalGraphicalObject(Layout* layout, const std::string& id) { + return set_layout_features_createAdditionalGraphicalObject(layout, id); +} + +int removeAdditionalGraphicalObject(Layout* layout, const unsigned int additionalGraphicalObjectIndex) { + return set_layout_features_removeAdditionalGraphicalObject(layout, additionalGraphicalObjectIndex); +} + const std::string getSBMLObjectId(Layout* layout, const std::string& graphicalObjectId) { return getSBMLObjectId(getGraphicalObjectUsingItsOwnId(layout, graphicalObjectId)); } @@ -1190,38 +1305,42 @@ LineSegment* getCurveSegment(Curve* curve, unsigned int curveSegmentIndex) { return NULL; } -LineSegment* createLineCurveSegment(Layout* layout, const std::string& id, unsigned int graphicalObjectIndex) { - return createLineCurveSegment(getGraphicalObject(layout, id, graphicalObjectIndex)); +int addLineCurveSegment(Layout* layout, const std::string& id, unsigned int graphicalObjectIndex) { + return addLineCurveSegment(getGraphicalObject(layout, id, graphicalObjectIndex)); } -LineSegment* createLineCurveSegment(GraphicalObject* graphicalObject) { - return createLineCurveSegment(getCurve(graphicalObject)); +int addLineCurveSegment(GraphicalObject* graphicalObject) { + return addLineCurveSegment(getCurve(graphicalObject)); } -LineSegment* createLineCurveSegment(Curve* curve) { - if (curve) - return curve->createLineSegment(); +int addLineCurveSegment(Curve* curve) { + if (curve) { + curve->createLineSegment(); + return 0; + } - return NULL; + return -1; } -CubicBezier* createCubicBezierCurveSegment(Layout* layout, const std::string& id, unsigned int graphicalObjectIndex) { - return createCubicBezierCurveSegment(getGraphicalObject(layout, id, graphicalObjectIndex)); +int addCubicBezierCurveSegment(Layout* layout, const std::string& id, unsigned int graphicalObjectIndex) { + return addCubicBezierCurveSegment(getGraphicalObject(layout, id, graphicalObjectIndex)); } -CubicBezier* createCubicBezierCurveSegment(GraphicalObject* graphicalObject) { - return createCubicBezierCurveSegment(getCurve(graphicalObject)); +int addCubicBezierCurveSegment(GraphicalObject* graphicalObject) { + return addCubicBezierCurveSegment(getCurve(graphicalObject)); } -CubicBezier* createCubicBezierCurveSegment(Curve* curve) { - if (curve) - return curve->createCubicBezier(); +int addCubicBezierCurveSegment(Curve* curve) { + if (curve) { + curve->createCubicBezier(); + return 0; + } - return NULL; + return -1; } -int removeCurveSegment(Layout* layout, const std::string& id, unsigned int curveSegmentIndex) { - return removeCurveSegment(getGraphicalObject(layout, id), curveSegmentIndex); +int removeCurveSegment(Layout* layout, const std::string& id, unsigned int graphicalObjectIndex, unsigned int curveSegmentIndex) { + return removeCurveSegment(getGraphicalObject(layout, id, graphicalObjectIndex), curveSegmentIndex); } int removeCurveSegment(GraphicalObject* graphicalObject, unsigned int curveSegmentIndex) { diff --git a/src/libsbmlnetwork_layout.h b/src/libsbmlnetwork_layout.h index 8ae0234..d7ca1d1 100755 --- a/src/libsbmlnetwork_layout.h +++ b/src/libsbmlnetwork_layout.h @@ -73,6 +73,77 @@ LIBSBMLNETWORK_EXTERN std::vector getGraphicalObjects(Layout* /// @return a pointer to the GraphicalObject object with the given index associated with the entered id, or NULL is GraphicalObject object does not exist or the object is @c NULL. LIBSBMLNETWORK_EXTERN GraphicalObject* getGraphicalObject(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex = 0); +LIBSBMLNETWORK_EXTERN int removeGraphicalObject(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex); + +/// @brief Predicates returning true if the id of the GraphicalObject with the given index inf the Layout object associated with the entered model entity id is set. +/// @param layout a pointer to the Layout object. +/// @param id the id of the model entity the the GraphicalObject objects of which to be returned. +/// @param graphicalObjectIndex the index of the GraphicalObject to return. +/// @return @c true if the id of the GraphicalObject with the given index is set, false otherwise +LIBSBMLNETWORK_EXTERN bool isSetId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex); + +/// @brief Returns the id of the GraphicalObject object with the given index associated with entered id of the Layout object. +/// @param layout a pointer to the Layout object. +/// @param id the id of the model entity the the GraphicalObject objects of which to be returned. +/// @param graphicalObjectIndex the index of the GraphicalObject to return. +/// @return the value of the "id" attribute of the GraphicalObject object with the given index associated with the entered id, or @c "" if +/// the GraphicalObject object does not exits or the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex); + +/// @brief Sets the id of the GraphicalObject object with the given index associated with entered id of the Layout object. +/// @param layout a pointer to the Layout object. +/// @param id the id of the model entity the the GraphicalObject objects of which to be returned. +/// @param graphicalObjectIndex the index of the GraphicalObject to return. +/// @param graphicalObjectId the id to set. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex, const std::string& graphicalObjectId); + +/// @brief Predicate returning true if the metaId of the GraphicalObject with the given index of the Layout object associated with the entered id is set. +/// @param layout a pointer to the Layout object. +/// @param id the id of the model entity the the GraphicalObject objects of which to be returned. +/// @param graphicalObjectIndex the index of the GraphicalObject to return. +/// @return @c true if the metaId of the GraphicalObject with the given index is set, false otherwise +LIBSBMLNETWORK_EXTERN bool isSetMetaId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex); + +/// @brief Returns the metaId of the GraphicalObject object with the given index associated with entered id of the Layout object. +/// @param layout a pointer to the Layout object. +/// @param id the id of the model entity the the GraphicalObject objects of which to be returned. +/// @param graphicalObjectIndex the index of the GraphicalObject to return. +/// @return the value of the "metaId" attribute of the GraphicalObject object with the given index associated with the entered id, or @c "" if +/// the GraphicalObject object does not exits or the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getMetaId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex); + +/// @brief Sets the metaId of the GraphicalObject object with the given index associated with entered id of the Layout object. +/// @param layout a pointer to the Layout object. +/// @param id the id of the model entity the the GraphicalObject objects of which to be returned. +/// @param graphicalObjectIndex the index of the GraphicalObject to return. +/// @param graphicalObjectMetaId the metaId to set. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setMetaId(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex, const std::string& graphicalObjectMetaId); + +/// @brief Predicate returning true if the name of the GraphicalObject with the given index of the Layout object associated with the entered id is set. +/// @param layout a pointer to the Layout object. +/// @param id the id of the model entity the the GraphicalObject objects of which to be returned. +/// @param graphicalObjectIndex the index of the GraphicalObject to return. +/// @return @c true if the name of the GraphicalObject with the given index is set, false otherwise +LIBSBMLNETWORK_EXTERN bool isSetName(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex); + +/// @brief Returns the name of the GraphicalObject object with the given index associated with entered id of the Layout object. +/// @param layout a pointer to the Layout object. +/// @param id the id of the model entity the the GraphicalObject objects of which to be returned. +/// @param graphicalObjectIndex the index of the GraphicalObject to return. +/// @return the value of the "name" attribute of the GraphicalObject object with the given index associated with the entered id, or @c "" if +/// the GraphicalObject object does not exits or the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getName(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex); + +/// @brief Sets the name of the GraphicalObject object with the given index associated with entered id of the Layout object. +/// @param layout a pointer to the Layout object. +/// @param id the id of the model entity the the GraphicalObject objects of which to be returned. +/// @param graphicalObjectIndex the index of the GraphicalObject to return. +/// @param name the name to set. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setName(Layout* layout, const std::string& id, const unsigned int graphicalObjectIndex, const std::string& name); + /// @brief Returns the number of CompartmentGlyph objects of the Layout object. /// @param layout a pointer to the Layout object /// @return the number of the CompartmentGlyph objects of the Layout object, or @c 0 if the object is @c NULL @@ -702,6 +773,35 @@ LIBSBMLNETWORK_EXTERN bool isTextGlyph(Layout* layout, const std::string& id, un /// @return @c true if this abstract GraphicalObject is of type TextGlyph, false otherwise LIBSBMLNETWORK_EXTERN bool isTextGlyph(GraphicalObject* graphicalObject); +/// @brief Returns the number of additional GraphicalObject objects of the Layout object. +/// @param Layout a pointer to the Layout object. +/// @return the number of additional GraphicalObject objects of the Layout object, or @c 0 if the object is @c NULL +LIBSBMLNETWORK_EXTERN const unsigned int getNumAdditionalGraphicalObjects(Layout* layout); + +/// @brief Returns a pointer to the additional GraphicalObject object with the given index of the Layout object. +/// @param Layout a pointer to the Layout object. +/// @param additionalGraphicalObjectIndex the index of the additional GraphicalObject to return. +/// @return a pointer to the additional GraphicalObject object with the given index, or @c NULL if the object is @c NULL +LIBSBMLNETWORK_EXTERN GraphicalObject* getAdditionalGraphicalObject(Layout* layout, const unsigned int additionalGraphicalObjectIndex = 0); + +/// @brief Returns the id of the additional GraphicalObject object with the given index of the Layout object. +/// @param Layout a pointer to the Layout object. +/// @param additionalGraphicalObjectIndex the index of the additional GraphicalObject to return. +/// @return the id of the additional GraphicalObject object with the given index, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getAdditionalGraphicalObjectId(Layout* layout, const unsigned int additionalGraphicalObjectIndex = 0); + +/// @brief Adds a new GraphicalObject object to the Layout object. +/// @param Layout a pointer to the Layout object. +/// @param id a string value to be set as the id of the GraphicalObject object. +/// @return a pointer to the newly created GraphicalObject object, or @c NULL if the object is @c NULL +LIBSBMLNETWORK_EXTERN GraphicalObject* addAdditionalGraphicalObject(Layout* layout, const std::string& id); + +/// @brief Removes the additional GraphicalObject object with the given index from the Layout object. +/// @param Layout a pointer to the Layout object. +/// @param additionalGraphicalObjectIndex the index of the additional GraphicalObject to remove. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int removeAdditionalGraphicalObject(Layout* layout, const unsigned int additionalGraphicalObjectIndex = 0); + /// Returns the value of the "id" attribute of the SBML object associated with the GraphicalObject object with the given id. /// @param layout a pointer to the Layout object. /// @param graphicalObjectId the id of the GraphicalObject object. @@ -1080,36 +1180,36 @@ LIBSBMLNETWORK_EXTERN LineSegment* getCurveSegment(Curve* curve, unsigned int cu /// @param Layout a pointer to the Layout object. /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. /// @param graphicalObjectIndex the index of the GraphicalObject to return. -/// @return the created @c LineSegment, or NULL if the line segment could not be created. -LIBSBMLNETWORK_EXTERN LineSegment* createLineCurveSegment(Layout* layout, const std::string& id, unsigned int graphicalObjectIndex = 0); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addLineCurveSegment(Layout* layout, const std::string& id, unsigned int graphicalObjectIndex = 0); /// @brief Creates a new LineSegment and adds it to the end of the list of the curve of this GraphicalObject object. /// @param graphicalObject a pointer to the GraphicalObject object. -/// @return the created @c LineSegment, or NULL if the line segment could not be created. -LIBSBMLNETWORK_EXTERN LineSegment* createLineCurveSegment(GraphicalObject* graphicalObject); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addLineCurveSegment(GraphicalObject* graphicalObject); /// @brief Creates a new LineSegment and adds it to the end of the list of this Curve object. /// @param curve a pointer to the Curve object. -/// @return the created @c LineSegment, or NULL if the line segment could not be created. -LIBSBMLNETWORK_EXTERN LineSegment* createLineCurveSegment(Curve* curve); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addLineCurveSegment(Curve* curve); /// @brief Creates a new CubicBezier and adds it to the end of the list of the curve of the GraphicalObject ///// with the given index associated with the model entity with the given id of the Layout object. /// @param Layout a pointer to the Layout object. /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. /// @param graphicalObjectIndex the index of the GraphicalObject to return. -/// @return the created @c CubicBezier, or NULL if the line segment could not be created. -LIBSBMLNETWORK_EXTERN CubicBezier* createCubicBezierCurveSegment(Layout* layout, const std::string& id, unsigned int graphicalObjectIndex = 0); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addCubicBezierCurveSegment(Layout* layout, const std::string& id, unsigned int graphicalObjectIndex = 0); /// @brief Creates a new CubicBezier and adds it to the end of the list of the curve of this GraphicalObject object. /// @param graphicalObject a pointer to the GraphicalObject object. -/// @return the created @c CubicBezier, or NULL if the line segment could not be created. -LIBSBMLNETWORK_EXTERN CubicBezier* createCubicBezierCurveSegment(GraphicalObject* graphicalObject); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addCubicBezierCurveSegment(GraphicalObject* graphicalObject); /// @brief Creates a new CubicBezier and adds it to the end of the list of this Curve object. /// @param curve a pointer to the Curve object. -/// @return the created @c CubicBezier, or NULL if the line segment could not be created. -LIBSBMLNETWORK_EXTERN CubicBezier* createCubicBezierCurveSegment(Curve* curve); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addCubicBezierCurveSegment(Curve* curve); /// @brief Removes and deletes the curve segment with the given index from the list of the Curve of the GraphicalObject ///// with the given index associated with the model entity with the given id of the Layout object. @@ -1118,7 +1218,7 @@ LIBSBMLNETWORK_EXTERN CubicBezier* createCubicBezierCurveSegment(Curve* curve); /// @param graphicalObjectIndex the index of the GraphicalObject to return. /// @param curveSegmentIndex an unsigned int representing the index of the curve segment to remove. /// @return integer value indicating success/failure of the function. -LIBSBMLNETWORK_EXTERN int removeCurveSegment(Layout* layout, const std::string& id, unsigned int curveSegmentIndex = 0); +LIBSBMLNETWORK_EXTERN int removeCurveSegment(Layout* layout, const std::string& id, unsigned int graphicalObjectIndex = 0, unsigned int curveSegmentIndex = 0); /// @brief Removes and deletes the curve segment with the given index from the list of the Curve of this GraphicalObject object. /// @param graphicalObject a pointer to the GraphicalObject object. diff --git a/src/libsbmlnetwork_layout_helpers.cpp b/src/libsbmlnetwork_layout_helpers.cpp index 9c144cd..9255206 100755 --- a/src/libsbmlnetwork_layout_helpers.cpp +++ b/src/libsbmlnetwork_layout_helpers.cpp @@ -5,7 +5,7 @@ #include "features/error_log/libsbmlnetwork_error_log.h" #include "features/user_data/libsbmlnetwork_user_data.h" #include "features/defaults/libsbmlnetwork_defaults_layout.h" -#include "features/hide_elements/libsbmlnetwork_hide_species.h" +#include "features/hide_elements/libsbmlnetwork_hide_elements.h" #include "features/set_layout_features/libsbmlnetwork_set_layout_features.h" #include @@ -164,7 +164,7 @@ std::vector getSpeciesReferencesAssociatedWithSpecies(La if (reactionGlyph) { for (unsigned int i = 0; i < reactionGlyph->getNumSpeciesReferenceGlyphs(); i++) { SpeciesGlyph* speciesGlyph = layout->getSpeciesGlyph(reactionGlyph->getSpeciesReferenceGlyph(i)->getSpeciesGlyphId()); - if (speciesGlyph && speciesGlyph->getSpeciesId() == speciesId) + if (speciesGlyph && (speciesGlyph->getSpeciesId() == speciesId || speciesGlyph->getId() == speciesId)) speciesReferencesAssociatedWithSpecies.push_back(reactionGlyph->getSpeciesReferenceGlyph(i)); } } @@ -372,10 +372,42 @@ GraphicalObject* getGraphicalObjectUsingItsOwnId(Layout* layout, const std::stri ReactionGlyph* reactionGlyph = layout->getReactionGlyph(graphicalObjectId); if (reactionGlyph) return reactionGlyph; + GraphicalObject* additionalGraphicalObject = layout->getAdditionalGraphicalObject(graphicalObjectId); + if (additionalGraphicalObject) + return additionalGraphicalObject; return NULL; } +int removeGraphicalObjectUsingItsOwnId(Layout* layout, const std::string& graphicalObjectId) { + CompartmentGlyph* compartmentGlyph = layout->getCompartmentGlyph(graphicalObjectId); + if (compartmentGlyph) { + user_data_freeUserData(compartmentGlyph); + delete layout->removeCompartmentGlyph(graphicalObjectId); + return 0; + } + SpeciesGlyph* speciesGlyph = layout->getSpeciesGlyph(graphicalObjectId); + if (speciesGlyph) { + user_data_freeUserData(speciesGlyph); + delete layout->removeSpeciesGlyph(graphicalObjectId); + return 0; + } + ReactionGlyph* reactionGlyph = layout->getReactionGlyph(graphicalObjectId); + if (reactionGlyph) { + user_data_freeUserData(reactionGlyph); + delete layout->removeReactionGlyph(graphicalObjectId); + return 0; + } + GraphicalObject* additionalGraphicalObject = layout->getAdditionalGraphicalObject(graphicalObjectId); + if (additionalGraphicalObject) { + user_data_freeUserData(additionalGraphicalObject); + delete layout->removeAdditionalGraphicalObject(graphicalObjectId); + return 0; + } + + return -1; +} + const std::string getEntityId(GraphicalObject* graphicalObject) { GraphicalObject* castedGraphicalObject = dynamic_cast(graphicalObject); if (castedGraphicalObject) @@ -581,6 +613,84 @@ int setCurveMiddlePositionY(Curve* curve, const double& y) { return -1; } +int updateGraphicalObjectId(Layout* layout, GraphicalObject* graphicalObject, const std::string& newId) { + if (graphicalObject && !newId.empty() && getGraphicalObjectUsingItsOwnId(layout, newId) == NULL) { + if (isSpeciesGlyph(graphicalObject)) { + std::vector speciesReferenceGlyphs = getSpeciesReferencesAssociatedWithSpeciesGlyph(layout, graphicalObject->getId()); + for (unsigned int i = 0; i < speciesReferenceGlyphs.size(); i++) + updateSpeciesReferenceGlyphSpeciesGlyphId(speciesReferenceGlyphs.at(i), graphicalObject->getId(), newId); + std::vector textGlyphs = getAssociatedTextGlyphsWithGraphicalObject(layout, graphicalObject); + for (unsigned int i = 0; i < textGlyphs.size(); i++) + updateTextGlyphGraphicalObjectId(textGlyphs.at(i), graphicalObject->getId(), newId); + BoundingBox* boundingBox = graphicalObject->getBoundingBox(); + if (boundingBox) + boundingBox->setId(newId + "_bb"); + } + else if (isReactionGlyph(graphicalObject)) { + std::vector speciesReferenceGlyphs = getSpeciesReferenceGlyphs((ReactionGlyph*)graphicalObject); + for (unsigned int i = 0; i < speciesReferenceGlyphs.size(); i++) + updateSpeciesReferenceGlyphReactionGlyphId(speciesReferenceGlyphs.at(i), graphicalObject->getId(), newId); + std::vector textGlyphs = getAssociatedTextGlyphsWithGraphicalObject(layout, graphicalObject); + for (unsigned int i = 0; i < textGlyphs.size(); i++) + updateTextGlyphGraphicalObjectId(textGlyphs.at(i), graphicalObject->getId(), newId); + BoundingBox* boundingBox = graphicalObject->getBoundingBox(); + if (boundingBox) + boundingBox->setId(newId + "_bb"); + } + graphicalObject->setId(newId); + + return 0; + } + + return -1; +} + +int updateSpeciesReferenceGlyphSpeciesGlyphId(SpeciesReferenceGlyph* speciesReferenceGlyph, const std::string& originalSpeciesGlyphId, const std::string& newSpeciesGlyphId) { + if (speciesReferenceGlyph) { + std::string speciesReferenceGlyphId = speciesReferenceGlyph->getId(); + std::string::size_type pos = speciesReferenceGlyphId.find(originalSpeciesGlyphId); + if (pos != std::string::npos) + speciesReferenceGlyphId.replace(pos, originalSpeciesGlyphId.length(), newSpeciesGlyphId); + speciesReferenceGlyph->setId(speciesReferenceGlyphId); + if (speciesReferenceGlyph->getSpeciesGlyphId() == originalSpeciesGlyphId) + speciesReferenceGlyph->setSpeciesGlyphId(newSpeciesGlyphId); + + return 0; + } + + return -1; +} + +int updateSpeciesReferenceGlyphReactionGlyphId(SpeciesReferenceGlyph* speciesReferenceGlyph, const std::string& originalReactionGlyphId, const std::string& newReactionGlyphId) { + if (speciesReferenceGlyph) { + std::string speciesReferenceGlyphId = speciesReferenceGlyph->getId(); + std::string::size_type pos = speciesReferenceGlyphId.find(originalReactionGlyphId); + if (pos != std::string::npos) + speciesReferenceGlyphId.replace(pos, originalReactionGlyphId.length(), newReactionGlyphId); + speciesReferenceGlyph->setId(speciesReferenceGlyphId); + + return 0; + } + + return -1; +} + +int updateTextGlyphGraphicalObjectId(TextGlyph* textGlyph, const std::string& originalGraphicalObjectId, const std::string& newGraphicalObjectId) { + if (textGlyph) { + std::string textGlyphId = textGlyph->getId(); + std::string::size_type pos = textGlyphId.find(originalGraphicalObjectId); + if (pos != std::string::npos) + textGlyphId.replace(pos, originalGraphicalObjectId.length(), newGraphicalObjectId); + textGlyph->setId(textGlyphId); + if (textGlyph->getGraphicalObjectId() == originalGraphicalObjectId) + textGlyph->setGraphicalObjectId(newGraphicalObjectId); + + return 0; + } + + return -1; +} + const bool isValidLayoutDimensionWidthValue(const double& width, SBase* sBase) { if (isValidDimensionValue(width, sBase) && width > 6 * defaults_getDefaultAutoLayoutPadding()) return true; diff --git a/src/libsbmlnetwork_layout_helpers.h b/src/libsbmlnetwork_layout_helpers.h index d6879db..523c3a4 100755 --- a/src/libsbmlnetwork_layout_helpers.h +++ b/src/libsbmlnetwork_layout_helpers.h @@ -84,6 +84,8 @@ std::vector getAssociatedTextGlyphsWithGraphicalObject(Layout* layou GraphicalObject* getGraphicalObjectUsingItsOwnId(Layout* layout, const std::string& graphicalObjectId); +int removeGraphicalObjectUsingItsOwnId(Layout* layout, const std::string& graphicalObjectId); + const std::string getEntityId(GraphicalObject* graphicalObject); std::vector getCompartmentGlyphs(Layout* layout); @@ -130,6 +132,14 @@ int setCurveMiddlePositionX(Curve* curve, const double& x); int setCurveMiddlePositionY(Curve* curve, const double& y); +int updateGraphicalObjectId(Layout* layout, GraphicalObject* graphicalObject, const std::string& newId); + +int updateSpeciesReferenceGlyphSpeciesGlyphId(SpeciesReferenceGlyph* speciesReferenceGlyph, const std::string& originalSpeciesGlyphId, const std::string& newSpeciesGlyphId); + +int updateSpeciesReferenceGlyphReactionGlyphId(SpeciesReferenceGlyph* speciesReferenceGlyph, const std::string& originalReactionGlyphId, const std::string& newReactionGlyphId); + +int updateTextGlyphGraphicalObjectId(TextGlyph* textGlyph, const std::string& originalGraphicalObjectId, const std::string& newGraphicalObjectId); + const bool isValidLayoutDimensionWidthValue(const double& width, SBase* sBase = NULL); const bool isValidLayoutDimensionHeightValue(const double& height, SBase* sBase = NULL); diff --git a/src/libsbmlnetwork_layout_render.h b/src/libsbmlnetwork_layout_render.h index c5471e7..6b085fa 100644 --- a/src/libsbmlnetwork_layout_render.h +++ b/src/libsbmlnetwork_layout_render.h @@ -26,7 +26,7 @@ LIBSBMLNETWORK_EXTERN const unsigned int getNumLocalRenderInformation(Layout* la /// @brief Returns a pointer to the LocalRenderInformation object with the given index in the ListOfLocalRenderInformation of this layout object. /// @param layout a pointer to the Layout object. /// @param n the index number of the GlobalRenderInformation to return. -/// @return the @c the nth LocalRenderInformation in the ListOfLocalRenderInformation of this Layout object or NULL if +/// @return the @c the LocalRenderInformation with the given index in the ListOfLocalRenderInformation of this Layout object or NULL if /// no such LocalRenderInformation exists or the object is @c NULL. LIBSBMLNETWORK_EXTERN LocalRenderInformation* getLocalRenderInformation(Layout* layout, unsigned int renderIndex = 0); diff --git a/src/libsbmlnetwork_render.h b/src/libsbmlnetwork_render.h index 36ddf00..4ab5d65 100755 --- a/src/libsbmlnetwork_render.h +++ b/src/libsbmlnetwork_render.h @@ -330,13 +330,13 @@ LIBSBMLNETWORK_EXTERN int setOffsetAsDouble(GradientStop* gradientStop, const do /// @brief Predicates returning @c true if the "stop-color" attribute of the GradientStop with the given index of the GradientBase with the given identifier is set. /// @param renderInformationBase a pointer to the RenderInformationBase object. /// @param sid a string representing the identifier of the GradientBase to retrieve. -/// @return @c true if the "stop-color" attribute of nth GradientStop of this GradientBase object is set, @c false if either the "stop-color" +/// @return @c true if the "stop-color" attribute of the GradientStop with the given index of this GradientBase object is set, @c false if either the "stop-color" /// attribute is not set or the object is @c NULL . LIBSBMLNETWORK_EXTERN bool isSetStopColor(RenderInformationBase* renderInformationBase, const std::string& sid, unsigned int gradientStopIndex = 0); /// @brief Predicates returning @c true if the "stop-color" attribute of the GradientStop with the given index of this GradientBase is set. /// @param gradientBase a pointer to the GradientBase object. -/// @return @c true if the "stop-color" attribute of nth GradientStop of this GradientBase object is set, @c false if either the "stop-color" +/// @return @c true if the "stop-color" attribute of the GradientStop with the given index of this GradientBase object is set, @c false if either the "stop-color" /// attribute is not set or the object is @c NULL . LIBSBMLNETWORK_EXTERN bool isSetStopColor(GradientBase* gradientBase, unsigned int gradientStopIndex = 0); @@ -6682,7 +6682,7 @@ LIBSBMLNETWORK_EXTERN const unsigned int getGeometricShapeNumElements(Transforma /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(RenderInformationBase* renderInformationBase, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -6691,7 +6691,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(RenderInforma /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(RenderInformationBase* renderInformationBase, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -6699,7 +6699,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(RenderInforma /// @param style a pointer to the Style object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if +/// @return the "x" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(Style* style, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -6707,14 +6707,14 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(Style* style, /// @param renderGroup a pointer to the RenderGroup object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the nth element of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if +/// @return the "x" attribute of the element with the given index of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(RenderGroup* renderGroup, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); /// @brief Returns the value of the "x" attribute of element at the given index of this Transformation2D. /// @param shape a pointer to the Transformation2D object. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the nth element of Transformation2D object, or @c RelAbsVector() if +/// @return the "x" attribute of the element with the given index of Transformation2D object, or @c RelAbsVector() if /// the Transformation2D object does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(Transformation2D* shape, unsigned int elementIndex = 0); @@ -6810,14 +6810,14 @@ LIBSBMLNETWORK_EXTERN int setGeometricShapeElementX(RenderGroup* renderGroup, un /// @brief Sets the value of the "x" attribute of the first element of this Transformation2D. /// @param shape a pointer to the Transformation2D object. -/// @param x a RelAbsVector to use as the value of the "x" attribute of nth element of this Transformation2D. +/// @param x a RelAbsVector to use as the value of the "x" attribute of element with the given index of this Transformation2D. /// @return integer value indicating success/failure of the function. LIBSBMLNETWORK_EXTERN int setGeometricShapeElementX(Transformation2D* shape, const RelAbsVector& x); /// @brief Sets the value of the "x" attribute of the element at the given index of this Transformation2D. /// @param shape a pointer to the Transformation2D object. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @param x a RelAbsVector to use as the value of the "x" attribute of nth element of this Transformation2D. +/// @param x a RelAbsVector to use as the value of the "x" attribute of element with the given index of this Transformation2D. /// @return integer value indicating success/failure of the function. LIBSBMLNETWORK_EXTERN int setGeometricShapeElementX(Transformation2D* shape, unsigned int elementIndex, const RelAbsVector& x); @@ -6988,7 +6988,7 @@ LIBSBMLNETWORK_EXTERN int setReactionGeometricShapeElementXAsDouble(GlobalRender /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(RenderInformationBase* renderInformationBase, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -6997,7 +6997,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(RenderInforma /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(RenderInformationBase* renderInformationBase, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7005,7 +7005,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(RenderInforma /// @param style a pointer to the Style object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if +/// @return the "y" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(Style* style, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7013,14 +7013,14 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(Style* style, /// @param renderGroup a pointer to the RenderGroup object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the nth element of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if +/// @return the "y" attribute of the element with the given index of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(RenderGroup* renderGroup, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); /// @brief Returns the value of the "y" attribute of element at the given index of this Transformation2D. /// @param shape a pointer to the Transformation2D object. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the nth element of Transformation2D object, or @c RelAbsVector() if +/// @return the "y" attribute of the element with the given index of Transformation2D object, or @c RelAbsVector() if /// the Transformation2D object does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(Transformation2D* shape, unsigned int elementIndex = 0); @@ -7116,14 +7116,14 @@ LIBSBMLNETWORK_EXTERN int setGeometricShapeElementY(RenderGroup* renderGroup, un /// @brief Sets the value of the "y" attribute of the first element of this Transformation2D. /// @param shape a pointer to the Transformation2D object. -/// @param x a RelAbsVector to use as the value of the "y" attribute of nth element of this Transformation2D. +/// @param x a RelAbsVector to use as the value of the "y" attribute of element with the given index of this Transformation2D. /// @return integer value indicating success/failure of the function. LIBSBMLNETWORK_EXTERN int setGeometricShapeElementY(Transformation2D* shape, const RelAbsVector& y); /// @brief Sets the value of the "y" attribute of element at the given index of this Transformation2D. /// @param shape a pointer to the Transformation2D object. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @param x a RelAbsVector to use as the value of the "y" attribute of nth element of this Transformation2D. +/// @param x a RelAbsVector to use as the value of the "y" attribute of element with the given index of this Transformation2D. /// @return integer value indicating success/failure of the function. LIBSBMLNETWORK_EXTERN int setGeometricShapeElementY(Transformation2D* shape, unsigned int elementIndex, const RelAbsVector& y); @@ -7294,7 +7294,7 @@ LIBSBMLNETWORK_EXTERN int setReactionGeometricShapeElementYAsDouble(GlobalRender /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(RenderInformationBase* renderInformationBase, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7303,7 +7303,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(RenderInfo /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(RenderInformationBase* renderInformationBase, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7311,7 +7311,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(RenderInfo /// @param style a pointer to the Style object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(Style* style, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7319,14 +7319,14 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(Style* sty /// @param renderGroup a pointer to the RenderGroup object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(RenderGroup* renderGroup, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); /// @brief Returns the value of the "x" attribute of the base point 1 of the element at the given index of this Transformation2D. /// @param shape a pointer to the Transformation2D object. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 1 of the nth element of Transformation2D object, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 1 of the element with the given index of Transformation2D object, or @c RelAbsVector() if /// the Transformation2D object does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(Transformation2D* shape, unsigned int elementIndex = 0); @@ -7600,7 +7600,7 @@ LIBSBMLNETWORK_EXTERN int setReactionGeometricShapeBasePoint1XAsDouble(GlobalRen /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(RenderInformationBase* renderInformationBase, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7609,7 +7609,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(RenderInfo /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(RenderInformationBase* renderInformationBase, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7617,7 +7617,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(RenderInfo /// @param style a pointer to the Style object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(Style* style, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7625,14 +7625,14 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(Style* sty /// @param renderGroup a pointer to the RenderGroup object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(RenderGroup* renderGroup, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); /// @brief Returns the value of the "y" attribute of the base point 1 of the element at the given index of this Transformation2D. /// @param shape a pointer to the Transformation2D object. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of he base point 1 of the nth element of Transformation2D object, or @c RelAbsVector() if +/// @return the "y" attribute of he base point 1 of the element with the given index of Transformation2D object, or @c RelAbsVector() if /// the Transformation2D object does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(Transformation2D* shape, unsigned int elementIndex = 0); @@ -7905,7 +7905,7 @@ LIBSBMLNETWORK_EXTERN int setReactionGeometricShapeBasePoint1YAsDouble(GlobalRen /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(RenderInformationBase* renderInformationBase, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7914,7 +7914,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(RenderInfo /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(RenderInformationBase* renderInformationBase, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7922,7 +7922,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(RenderInfo /// @param style a pointer to the Style object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(Style* style, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -7930,14 +7930,14 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(Style* sty /// @param renderGroup a pointer to the RenderGroup object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(RenderGroup* renderGroup, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); /// @brief Returns the value of the "x" attribute of the base point 2 of the element at the given index of this Transformation2D. /// @param shape a pointer to the Transformation2D object. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 2 of the nth element of Transformation2D object, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 2 of the element with the given index of Transformation2D object, or @c RelAbsVector() if /// the Transformation2D object does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(Transformation2D* shape, unsigned int elementIndex = 0); @@ -8210,7 +8210,7 @@ LIBSBMLNETWORK_EXTERN int setReactionGeometricShapeBasePoint2XAsDouble(GlobalRen /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(RenderInformationBase* renderInformationBase, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -8219,7 +8219,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(RenderInfo /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(RenderInformationBase* renderInformationBase, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -8227,7 +8227,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(RenderInfo /// @param style a pointer to the Style object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of this Style, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(Style* style, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -8235,14 +8235,14 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(Style* sty /// @param renderGroup a pointer to the RenderGroup object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of this RenderGroup, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(RenderGroup* renderGroup, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); /// @brief Returns the value of the "y" attribute of the base point 2 of the element at the given index of this Transformation2D. /// @param shape a pointer to the Transformation2D object. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of he base point 2 of the nth element of Transformation2D object, or @c RelAbsVector() if +/// @return the "y" attribute of he base point 2 of the element with the given index of Transformation2D object, or @c RelAbsVector() if /// the Transformation2D object does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(Transformation2D* shape, unsigned int elementIndex = 0); diff --git a/src/libsbmlnetwork_render_helpers.cpp b/src/libsbmlnetwork_render_helpers.cpp index 36a2916..3fa0e51 100755 --- a/src/libsbmlnetwork_render_helpers.cpp +++ b/src/libsbmlnetwork_render_helpers.cpp @@ -294,10 +294,11 @@ const std::string addColor(RenderInformationBase* renderInformationBase, const s } const std::string addColor(RenderInformationBase* renderInformationBase, const std::string &colorId, const std::string &colorValue) { + if (colorValue.empty()) + return ""; if (stringCompare(getColorValue(renderInformationBase, colorId), colorValue)) return colorId; - - if (!colorId.empty() && !colorValue.empty()) { + if (!colorId.empty()) { RenderPkgNamespaces renderPkgNamespaces(renderInformationBase->getLevel(), renderInformationBase->getVersion()); ColorDefinition* cd = createColorDefinition(&renderPkgNamespaces, toLowerCase(colorId), colorValue); if (!renderInformationBase->addColorDefinition(cd)) { @@ -601,6 +602,7 @@ void addGlobalStyles(GlobalRenderInformation* globalRenderInformation) { addSpeciesReferenceGlyphGlobalStyles(globalRenderInformation); addEmptySpeciesGlyphGlobalStyle(globalRenderInformation); addTextGlyphsGlobalStyles(globalRenderInformation); + addGraphicalObjectGlobalStyle(globalRenderInformation); } GlobalStyle* createGlobalStyleByType(GlobalRenderInformation* globalRenderInformation, const std::string& type) { @@ -692,6 +694,14 @@ void addReactionGlyphTextGlyphGlobalStyle(GlobalRenderInformation* globalRenderI } } +void addGraphicalObjectGlobalStyle(GlobalRenderInformation* globalRenderInformation) { + if (!findStyleByTypeList(globalRenderInformation, getGraphicalObjectStyleType())) { + GlobalStyle* globalStyle = createGlobalStyleByType(globalRenderInformation, getGraphicalObjectStyleType()); + RenderGroup* renderGroup = globalStyle->createGroup(); + setGraphicalObjectRenderGroupFeatures(renderGroup); + } +} + void addLocalStyles(Layout* layout, LocalRenderInformation* localRenderInformation) { addCompartmentGlyphsLocalStyles(layout, localRenderInformation); addSpeciesGlyphsLocalStyles(layout, localRenderInformation); @@ -874,6 +884,14 @@ void setGeneralTextGlyphRenderGroupFeatures(RenderGroup* renderGroup) { renderGroup->setVTextAnchor(getDefaultPredefinedStyleFeatures()["species-text-vertical-alignment"]); } +void setGraphicalObjectRenderGroupFeatures(RenderGroup* renderGroup) { + Rectangle* rectangle = renderGroup->createRectangle(); + defaults_setDefaultRectangleShapeFeatures(rectangle); + rectangle->setRX(RelAbsVector(std::stod(getDefaultPredefinedStyleFeatures()["species-border-radius-x"]), 0.0)); + rectangle->setRY(RelAbsVector(std::stod(getDefaultPredefinedStyleFeatures()["species-border-radius-y"]), 0.0)); + setGeneralTextGlyphRenderGroupFeatures(renderGroup); +} + void unifyGeometricShapeMutualFeatures(RenderGroup* renderGroup) { if (renderGroup && getNumGeometricShapes(renderGroup) > 1) { std::string strokeColor = "black"; @@ -929,17 +947,17 @@ const bool canHaveStrokeDashArray(GraphicalObject* graphicalObject) { } const bool canHaveFillColor(GraphicalObject* graphicalObject) { - if (isCompartmentGlyph(graphicalObject) || isSpeciesGlyph(graphicalObject) || isReactionGlyph(graphicalObject)) - return true; + if (isSpeciesReferenceGlyph(graphicalObject)) + return false; - return false; + return true; } const bool canHaveFillRule(GraphicalObject* graphicalObject) { - if (isCompartmentGlyph(graphicalObject) || isSpeciesGlyph(graphicalObject) || (isReactionGlyph(graphicalObject) && !getCurve(graphicalObject))) - return true; + if (isSpeciesReferenceGlyph(graphicalObject)) + return false; - return false; + return true; } const bool canHaveFontColor(TextGlyph* textGlyph) { @@ -1006,17 +1024,17 @@ const bool canHaveEndHead(GraphicalObject* graphicalObject) { } const bool canHaveGeometricShape(GraphicalObject* graphicalObject) { - if (isCompartmentGlyph(graphicalObject) || isSpeciesGlyph(graphicalObject) || (isReactionGlyph(graphicalObject) && !isSetCurve(graphicalObject))) - return true; + if ((isReactionGlyph(graphicalObject) && isSetCurve(graphicalObject)) || isSpeciesReferenceGlyph(graphicalObject)) + return false; - return false; + return true; } const bool canPotentiallyHaveGeometricShape(GraphicalObject* graphicalObject) { - if (isCompartmentGlyph(graphicalObject) || isSpeciesGlyph(graphicalObject) || isReactionGlyph(graphicalObject)) - return true; + if (isSpeciesReferenceGlyph(graphicalObject)) + return false; - return false; + return true; } const bool isValidBackgroundColorValue(const std::string& backgroundColor, SBase* sBase) { diff --git a/src/libsbmlnetwork_render_helpers.h b/src/libsbmlnetwork_render_helpers.h index a060838..3ccf970 100755 --- a/src/libsbmlnetwork_render_helpers.h +++ b/src/libsbmlnetwork_render_helpers.h @@ -165,6 +165,8 @@ void addSpeciesGlyphTextGlyphGlobalStyle(GlobalRenderInformation* globalRenderIn void addReactionGlyphTextGlyphGlobalStyle(GlobalRenderInformation* globalRenderInformation); +void addGraphicalObjectGlobalStyle(GlobalRenderInformation* globalRenderInformation); + void addLocalStyles(Layout* layout, LocalRenderInformation* localRenderInformation); Style* createLocalStyle(RenderInformationBase* localRenderInformation, Style* globalStyle, GraphicalObject* graphicalObject); @@ -219,6 +221,8 @@ void setReactionGlyphTextGlyphRenderGroupFeatures(RenderGroup* renderGroup); void setSpeciesReferenceGlyphRenderGroupFeatures(RenderGroup* renderGroup, SpeciesReferenceRole_t role); +void setGraphicalObjectRenderGroupFeatures(RenderGroup* renderGroup); + void unifyGeometricShapeMutualFeatures(RenderGroup* renderGroup); const std::string getGlobalStyleUniqueId(GlobalRenderInformation* globalRenderInformation, const std::string& type); diff --git a/src/libsbmlnetwork_sbmldocument.cpp b/src/libsbmlnetwork_sbmldocument.cpp index 76c690f..ce9ebff 100644 --- a/src/libsbmlnetwork_sbmldocument.cpp +++ b/src/libsbmlnetwork_sbmldocument.cpp @@ -85,8 +85,8 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return false; } - int autolayout(SBMLDocument* document, const int maxNumConnectedEdges, bool useNameAsTextLabel, bool resetFixedPositionElements, std::set > fixedPositionNodesSet) { - const bool layoutIsAdded = !createDefaultLayoutLocations(document, maxNumConnectedEdges, useNameAsTextLabel, resetFixedPositionElements, fixedPositionNodesSet); + int autolayout(SBMLDocument* document, const int maxNumConnectedEdges, bool resetFixedPositionElements, std::set > fixedPositionNodesSet) { + const bool layoutIsAdded = !createDefaultLayoutLocations(document, maxNumConnectedEdges, resetFixedPositionElements, fixedPositionNodesSet); const bool renderIsAdded = !createDefaultRenderInformation(document); if (layoutIsAdded || renderIsAdded) return 0; @@ -144,75 +144,6 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return NULL; } - bool isSetId(SBase* object) { - if (object) - return object->isSetId(); - - return false; - } - - const std::string getId(SBase* object) { - if (object) - return object->getId(); - - return ""; - } - - int setId(SBase* object, const std::string& sid) { - if (object) { - object->setId(sid); - return 0; - } - - return -1; - } - - bool isSetName(SBase* object) { - if (object) - object->isSetName(); - - return false; - } - - const std::string getName(SBase* object) { - if (object) - return object->getName(); - - return ""; - } - - int setName(SBase* object, const std::string& name) { - if (object) { - object->setName(name); - return 0; - } - - return -1; - } - - bool isSetMetaId(SBase* object) { - if (object) - return object->isSetMetaId(); - - return false; - } - - const std::string getMetaId(SBase* object) { - if (object) - return object->getMetaId(); - - return ""; - } - - int setMetaId(SBase* object, const std::string& metaid) { - if (object) { - object->setMetaId(metaid); - return 0; - } - - return -1; - } - const unsigned int getNumCompartments(SBMLDocument* document) { if (document && document->isSetModel()) return document->getModel()->getNumCompartments(); @@ -220,7 +151,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return 0; } - const std::string getNthCompartmentId(SBMLDocument* document, unsigned int index) { + const std::string getCompartmentId(SBMLDocument* document, unsigned int index) { if (document && document->isSetModel()) return document->getModel()->getCompartment(index)->getId(); @@ -241,7 +172,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return 0; } - const std::string getNthSpeciesId(SBMLDocument* document, unsigned int index) { + const std::string getSpeciesId(SBMLDocument* document, unsigned int index) { if (document && document->isSetModel()) return document->getModel()->getSpecies(index)->getId(); @@ -262,7 +193,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return 0; } - const std::string getNthReactionId(SBMLDocument* document, unsigned int index) { + const std::string getReactionId(SBMLDocument* document, unsigned int index) { if (document && document->isSetModel()) return document->getModel()->getReaction(index)->getId(); @@ -316,7 +247,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return 0; } - const std::string getNthReactantId(SBMLDocument* document, const std::string& reactionId, unsigned int index) { + const std::string getReactantId(SBMLDocument* document, const std::string& reactionId, unsigned int index) { if (document && document->isSetModel()) { Reaction* reaction = getReaction(document, reactionId); if (reaction) @@ -326,7 +257,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return ""; } - const std::string getNthProductId(SBMLDocument* document, const std::string& reactionId, unsigned int index) { + const std::string getProductId(SBMLDocument* document, const std::string& reactionId, unsigned int index) { if (document && document->isSetModel()) { Reaction* reaction = getReaction(document, reactionId); if (reaction) @@ -336,7 +267,7 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return ""; } - const std::string getNthModifierId(SBMLDocument* document, const std::string& reactionId, unsigned int index) { + const std::string getModifierId(SBMLDocument* document, const std::string& reactionId, unsigned int index) { if (document && document->isSetModel()) { Reaction* reaction = getReaction(document, reactionId); if (reaction) diff --git a/src/libsbmlnetwork_sbmldocument.h b/src/libsbmlnetwork_sbmldocument.h index 6326bb7..78a1a05 100644 --- a/src/libsbmlnetwork_sbmldocument.h +++ b/src/libsbmlnetwork_sbmldocument.h @@ -79,12 +79,11 @@ LIBSBMLNETWORK_EXTERN bool isSetModel(SBMLDocument* document); /// @brief Create a Layout object, a GlobalRenderInformation object, and LocalRenderInformation resume object, add them /// to the the SBML document, and set all the necessary features for them. /// @param document a pointer to the SBMLDocument object. -/// @param maxNumConnectedEdges the maximum number of connected edges to a node in the autolayout algorithm. -/// @param useNameAsTextLabel a variable that determines whether to use the name of the species/reaction as the text label in the autolayout algorithm. +/// @param maxNumConnectedEdges the maximum number of connected edges to a node in the autolayout algorithm.. /// @param resetFixedPositionElements a variable that determines whether to reset the fixed position elements in the autolayout algorithm. /// @param fixedPositionNodesSet a set of fixed position nodes and their graphical object indices to be used in the autolayout algorithm. /// @return integer value indicating success/failure of the function. -LIBSBMLNETWORK_EXTERN int autolayout(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, bool resetFixedPositionElements = false, std::set > fixedPositionNodesSet = {}); +LIBSBMLNETWORK_EXTERN int autolayout(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool resetFixedPositionElements = false, std::set > fixedPositionNodesSet = {}); /// @brief Create a Render object and add it to the the SBML document if it does not exist. /// @param document a pointer to the SBMLDocument object. @@ -114,67 +113,16 @@ LIBSBMLNETWORK_EXTERN int distribute(SBMLDocument* document, std::set > fixedPositionNodesSet) { - return set_layout_features_setDefaultLayoutLocations(document, layout, maxNumConnectedEdges, useNameAsTextLabel, resetFixedPositionElements, fixedPositionNodesSet); +int setDefaultLayoutLocations(SBMLDocument* document, Layout* layout, const int maxNumConnectedEdges, bool resetFixedPositionElements, const std::set > fixedPositionNodesSet) { + return set_layout_features_setDefaultLayoutLocations(document, layout, maxNumConnectedEdges, resetFixedPositionElements, fixedPositionNodesSet); } int updateLayoutCurves(SBMLDocument* document, Layout* layout) { - return update_curves_updateLayoutCurves(document, layout); + return update_curves_updateLayoutCurves(document, layout); +} + +bool getUseNameAsTextLabel(SBMLDocument* document, unsigned int layoutIndex) { + return user_data_getUserData(getLayout(document, layoutIndex), "use_name_as_text_label") != "false"; +} + +int setUseNameAsTextLabel(SBMLDocument* document, unsigned int layoutIndex, bool useNameAsTextLabel) { + return user_data_setUserData(getLayout(document, layoutIndex), "use_name_as_text_label", useNameAsTextLabel ? "true" : "false"); } int createDefaultLayoutFeatures(SBMLDocument* document, const int maxNumConnectedEdges) { @@ -86,13 +92,12 @@ int createDefaultLayoutFeatures(SBMLDocument* document, const int maxNumConnecte return setDefaultLayoutFeatures(document, layout, maxNumConnectedEdges); } -int createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges, bool useNameAsTextLabel, - bool resetFixedPositionElements, const std::set > fixedPositionNodesSet) { +int createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges, bool resetFixedPositionElements, const std::set > fixedPositionNodesSet) { Layout* layout = getLayout(document); if (!layout) layout = createLayout(document); - return setDefaultLayoutLocations(document, layout, maxNumConnectedEdges, useNameAsTextLabel, resetFixedPositionElements, fixedPositionNodesSet); + return setDefaultLayoutLocations(document, layout, maxNumConnectedEdges, resetFixedPositionElements, fixedPositionNodesSet); } int createAliasSpeciesGlyph(SBMLDocument* document, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex) { @@ -103,7 +108,7 @@ int createAliasSpeciesGlyph(SBMLDocument* document, const std::string& speciesId } int createAliasSpeciesGlyph(SBMLDocument* document, unsigned int layoutIndex, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex) { - if (!alias_element_createAliasSpeciesGlyph(getLayout(document, layoutIndex), speciesId, getReactionGlyph(document, reactionId, reactionGlyphIndex))) + if (!alias_element_createAliasSpeciesGlyph(getLayout(document, layoutIndex), speciesId, getReactionGlyph(document, layoutIndex, reactionId, reactionGlyphIndex))) return updateLayoutCurves(document, getLayout(document, layoutIndex)); return -1; @@ -114,7 +119,7 @@ int createAliasReactionGlyph(SBMLDocument* document, const std::string& reaction } int createAliasReactionGlyph(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId) { - return alias_element_createAliasReactionGlyph(document, getLayout(document, layoutIndex), getReactionGlyph(document, reactionId)); + return alias_element_createAliasReactionGlyph(document, getLayout(document, layoutIndex), getReactionGlyph(document, layoutIndex, reactionId)); } int setSpeciesGlyphIndexInReactionGlyph(SBMLDocument* document, const std::string& speciesId, const std::string& reactionId, const unsigned int index) { @@ -125,7 +130,7 @@ int setSpeciesGlyphIndexInReactionGlyph(SBMLDocument* document, const std::strin } int setSpeciesGlyphIndexInReactionGlyph(SBMLDocument* document, unsigned int layoutIndex, const std::string& speciesId, const std::string& reactionId, const unsigned int index) { - if (!setSpeciesGlyphIndexInReactionGlyph(getLayout(document, layoutIndex), speciesId, getReactionGlyph(document, reactionId), index)) + if (!setSpeciesGlyphIndexInReactionGlyph(getLayout(document, layoutIndex), speciesId, getReactionGlyph(document, layoutIndex, reactionId), index)) return updateLayoutCurves(document, getLayout(document, layoutIndex)); return -1; @@ -139,46 +144,12 @@ int setSpeciesGlyphIndexInReactionGlyph(SBMLDocument* document, const std::strin } int setSpeciesGlyphIndexInReactionGlyph(SBMLDocument* document, unsigned int layoutIndex, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex, const unsigned int index) { - if (!setSpeciesGlyphIndexInReactionGlyph(getLayout(document, layoutIndex), speciesId, getReactionGlyph(document, reactionId, reactionGlyphIndex), index)) + if (!setSpeciesGlyphIndexInReactionGlyph(getLayout(document, layoutIndex), speciesId, getReactionGlyph(document, layoutIndex, reactionId, reactionGlyphIndex), index)) return updateLayoutCurves(document, getLayout(document, layoutIndex)); return -1; } -int makeSpeciesGlyphVisible(SBMLDocument* document, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex, bool visible) { - if (!hide_elements_makeSpeciesGlyphVisible(getReactionGlyph(document, reactionId, reactionGlyphIndex), speciesId, visible)) - return setDefaultLayoutLocations(document, getLayout(document)); - - return -1; -} - -int makeSpeciesGlyphVisible(SBMLDocument* document, unsigned int layoutIndex, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex, bool visible) { - if (!hide_elements_makeSpeciesGlyphVisible(getReactionGlyph(document, layoutIndex, reactionId, reactionGlyphIndex), speciesId, visible)) - return setDefaultLayoutLocations(document, getLayout(document, layoutIndex)); - - return -1; -} - -int makeSpeciesGlyphsVisible(SBMLDocument* document, const std::set >& species, bool visible) { - if (document && document->isSetModel()) { - if (!hide_elements_makeSpeciesGlyphsVisible(document->getModel(), getLayout(document), species, visible)) - return setDefaultLayoutLocations(document, getLayout(document)); - } - - - return -1; -} - -int makeSpeciesGlyphsVisible(SBMLDocument* document, unsigned int layoutIndex, const std::set >& species, bool visible) { - if (document && document->isSetModel()) { - if (!hide_elements_makeSpeciesGlyphsVisible(document->getModel(), getLayout(document, layoutIndex), species, visible)) - return setDefaultLayoutLocations(document, getLayout(document, layoutIndex)); - } - - return -1; -} - - Dimensions* getDimensions(SBMLDocument* document, unsigned int layoutIndex) { return getDimensions(getLayout(document, layoutIndex)); } @@ -235,6 +206,50 @@ GraphicalObject* getGraphicalObject(SBMLDocument* document, unsigned int layoutI return getGraphicalObject(getLayout(document, layoutIndex), id, graphicalObjectIndex); } +int removeGraphicalObject(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex) { + return removeGraphicalObject(getLayout(document), id, graphicalObjectIndex); +} + +int removeGraphicalObject(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { + return removeGraphicalObject(getLayout(document, layoutIndex), id, graphicalObjectIndex); +} + +bool isSetId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { + return isSetId(getLayout(document, layoutIndex), id, graphicalObjectIndex); +} + +const std::string getId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { + return getId(getLayout(document, layoutIndex), id, graphicalObjectIndex); +} + +int setId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex, const std::string& graphicalObjectId) { + return setId(getLayout(document, layoutIndex), id, graphicalObjectIndex, graphicalObjectId); +} + +bool isSetMetaId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { + return isSetMetaId(getLayout(document, layoutIndex), id, graphicalObjectIndex); +} + +const std::string getMetaId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { + return getMetaId(getLayout(document, layoutIndex), id, graphicalObjectIndex); +} + +int setMetaId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex, const std::string& graphicalObjectMetaId) { + return setMetaId(getLayout(document, layoutIndex), id, graphicalObjectIndex, graphicalObjectMetaId); +} + +bool isSetName(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { + return isSetName(getLayout(document, layoutIndex), id, graphicalObjectIndex); +} + +const std::string getName(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { + return getName(getLayout(document, layoutIndex), id, graphicalObjectIndex); +} + +int setName(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex, const std::string& graphicalObjectName) { + return setName(getLayout(document, layoutIndex), id, graphicalObjectIndex, graphicalObjectName); +} + const unsigned int getNumCompartmentGlyphs(SBMLDocument* document, unsigned int layoutIndex) { return getNumCompartmentGlyphs(getLayout(document, layoutIndex)); } @@ -275,15 +290,15 @@ bool isCompartmentGlyph(SBMLDocument* document, unsigned int layoutIndex, const return isCompartmentGlyph(getLayout(document, layoutIndex), id); } -std::string getCompartmentId(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex) { - return getCompartmentId(document, getGraphicalObject(document, id, graphicalObjectIndex)); +std::string getGraphicalObjectCompartmentId(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex) { + return getGraphicalObjectCompartmentId(document, getGraphicalObject(document, id, graphicalObjectIndex)); } -std::string getCompartmentId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { - return getCompartmentId(document, getGraphicalObject(document, layoutIndex, id, graphicalObjectIndex)); +std::string getGraphicalObjectCompartmentId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { + return getGraphicalObjectCompartmentId(document, getGraphicalObject(document, layoutIndex, id, graphicalObjectIndex)); } -std::string getCompartmentId(SBMLDocument* document, GraphicalObject* graphicalObject) { +std::string getGraphicalObjectCompartmentId(SBMLDocument* document, GraphicalObject* graphicalObject) { Compartment* compartment = getAssociatedCompartment(document, graphicalObject); if (compartment) return compartment->getId(); @@ -556,20 +571,20 @@ LineSegment* getSpeciesReferenceCurveSegment(SBMLDocument* document, unsigned in return getCurveSegment(getSpeciesReference(getLayout(document, layoutIndex), reactionId, reactionGlyphIndex, speciesReferenceIndex), curveSegmentIndex); } -LineSegment* createSpeciesReferenceLineCurveSegment(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex) { - return createLineCurveSegment(getSpeciesReference(getLayout(document), reactionId, reactionGlyphIndex, speciesReferenceIndex)); +int addSpeciesReferenceLineCurveSegment(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex) { + return addLineCurveSegment(getSpeciesReference(getLayout(document), reactionId, reactionGlyphIndex, speciesReferenceIndex)); } -LineSegment* createSpeciesReferenceLineCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex) { - return createLineCurveSegment(getSpeciesReference(getLayout(document, layoutIndex), reactionId, reactionGlyphIndex, speciesReferenceIndex)); +int addSpeciesReferenceLineCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex) { + return addLineCurveSegment(getSpeciesReference(getLayout(document, layoutIndex), reactionId, reactionGlyphIndex, speciesReferenceIndex)); } -CubicBezier* createSpeciesReferenceCubicBezierCurveSegment(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex) { - return createCubicBezierCurveSegment(getSpeciesReference(getLayout(document), reactionId, reactionGlyphIndex, speciesReferenceIndex)); +int addSpeciesReferenceCubicBezierCurveSegment(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex) { + return addCubicBezierCurveSegment(getSpeciesReference(getLayout(document), reactionId, reactionGlyphIndex, speciesReferenceIndex)); } -CubicBezier* createSpeciesReferenceCubicBezierCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex) { - return createCubicBezierCurveSegment(getSpeciesReference(getLayout(document, layoutIndex), reactionId, reactionGlyphIndex, speciesReferenceIndex)); +int addSpeciesReferenceCubicBezierCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex) { + return addCubicBezierCurveSegment(getSpeciesReference(getLayout(document, layoutIndex), reactionId, reactionGlyphIndex, speciesReferenceIndex)); } int removeSpeciesReferenceCurveSegment(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int curveSegmentIndex) { @@ -760,24 +775,26 @@ bool isSetText(SBMLDocument* document, unsigned int layoutIndex, const std::stri return isSetText(getLayout(document, layoutIndex), id); } -const std::string getText(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex, unsigned int textGlyphIndex, bool useNameAsTextLabel) { - return getText(document, 0, id, graphicalObjectIndex, textGlyphIndex, useNameAsTextLabel); +const std::string getText(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex, unsigned int textGlyphIndex) { + return getText(document, 0, id, graphicalObjectIndex, textGlyphIndex); } -const std::string getText(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex, unsigned int textGlyphIndex, bool useNameAsTextLabel) { +const std::string getText(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex, unsigned int textGlyphIndex) { std::string text = getText(getLayout(document, layoutIndex), id, graphicalObjectIndex, textGlyphIndex); if (!text.empty()) { return text; } - if (useNameAsTextLabel) { - text = getName(getSBMLObject(document, getOriginOfTextId(document, layoutIndex, id, graphicalObjectIndex, textGlyphIndex))); + SBase* sBase = getSBMLObject(document, getOriginOfTextId(document, layoutIndex, id, graphicalObjectIndex, textGlyphIndex)); + if (sBase) { + if (user_data_getUserData(getLayout(document, layoutIndex), "use_name_as_text_label") != "false") { + text = sBase->getName(); + if (!text.empty()) + return text; + } + text = sBase->getId(); if (!text.empty()) return text; } - text = getId(getSBMLObject(document, getOriginOfTextId(document, layoutIndex, id, graphicalObjectIndex, textGlyphIndex))); - if (!text.empty()) { - return text; - } text = getGraphicalObjectId(document, layoutIndex, id, graphicalObjectIndex, textGlyphIndex); if (!text.empty()) { return text; @@ -890,6 +907,29 @@ bool isTextGlyph(SBMLDocument* document, unsigned int layoutIndex, const std::st return isTextGlyph(getLayout(document, layoutIndex), id, textGlyphIndex); } +const unsigned int getNumAdditionalGraphicalObjects(SBMLDocument* document, unsigned int layoutIndex) { + return getNumAdditionalGraphicalObjects(getLayout(document, layoutIndex)); +} + +GraphicalObject* getAdditionalGraphicalObject(SBMLDocument* document, unsigned int additionalGraphicalObjectIndex) { + return getAdditionalGraphicalObject(getLayout(document), additionalGraphicalObjectIndex); +} + +const std::string getAdditionalGraphicalObjectId(SBMLDocument* document, unsigned int layoutIndex, unsigned int additionalGraphicalObjectIndex) { + return getAdditionalGraphicalObjectId(getLayout(document, layoutIndex), additionalGraphicalObjectIndex); +} + +int addAdditionalGraphicalObject(SBMLDocument* document, unsigned int layoutIndex, const std::string& id) { + if (set_layout_features_createAdditionalGraphicalObject(getLayout(document, layoutIndex), id)) + return 0; + + return -1; +} + +int removeAdditionalGraphicalObject(SBMLDocument* document, unsigned int layoutIndex, unsigned int additionalGraphicalObjectIndex) { + return set_layout_features_removeAdditionalGraphicalObject(getLayout(document, layoutIndex), additionalGraphicalObjectIndex); +} + BoundingBox* getBoundingBox(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex) { return getBoundingBox(getLayout(document), id, graphicalObjectIndex); } @@ -1417,28 +1457,28 @@ LineSegment* getCurveSegment(SBMLDocument* document, unsigned int layoutIndex, c return getCurveSegment(getLayout(document, layoutIndex), id, graphicalObjectIndex, curveSegmentIndex); } -LineSegment* createLineCurveSegment(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex) { - return createLineCurveSegment(getLayout(document), id, graphicalObjectIndex); +int addLineCurveSegment(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex) { + return addLineCurveSegment(getLayout(document), id, graphicalObjectIndex); } -LineSegment* createLineCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { - return createLineCurveSegment(getLayout(document, layoutIndex), id, graphicalObjectIndex); +int addLineCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { + return addLineCurveSegment(getLayout(document, layoutIndex), id, graphicalObjectIndex); } -CubicBezier* createCubicBezierCurveSegment(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex) { - return createCubicBezierCurveSegment(getLayout(document), id, graphicalObjectIndex); +int addCubicBezierCurveSegment(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex) { + return addCubicBezierCurveSegment(getLayout(document), id, graphicalObjectIndex); } -CubicBezier* createCubicBezierCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { - return createCubicBezierCurveSegment(getLayout(document, layoutIndex), id, graphicalObjectIndex); +int addCubicBezierCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex) { + return addCubicBezierCurveSegment(getLayout(document, layoutIndex), id, graphicalObjectIndex); } -int removeCurveSegment(SBMLDocument* document, const std::string& id, unsigned int curveSegmentIndex) { - return removeCurveSegment(getLayout(document), id, curveSegmentIndex); +int removeCurveSegment(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex, unsigned int curveSegmentIndex) { + return removeCurveSegment(getLayout(document), id, graphicalObjectIndex, curveSegmentIndex); } -int removeCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int curveSegmentIndex) { - return removeCurveSegment(getLayout(document, layoutIndex), id, curveSegmentIndex); +int removeCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex, unsigned int curveSegmentIndex) { + return removeCurveSegment(getLayout(document, layoutIndex), id, graphicalObjectIndex, curveSegmentIndex); } bool isCubicBezier(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex, unsigned int curveSegmentIndex) { diff --git a/src/libsbmlnetwork_sbmldocument_layout.h b/src/libsbmlnetwork_sbmldocument_layout.h index c55d52e..71a1670 100644 --- a/src/libsbmlnetwork_sbmldocument_layout.h +++ b/src/libsbmlnetwork_sbmldocument_layout.h @@ -25,7 +25,7 @@ LIBSBMLNETWORK_EXTERN const unsigned int getNumLayouts(SBMLDocument* document); /// @brief Returns a pointer to the Layout with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout to return. -/// @return the @c the nth Layout in the ListOfLayouts of the SBML document or NULL if no such Layout exists or the document is @c NULL. +/// @return the @c the Layout with the given index in the ListOfLayouts of the SBML document or NULL if no such Layout exists or the document is @c NULL. LIBSBMLNETWORK_EXTERN Layout* getLayout(SBMLDocument* document, unsigned int layoutIndex = 0); /// @brief Add Layout to list of layouts of the SBML document. @@ -48,22 +48,20 @@ LIBSBMLNETWORK_EXTERN int removeAllLayouts(SBMLDocument* document); /// @param document a pointer to the SBMLDocument object. /// @param layout a pointer to the Layout object. /// @param maxNumConnectedEdges the maximum number of connected edges before creating an alias SpeciesGlyph. -/// @param useNameAsTextLabel a variable that determines whether to use the name of the model entities as text labels in the autolayout algorithm. /// @param resetFixedPositionElements a variable that determines whether to reset the fixed position elements in the autolayout algorithm. /// @param fixedPositionNodesSet a set of ids of the model entities and the graphical objects indices that are going to be have fixed position in the autolayout algorithm. /// @return integer value indicating success/failure of the function. -LIBSBMLNETWORK_EXTERN int setDefaultLayoutLocations(SBMLDocument* document, Layout* layout, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, +LIBSBMLNETWORK_EXTERN int setDefaultLayoutLocations(SBMLDocument* document, Layout* layout, const int maxNumConnectedEdges = 3, bool resetFixedPositionElements = false, const std::set > fixedPositionNodesSet = {}); /// @brief Create a Layout object, add it to list of layouts of the SBML document, set all the necessary features for it, and apply autolayout algorithm. /// @param document a pointer to the SBMLDocument object. /// @param maxNumConnectedEdges the maximum number of connected edges before creating an alias SpeciesGlyph. -/// @param useNameAsTextLabel a variable that determines whether to use the name of the model entities as text labels in the autolayout algorithm. /// @param resetFixedPositionElements a variable that determines whether to reset the fixed position elements in the autolayout algorithm. /// @param fixedPositionNodeIds a set of ids of the model entities and their graphical objects indices that are going to have fixed position in the autolayout algorithm. /// @return integer value indicating success/failure of the function. -LIBSBMLNETWORK_EXTERN int createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, - bool resetFixedPositionElements = false, const std::set > fixedPositionNodesSet = {}); +LIBSBMLNETWORK_EXTERN int createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool resetFixedPositionElements = false, + const std::set > fixedPositionNodesSet = {}); /// @brief Create a Layout object, add it to list of layouts of the SBML document, and set all the necessary features for it. /// @param document a pointer to the SBMLDocument object. @@ -78,6 +76,19 @@ LIBSBMLNETWORK_EXTERN int createDefaultLayoutFeatures(SBMLDocument* document, co /// @return integer value indicating success/failure of the function. LIBSBMLNETWORK_EXTERN int updateLayoutCurves(SBMLDocument* document, Layout* layout); +/// @brief Get whether the name of the GraphicalObjects must be used as the label of TextGlyph objects associated with them in the Layout object with the given index in the ListOfLayouts of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return boolean value indicating whether the name of the GraphicalObjects must be used as the label of TextGlyph objects associated with them. +LIBSBMLNETWORK_EXTERN bool getUseNameAsTextLabel(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Set whether the name of the GraphicalObjects must be used as the label of TextGlyph objects associated with them in the Layout object with the given index in the ListOfLayouts of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @param useNameAsTextLabel a boolean value indicating whether the name of the GraphicalObjects must be used as the label of TextGlyph objects associated with them. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setUseNameAsTextLabel(SBMLDocument* document, unsigned int layoutIndex, bool useNameAsTextLabel); + /// @brief Create an alias SpeciesGlyph object for Species with the given id and connect all the SpeciesReferences in the ReactionGlyph object with the given id and index that contain Species as a participant to the alias SpeciesGlyph in the first Layout object in the ListOfLayouts of the SBMLDocument. /// @param document a pointer to the SBMLDocument object. /// @param speciesId the id of the Species to create an alias SpeciesGlyph for. @@ -146,40 +157,6 @@ LIBSBMLNETWORK_EXTERN int setSpeciesGlyphIndexInReactionGlyph(SBMLDocument* docu /// @return integer value indicating success/failure of the function. LIBSBMLNETWORK_EXTERN int setSpeciesGlyphIndexInReactionGlyph(SBMLDocument* document, unsigned int layoutIndex, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex, const unsigned int index); -/// @brief Makes the Species Glyph with the given species Id which is a participant of the reaction with the given Id and index in the Layout object with the given index in the first Layout object in the ListOfLayouts of the SBML document visible or invisible. -/// @param document a pointer to the SBMLDocument object. -/// @param speciesId the id of the Species to hide/show. -/// @param reactionId the id of the Reaction to hide/show the SpeciesGlyph for. -/// @param reactionGlyphIndex the index of the ReactionGlyph object to hide/show the SpeciesGlyph for. -/// @param visible a boolean value to determine whether to make the SpeciesGlyph visible or invisible. -/// @return integer value indicating success/failure of the function. -LIBSBMLNETWORK_EXTERN int makeSpeciesGlyphVisible(SBMLDocument* document, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, bool visible = true); - -/// @brief Makes the Species Glyph with the given species Id which is a participant of the reaction with the given Id and index in the Layout object with the given index in the ListOfLayouts of the SBML document visible or invisible. -/// @param document a pointer to the SBMLDocument object. -/// @param layoutIndex the index number of the Layout to return. -/// @param speciesId the id of the Species to hide/show. -/// @param reactionId the id of the Reaction to hide/show the SpeciesGlyph for. -/// @param reactionGlyphIndex the index of the ReactionGlyph object to hide/show the SpeciesGlyph for. -/// @param visible a boolean value to determine whether to make the SpeciesGlyph visible or invisible. -/// @return integer value indicating success/failure of the function. -LIBSBMLNETWORK_EXTERN int makeSpeciesGlyphVisible(SBMLDocument* document, unsigned int layoutIndex, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, bool visible = true); - -/// @brief Makes the Species Glyph with the given species Id which is a participant of the reaction with the given Id and index in the first Layout object in the ListOfLayouts of the SBML document visible or invisible. -/// @param document a pointer to the SBMLDocument object. -/// @param species a set of tuples of the ids of the Species, the id of the Reaction, and the index of the ReactionGlyph object to hide/show the SpeciesGlyph for. -/// @param visible a boolean value to determine whether to make the SpeciesGlyph visible or invisible. -/// @return integer value indicating success/failure of the function. -LIBSBMLNETWORK_EXTERN int makeSpeciesGlyphsVisible(SBMLDocument* document, const std::set >& species, bool visible); - -/// @brief Makes the Species Glyph with the given species Id which is a participant of the reaction with the given Id and index in the Layout object with the given index in the ListOfLayouts of the SBML document visible or invisible. -/// @param document a pointer to the SBMLDocument object. -/// @param layoutIndex the index number of the Layout to return. -/// @param species a set of tuples of the ids of the Species, the id of the Reaction, and the index of the ReactionGlyph object to hide/show the SpeciesGlyph for. -/// @param visible a boolean value to determine whether to make the SpeciesGlyph visible or invisible. -/// @return integer value indicating success/failure of the function. -LIBSBMLNETWORK_EXTERN int makeSpeciesGlyphsVisible(SBMLDocument* document, unsigned int layoutIndex, const std::set >& species, bool visible); - /// @brief Returns the Dimensions object of the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout to return. @@ -267,7 +244,7 @@ LIBSBMLNETWORK_EXTERN std::vector getGraphicalObjects(SBMLDocu /// @param document a pointer to the SBMLDocument object. /// @param id the id of the model entity the GraphicalObject object associated with it is going to be returned. /// @param graphicalObjectIndex the index number of the GraphicalObject object to return. -/// @return a pointer the nth GraphicalObject object associated with the entered model entity id. +/// @return a pointer the GraphicalObject object with the given index associated with the entered model entity id. LIBSBMLNETWORK_EXTERN GraphicalObject* getGraphicalObject(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0); /// @brief Returns the GraphicalObject object with the given index of the Layout object with the given index in the ListOfLayouts of the SBML document @@ -275,9 +252,88 @@ LIBSBMLNETWORK_EXTERN GraphicalObject* getGraphicalObject(SBMLDocument* document /// @param document a pointer to the SBMLDocument object. /// @param id the id of the model entity the GraphicalObject object associated with it is going to be returned. /// @param graphicalObjectIndexIndex the index number of the GraphicalObject object to return. -/// @return a pointer the nth GraphicalObject object associated with the entered model entity id. +/// @return a pointer the GraphicalObject object with the given index associated with the entered model entity id. LIBSBMLNETWORK_EXTERN GraphicalObject* getGraphicalObject(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex = 0); +LIBSBMLNETWORK_EXTERN int removeGraphicalObject(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex); + +LIBSBMLNETWORK_EXTERN int removeGraphicalObject(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex); + +/// @brief Predicates Returning @c true if the id of the GraphicalObject object with the given index in the Layout object with the given index in the ListOfLayouts of the SBML document +/// associated with the entered model entity id is set. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the model entity the GraphicalObject object associated with it is going to be checked. +/// @param graphicalObjectIndex the index number of the GraphicalObject object to check. +/// @return @c true if the id of the GraphicalObject object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex); + +/// @brief Returns the id of the GraphicalObject object with the given index in the Layout object with the given index in the ListOfLayouts of the SBML document +/// associated with the entered model entity id. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the model entity the GraphicalObject object associated with it is going to be returned. +/// @param graphicalObjectIndex the index number of the GraphicalObject object to return. +/// @return the id of the GraphicalObject object, or @c "" if the object is @c NULL or the id is not set. +LIBSBMLNETWORK_EXTERN const std::string getId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex); + +/// @brief Sets the id of the GraphicalObject object with the given index in the Layout object with the given index in the ListOfLayouts of the SBML document +/// associated with the entered model entity id. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the model entity the GraphicalObject object associated with it is going to be set. +/// @param graphicalObjectIndex the index number of the GraphicalObject object to set. +/// @param graphicalObjectId the id to set for the GraphicalObject object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex, const std::string& graphicalObjectId); + +/// @brief Predicates Returning @c true if the metaid of the GraphicalObject object with the given index in the Layout object with the given index in the ListOfLayouts of the SBML document +/// associated with the entered model entity id is set. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the model entity the GraphicalObject object associated with it is going to be checked. +/// @param graphicalObjectIndex the index number of the GraphicalObject object to check. +/// @return @c true if the metaid of the GraphicalObject object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetMetaId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex); + +/// @brief Returns the metaid of the GraphicalObject object with the given index in the Layout object with the given index in the ListOfLayouts of the SBML document +/// associated with the entered model entity id. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the model entity the GraphicalObject object associated with it is going to be returned. +/// @param graphicalObjectIndex the index number of the GraphicalObject object to return. +/// @return the metaid of the GraphicalObject object, or @c "" if the object is @c NULL or the metaid is not set. +LIBSBMLNETWORK_EXTERN const std::string getMetaId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex); + +/// @brief Sets the metaid of the GraphicalObject object with the given index in the Layout object with the given index in the ListOfLayouts of the SBML document +/// associated with the entered model entity id. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the model entity the GraphicalObject object associated with it is going to be set. +/// @param graphicalObjectIndex the index number of the GraphicalObject object to set. +/// @param graphicalObjectMetaId the metaid to set for the GraphicalObject object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setMetaId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex, const std::string& graphicalObjectMetaId); + +/// @brief Predicates Returning @c true if the name of the GraphicalObject object with the given index in the Layout object with the given index in the ListOfLayouts of the SBML document +/// associated with the entered model entity id is set. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the model entity the GraphicalObject object associated with it is going to be checked. +/// @param graphicalObjectIndex the index number of the GraphicalObject object to check. +/// @return @c true if the name of the GraphicalObject object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetName(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex); + +/// @brief Returns the name of the GraphicalObject object with the given index in the Layout object with the given index in the ListOfLayouts of the SBML document +/// associated with the entered model entity id. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the model entity the GraphicalObject object associated with it is going to be returned. +/// @param graphicalObjectIndex the index number of the GraphicalObject object to return. +/// @return the name of the GraphicalObject object, or @c "" if the object is @c NULL or the name is not set. +LIBSBMLNETWORK_EXTERN const std::string getName(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex); + +/// @brief Sets the name of the GraphicalObject object with the given index in the Layout object with the given index in the ListOfLayouts of the SBML document +/// associated with the entered model entity id. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the model entity the GraphicalObject object associated with it is going to be set. +/// @param graphicalObjectIndex the index number of the GraphicalObject object to set. +/// @param graphicalObjectName the name to set for the GraphicalObject object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setName(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex, const std::string& graphicalObjectName); + /// @brief Returns the number of CompartmentGlyphs of the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout to return. @@ -321,7 +377,7 @@ LIBSBMLNETWORK_EXTERN std::vector getCompartmentGlyphs(SBMLDo /// @param document a pointer to the SBMLDocument object. /// @param compartmentId the id of the compartment the CompartmentGlyph object associated with it is going to be returned. /// @param compartmentGlyphIndex the index number of the CompartmentGlyph object to return. -/// @return a pointer the nth CompartmentGlyph object associated with the entered compartment id. +/// @return a pointer the CompartmentGlyph object with the given index associated with the entered compartment id. LIBSBMLNETWORK_EXTERN CompartmentGlyph* getCompartmentGlyph(SBMLDocument* document, const std::string& compartmentId, unsigned int compartmentGlyphIndex = 0); /// @brief Returns the CompartmentGlyph object with the given index of the Layout object with the given index in the ListOfLayouts of the SBML document @@ -330,7 +386,7 @@ LIBSBMLNETWORK_EXTERN CompartmentGlyph* getCompartmentGlyph(SBMLDocument* docume /// @param layoutIndex the index number of the Layout to return. /// @param compartmentId the id of the compartment the CompartmentGlyph object associated with it is going to be returned. /// @param compartmentGlyphIndex the index number of the CompartmentGlyph object to return. -/// @return a pointer to the nth CompartmentGlyph object associated with the entered compartment id. +/// @return a pointer to the CompartmentGlyph object with the given index associated with the entered compartment id. LIBSBMLNETWORK_EXTERN CompartmentGlyph* getCompartmentGlyph(SBMLDocument* document, unsigned int layoutIndex, const std::string& compartmentId, unsigned int compartmentGlyphIndex = 0); /// @brief Returns the CompartmentGlyph object with the given index in the the Layout object with the given index in the ListOfLayouts of the SBML document. @@ -358,7 +414,7 @@ LIBSBMLNETWORK_EXTERN bool isCompartmentGlyph(SBMLDocument* document, unsigned i /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. /// @param graphicalObjectIndex the index of the GraphicalObject to return. /// @return the id of the compartment associated with the graphical object, or @c "" if the object does not have an associated compartment or is @c NULL -LIBSBMLNETWORK_EXTERN std::string getCompartmentId(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0); +LIBSBMLNETWORK_EXTERN std::string getGraphicalObjectCompartmentId(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0); /// Returns the id of the compartment associated with the GraphicalObject with the given index associated with the model entity with the given id of the Layout object with the given index in the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -366,13 +422,13 @@ LIBSBMLNETWORK_EXTERN std::string getCompartmentId(SBMLDocument* document, const /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. /// @param graphicalObjectIndex the index of the GraphicalObject to return. /// @return the id of the compartment associated with the graphical object, or @c "" if the object does not have an associated compartment or is @c NULL -LIBSBMLNETWORK_EXTERN std::string getCompartmentId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex = 0); +LIBSBMLNETWORK_EXTERN std::string getGraphicalObjectCompartmentId(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex = 0); /// Returns the id of the compartment associated with the graphical object. /// @param document a pointer to the SBMLDocument object. /// @param graphicalObject a pointer to the GraphicalObject object. /// @return the id of the compartment associated with the graphical object, or @c "" if the object does not have an associated compartment or is @c NULL -LIBSBMLNETWORK_EXTERN std::string getCompartmentId(SBMLDocument* document, GraphicalObject* graphicalObject); +LIBSBMLNETWORK_EXTERN std::string getGraphicalObjectCompartmentId(SBMLDocument* document, GraphicalObject* graphicalObject); /// Returns a pointer to the compartment associated with the GraphicalObject with the given index associated with the model entity with the given id of the first Layout object in the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -443,7 +499,7 @@ LIBSBMLNETWORK_EXTERN std::vector getSpeciesGlyphs(SBMLDocument* /// @param document a pointer to the SBMLDocument object. /// @param speciesId the id of the species the SpeciesGlyph object associated with it is going to be returned. /// @param speciesGlyphIndex the index number of the SpeciesGlyph object to return. -/// @return a pointer the nth SpeciesGlyph object associated with the entered species id. +/// @return a pointer the SpeciesGlyph object with the given index associated with the entered species id. LIBSBMLNETWORK_EXTERN SpeciesGlyph* getSpeciesGlyph(SBMLDocument* document, const std::string& speciesId, unsigned int speciesGlyphIndex = 0); /// @brief Returns the SpeciesGlyph object with the given index of the Layout object with the given index in the ListOfLayouts of the SBML document @@ -452,14 +508,14 @@ LIBSBMLNETWORK_EXTERN SpeciesGlyph* getSpeciesGlyph(SBMLDocument* document, cons /// @param layoutIndex the index number of the Layout to return. /// @param speciesId the id of the species the SpeciesGlyph object associated with it is going to be returned. /// @param speciesGlyphIndex the index number of the SpeciesGlyph object to return. -/// @return a pointer the nth SpeciesGlyph object associated with the entered species id. +/// @return a pointer the SpeciesGlyph object with the given index associated with the entered species id. LIBSBMLNETWORK_EXTERN SpeciesGlyph* getSpeciesGlyph(SBMLDocument* document, unsigned int layoutIndex, const std::string& speciesId, unsigned int speciesGlyphIndex = 0); /// @brief Returns the SpeciesGlyph object with the given index in the the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout to return. /// @param speciesGlyphIndex the index number of the SpeciesGlyph object to return. -/// @return a pointer to the nth SpeciesGlyph object with the given index in the ListOfSpeciesGlyphs of the Layout object. +/// @return a pointer to the SpeciesGlyph object with the given index with the given index in the ListOfSpeciesGlyphs of the Layout object. LIBSBMLNETWORK_EXTERN SpeciesGlyph* getSpeciesGlyph(SBMLDocument* document, unsigned int layoutIndex = 0, unsigned int speciesGlyphIndex = 0); /// @brief Returns the index of the SpeciesGlyph object associated in the list of SpeciesGlyph objects among the list of SpeciesGlyph objects associated with the given species id that is associated with the given reaction id with the given index in the first Layout object in the ListOfLayouts of the SBML document. @@ -542,7 +598,7 @@ LIBSBMLNETWORK_EXTERN std::vector getReactionGlyphs(SBMLDocument /// @param document a pointer to the SBMLDocument object. /// @param reactionId the id of the reaction the ReactionGlyph object associated with it is going to be returned. /// @param reactionGlyphIndex the index number of the ReactionGlyph object to return. -/// @return a pointer the nth ReactionGlyph object associated with the entered reaction id. +/// @return a pointer the ReactionGlyph object with the given index associated with the entered reaction id. LIBSBMLNETWORK_EXTERN ReactionGlyph* getReactionGlyph(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0); /// @brief Returns the ReactionGlyph object with the given index of the Layout object with the given index in the ListOfLayouts of the SBML document @@ -551,14 +607,14 @@ LIBSBMLNETWORK_EXTERN ReactionGlyph* getReactionGlyph(SBMLDocument* document, co /// @param layoutIndex the index number of the Layout to return. /// @param reactionId the id of the reaction the ReactionGlyph object associated with it is going to be returned. /// @param reactionGlyphIndex the index number of the ReactionGlyph object to return. -/// @return a pointer the nth ReactionGlyph object associated with the entered reaction id. +/// @return a pointer the ReactionGlyph object with the given index associated with the entered reaction id. LIBSBMLNETWORK_EXTERN ReactionGlyph* getReactionGlyph(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0); /// @brief Returns the ReactionGlyph object with the given index in the the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout to return. /// @param reactionGlyphIndex the index number of the ReactionGlyph object to return. -/// @return a pointer to the nth ReactionGlyph object with the given index in the ListOfReactionGlyphs of the Layout object. +/// @return a pointer to the ReactionGlyph object with the given index with the given index in the ListOfReactionGlyphs of the Layout object. LIBSBMLNETWORK_EXTERN ReactionGlyph* getReactionGlyph(SBMLDocument* document, unsigned int layoutIndex = 0, unsigned int reactionGlyphIndex = 0); /// @brief Predicate returning true if the abstract GraphicalObject with the given id in the first Layout object of the SBML document is of type ReactionGlyph. @@ -839,24 +895,24 @@ LIBSBMLNETWORK_EXTERN const int getNumSpeciesReferencesAssociatedWithSpecies(SBM /// or @c 0 if the object is @c NULL or has no associated SpeciesReference objects. LIBSBMLNETWORK_EXTERN const int getNumSpeciesReferencesAssociatedWithSpecies(SBMLDocument* document, unsigned int layoutIndex, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex = 0); -/// @brief Returns the index of the nth SpeciesReference object associated with the given species id in the ReactionGlyph object with the given index associated with the entered reaction id in the Layout object with the given index in the ListOfLayouts of the SBML document. +/// @brief Returns the index of the SpeciesReference object with the given index associated with the given species id in the ReactionGlyph object with the given index associated with the entered reaction id in the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param speciesId the id of the species the number of SpeciesReference objects of its ReactionGlyph object with the given index associated with it is going to be returned. /// @param reactionId the id of the reaction the number of SpeciesReference objects of its ReactionGlyph object with the given index associated with it is going to be returned. /// @param reactionGlyphIndex the index of the ReactionGlyph. /// @param n the index of the SpeciesReference object. -/// @return the index of the nth SpeciesReference object associated with the given species id in the ReactionGlyph object with the given index associated with the entered reaction id, +/// @return the index of the SpeciesReference object with the given index associated with the given species id in the ReactionGlyph object with the given index associated with the entered reaction id, /// or @c -1 if the object is @c NULL or has no associated SpeciesReference objects. LIBSBMLNETWORK_EXTERN const int getSpeciesReferenceIndexAssociatedWithSpecies(SBMLDocument* document, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int n = 0); -/// @brief Returns the index of the nth SpeciesReference object associated with the given species id in the ReactionGlyph object with the given index associated with the entered reaction id in the Layout object with the given index in the ListOfLayouts of the SBML document. +/// @brief Returns the index of the SpeciesReference object with the given index associated with the given species id in the ReactionGlyph object with the given index associated with the entered reaction id in the Layout object with the given index in the ListOfLayouts of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout to return. /// @param speciesId the id of the species the number of SpeciesReference objects of its ReactionGlyph object with the given index associated with it is going to be returned. /// @param reactionId the id of the reaction the number of SpeciesReference objects of its ReactionGlyph object with the given index associated with it is going to be returned. /// @param reactionGlyphIndex the index of the ReactionGlyph. /// @param n the index of the SpeciesReference object. -/// @return the index of the nth SpeciesReference object associated with the given species id in the ReactionGlyph object with the given index associated with the entered reaction id, +/// @return the index of the SpeciesReference object with the given index associated with the given species id in the ReactionGlyph object with the given index associated with the entered reaction id, /// or @c -1 if the object is @c NULL or has no associated SpeciesReference objects. LIBSBMLNETWORK_EXTERN const int getSpeciesReferenceIndexAssociatedWithSpecies(SBMLDocument* document, unsigned int layoutIndex, const std::string& speciesId, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int n = 0); @@ -949,9 +1005,8 @@ LIBSBMLNETWORK_EXTERN LineSegment* getSpeciesReferenceCurveSegment(SBMLDocument* /// @param reactionId the id of the reaction the SpeciesReference object of which to be returned. /// @param reactionGlyphIndex the index of the ReactionGlyph. /// @param speciesReferenceIndex the index of the SpeciesReference. -/// @return a pointer to the newly created LineSegment object, or @c NULL if -/// the SpeciesReference object does not exits or the object is @c NULL -LIBSBMLNETWORK_EXTERN LineSegment* createSpeciesReferenceLineCurveSegment(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addSpeciesReferenceLineCurveSegment(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0); /// @brief Creates a new LineSegment and adds it to the Curve object of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id /// of the Layout object with the given index in the ListOfLayouts of the SBML document. @@ -960,9 +1015,8 @@ LIBSBMLNETWORK_EXTERN LineSegment* createSpeciesReferenceLineCurveSegment(SBMLDo /// @param reactionId the id of the reaction the SpeciesReference object of which to be returned. /// @param reactionGlyphIndex the index of the ReactionGlyph. /// @param speciesReferenceIndex the index of the SpeciesReference. -/// @return a pointer to the newly created LineSegment object, or @c NULL if -/// the SpeciesReference object does not exits or the object is @c NULL -LIBSBMLNETWORK_EXTERN LineSegment* createSpeciesReferenceLineCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addSpeciesReferenceLineCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0); /// @brief Creates a new CubicBezier object and adds it to the Curve object of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id /// of the first Layout object in the ListOfLayouts of the SBML document. @@ -970,9 +1024,8 @@ LIBSBMLNETWORK_EXTERN LineSegment* createSpeciesReferenceLineCurveSegment(SBMLDo /// @param reactionId the id of the reaction the SpeciesReference object of which to be returned. /// @param reactionGlyphIndex the index of the ReactionGlyph. /// @param speciesReferenceIndex the index of the SpeciesReference. -/// @return a pointer to the newly created CubicBezier object, or @c NULL if -/// the SpeciesReference object does not exits or the object is @c NULL -LIBSBMLNETWORK_EXTERN CubicBezier* createSpeciesReferenceCubicBezierCurveSegment(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addSpeciesReferenceCubicBezierCurveSegment(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0); /// @brief Creates a new CubicBezier object and adds it to the Curve object of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id /// of the Layout object with the given index in the ListOfLayouts of the SBML document. @@ -981,9 +1034,8 @@ LIBSBMLNETWORK_EXTERN CubicBezier* createSpeciesReferenceCubicBezierCurveSegment /// @param reactionId the id of the reaction the SpeciesReference object of which to be returned. /// @param reactionGlyphIndex the index of the ReactionGlyph. /// @param speciesReferenceIndex the index of the SpeciesReference. -/// @return a pointer to the newly created CubicBezier object, or @c NULL if -/// the SpeciesReference object does not exits or the object is @c NULL -LIBSBMLNETWORK_EXTERN CubicBezier* createSpeciesReferenceCubicBezierCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addSpeciesReferenceCubicBezierCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0); /// @brief Removes the Curve object of the SpeciesReference object with the given index of the ReactionGlyph object with the given index associated with the entered reaction id /// of the first Layout object in the ListOfLayouts of the SBML document. @@ -1486,10 +1538,9 @@ LIBSBMLNETWORK_EXTERN bool isSetText(SBMLDocument* document, unsigned int layout /// @param id the id of the model entity the TextGlyph objects associated with it to be returned. /// @param graphicalObjectIndex the index of the GraphicalObject. /// @param textGlyphIndex the index of the TextGlyph to return. -/// @param useNameAsTextLabel a boolean value to indicate whether to return the name of the model entity as the text label. /// @return the "text" attribute of this TextGlyph object or @c empty string if either the "text" attribute is not set /// , TextGlyph does not exits or the object is @c NULL. -LIBSBMLNETWORK_EXTERN const std::string getText(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0, unsigned int textGlyphIndex = 0, bool useNameAsTextLabel = false); +LIBSBMLNETWORK_EXTERN const std::string getText(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0, unsigned int textGlyphIndex = 0); /// @brief Returns the "text" attribute of the TextGlyph object with the given index associated with the given id in /// the Layout object with the given index of the SBML document. @@ -1498,10 +1549,9 @@ LIBSBMLNETWORK_EXTERN const std::string getText(SBMLDocument* document, const st /// @param id the id of the model entity the TextGlyph objects associated with it to be returned. /// @param graphicalObjectIndex the index of the GraphicalObject. /// @param textGlyphIndex the index of the TextGlyph to return. -/// @param useNameAsTextLabel a boolean value to indicate whether to return the name of the model entity as the text label. /// @return the "text" attribute of this TextGlyph object or @c empty string if either the "text" attribute is not set /// , TextGlyph does not exits or the object is @c NULL. -LIBSBMLNETWORK_EXTERN const std::string getText(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex = 0, unsigned int textGlyphIndex = 0, bool useNameAsTextLabel = false); +LIBSBMLNETWORK_EXTERN const std::string getText(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex = 0, unsigned int textGlyphIndex = 0); /// @brief Sets the value of the "text" attribute of the first TextGlyph object associated with the given id in /// the first Layout object of the SBML document. @@ -1758,13 +1808,45 @@ LIBSBMLNETWORK_EXTERN bool isTextGlyph(SBMLDocument* document, const std::string /// @return @c true if this abstract GraphicalObject is of type TextGlyph, false otherwise LIBSBMLNETWORK_EXTERN bool isTextGlyph(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int textGlyphIndex = 0); +/// @brief Returns the number of additional GraphicalObject objects associated with the Layout object with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return the number of the additional GraphicalObject objects associated with the Layout object, or @c 0 if the object is @c NULL +LIBSBMLNETWORK_EXTERN const unsigned int getNumAdditionalGraphicalObjects(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Returns id of the additional GraphicalObject object with the given index associated with the first Layout object of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param additionalGraphicalObjectIndex the index of the additional GraphicalObject to return. +/// @return the id of the additional GraphicalObject object with the given index, or @c empty string if the object is @c NULL +LIBSBMLNETWORK_EXTERN GraphicalObject* getAdditionalGraphicalObject(SBMLDocument* document, unsigned int additionalGraphicalObjectIndex = 0); + +/// @brief Returns id of the additional GraphicalObject object with the given index associated with the Layout object with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @param additionalGraphicalObjectIndex the index of the additional GraphicalObject to return. +/// @return the id of the additional GraphicalObject object with the given index, or @c empty string if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getAdditionalGraphicalObjectId(SBMLDocument* document, unsigned int layoutIndex = 0, unsigned int additionalGraphicalObjectIndex = 0); + +/// @brief Adds a new GraphicalObject object to the first Layout object of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the additional GraphicalObject object to be added. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addAdditionalGraphicalObject(SBMLDocument* document, unsigned int layoutIndex, const std::string& id); + +/// @brief Removes the additional GraphicalObject object with the given index associated with the Layout object with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @param additionalGraphicalObjectIndex the index of the additional GraphicalObject to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int removeAdditionalGraphicalObject(SBMLDocument* document, unsigned int layoutIndex, unsigned int additionalGraphicalObjectIndex = 0); + /// Returns the BoundingBox object of the GraphicalObject with the given index associated with the model entity with the given id of the first Layout object in the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout to return. /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. /// @return a pointer to the BoundingBox object of the GraphicalObject object associated with the entered id, or @c NULL if /// the GraphicalObject object does not exits or the object is @c NULL - LIBSBMLNETWORK_EXTERN BoundingBox* getBoundingBox(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0); +LIBSBMLNETWORK_EXTERN BoundingBox* getBoundingBox(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0); /// Returns the BoundingBox object of the GraphicalObject with the given index associated with the model entity with the given id of the Layout object with the given index in the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -2550,8 +2632,8 @@ LIBSBMLNETWORK_EXTERN LineSegment* getCurveSegment(SBMLDocument* document, unsig /// @param document a pointer to the SBMLDocument object. /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. /// @param graphicalObjectIndex the index of the GraphicalObject to return. -/// @return the created @c LineSegment, or NULL if the line segment could not be created. -LIBSBMLNETWORK_EXTERN LineSegment* createLineCurveSegment(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addLineCurveSegment(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0); /// @brief Creates a new LineSegment and adds it to the end of the list of the curve of the GraphicalObject /// with the given index associated with the model entity with the given id of the Layout object with the given index in the SBML document. @@ -2559,16 +2641,16 @@ LIBSBMLNETWORK_EXTERN LineSegment* createLineCurveSegment(SBMLDocument* document /// @param layoutIndex the index number of the Layout to return. /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. /// @param graphicalObjectIndex the index of the GraphicalObject to return. -/// @return the created @c LineSegment, or NULL if the line segment could not be created. -LIBSBMLNETWORK_EXTERN LineSegment* createLineCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex = 0); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addLineCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex = 0); /// @brief Creates a new CubicBezier and adds it to the end of the list of the curve of the GraphicalObject /// with the given index associated with the model entity with the given id of the first Layout object in the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. /// @param graphicalObjectIndex the index of the GraphicalObject to return. -/// @return the created @c CubicBezier, or NULL if the line segment could not be created. -LIBSBMLNETWORK_EXTERN CubicBezier* createCubicBezierCurveSegment(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addCubicBezierCurveSegment(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0); /// @brief Creates a new CubicBezier and adds it to the end of the list of the curve of the GraphicalObject /// with the given index associated with the model entity with the given id of the Layout object with the given index in the SBML document. @@ -2576,8 +2658,8 @@ LIBSBMLNETWORK_EXTERN CubicBezier* createCubicBezierCurveSegment(SBMLDocument* d /// @param layoutIndex the index number of the Layout to return. /// @param id the id of the model entity the GraphicalObject object associated with it to be returned. /// @param graphicalObjectIndex the index of the GraphicalObject to return. -/// @return the created @c CubicBezier, or NULL if the line segment could not be created. -LIBSBMLNETWORK_EXTERN CubicBezier* createCubicBezierCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex = 0); +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addCubicBezierCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex = 0); /// @brief Removes and deletes the curve segment with the given index from the list of the Curve of the GraphicalObject /// with the given index associated with the model entity with the given id of the first Layout object in the SBML document. @@ -2586,7 +2668,7 @@ LIBSBMLNETWORK_EXTERN CubicBezier* createCubicBezierCurveSegment(SBMLDocument* d /// @param graphicalObjectIndex the index of the GraphicalObject to return. /// @param curveSegmentIndex an unsigned int representing the index of the curve segment to remove. /// @return integer value indicating success/failure of the function. -LIBSBMLNETWORK_EXTERN int removeCurveSegment(SBMLDocument* document, const std::string& id, unsigned int curveSegmentIndex = 0); +LIBSBMLNETWORK_EXTERN int removeCurveSegment(SBMLDocument* document, const std::string& id, unsigned int graphicalObjectIndex = 0, unsigned int curveSegmentIndex = 0); /// @brief Removes and deletes the curve segment with the given index from the list of the Curve of the GraphicalObject /// with the given index associated with the model entity with the given id of the Layout object with the given index in the SBML document. @@ -2596,7 +2678,7 @@ LIBSBMLNETWORK_EXTERN int removeCurveSegment(SBMLDocument* document, const std:: /// @param graphicalObjectIndex the index of the GraphicalObject to return. /// @param curveSegmentIndex an unsigned int representing the index of the curve segment to remove. /// @return integer value indicating success/failure of the function. -LIBSBMLNETWORK_EXTERN int removeCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int curveSegmentIndex = 0); +LIBSBMLNETWORK_EXTERN int removeCurveSegment(SBMLDocument* document, unsigned int layoutIndex, const std::string& id, unsigned int graphicalObjectIndex = 0, unsigned int curveSegmentIndex = 0); /// @brief Predicate returning true if the curve segment with the given index of the Curve of the GraphicalObject /// with the given index associated with the model entity with the given id of the first Layout object in the SBML document is of type CubicBezier. diff --git a/src/libsbmlnetwork_sbmldocument_render.cpp b/src/libsbmlnetwork_sbmldocument_render.cpp index 031f6a4..15ef6dc 100644 --- a/src/libsbmlnetwork_sbmldocument_render.cpp +++ b/src/libsbmlnetwork_sbmldocument_render.cpp @@ -8,6 +8,7 @@ #include "features/styles/libsbmlnetwork_styles.h" #include "features/error_log/libsbmlnetwork_error_log.h" #include "features/defaults/libsbmlnetwork_defaults_render.h" +#include "features/hide_elements/libsbmlnetwork_hide_elements.h" namespace LIBSBMLNETWORK_CPP_NAMESPACE { @@ -170,7 +171,7 @@ const unsigned int getNumGlobalColorDefinitions(SBMLDocument* document, unsigned return getNumColorDefinitions(getGlobalRenderInformation(document, renderIndex)); } -const std::string getNthGlobalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex, unsigned int colorIndex) { +const std::string getGlobalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex, unsigned int colorIndex) { ColorDefinition* colorDefinition = getColorDefinition(getGlobalRenderInformation(document, renderIndex), colorIndex); if (colorDefinition) return colorDefinition->getId(); @@ -182,7 +183,7 @@ const unsigned int getNumLocalColorDefinitions(SBMLDocument* document, unsigned return getNumColorDefinitions(getLocalRenderInformation(document, 0, renderIndex)); } -const std::string getNthLocalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex, unsigned int colorIndex) { +const std::string getLocalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex, unsigned int colorIndex) { ColorDefinition* colorDefinition = getColorDefinition(getLocalRenderInformation(document, 0, renderIndex), colorIndex); if (colorDefinition) return colorDefinition->getId(); @@ -249,7 +250,7 @@ const unsigned int getNumLocalGradientDefinitions(SBMLDocument* document, unsign return getNumGradientDefinitions(getLocalRenderInformation(document, 0, renderIndex)); } -const std::string getNthGlobalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex, unsigned int gradientIndex) { +const std::string getGlobalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex, unsigned int gradientIndex) { GradientBase* gradientDefinition = getGradientDefinition(getGlobalRenderInformation(document, renderIndex), gradientIndex); if (gradientDefinition) return gradientDefinition->getId(); @@ -257,7 +258,7 @@ const std::string getNthGlobalGradientDefinitionId(SBMLDocument* document, unsig return ""; } -const std::string getNthLocalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex, unsigned int gradientIndex) { +const std::string getLocalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex, unsigned int gradientIndex) { GradientBase* gradientDefinition = getGradientDefinition(getLocalRenderInformation(document, 0, renderIndex), gradientIndex); if (gradientDefinition) return gradientDefinition->getId(); @@ -810,7 +811,7 @@ const unsigned int getNumLocalLineEndings(SBMLDocument* document, unsigned int r return getNumLineEndings(getLocalRenderInformation(document, 0, renderIndex)); } -const std::string getNthGlobalLineEndingId(SBMLDocument* document, unsigned int renderIndex, unsigned int lineEndingIndex) { +const std::string getGlobalLineEndingId(SBMLDocument* document, unsigned int renderIndex, unsigned int lineEndingIndex) { LineEnding* lineEnding = getLineEnding(getGlobalRenderInformation(document, renderIndex), lineEndingIndex); if (lineEnding) return lineEnding->getId(); @@ -818,7 +819,7 @@ const std::string getNthGlobalLineEndingId(SBMLDocument* document, unsigned int return ""; } -const std::string getNthLocalLineEndingId(SBMLDocument* document, unsigned int renderIndex, unsigned int lineEndingIndex) { +const std::string getLocalLineEndingId(SBMLDocument* document, unsigned int renderIndex, unsigned int lineEndingIndex) { LineEnding* lineEnding = getLineEnding(getLocalRenderInformation(document, 0, renderIndex), lineEndingIndex); if (lineEnding) return lineEnding->getId(); @@ -869,7 +870,10 @@ LineEnding* getSpeciesReferenceLineEnding(SBMLDocument* document, const std::str } LineEnding* getSpeciesReferenceLineEnding(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex) { - SpeciesReferenceGlyph* speciesReferenceGlyph = getSpeciesReference(document, reactionId, reactionGlyphIndex, speciesReferenceIndex); + return getSpeciesReferenceLineEnding(document, getSpeciesReference(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)); +} + +LineEnding* getSpeciesReferenceLineEnding(SBMLDocument* document, SpeciesReferenceGlyph* speciesReferenceGlyph) { LineEnding* lineEnding = getLineEnding(document, getStartHead(document, speciesReferenceGlyph)); if (!lineEnding) lineEnding = getLineEnding(document, getEndHead(document, speciesReferenceGlyph)); @@ -882,8 +886,11 @@ LineEnding* getSpeciesReferenceLocalLineEnding(SBMLDocument* document, const std } LineEnding* getSpeciesReferenceLocalLineEnding(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex) { - LineEnding* lineEnding = getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex); - SpeciesReferenceGlyph* speciesReferenceGlyph = getSpeciesReference(document, reactionId, reactionGlyphIndex, speciesReferenceIndex); + return getSpeciesReferenceLocalLineEnding(document, getSpeciesReference(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)); +} + +LineEnding* getSpeciesReferenceLocalLineEnding(SBMLDocument* document, SpeciesReferenceGlyph* speciesReferenceGlyph) { + LineEnding* lineEnding = getSpeciesReferenceLineEnding(document, speciesReferenceGlyph); if(!isLocal(document, lineEnding, speciesReferenceGlyph)) lineEnding = createLocalLineEnding(document, lineEnding, speciesReferenceGlyph); @@ -1563,6 +1570,124 @@ unsigned int getNumSpeciesReferenceLineEndingGeometricShapes(SBMLDocument* docum return getNumGeometricShapes(getRenderGroup(getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex))); } +int addLineEndingGeometricShape(SBMLDocument* document, const std::string& id, const std::string& shape) { + return addGeometricShape(getLineEndingRenderGroup(document, id), shape); +} + +int addLineEndingGeometricShape(SBMLDocument* document, unsigned int renderIndex, const std::string& id, const std::string& shape) { + return addGeometricShape(getLineEndingRenderGroup(document, renderIndex, id), shape); +} + +int addSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, const std::string& shape) { + return addGeometricShape(getRenderGroup(getSpeciesReferenceLocalLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)), shape); +} + +int addSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, const std::string& shape) { + return addGeometricShape(getRenderGroup(getSpeciesReferenceLocalLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), shape); +} + +int removeLineEndingGeometricShape(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { + return removeGeometricShape(getLineEndingRenderGroup(document, id), geometricShapeIndex); +} + +int removeLineEndingGeometricShape(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex) { + return removeGeometricShape(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex); +} + +int removeSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return removeGeometricShape(getRenderGroup(getSpeciesReferenceLocalLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +int removeSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return removeGeometricShape(getRenderGroup(getSpeciesReferenceLocalLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +std::string getLineEndingGeometricShapeType(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { + return getGeometricShapeType(getLineEndingRenderGroup(document, id), geometricShapeIndex); +} + +std::string getLineEndingGeometricShapeType(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex) { + return getGeometricShapeType(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex); +} + +std::string getSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return getSpeciesReferenceLineEndingGeometricShapeType(document, 0, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex); +} + +std::string getSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return getGeometricShapeType(getRenderGroup(getSpeciesReferenceLocalLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +int setLineEndingGeometricShapeType(SBMLDocument* document, const std::string& id, const std::string& shape) { + if (!setGeometricShapeType(getLineEndingRenderGroup(document, id), shape)) { + defaults_addColorsOfDefaultGeometricShapes(getGlobalRenderInformation(document)); + return 0; + } + + return -1; +} + +int setLineEndingGeometricShapeType(SBMLDocument* document, unsigned int renderIndex, const std::string& id, const std::string& shape) { + if (!setGeometricShapeType(getLineEndingRenderGroup(document, renderIndex, id), shape)) { + defaults_addColorsOfDefaultGeometricShapes(getGlobalRenderInformation(document, renderIndex)); + return 0; + } + + return -1; +} + +int setSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, const std::string& shape) { + LineEnding* lineEnding = getSpeciesReferenceLocalLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex); + if (!setGeometricShapeType(getRenderGroup(lineEnding), shape)) { + defaults_addColorsOfDefaultGeometricShapes(document, lineEnding); + return 0; + } + + return -1; +} + +int setSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, const std::string& shape) { + LineEnding* lineEnding = getSpeciesReferenceLocalLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex); + if (!setGeometricShapeType(getRenderGroup(lineEnding), shape)) { + defaults_addColorsOfDefaultGeometricShapes(document, lineEnding); + return 0; + } + + return -1; +} + +const std::string getLineEndingGeometricShapeId(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { + return getGeometricShapeId(getLineEndingRenderGroup(document, id), geometricShapeIndex); +} + +const std::string getLineEndingGeometricShapeId(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex) { + return getGeometricShapeId(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex); +} + +const std::string getSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return getSpeciesReferenceLineEndingGeometricShapeId(document, 0, reactionId, reactionGlyphIndex, speciesReferenceIndex, geometricShapeIndex); +} + +const std::string getSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return getGeometricShapeId(getRenderGroup(getSpeciesReferenceLocalLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +int setLineEndingGeometricShapeId(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex, const std::string& shapeId) { + return setGeometricShapeId(getLineEndingRenderGroup(document, id), geometricShapeIndex, shapeId); +} + +int setLineEndingGeometricShapeId(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex, const std::string& shapeId) { + return setGeometricShapeId(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex, shapeId); +} + +int setSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& shapeId) { + return setGeometricShapeId(getRenderGroup(getSpeciesReferenceLocalLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex, shapeId); +} + +int setSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& shapeId) { + return setGeometricShapeId(getRenderGroup(getSpeciesReferenceLocalLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex, shapeId); +} + bool isLineEndingRectangle(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { return isRectangle(getGeometricShape(getLineEndingRenderGroup(document, id), geometricShapeIndex)); } @@ -1659,6 +1784,186 @@ bool isSpeciesReferenceLineEndingText(SBMLDocument* document, unsigned int layou return isText(getRenderGroup(getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); } +bool isSetLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { + return isSetGeometricShapeStrokeColor(getLineEndingRenderGroup(document, id), geometricShapeIndex); +} + +bool isSetLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex) { + return isSetGeometricShapeStrokeColor(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex); +} + +bool isSetSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return isSetGeometricShapeStrokeColor(getRenderGroup(getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +bool isSetSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return isSetGeometricShapeStrokeColor(getRenderGroup(getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +const std::string getLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { + return getGeometricShapeStrokeColor(getLineEndingRenderGroup(document, id), geometricShapeIndex); +} + +const std::string getLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex) { + return getGeometricShapeStrokeColor(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex); +} + +const std::string getSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return getGeometricShapeStrokeColor(getRenderGroup(getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +const std::string getSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return getGeometricShapeStrokeColor(getRenderGroup(getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +int setLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex, const std::string& strokeColor) { + LineEnding* lineEnding = getLineEnding(document, id); + std::string colorId = addColor(document, lineEnding, strokeColor); + return setGeometricShapeStrokeColor(getRenderGroup(lineEnding), geometricShapeIndex, colorId, getValue(document, colorId)); +} + +int setLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex, const std::string& strokeColor) { + LineEnding* lineEnding = getLineEnding(document, renderIndex, id); + std::string colorId = addColor(document, lineEnding, strokeColor); + return setGeometricShapeStrokeColor(getRenderGroup(lineEnding), geometricShapeIndex, colorId, getValue(document, colorId)); +} + +int setSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& strokeColor) { + LineEnding* lineEnding = getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex); + std::string colorId = addColor(document, lineEnding, strokeColor); + return setGeometricShapeStrokeColor(getRenderGroup(lineEnding), geometricShapeIndex, colorId, getValue(document, colorId)); +} + +int setSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& strokeColor) { + LineEnding* lineEnding = getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex); + std::string colorId = addColor(document, lineEnding, strokeColor); + return setGeometricShapeStrokeColor(getRenderGroup(lineEnding), geometricShapeIndex, colorId, getValue(document, colorId)); +} + +bool isSetLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { + return isSetGeometricShapeStrokeWidth(getLineEndingRenderGroup(document, id), geometricShapeIndex); +} + +bool isSetLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex) { + return isSetGeometricShapeStrokeWidth(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex); +} + +bool isSetSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return isSetGeometricShapeStrokeWidth(getRenderGroup(getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +bool isSetSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return isSetGeometricShapeStrokeWidth(getRenderGroup(getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +const double getLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { + return getGeometricShapeStrokeWidth(getLineEndingRenderGroup(document, id), geometricShapeIndex); +} + +const double getLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex) { + return getGeometricShapeStrokeWidth(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex); +} + +const double getSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return getGeometricShapeStrokeWidth(getRenderGroup(getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +const double getSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return getGeometricShapeStrokeWidth(getRenderGroup(getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +int setLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex, double strokeWidth) { + return setGeometricShapeStrokeWidth(getLineEndingRenderGroup(document, id), geometricShapeIndex, strokeWidth); +} + +int setLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex, double strokeWidth) { + return setGeometricShapeStrokeWidth(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex, strokeWidth); +} + +int setSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, double strokeWidth) { + return setGeometricShapeStrokeWidth(getRenderGroup(getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex, strokeWidth); +} + +int setSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, double strokeWidth) { + return setGeometricShapeStrokeWidth(getRenderGroup(getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex, strokeWidth); +} + +bool isSetLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { + return isSetGeometricShapeFillColor(getLineEndingRenderGroup(document, id), geometricShapeIndex); +} + +bool isSetLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex) { + return isSetGeometricShapeFillColor(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex); +} + +bool isSetSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return isSetGeometricShapeFillColor(getRenderGroup(getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +bool isSetSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return isSetGeometricShapeFillColor(getRenderGroup(getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +const std::string getLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { + return getGeometricShapeFillColor(getLineEndingRenderGroup(document, id), geometricShapeIndex); +} + +const std::string getLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex) { + return getGeometricShapeFillColor(getLineEndingRenderGroup(document, renderIndex, id), geometricShapeIndex); +} + +const std::string getSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return getGeometricShapeFillColor(getRenderGroup(getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +const std::string getSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex) { + return getGeometricShapeFillColor(getRenderGroup(getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex)), geometricShapeIndex); +} + +int setLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex, const std::string& fillColor) { + LineEnding* lineEnding = getLineEnding(document, id); + std::string colorId = addColor(document, lineEnding, fillColor); + return setGeometricShapeFillColor(getRenderGroup(lineEnding), geometricShapeIndex, colorId, getValue(document, colorId)); +} + +int setLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex, const std::string& fillColor) { + LineEnding* lineEnding = getLineEnding(document, renderIndex, id); + std::string colorId = addColor(document, lineEnding, fillColor); + return setGeometricShapeFillColor(getRenderGroup(lineEnding), geometricShapeIndex, colorId, getValue(document, colorId)); +} + +int setLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex, const std::string& gradientType, std::vector> stopsVector) { + LineEnding* lineEnding = getLineEnding(document, id); + return setGeometricShapeFillColorAsGradient(getRenderGroup(lineEnding), geometricShapeIndex, addGradient(document, lineEnding, gradientType, stopsVector)); +} + +int setLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex, const std::string& gradientType, std::vector> stopsVector) { + LineEnding* lineEnding = getLineEnding(document, renderIndex, id); + return setGeometricShapeFillColorAsGradient(getRenderGroup(lineEnding), geometricShapeIndex, addGradient(document, lineEnding, gradientType, stopsVector)); +} + +int setSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& fillColor) { + LineEnding* lineEnding = getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex); + std::string colorId = addColor(document, lineEnding, fillColor); + return setFillColor(getGeometricShape(getRenderGroup(lineEnding), geometricShapeIndex), colorId, getValue(document, colorId)); +} + +int setSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& fillColor) { + LineEnding* lineEnding = getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex); + std::string colorId = addColor(document, lineEnding, fillColor); + return setFillColor(getGeometricShape(getRenderGroup(lineEnding), geometricShapeIndex), colorId, getValue(document, colorId)); +} + +int setSpeciesReferenceLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& gradientType, std::vector> stopsVector) { + LineEnding* lineEnding = getSpeciesReferenceLineEnding(document, reactionId, reactionGlyphIndex, speciesReferenceIndex); + return setFillColorAsGradient(getGeometricShape(getRenderGroup(lineEnding), geometricShapeIndex), addGradient(document, lineEnding, gradientType, stopsVector)); +} + +int setSpeciesReferenceLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& gradientType, std::vector> stopsVector) { + LineEnding* lineEnding = getSpeciesReferenceLineEnding(document, layoutIndex, reactionId, reactionGlyphIndex, speciesReferenceIndex); + return setFillColorAsGradient(getGeometricShape(getRenderGroup(lineEnding), geometricShapeIndex), addGradient(document, lineEnding, gradientType, stopsVector)); +} + bool isSetLineEndingGeometricShapeX(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex) { return isSetGeometricShapeX(getLineEndingRenderGroup(document, id), geometricShapeIndex); } @@ -10823,4 +11128,60 @@ bool whetherDisplayReactionTextLabel(const std::string& styleName) { return false; } +int makeVisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeVisible(document, layoutIndex); +} + +int makeInvisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeInvisible(document, layoutIndex); +} + +int makeCompartmentVisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeCompartmentVisible(document, layoutIndex); +} + +int makeCompartmentInvisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeCompartmentInvisible(document, layoutIndex); +} + +int makeSpeciesVisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeSpeciesVisible(document, layoutIndex); +} + +int makeSpeciesInvisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeSpeciesInvisible(document, layoutIndex); +} + +int makeReactionVisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeReactionVisible(document, layoutIndex); +} + +int makeReactionInvisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeReactionInvisible(document, layoutIndex); +} + +int makeSpeciesReferenceVisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeSpeciesReferenceVisible(document, layoutIndex); +} + +int makeSpeciesReferenceInvisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeSpeciesReferenceInvisible(document, layoutIndex); +} + +int makeLineEndingVisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeLineEndingVisible(document, layoutIndex); +} + +int makeLineEndingInvisible(SBMLDocument* document, unsigned int layoutIndex) { + return hide_elements_makeLineEndingInvisible(document, layoutIndex); +} + +int makeVisible(SBMLDocument* document, GraphicalObject* graphicalObject, const bool& applyToConnectedElements) { + return hide_elements_makeVisible(document, graphicalObject, applyToConnectedElements); +} + +int makeInvisible(SBMLDocument* document, GraphicalObject* graphicalObject, const bool& applyToConnectedElements) { + return hide_elements_makeInvisible(document, graphicalObject, applyToConnectedElements); +} + } diff --git a/src/libsbmlnetwork_sbmldocument_render.h b/src/libsbmlnetwork_sbmldocument_render.h index dad1cfc..c354017 100644 --- a/src/libsbmlnetwork_sbmldocument_render.h +++ b/src/libsbmlnetwork_sbmldocument_render.h @@ -25,7 +25,7 @@ LIBSBMLNETWORK_EXTERN const unsigned int getNumGlobalRenderInformation(SBMLDocum /// @brief Returns a pointer to the GlobalRenderInformation with the given index in the ListOfGlobalRenderInformation of the SBML document. /// @param renderIndex the index number of the GlobalRenderInformation to return. -/// @return the @c the nth GlobalRenderInformation in the ListOfGlobalRenderInformation of the SBML document or NULL if +/// @return the @c the GlobalRenderInformation with the given index in the ListOfGlobalRenderInformation of the SBML document or NULL if /// no such GlobalRenderInformation exists or the document is @c NULL. LIBSBMLNETWORK_EXTERN GlobalRenderInformation* getGlobalRenderInformation(SBMLDocument* document, unsigned int renderIndex = 0); @@ -166,12 +166,12 @@ LIBSBMLNETWORK_EXTERN int setBackgroundColor(SBMLDocument* document, unsigned in /// @return the number of ColorDefinitions of this GlobalRenderInformation object, or @c 0 if the object is @c NULL LIBSBMLNETWORK_EXTERN const unsigned int getNumGlobalColorDefinitions(SBMLDocument* document, unsigned int renderIndex = 0); -/// @brief Returns the id of the nth ColorDefinition object of the GlobalRenderInformation object with the given index of the SBML document. +/// @brief Returns the id of the ColorDefinition object with the given index of the GlobalRenderInformation object with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param renderIndex the index number of the GlobalRenderInformation object. /// @param colorIndex the of the ColorDefinition. -/// @return the id of the nth ColorDefinition object in the ListOfColorDefinitions within this GlobalRenderInformation, or @c "" if the object is @c NULL -LIBSBMLNETWORK_EXTERN const std::string getNthGlobalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int colorIndex = 0); +/// @return the id of the ColorDefinition object with the given index in the ListOfColorDefinitions within this GlobalRenderInformation, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getGlobalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int colorIndex = 0); /// @brief Returns the number of ColorDefinitions of the LocalRenderInformation object with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -179,12 +179,12 @@ LIBSBMLNETWORK_EXTERN const std::string getNthGlobalColorDefinitionId(SBMLDocume /// @return the number of ColorDefinitions of this LocalRenderInformation object, or @c 0 if the object is @c NULL LIBSBMLNETWORK_EXTERN const unsigned int getNumLocalColorDefinitions(SBMLDocument* document, unsigned int renderIndex = 0); -/// @brief Returns the id of the nth ColorDefinition object of the LocalRenderInformation object with the given index of the SBML document. +/// @brief Returns the id of the ColorDefinition object with the given index of the LocalRenderInformation object with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param renderIndex the index number of the LocalRenderInformation object. /// @param colorIndex the of the ColorDefinition. -/// @return the id of the nth ColorDefinition object in the ListOfColorDefinitions within this LocalRenderInformation, or @c "" if the object is @c NULL -LIBSBMLNETWORK_EXTERN const std::string getNthLocalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int colorIndex = 0); +/// @return the id of the ColorDefinition object with the given index in the ListOfColorDefinitions within this LocalRenderInformation, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getLocalColorDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int colorIndex = 0); /// @brief Returns a ColorDefinition from all RenderInformationBase objects of the SBML document based on its identifier. /// @param document a pointer to the SBMLDocument object. @@ -262,19 +262,19 @@ LIBSBMLNETWORK_EXTERN const unsigned int getNumGlobalGradientDefinitions(SBMLDoc /// @return the number of GradientDefinitions of this LocalRenderInformation object, or @c 0 if the object is @c NULL LIBSBMLNETWORK_EXTERN const unsigned int getNumLocalGradientDefinitions(SBMLDocument* document, unsigned int renderIndex = 0); -/// @brief Returns the id of the nth GradientDefinition object of the GlobalRenderInformation object with the given index of the SBML document. +/// @brief Returns the id of the GradientDefinition object with the given index of the GlobalRenderInformation object with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param renderIndex the index number of the GlobalRenderInformation object. /// @param gradientIndex the of the GlobalRenderInformation. -/// @return the id of the nth GradientDefinition object in the ListOfGradientDefinitions within this GlobalRenderInformation, or @c "" if the object is @c NULL -LIBSBMLNETWORK_EXTERN const std::string getNthGlobalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int gradientIndex = 0); +/// @return the id of the GradientDefinition object with the given index in the ListOfGradientDefinitions within this GlobalRenderInformation, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getGlobalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int gradientIndex = 0); -/// @breif Returns the id of the nth GradientDefinition object of the LocalRenderInformation object with the given index of the SBML document. +/// @breif Returns the id of the GradientDefinition object with the given index of the LocalRenderInformation object with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param renderIndex the index number of the LocalRenderInformation object. /// @param gradientIndex the of the LocalRenderInformation. -/// @return the id of the nth GradientDefinition object in the ListOfGradientDefinitions within this LocalRenderInformation, or @c "" if the object is @c NULL -LIBSBMLNETWORK_EXTERN const std::string getNthLocalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int gradientIndex = 0); +/// @return the id of the GradientDefinition object with the given index in the ListOfGradientDefinitions within this LocalRenderInformation, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getLocalGradientDefinitionId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int gradientIndex = 0); /// @brief Returns a GradientBase from all the RenderInformationBase objects of the SBML document based on its identifier. /// @param document a pointer to the SBMLDocument object. @@ -507,7 +507,7 @@ LIBSBMLNETWORK_EXTERN int setOffsetAsDouble(SBMLDocument* document, unsigned int /// @brief Predicates returning @c true if the "stop-color" attribute of the GradientStop with the given index of the GradientBase in all RenderInformationBase objects of SBML document with the given identifier is set. /// @param document a pointer to the SBMLDocument object. /// @param sid a string representing the identifier of the GradientBase to retrieve. -/// @return @c true if the "stop-color" attribute of nth GradientStop of this GradientBase object is set, @c false if either the "stop-color" +/// @return @c true if the "stop-color" attribute of GradientStop with the given index of this GradientBase object is set, @c false if either the "stop-color" /// attribute is not set or the object is @c NULL . LIBSBMLNETWORK_EXTERN bool isSetStopColor(SBMLDocument* document, const std::string& sid, unsigned int gradientStopIndex = 0); @@ -515,7 +515,7 @@ LIBSBMLNETWORK_EXTERN bool isSetStopColor(SBMLDocument* document, const std::str /// @param document a pointer to the SBMLDocument object. /// @param renderIndex the index number of the RenderInformationBase object. /// @param sid a string representing the identifier of the GradientBase to retrieve. -/// @return @c true if the "stop-color" attribute of nth GradientStop of this GradientBase object is set, @c false if either the "stop-color" +/// @return @c true if the "stop-color" attribute of GradientStop with the given index of this GradientBase object is set, @c false if either the "stop-color" /// attribute is not set or the object is @c NULL . LIBSBMLNETWORK_EXTERN bool isSetStopColor(SBMLDocument* document, unsigned int renderIndex, const std::string& sid, unsigned int gradientStopIndex = 0); @@ -1215,19 +1215,19 @@ LIBSBMLNETWORK_EXTERN const unsigned int getNumGlobalLineEndings(SBMLDocument* d /// @return the number of LineEndings of this LocalRenderInformation object, or @c 0 if the object is @c NULL LIBSBMLNETWORK_EXTERN const unsigned int getNumLocalLineEndings(SBMLDocument* document, unsigned int renderIndex = 0); -/// @brief Returns the id of the nth LineEnding of the GlobalRenderInformation object with the given index of the SBML document. +/// @brief Returns the id of the LineEnding with the given index of the GlobalRenderInformation object with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param renderIndex the index number of the GlobalRenderInformation object. /// @param lineEndingIndex the index number of the LineEnding to return. -/// @return the id of the nth LineEnding of this GlobalRenderInformation object, or @c NULL if the object is @c NULL -LIBSBMLNETWORK_EXTERN const std::string getNthGlobalLineEndingId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int lineEndingIndex = 0); +/// @return the id of the LineEnding with the given index of this GlobalRenderInformation object, or @c NULL if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getGlobalLineEndingId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int lineEndingIndex = 0); -/// @brief Returns the id of the nth LineEnding of the LocalRenderInformation object with the given index of the SBML document. +/// @brief Returns the id of the LineEnding with the given index of the LocalRenderInformation object with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param renderIndex the index number of the LocalRenderInformation object. /// @param lineEndingIndex the index number of the LineEnding to return. -/// @return the id of the nth LineEnding of this LocalRenderInformation object, or @c NULL if the object is @c NULL -LIBSBMLNETWORK_EXTERN const std::string getNthLocalLineEndingId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int lineEndingIndex = 0); +/// @return the id of the LineEnding with the given index of this LocalRenderInformation object, or @c NULL if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getLocalLineEndingId(SBMLDocument* document, unsigned int renderIndex = 0, unsigned int lineEndingIndex = 0); /// @brief Returns a LineEnding from all the RenderInformationBase objects of the SBML document based on its identifier. /// @param sid a string representing the identifier of the LineEnding to retrieve. @@ -1264,6 +1264,8 @@ LIBSBMLNETWORK_EXTERN LineEnding* createLocalLineEnding(SBMLDocument* document, /// @return the LineEnding associated with the SpeciesReferenceGlyph with the given index, or @c NULL if the object is @c NULL LIBSBMLNETWORK_EXTERN LineEnding* getSpeciesReferenceLineEnding(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); +LineEnding* getSpeciesReferenceLineEnding(SBMLDocument* document, SpeciesReferenceGlyph* speciesReferenceGlyph); + /// @brief Returns the local LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. Creates a new LineEnding from the global LineEnding if the local LineEnding does not exist. /// @param document a pointer to the SBMLDocument object. /// @reactionId a string representing the identifier of the Reaction object. @@ -1281,6 +1283,8 @@ LIBSBMLNETWORK_EXTERN LineEnding* getSpeciesReferenceLocalLineEnding(SBMLDocumen /// @return the LineEnding associated with the SpeciesReferenceGlyph with the given index, or @c NULL if the object is @c NULL LIBSBMLNETWORK_EXTERN LineEnding* getSpeciesReferenceLocalLineEnding(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); +LineEnding* getSpeciesReferenceLocalLineEnding(SBMLDocument* document, SpeciesReferenceGlyph* speciesReferenceGlyph); + /// @brief Predicates returning @c true if the "enableRotationalMapping" attribute of the LineEnding with the given identifier /// of the first RenderInformationBase object of the SBML document is set. /// @param sid a string representing the identifier of the LineEnding to retrieve. @@ -1718,21 +1722,21 @@ LIBSBMLNETWORK_EXTERN bool isSetLineEndingStrokeColor(SBMLDocument* document, co /// attribute is not set or the object is @c NULL. LIBSBMLNETWORK_EXTERN bool isSetLineEndingStrokeColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id); -/// @brief Predicates returning \c true if the "stroke" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @brief Predicates returning @c true if the "stroke" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. -/// @return \c true if the "stroke" attribute of the RenderGroup for this LineEnding object is set, \c false if either the "stroke" attribute is not set or the object is \c NULL. +/// @return @c true if the "stroke" attribute of the RenderGroup for this LineEnding object is set, @c false if either the "stroke" attribute is not set or the object is \c NULL. LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingStrokeColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); -/// @brief Predicates returning \c true if the "stroke" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @brief Predicates returning @c true if the "stroke" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. -/// @return \c true if the "stroke" attribute of the RenderGroup for this LineEnding object is set, \c false if either the "stroke" attribute is not set or the object is \c NULL. +/// @return @c true if the "stroke" attribute of the RenderGroup for this LineEnding object is set, @c false if either the "stroke" attribute is not set or the object is \c NULL. LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingStrokeColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); /// @brief Returns the value of the "stroke" attribute of the RenderGroup for the LineEnding with the given identifier @@ -1846,21 +1850,21 @@ LIBSBMLNETWORK_EXTERN bool isSetLineEndingStrokeWidth(SBMLDocument* document, co /// attribute is not set or the object is @c NULL. LIBSBMLNETWORK_EXTERN bool isSetLineEndingStrokeWidth(SBMLDocument* document, unsigned int renderIndex, const std::string& id); -/// @brief Predicates returning \c true if the "stroke-width" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @brief Predicates returning @c true if the "stroke-width" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. -/// @return \c true if the "stroke-width" attribute of the RenderGroup for this LineEnding object is set, \c false if either the "stroke-width" attribute is not set or the object is \c NULL. +/// @return @c true if the "stroke-width" attribute of the RenderGroup for this LineEnding object is set, @c false if either the "stroke-width" attribute is not set or the object is \c NULL. LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingStrokeWidth(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); -/// @brief Predicates returning \c true if the "stroke-width" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @brief Predicates returning @c true if the "stroke-width" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. -/// @return \c true if the "stroke-width" attribute of the RenderGroup for this LineEnding object is set, \c false if either the "stroke-width" attribute is not set or the object is \c NULL. +/// @return @c true if the "stroke-width" attribute of the RenderGroup for this LineEnding object is set, @c false if either the "stroke-width" attribute is not set or the object is \c NULL. LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingStrokeWidth(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); /// @brief Returns the value of the "stroke-width" attribute of the RenderGroup for the LineEnding with the given identifier /// @param document a pointer to the SBMLDocument object. @@ -2134,21 +2138,21 @@ LIBSBMLNETWORK_EXTERN bool isSetLineEndingFillColor(SBMLDocument* document, cons /// attribute is not set or the object is @c NULL. LIBSBMLNETWORK_EXTERN bool isSetLineEndingFillColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id); -/// @brief Predicates returning \c true if the "fill" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @brief Predicates returning @c true if the "fill" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. -/// @return \c true if the "fill" attribute of the RenderGroup for this LineEnding object is set, \c false if either the "fill" attribute is not set or the object is \c NULL. +/// @return @c true if the "fill" attribute of the RenderGroup for this LineEnding object is set, @c false if either the "fill" attribute is not set or the object is \c NULL. LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingFillColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); -/// @brief Predicates returning \c true if the "fill" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @brief Predicates returning @c true if the "fill" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. -/// @return \c true if the "fill" attribute of the RenderGroup for this LineEnding object is set, \c false if either the "fill" attribute is not set or the object is \c NULL. +/// @return @c true if the "fill" attribute of the RenderGroup for this LineEnding object is set, @c false if either the "fill" attribute is not set or the object is \c NULL. LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingFillColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); /// @brief Returns the value of the "fill" attribute of the RenderGroup for the LineEnding with the given identifier @@ -2304,23 +2308,23 @@ LIBSBMLNETWORK_EXTERN bool isSetLineEndingFillRule(SBMLDocument* document, const /// attribute is not set or the object is @c NULL. LIBSBMLNETWORK_EXTERN bool isSetLineEndingFillRule(SBMLDocument* document, unsigned int renderIndex, const std::string& id); -/// @brief Predicates returning \c true if the "fill-rule" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @brief Predicates returning @c true if the "fill-rule" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. -/// @return \c true if the "fill-rule" attribute of the RenderGroup for this LineEnding object is set, \c false if either the "fill-rule" attribute is not set or the object is \c NULL. +/// @return @c true if the "fill-rule" attribute of the RenderGroup for this LineEnding object is set, @c false if either the "fill-rule" attribute is not set or the object is \c NULL. LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingFillRule(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); -/// @brief Predicates returning \c true if the "fill-rule" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @brief Predicates returning @c true if the "fill-rule" attribute of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. -/// @return \c true if the "fill-rule" attribute of the RenderGroup for this LineEnding object is set, \c false if either the "fill-rule" attribute is not set or the object is \c NULL. - +/// @return @c true if the "fill-rule" attribute of the RenderGroup for this LineEnding object is set, @c false if either the "fill-rule" attribute is not set or the object is \c NULL. LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingFillRule(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); + /// @brief Returns the value of the "fill-rule" attribute of the RenderGroup for the LineEnding with the given identifier /// @param document a pointer to the SBMLDocument object. /// @param id a string representing the identifier of the LineEnding to retrieve. @@ -2420,7 +2424,7 @@ LIBSBMLNETWORK_EXTERN unsigned int getNumLineEndingGeometricShapes(SBMLDocument* /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @return the number of Transformation2D objects in the RenderGroup for this LineEnding object, or @c 0 if the object is @c NULL. -LIBSBMLNETWORK_EXTERN unsigned int getNumSpeciesReferenceLineEndingGeometricShapes(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); +LIBSBMLNETWORK_EXTERN unsigned int getNumSpeciesReferenceLineEndingGeometricShapes(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0); /// @brief Returns the number of Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. /// @param document a pointer to the SBMLDocument object. @@ -2429,8 +2433,212 @@ LIBSBMLNETWORK_EXTERN unsigned int getNumSpeciesReferenceLineEndingGeometricShap /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @return the number of Transformation2D objects in the RenderGroup for this LineEnding object, or @c 0 if the object is @c NULL. +LIBSBMLNETWORK_EXTERN unsigned int getNumSpeciesReferenceLineEndingGeometricShapes(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0); + +/// @brief Adds a geometric shape to the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the first RenderInformationBase object of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param shape a string value indicating the shape of the geometric shape to be set. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addLineEndingGeometricShape(SBMLDocument* document, const std::string& id, const std::string& shape); + +/// @brief Adds a geometric shape to the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the RenderInformationBase object with the given index of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param shape a string value indicating the shape of the geometric shape to be set. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addLineEndingGeometricShape(SBMLDocument* document, unsigned int renderIndex, const std::string& id, const std::string& shape); + +/// @brief Adds a geometric shape to the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param shape a string value indicating the shape of the geometric shape to be set. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, const std::string& shape); + +/// @brief Adds a geometric shape to the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param shape a string value indicating the shape of the geometric shape to be set. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int addSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, const std::string& shape); + +/// @brief Removes the geometric shape with the given index from the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the first RenderInformationBase object of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to remove. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int removeLineEndingGeometricShape(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Removes the geometric shape with the given index from the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the RenderInformationBase object with the given index of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to remove. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int removeLineEndingGeometricShape(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Removes the geometric shape with the given index from the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to remove. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int removeSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Removes the geometric shape with the given index from the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to remove. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int removeSpeciesReferenceLineEndingGeometricShape(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the type of the geometric shape with the given index in the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the first RenderInformationBase object of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return the type of the geometric shape of the Transformation2D at the given index of the RenderGroup of this LineEnding, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN std::string getLineEndingGeometricShapeType(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the type of the geometric shape with the given index in the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the RenderInformationBase object with the given index of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return the type of the geometric shape of the Transformation2D at the given index of the RenderGroup of this LineEnding, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN std::string getLineEndingGeometricShapeType(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the type of the geometric shape with the given index of the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to remove. +/// @return the type of the geometric shape of the Transformation2D at the given index of the RenderGroup of this LineEnding, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN std::string getSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the type of the geometric shape with the given index of the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to remove. +/// @return the type of the geometric shape of the Transformation2D at the given index of the RenderGroup of this LineEnding, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN std::string getSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Sets the type of the geometric shape of the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the first RenderInformationBase object of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param shape a string value indicating the shape of the geometric shape to be set. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeType(SBMLDocument* document, const std::string& id, const std::string& shape); + +/// @brief Sets the type of the geometric shape of the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the RenderInformationBase object with the given index of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param shape a string value indicating the shape of the geometric shape to be set. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeType(SBMLDocument* document, unsigned int renderIndex, const std::string& id, const std::string& shape); + +/// @brief Sets the type of the geometric shape of the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, const std::string& shape); + +/// @brief Sets the type of the geometric shape of the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeType(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, const std::string& shape) ; + +/// @brief Returns the id of the geometric shape with the given index in the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the first RenderInformationBase object of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return the id of the geometric shape of the Transformation2D at the given index of the RenderGroup of this LineEnding, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getLineEndingGeometricShapeId(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the id of the geometric shape with the given index in the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the RenderInformationBase object with the given index of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return the type of the geometric shape of the Transformation2D at the given index of the RenderGroup of this LineEnding, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getLineEndingGeometricShapeId(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the id of the geometric shape with the given index of the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to remove. +/// @return the id of the geometric shape of the Transformation2D at the given index of the RenderGroup of this LineEnding, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); + +/// @brief Returns the type of the geometric shape with the given index of the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to remove. +/// @return the type of the geometric shape of the Transformation2D at the given index of the RenderGroup of this LineEnding, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN const std::string getSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); + +/// @brief Sets the type of the geometric shape with the given index of the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the first RenderInformationBase object of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param shapeId a string value indicating the id of the geometric shape to be set. +/// @return the type of the geometric shape with the given index of the Transformation2D at the given index of the RenderGroup of this LineEnding, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeId(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex, const std::string& shapeId); + +/// @brief Sets the type of the geometric shape with the given index of the Transformation2D objects in the RenderGroup for the LineEnding with the given identifier in the RenderInformationBase object with the given index of the SBMLDocument. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param shapeId a string value indicating the id of the geometric shape to be set. +/// @return the type of the geometric shape with the given index of the Transformation2D at the given index of the RenderGroup of this LineEnding, or @c "" if the object is @c NULL +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeId(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex, const std::string& shapeId); + +/// @brief Sets the type of the geometric shape with the given index of the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& shapeId); + +/// @brief Sets the type of the geometric shape of the Transformation2D objects in the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeId(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& shapeId); -LIBSBMLNETWORK_EXTERN unsigned int getNumSpeciesReferenceLineEndingGeometricShapes(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex); /// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is of type Rectangle. /// @param document a pointer to the SBMLDocument object. /// @param id a string representing the identifier of the LineEnding to retrieve. @@ -2446,23 +2654,23 @@ LIBSBMLNETWORK_EXTERN bool isLineEndingRectangle(SBMLDocument* document, const s /// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Rectangle, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isLineEndingRectangle(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type Rectangle. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type Rectangle. /// @param document a pointer to the SBMLDocument object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Rectangle, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Rectangle, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingRectangle(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type Rectangle. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type Rectangle. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Rectangle, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Rectangle, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingRectangle(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); /// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is of type Ellipse. @@ -2480,23 +2688,23 @@ LIBSBMLNETWORK_EXTERN bool isLineEndingEllipse(SBMLDocument* document, const std /// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Ellipse, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isLineEndingEllipse(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type Ellipse. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type Ellipse. /// @param document a pointer to the SBMLDocument object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Ellipse, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Ellipse, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingEllipse(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type Ellipse. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type Ellipse. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Ellipse, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Ellipse, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingEllipse(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); /// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is of type Polygon. @@ -2514,23 +2722,23 @@ LIBSBMLNETWORK_EXTERN bool isLineEndingPolygon(SBMLDocument* document, const std /// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Polygon, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isLineEndingPolygon(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type Polygon. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type Polygon. /// @param document a pointer to the SBMLDocument object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Polygon, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Polygon, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingPolygon(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type Polygon. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type Polygon. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Polygon, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Polygon, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingPolygon(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); /// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is of type Image. @@ -2548,23 +2756,23 @@ LIBSBMLNETWORK_EXTERN bool isLineEndingImage(SBMLDocument* document, const std:: /// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Image, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isLineEndingImage(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type Image. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type Image. /// @param document a pointer to the SBMLDocument object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Image, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Image, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingImage(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type Image. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type Image. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Image, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Image, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingImage(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); /// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is of type RenderCurve. @@ -2582,23 +2790,23 @@ LIBSBMLNETWORK_EXTERN bool isLineEndingRenderCurve(SBMLDocument* document, const /// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type RenderCurve, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isLineEndingRenderCurve(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type RenderCurve. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type RenderCurve. /// @param document a pointer to the SBMLDocument object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type RenderCurve, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type RenderCurve, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingRenderCurve(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type RenderCurve. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type RenderCurve. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type RenderCurve, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type RenderCurve, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingRenderCurve(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); /// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is of type Text. @@ -2616,25 +2824,382 @@ LIBSBMLNETWORK_EXTERN bool isLineEndingText(SBMLDocument* document, const std::s /// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Text, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isLineEndingText(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type Text. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is of type Text. /// @param document a pointer to the SBMLDocument object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Text, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Text, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingText(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); -/// @brief Predicates returning \c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type Text. +/// @brief Predicates returning @c true if the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is of type Text. /// @param document a pointer to the SBMLDocument object. /// @param layoutIndex the index number of the Layout object. /// @param reactionId a string representing the identifier of the Reaction object. /// @param reactionGlyphIndex the index number of the ReactionGlyph object. /// @param speciesReferenceIndex the index number of the SpeciesReference object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. -/// @return \c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Text, \c false otherwise. +/// @return @c true if the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Text, @c false otherwise. LIBSBMLNETWORK_EXTERN bool isSpeciesReferenceLineEndingText(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); +/// @brief Predicates returning @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the first RenderInformationBase of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Predicates returning @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is of type Text, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Predicates returning @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Predicates returning @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the first RenderInformationBase of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const std::string getLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const std::string getLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const std::string getSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const std::string getSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Sets the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the first RenderInformationBase of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param strokeColor a string to use as the value of the "stroke" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex, const std::string& strokeColor); + +/// @brief Sets the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param strokeColor a string to use as the value of the "stroke" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex, const std::string& strokeColor); + +/// @brief Sets the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @param strokeColor a string to use as the value of the "stroke" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& strokeColor); + +/// @brief Sets the value of the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @param strokeColor a string to use as the value of the "stroke" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeStrokeColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& strokeColor); + +/// @brief Predicates returning @c true if "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the first RenderInformationBase object of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Predicates returning @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "stroke" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Predicates returning @c true if the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex = 0); + +/// @brief Predicates returning @c true if the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the first RenderInformationBase of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const double getLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const double getLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const double getSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const double getSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Sets the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the first RenderInformationBase of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param strokeWidth a string to use as the value of the "stroke-width" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex, double strokeWidth); + +/// @brief Sets the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param strokeWidth a string to use as the value of the "stroke-width" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex, double strokeWidth); + +/// @brief Sets the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @param strokeWidth a string to use as the value of the "stroke-width" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, double strokeWidth); + +/// @brief Sets the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @param strokeWidth a string to use as the value of the "stroke-width" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeStrokeWidth(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, double strokeWidth); + +/// @brief Predicates returning @c true if "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the first RenderInformationBase objec of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Predicates returning @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex = 0); + +/// @brief Predicates returning @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Predicates returning @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document is set. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return @c true if the "fill" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object is set, @c false otherwise. +LIBSBMLNETWORK_EXTERN bool isSetSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex = 0, unsigned int speciesReferenceIndex = 0, unsigned int geometricShapeIndex = 0); + +/// @brief Returns the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the first RenderInformationBase of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return the "fill" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const std::string getLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex); + +/// @brief Returns the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase object with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @return the "fill" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const std::string getLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex); + +/// @brief Returns the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return the "fill" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const std::string getSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); + +/// @brief Returns the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @return the "fill" attribute of the Transformation2D at the given index of the RenderGroup for this LineEnding object, or @c "" if the object is @c NULL. +LIBSBMLNETWORK_EXTERN const std::string getSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex); + +/// @brief Sets the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the first RenderInformationBase of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param fillColor a string to use as the value of the "fill" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex, const std::string& fillColor); + +/// @brief Sets the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param fillColor a string to use as the value of the "fill" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex, const std::string& fillColor); + +/// @brief Sets the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the first RenderInformationBase of the SBML document as gradient. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param gradientType a string representing the type of gradient to use. +/// @param stopsVector a vector of pairs where each pair consists of a string representing the color and a double representing the offset for the gradient stop. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, const std::string& id, unsigned int geometricShapeIndex, const std::string& gradientType, std::vector> stopsVector); + +/// @brief Sets the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup of the LineEnding object of the RenderInformationBase with the given index of the SBML document as gradient. +/// @param document a pointer to the SBMLDocument object. +/// @param renderIndex the index number of the RenderInformationBase object. +/// @param id a string representing the identifier of the LineEnding to retrieve. +/// @param geometricShapeIndex an int representing the index of the Transformation2D to retrieve. +/// @param gradientType a string representing the type of gradient to use. +/// @param stopsVector a vector of pairs where each pair consists of a string representing the color and a double representing the offset for the gradient stop. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, unsigned int renderIndex, const std::string& id, unsigned int geometricShapeIndex, const std::string& gradientType, std::vector> stopsVector); + +/// @brief Sets the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @param fillColor a string to use as the value of the "fill" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& fillColor); + +/// @brief Sets the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @param fillColor a string to use as the value of the "fill" attribute of the RenderGroup for this LineEnding object. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeFillColor(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& fillColor); + +/// @brief Sets the value of the "fill" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the first Layout of the SBML document as gradient. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @param gradientType a string representing the type of gradient to use. +/// @param stopsVector a vector of pairs where each pair consists of a string representing the color and a double representing the offset for the gradient stop. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& gradientType, std::vector> stopsVector); + +/// @brief Sets the value of the "stroke-width" attribute of the Transformation2D at the given index of the RenderGroup for the LineEnding associated with the SpeciesReferenceGlyph with the given index of the reaction glyph with the given index of the reaction with the given identifier in the Layout with the given index of the SBML document as gradient. +/// @param document a pointer to the SBMLDocument object. +/// @param reactionId a string representing the identifier of the Reaction object. +/// @param reactionGlyphIndex the index number of the ReactionGlyph object. +/// @param speciesReferenceIndex the index number of the SpeciesReference object. +/// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. +/// @param gradientType a string representing the type of gradient to use. +/// @param stopsVector a vector of pairs where each pair consists of a string representing the color and a double representing the offset for the gradient stop. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int setSpeciesReferenceLineEndingGeometricShapeFillColorAsGradient(SBMLDocument* document, unsigned int layoutIndex, const std::string& reactionId, unsigned int reactionGlyphIndex, unsigned int speciesReferenceIndex, unsigned int geometricShapeIndex, const std::string& gradientType, std::vector> stopsVector); + /// @brief Checks if the X coordinate of the geometric shape for the LineEnding with the given identifier is set. /// @param document a pointer to the SBMLDocument object. /// @param id a string representing the identifier of the LineEnding to retrieve. @@ -7986,14 +8551,14 @@ LIBSBMLNETWORK_EXTERN int addGeometricShape(SBMLDocument* document, const std::s /// @param document a pointer to the SBMLDocument object. /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to remove. -/// @return a pointer to the nth Transformation2D of the RenderGroup of the Style for this GraphicalObject, or @c NULL if the object is @c NULL +/// @return a pointer to the Transformation2D with the given index of the RenderGroup of the Style for this GraphicalObject, or @c NULL if the object is @c NULL LIBSBMLNETWORK_EXTERN int removeGeometricShape(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0); /// @brief Remove a geometric shape from the Style that matches this attribute (id, role, type) of a GraphicalObject. /// @param document a pointer to the SBMLDocument object. /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to remove. -/// @return a pointer to the nth Transformation2D of the RenderGroup of the Style for this GraphicalObject, or @c NULL if the object is @c NULL +/// @return a pointer to the Transformation2D with the given index of the RenderGroup of the Style for this GraphicalObject, or @c NULL if the object is @c NULL LIBSBMLNETWORK_EXTERN int removeGeometricShape(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0); /// @brief Returns the ID of the geometric shape of the Transformation2D at the given index of the RenderGroup of the Style for this GraphicalObject. @@ -10515,7 +11080,7 @@ LIBSBMLNETWORK_EXTERN bool isGeometricShapeElementCubicBezier(SBMLDocument* docu /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10524,7 +11089,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(SBMLDocument* /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10533,7 +11098,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementX(SBMLDocument* /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "x" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeElementXAsDouble(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10542,7 +11107,7 @@ LIBSBMLNETWORK_EXTERN const double getGeometricShapeElementXAsDouble(SBMLDocumen /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "x" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeElementXAsDouble(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10741,7 +11306,7 @@ LIBSBMLNETWORK_EXTERN int setGeometricShapeElementXAsDouble(SBMLDocument* docume /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10750,7 +11315,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(SBMLDocument* /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10759,7 +11324,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeElementY(SBMLDocument* /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "y" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeElementYAsDouble(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10768,7 +11333,7 @@ LIBSBMLNETWORK_EXTERN const double getGeometricShapeElementYAsDouble(SBMLDocumen /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "y" attribute of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeElementYAsDouble(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10967,7 +11532,7 @@ LIBSBMLNETWORK_EXTERN int setGeometricShapeElementYAsDouble(SBMLDocument* docume /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10976,7 +11541,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(SBMLDocume /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10985,7 +11550,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1X(SBMLDocume /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "x" attribute of base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint1XAsDouble(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -10994,7 +11559,7 @@ LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint1XAsDouble(SBMLDocu /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "x" attribute of base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint1XAsDouble(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11193,7 +11758,7 @@ LIBSBMLNETWORK_EXTERN int setGeometricShapeBasePoint1XAsDouble(SBMLDocument* doc /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11202,7 +11767,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(SBMLDocume /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11211,7 +11776,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint1Y(SBMLDocume /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "y" attribute of base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint1YAsDouble(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11220,7 +11785,7 @@ LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint1YAsDouble(SBMLDocu /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of base point 1 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "y" attribute of base point 1 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint1YAsDouble(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11419,7 +11984,7 @@ LIBSBMLNETWORK_EXTERN int setGeometricShapeBasePoint1YAsDouble(SBMLDocument* doc /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11428,7 +11993,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(SBMLDocume /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "x" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11437,7 +12002,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2X(SBMLDocume /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "x" attribute of base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint2XAsDouble(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11446,7 +12011,7 @@ LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint2XAsDouble(SBMLDocu /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "x" attribute of base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "x" attribute of base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint2XAsDouble(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11644,7 +12209,7 @@ LIBSBMLNETWORK_EXTERN int setGeometricShapeBasePoint2XAsDouble(SBMLDocument* doc /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11653,7 +12218,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(SBMLDocume /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of the base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if +/// @return the "y" attribute of the base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject, or @c RelAbsVector() if /// either Transformation2D object does not exists, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11662,7 +12227,7 @@ LIBSBMLNETWORK_EXTERN const RelAbsVector getGeometricShapeBasePoint2Y(SBMLDocume /// @param graphicalObject a pointer to the GraphicalObject object. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "y" attribute of base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint2YAsDouble(SBMLDocument* document, GraphicalObject* graphicalObject, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -11671,7 +12236,7 @@ LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint2YAsDouble(SBMLDocu /// @param attribute the attribute (id, role, type) of a GraphicalObject. /// @param geometricShapeIndex an unsigned int representing the index of the Transformation2D to retrieve. /// @param elementIndex an unsigned int representing the index of the element to retrieve. -/// @return the "y" attribute of base point 2 of the nth element of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if +/// @return the "y" attribute of base point 2 of the element with the given index of the Transformation2D object at the given index of the RenderGroup of the Style for this GraphicalObject as a double, or @c 0.0 if /// either Transformation2D object does not exist, does not have any elements, it has less than n elements, or the object is @c NULL. LIBSBMLNETWORK_EXTERN const double getGeometricShapeBasePoint2YAsDouble(SBMLDocument* document, const std::string& attribute, unsigned int geometricShapeIndex = 0, unsigned int elementIndex = 0); @@ -12050,6 +12615,96 @@ LIBSBMLNETWORK_EXTERN int setStyle(SBMLDocument* document, unsigned int renderIn /// @return boolean value indicating whether to display the reaction text label. LIBSBMLNETWORK_EXTERN bool whetherDisplayReactionTextLabel(const std::string& styleName); +/// @brief Make all the elements in the Layout object with the given index of the SBML document visible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Make all the elements in the Layout object with the given index of the SBML document invisible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeInvisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Make all the compartments in the Layout object with the given index of the SBML document visible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeCompartmentVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Make all the compartments in the Layout object with the given index of the SBML document invisible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeCompartmentInvisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Make all the species in the Layout object with the given index of the SBML document visible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeSpeciesVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Make all the species in the Layout object with the given index of the SBML document invisible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeSpeciesInvisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Make all the reactions in the Layout object with the given index of the SBML document visible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeReactionVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Make all the species in the Layout object with the given index of the SBML document invisible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeReactionInvisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Make all the species references in the Layout object with the given index of the SBML document visible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeSpeciesReferenceVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Make all the species references in the Layout object with the given index of the SBML document invisible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeSpeciesReferenceInvisible(SBMLDocument* document, unsigned int layoutIndex); + +/// @brief Make all the line endings in the Layout object with the given index of the SBML document visible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeLineEndingVisible(SBMLDocument* document, unsigned int layoutIndex = 0); + +/// @brief Make all the line endings in the Layout object with the given index of the SBML document invisible. +/// @param document a pointer to the SBMLDocument object. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeLineEndingInvisible(SBMLDocument* document, unsigned int layoutIndex); + +/// @brief Make the graphical object with the given index associated with the entered model in the layout object with the given index of the SBML document visible. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the graphical object to make visible. +/// @param applyToConnectedElements a variable that determines whether to apply the visibility change to the connected elements. +/// @param graphicalObjectIndex the index number of the GraphicalObject to return. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeVisible(SBMLDocument* document, GraphicalObject* graphicalObject, const bool& applyToConnectedElements = true); + +/// @brief Make the graphical object with the given index associated with the entered model in the layout object with the given index of the SBML document invisible. +/// @param document a pointer to the SBMLDocument object. +/// @param id the id of the graphical object to make invisible. +/// @param applyToConnectedElements a variable that determines whether to apply the visibility change to the connected elements. +/// @param graphicalObjectIndex the index number of the GraphicalObject to return. +/// @param layoutIndex the index number of the Layout to return. +/// @return integer value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN int makeInvisible(SBMLDocument* document, GraphicalObject* graphicalObject, const bool& applyToConnectedElements = true); + } #endif \ No newline at end of file