Skip to content

Commit

Permalink
Merge pull request #12 from sys-bio/extract-features
Browse files Browse the repository at this point in the history
Refactor and Modularize Features
  • Loading branch information
adelhpour authored Nov 20, 2024
2 parents 06fb807 + 6548df1 commit 6cfb63e
Show file tree
Hide file tree
Showing 70 changed files with 3,293 additions and 2,938 deletions.
6 changes: 3 additions & 3 deletions docs/api_reference/c_api_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ Functions

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_isSetModel(SBMLDocument* document)

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_autolayout(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, bool resetLockedElements = false, const char** lockedNodeIds = NULL, const int lockedNodesSize = 0)
.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_autolayout(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, bool resetFixedPositionElements = false, const char** fixedPositionNodeIds = NULL, const int fixedPositionNodesSize = 0)

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_autorender(SBMLDocument *document, const int maxNumConnectedEdges = 3)

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_align(SBMLDocument* document, const char **nodeIds, const int nodesSize, const char* alignment, bool ignoreLockedNodes = false)
.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_align(SBMLDocument* document, const char **nodeIds, const int nodesSize, const char* alignment, bool ignoreFixedPositionNodes = false)

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_distribute(SBMLDocument* document, const char **nodeIds, const int nodesSize, const char* direction, const double spacing = -1.0)

Expand All @@ -39,7 +39,7 @@ Functions

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_createDefaultLayoutFeatures(SBMLDocument* document, const int maxNumConnectedEdges = 3)

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel= true, bool resetLockedElements = false, const char** lockedNodeIds = NULL, const int lockedNodesSize = 0)
.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel= true, bool resetFixedPositionElements = false, const char** fixedPositionNodeIds = NULL, const int fixedPositionNodesSize = 0)

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::c_api_createAliasSpeciesGlyph(SBMLDocument* document, const char* speciesId, const char* reactionId, int reactionGlyphIndex, int layoutIndex)

Expand Down
8 changes: 4 additions & 4 deletions docs/api_reference/cpp_api_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ SBMLDocument Functions

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::isSetModel(SBMLDocument* document)

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, bool resetLockedElements = false, std::set<std::string> lockedNodeIds = std::set<std::string>())
.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, bool resetFixedPositionElements = false, std::set<std::string> fixedPositionNodeIds = std::set<std::string>())

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::autorender(SBMLDocument* document, const int maxNumConnectedEdges = 3)

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::align(SBMLDocument* document, std::set<std::string> nodeIds, const std::string& alignment, const bool ignoreLockedNodes = false)
.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::align(SBMLDocument* document, std::set<std::string> nodeIds, const std::string& alignment, const bool ignoreFixedPositionNodes = false)

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::distribute(SBMLDocument* document, std::set<std::pair<std::string, unsigned int>> nodeIds, const std::string& direction, const double spacing = -1)

Expand Down Expand Up @@ -106,9 +106,9 @@ Layout Functions

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::removeAllLayouts(SBMLDocument* document)

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::setDefaultLayoutLocations(SBMLDocument* document, Layout* layout, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, bool resetLockedElements = false, const std::set<std::string> lockedNodeIds = std::set<std::string>())
.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::setDefaultLayoutLocations(SBMLDocument* document, Layout* layout, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, bool resetFixedPositionElements = false, const std::set<std::string> fixedPositionNodeIds = std::set<std::string>())

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, bool resetLockedElements = false, const std::set<std::string> lockedNodeIds = std::set<std::string>())
.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::createDefaultLayoutLocations(SBMLDocument* document, const int maxNumConnectedEdges = 3, bool useNameAsTextLabel = true, bool resetFixedPositionElements = false, const std::set<std::string> fixedPositionNodeIds = std::set<std::string>())

.. doxygenfunction:: LIBSBMLNETWORK_CPP_NAMESPACE::createDefaultLayoutFeatures(SBMLDocument* document, const int maxNumConnectedEdges = 3)

Expand Down
2 changes: 1 addition & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Given the non-deterministic nature of the autolayout algorithm, users can apply
network.autolayout()
# run autolayout with set parameters
network.autolayout(stiffness=10, gravity=15, use_magnetism=True, use_boundary=True, use_grid=True, locked_nodes=["S1", "S2"])
network.autolayout(stiffness=10, gravity=15, use_magnetism=True, use_boundary=True, use_grid=True, fixed_position_nodes=["S1", "S2"])
Get/Set Layout and Render data attributes
-----------------------------------------
Expand Down
77 changes: 47 additions & 30 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,32 @@ set(SOURCES
libsbmlnetwork_render.cpp
libsbmlnetwork_render_helpers.cpp
libsbmlnetwork_sbmldocument.cpp
libsbmlnetwork_sbmldocument_helpers.cpp
libsbmlnetwork_sbmldocument_layout.cpp
libsbmlnetwork_layout_render.cpp
libsbmlnetwork_sbmldocument_render.cpp
colors/libsbmlnetwork_colors.cpp
styles/libsbmlnetwork_styles.cpp
autolayout/libsbmlnetwork_autolayout.cpp
autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.cpp
autolayout/libsbmlnetwork_autolayout_object_base.cpp
autolayout/libsbmlnetwork_autolayout_node.cpp
autolayout/libsbmlnetwork_autolayout_connection.cpp
autolayout/libsbmlnetwork_autolayout_curve.cpp
autolayout/libsbmlnetwork_autolayout_point.cpp
features/colors/libsbmlnetwork_colors.cpp
features/styles/libsbmlnetwork_styles.cpp
features/autolayout/libsbmlnetwork_autolayout.cpp
features/autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.cpp
features/autolayout/libsbmlnetwork_autolayout_object_base.cpp
features/autolayout/libsbmlnetwork_autolayout_node.cpp
features/autolayout/libsbmlnetwork_autolayout_connection.cpp
features/autolayout/libsbmlnetwork_autolayout_curve.cpp
features/autolayout/libsbmlnetwork_autolayout_point.cpp
features/error_log/libsbmlnetwork_error_log.cpp
features/user_data/libsbmlnetwork_user_data.cpp
features/defaults/libsbmlnetwork_defaults_layout.cpp
features/defaults/libsbmlnetwork_defaults_render.cpp
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/align_elements/libsbmlnetwork_align_element.cpp
features/align_elements/libsbmlnetwork_align_species.cpp
features/fix_elements/libsbmlnetwork_fix_element_position.cpp
features/fix_elements/libsbmlnetwork_fix_element_dimensions.cpp
features/set_layout_features/libsbmlnetwork_set_layout_features.cpp
features/update_curves/libsbmlnetwork_update_curves.cpp
c_api/libsbmlnetwork_c_api.cpp)

## headers
Expand All @@ -31,19 +44,32 @@ set(HEADERS
libsbmlnetwork_render.h
libsbmlnetwork_render_helpers.h
libsbmlnetwork_sbmldocument.h
libsbmlnetwork_sbmldocument_helpers.h
libsbmlnetwork_sbmldocument_layout.h
libsbmlnetwork_layout_render.h
libsbmlnetwork_sbmldocument_render.h
colors/libsbmlnetwork_colors.h
styles/libsbmlnetwork_styles.h
autolayout/libsbmlnetwork_autolayout.h
autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.h
autolayout/libsbmlnetwork_autolayout_object_base.h
autolayout/libsbmlnetwork_autolayout_node.h
autolayout/libsbmlnetwork_autolayout_connection.h
autolayout/libsbmlnetwork_autolayout_curve.h
autolayout/libsbmlnetwork_autolayout_point.h
features/colors/libsbmlnetwork_colors.h
features/styles/libsbmlnetwork_styles.h
features/autolayout/libsbmlnetwork_autolayout.h
features/autolayout/libsbmlnetwork_fruchterman_reingold_algorithm.h
features/autolayout/libsbmlnetwork_autolayout_object_base.h
features/autolayout/libsbmlnetwork_autolayout_node.h
features/autolayout/libsbmlnetwork_autolayout_connection.h
features/autolayout/libsbmlnetwork_autolayout_curve.h
features/autolayout/libsbmlnetwork_autolayout_point.h
features/error_log/libsbmlnetwork_error_log.h
features/user_data/libsbmlnetwork_user_data.h
features/defaults/libsbmlnetwork_defaults_layout.h
features/defaults/libsbmlnetwork_defaults_render.h
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/align_elements/libsbmlnetwork_align_element.h
features/align_elements/libsbmlnetwork_align_species.h
features/fix_elements/libsbmlnetwork_fix_element_position.h
features/fix_elements/libsbmlnetwork_fix_element_dimensions.h
features/set_layout_features/libsbmlnetwork_set_layout_features.h
features/update_curves/libsbmlnetwork_update_curves.h
c_api/libsbmlnetwork_c_api.h)

#### dependencies
Expand Down Expand Up @@ -87,16 +113,7 @@ if (BUILD_STATIC_LIBS)
endif()

### install
file(GLOB SOURCE_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
install(FILES ${SOURCE_HEADERS} DESTINATION include/sbmlnetwork COMPONENT libsbmlnetwork_api)
file(GLOB AUTOLAYOUT_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/autolayout/*.h")
install(FILES ${AUTOLAYOUT_HEADERS} DESTINATION include/sbmlnetwork/autolayout COMPONENT libsbmlnetwork_api)
file(GLOB COLORS_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/colors/*.h")
install(FILES ${COLORS_HEADERS} DESTINATION include/sbmlnetwork/colors COMPONENT libsbmlnetwork_api)
file(GLOB STYLES_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/styles/*.h")
install(FILES ${STYLES_HEADERS} DESTINATION include/sbmlnetwork/styles COMPONENT libsbmlnetwork_api)
file(GLOB C_API_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/c_api/*.h")
install(FILES ${C_API_HEADERS} DESTINATION include/sbmlnetwork/c_api COMPONENT libsbmlnetwork_api)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION include FILES_MATCHING PATTERN "*.h" PATTERN "bindings" EXCLUDE)
if (WIN32)
include (InstallRequiredSystemLibraries)
endif()
Expand Down
86 changes: 0 additions & 86 deletions src/autolayout/libsbmlnetwork_autolayout.h

This file was deleted.

Loading

0 comments on commit 6cfb63e

Please sign in to comment.