Skip to content

Commit

Permalink
make changes to see if the alias reaction test passes on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
adelhpour committed Feb 7, 2025
1 parent f2944e0 commit ff292da
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions src/features/alias_elements/libsbmlnetwork_alias_reaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,24 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE {
for (unsigned int i = 0; i < referenceReactionGlyph->getNumSpeciesReferenceGlyphs(); i++) {
SpeciesReferenceGlyph *speciesReferenceGlyph = referenceReactionGlyph->getSpeciesReferenceGlyph(i);
SpeciesGlyph *speciesGlyph = layout->getSpeciesGlyph(speciesReferenceGlyph->getSpeciesGlyphId());
if (speciesGlyph) {
SpeciesGlyph *connectedSpeciesGlyph = NULL;
if (speciesGlyphAliasSpeciesGlyphIds.find(speciesGlyph->getId()) == speciesGlyphAliasSpeciesGlyphIds.end())
connectedSpeciesGlyph = alias_element_createAliasSpeciesGlyph(layout, speciesGlyph, padding);
else
connectedSpeciesGlyph = layout->getSpeciesGlyph(
speciesGlyphAliasSpeciesGlyphIds[speciesGlyph->getId()]);
if (connectedSpeciesGlyph != NULL) {
speciesGlyphAliasSpeciesGlyphIds[speciesGlyph->getId()] = connectedSpeciesGlyph->getId();
std::cout << "SpeciesGlyphAliasSpeciesGlyphIds: " << speciesGlyphAliasSpeciesGlyphIds[speciesGlyph->getId()] << std::endl;
int stoichiometry = getStoichiometryAsInteger(layout,
findSpeciesReference(document->getModel(), layout, referenceReactionGlyph, speciesGlyph));
for (unsigned int stoichiometryIndex = 0; stoichiometryIndex < stoichiometry; stoichiometryIndex++)
alias_element_createAliasSpeciesReferenceGlyph(reactionGlyph, speciesReferenceGlyph,
connectedSpeciesGlyph->getId(),
stoichiometryIndex, padding);
}
}
else
if (!speciesGlyph)
return -1;

SpeciesGlyph *connectedSpeciesGlyph = NULL;
if (speciesGlyphAliasSpeciesGlyphIds.find(speciesGlyph->getId()) == speciesGlyphAliasSpeciesGlyphIds.end())
connectedSpeciesGlyph = alias_element_createAliasSpeciesGlyph(layout, speciesGlyph, padding);
else
connectedSpeciesGlyph = layout->getSpeciesGlyph(
speciesGlyphAliasSpeciesGlyphIds[speciesGlyph->getId()]);
if (connectedSpeciesGlyph != NULL) {
speciesGlyphAliasSpeciesGlyphIds[speciesGlyph->getId()] = connectedSpeciesGlyph->getId();
int stoichiometry = getStoichiometryAsInteger(layout,
findSpeciesReference(document->getModel(), layout, referenceReactionGlyph, speciesGlyph));
for (unsigned int stoichiometryIndex = 0; stoichiometryIndex < stoichiometry; stoichiometryIndex++)
alias_element_createAliasSpeciesReferenceGlyph(reactionGlyph, speciesReferenceGlyph,
connectedSpeciesGlyph->getId(),
stoichiometryIndex, padding);
}
}

return 0;
Expand Down

0 comments on commit ff292da

Please sign in to comment.