Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rd-party/arbor
Submodule arbor updated 93 files
+3 −3 .github/workflows/test-docs.yaml
+0 −122 .gitlab/cscs-ci-default.yaml
+0 −32 .gitlab/docker/Dockerfile.app
+0 −50 .gitlab/docker/Dockerfile.base
+2 −2 .readthedocs.yml
+1 −1 CHANGELOG.md
+10 −8 CITATION.bib
+9 −3 CMakeLists.txt
+1 −1 VERSION
+1 −0 arbor/CMakeLists.txt
+3 −0 arbor/backends/event.hpp
+35 −55 arbor/backends/event_stream_base.hpp
+1 −1 arbor/backends/gpu/shared_state.cpp
+9 −6 arbor/backends/multicore/shared_state.cpp
+152 −118 arbor/communication/communicator.cpp
+18 −3 arbor/communication/communicator.hpp
+18 −50 arbor/domain_decomposition.cpp
+7 −2 arbor/fvm_layout.cpp
+1 −3 arbor/fvm_lowered_cell.hpp
+45 −77 arbor/fvm_lowered_cell_impl.hpp
+7 −1 arbor/include/arbor/arbexcept.hpp
+0 −3 arbor/include/arbor/common_types.hpp
+5 −9 arbor/include/arbor/domain_decomposition.hpp
+30 −48 arbor/include/arbor/event_generator.hpp
+1 −1 arbor/include/arbor/iexpr.hpp
+2 −1 arbor/include/arbor/morph/label_dict.hpp
+2 −7 arbor/include/arbor/morph/locset.hpp
+13 −18 arbor/include/arbor/recipe.hpp
+1 −0 arbor/include/arbor/util/visibility.hpp
+95 −154 arbor/label_resolution.cpp
+46 −50 arbor/label_resolution.hpp
+14 −34 arbor/morph/label_dict.cpp
+3 −2 arbor/morph/stitch.cpp
+15 −20 arbor/simulation.cpp
+2 −0 arbor/util/filter.hpp
+1 −3 arbor/util/iterutil.hpp
+1 −0 arbor/util/partition.hpp
+78 −0 arbor/util/smallvec.hpp
+21 −13 arborio/include/arborio/swcio.hpp
+93 −65 arborio/swcio.cpp
+0 −4 bors.toml
+1 −1 doc/concepts/cable_cell.rst
+65 −3 doc/concepts/interconnectivity.rst
+0 −14 doc/contrib/release.rst
+42 −0 doc/cpp/event_generators
+79 −0 doc/cpp/event_generators.rst
+5 −0 doc/cpp/index.rst
+2 −2 doc/cpp/interconnectivity.rst
+552 −0 doc/cpp/labels.rst
+5 −4 doc/cpp/morphology.rst
+20 −0 doc/cpp/spike_source_cell.rst
+27 −0 doc/fileformat/index.rst
+1 −1 doc/fileformat/nmodl.rst
+9 −2 doc/index.rst
+53 −0 doc/python/event_generators.rst
+2 −0 doc/python/index.rst
+49 −30 doc/python/labels.rst
+24 −11 doc/tutorial/brunel.rst
+6 −3 doc/tutorial/full-feature-diffusion.rst
+1 −1 doc/tutorial/network_two_cells_gap_junctions.rst
+3 −3 doc/tutorial/plasticity.rst
+1 −1 doc/tutorial/single_cell_cable.rst
+3 −3 doc/tutorial/single_cell_model.rst
+1 −0 example/CMakeLists.txt
+76 −62 example/brunel/brunel.cpp
+4 −0 example/busyring-tiled/CMakeLists.txt
+29 −0 example/busyring-tiled/complex-n-128-depth-10.json
+26 −0 example/busyring-tiled/init-only-2048-complex.json
+114 −0 example/busyring-tiled/parameters.hpp
+10 −0 example/busyring-tiled/readme.md
+413 −0 example/busyring-tiled/ring.cpp
+1 −1 example/busyring/complex-n-128-depth-10.json
+1 −3 example/ornstein_uhlenbeck/CMakeLists.txt
+3 −3 python/cable_cell_io.cpp
+2 −2 python/cells.cpp
+90 −42 python/label_dict.cpp
+63 −100 python/label_dict.hpp
+4 −6 python/morphology.cpp
+30 −1 python/recipe.cpp
+34 −35 python/recipe.hpp
+4 −4 python/single_cell_model.cpp
+1 −1 scripts/check-all-tags.sh
+19 −3 scripts/run_cpp_examples.sh
+14 −14 spack/package.py
+1 −0 test/ubench/CMakeLists.txt
+2 −0 test/unit-distributed/CMakeLists.txt
+1 −0 test/unit/CMakeLists.txt
+38 −6 test/unit/test_diffusion.cpp
+4 −4 test/unit/test_event_generators.cpp
+37 −42 test/unit/test_label_resolution.cpp
+8 −13 test/unit/test_merge_events.cpp
+99 −1 test/unit/test_recipe.cpp
+9 −4 test/unit/test_swcio.cpp
59 changes: 45 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.27)
find_package(Git)

project(the-arbor-gui
VERSION 0.11.1
VERSION 0.11.2
LANGUAGES C CXX)

set(EXPORT_COMPILE_COMMANDS ON)
Expand Down Expand Up @@ -186,22 +186,53 @@ if(ARBORGUI_BUILD_BUNDLE)

set(ARBORGUI_ICON arbor.icns)
set(ARBORGUI_ICON_PATH ${CMAKE_SOURCE_DIR}/images/${ARBORGUI_ICON})
set_source_files_properties(${ARBORGUI_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

add_executable(arbor-gui MACOSX_BUNDLE ${ARBORGUI_ICON_PATH} ${gui_srcs} $<TARGET_OBJECTS:imgui>)
set_target_properties(arbor-gui PROPERTIES MACOSX_BUNDLE_ICONFILE ${ARBORGUI_ICON})
set(arbgui_resources)
set_source_files_properties(${CMAKE_SOURCE_DIR}/imgui.ini
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
list(APPEND arbgui_resources ${CMAKE_SOURCE_DIR}/imgui.ini)

file(GLOB_RECURSE shaders ${CMAKE_SOURCE_DIR}/glsl/*/*.glsl)
foreach(SHADER_FILE ${shaders})
list(APPEND arbgui_resources ${SHADER_FILE})
file(RELATIVE_PATH SHADER_REL ${CMAKE_SOURCE_DIR}/glsl ${SHADER_FILE})
get_filename_component(SHADER_DIR ${SHADER_REL} DIRECTORY)
set_source_files_properties(${SHADER_FILE}
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources/glsl/${SHADER_DIR})
endforeach()

file(GLOB_RECURSE fonts ${CMAKE_SOURCE_DIR}/fonts/*/*.ttf)
foreach(FONT_FILE ${fonts})
list(APPEND arbgui_resources ${FONT_FILE})
file(RELATIVE_PATH FONT_REL ${CMAKE_SOURCE_DIR}/fonts ${FONT_FILE})
get_filename_component(FONT_DIR ${FONT_REL} DIRECTORY)
set_source_files_properties(${FONT_FILE}
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources/fonts/${FONT_DIR})
endforeach()

set_source_files_properties(${CMAKE_SOURCE_DIR}/images/arbor.icns
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)

add_executable(arbor-gui MACOSX_BUNDLE ${gui_srcs} $<TARGET_OBJECTS:imgui> ${arbgui_resources} ${CMAKE_SOURCE_DIR}/images/arbor.icns)
set_target_properties(arbor-gui
PROPERTIES
BUNDLE True
MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_ICONFILE ${ARBORGUI_ICON}
MACOSX_BUNDLE_INFO_STRING "A GUI for Arbor"
RESOURCE ${arbgui_resources})
target_compile_definitions(arbor-gui PUBLIC FMT_HEADER_ONLY)
target_include_directories(arbor-gui PRIVATE src ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(arbor-gui PRIVATE ${ARBORGUI_LIBS} arbor arborio glbinding glfw arbor-gui-deps)

install(TARGETS arbor-gui
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime)

install(FILES ${ARBORGUI_ICON_PATH} DESTINATION ${resource_path})
install(FILES default.ini DESTINATION ${resource_path} RENAME imgui.ini)
install(DIRECTORY glsl DESTINATION ${resource_path})
install(DIRECTORY fonts DESTINATION ${resource_path})
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime)

set(CPACK_BINARY_DRAGNDROP ON)
set(CPACK_GENERATOR "DragNDrop")
Expand Down Expand Up @@ -237,7 +268,7 @@ else()
endif()

# install resources
install(DIRECTORY glsl DESTINATION ${resource_path})
install(DIRECTORY fonts DESTINATION ${resource_path})
install(FILES default.ini DESTINATION ${resource_path} RENAME imgui.ini)
install(DIRECTORY glsl DESTINATION ${resource_path})
install(DIRECTORY fonts DESTINATION ${resource_path})
install(FILES imgui.ini DESTINATION ${resource_path})
endif()
25 changes: 5 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,31 +120,16 @@ Next, follow the platform specific instructions.
``` bash
sudo apt update
sudo apt install build-essential libssl-dev \
libxml2-dev libxrandr-dev libxinerama-dev \
libxrandr-dev libxinerama-dev \
libxcursor-dev libxi-dev libglu1-mesa-dev \
freeglut3-dev mesa-common-dev gcc-10 g++-10
freeglut3-dev mesa-common-dev gcc g++ \
libglfw3 cmake pkg-config xorg-dev libwayland-dev
```
If your cmake version is less than 3.18, you will need to update it
as well
``` bash
cmake --version
3.16 # default on Ubunte 20.04 LTS
# if pip is present
pip install --update cmake
```
2. Add GCC10 as alternative to GCC and select it:
``` bash
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
```
Use `gcc --version` to confirm it is now version 10. If not you will
need to run `sudo update-alternatives --config gcc` (and its analog for
`g++`) and manually select the right number.

3. Install Arbor GUI
```bash
cmake ..
sudo make install -j 4
make
sudo make install
```

## Windows (WSL2)
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/gui_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ namespace {
}

inline void gui_cell_context_menu(gui_state& state) {
if (ImGui::BeginPopupContextWindow()) {
if (ImGui::BeginPopupContextWindow("cell-ctx-window", ImGuiPopupFlags_MouseButtonRight)) {
ImGui::Text("%s Camera", icon_camera);
{
with_indent indent{};
Expand Down Expand Up @@ -469,7 +469,7 @@ namespace {
vs.zoom = std::clamp(vs.zoom + delta_zoom, 1.0f, 45.0f);
}
}

gui_cell_context_menu(state);
//
static float t_last = 0.0;
float t_now = glfwGetTime();
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ int main(int, char**) {
Window window{};
gui_state state{};

// show at least once.
window.begin_frame();
state.gui();
window.end_frame();

for (;window.running() && !state.shutdown_requested;) {
if (!window.visible()) {
log_debug("Pausing for events.");
Expand Down
4 changes: 2 additions & 2 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ std::filesystem::path get_resource_path(const std::filesystem::path& fn) {
CFURLRef appUrlRef = CFBundleCopyBundleURL( CFBundleGetMainBundle() );
CFStringRef macPath = CFURLCopyFileSystemPath( appUrlRef, kCFURLPOSIXPathStyle );
CFStringEncoding encodingMethod = CFStringGetSystemEncoding();
const char* path = CFStringGetCStringPtr(macPath, encodingMethod);
auto path = std::string(CFStringGetCStringPtr(macPath, encodingMethod));
CFRelease(appUrlRef);
CFRelease(macPath);
return std::filesystem::path{path} / "Contents/Resources" / fn;
#endif
}

void log_init() {
spdlog::set_level(spdlog::level::info);
spdlog::set_level(spdlog::level::debug);
}


Expand Down
2 changes: 2 additions & 0 deletions src/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Window::Window() {
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, 1);
glfwWindowHint(GLFW_FOCUSED, 1);
glfwWindowHint(GLFW_VISIBLE, 1);
glsl_version = "#version 410";
handle = glfwCreateWindow(1280, 720, "arbor-gui", NULL, NULL);
if (handle == nullptr) log_fatal("Failed to obtain window");
Expand Down