Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time_func model #4

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
BasedOnStyle: Mozilla
BreakBeforeBraces: Mozilla
AccessModifierOffset: -4
ColumnLimit: 79
UseTab: Never
IndentWidth: 4
BinPackArguments: false
BinPackParameters: false
Standard: Cpp11
AlignOperands: true
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
IndentCaseLabels: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ variables:
build:
stage: build
before_script:
- apt update && apt -y install cmake g++ ninja-build
- apt update && apt -y install cmake g++ ninja-build libglew-dev libglfw3-dev
script:
- mkdir build && cd build
- cmake -G Ninja ..
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "external/fmt"]
path = external/fmt
url = https://github.com/fmtlib/fmt.git
[submodule "external/imgui"]
path = external/imgui
url = https://github.com/ocornut/imgui.git
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ branches:
addons:
apt:
packages: &common_packages
- libglew-dev
- libglfw3-dev
- lcov
- cmake
- make
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ project(irritator VERSION 0.1.0 LANGUAGES CXX)
# https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html
include(GNUInstallDirs)

option(WITH_GUI "Build the graphical user interface [default: ON]" ON)

find_package(Threads REQUIRED)
add_library(threads INTERFACE IMPORTED)
set_property(TARGET threads PROPERTY
Expand Down
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,29 @@ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

-

imnodes.cpp, imnodes.hpp

MIT License

Copyright (c) 2019 Johann Muszynski

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
4 changes: 4 additions & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ install(TARGETS app
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

if (WITH_GUI)
add_subdirectory(gui)
endif ()
81 changes: 81 additions & 0 deletions app/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(irritator-gui VERSION 0.1.0 LANGUAGES CXX)

set(gui_sources
imnodes.cpp imnodes.hpp node-editor.cpp
${PROJECT_SOURCE_DIR}/../../external/imgui/imgui.cpp
${PROJECT_SOURCE_DIR}/../../external/imgui/imgui.h
${PROJECT_SOURCE_DIR}/../../external/imgui/imgui_demo.cpp
${PROJECT_SOURCE_DIR}/../../external/imgui/imgui_draw.cpp
${PROJECT_SOURCE_DIR}/../../external/imgui/imgui_widgets.cpp
${PROJECT_SOURCE_DIR}/../../external/imgui/imgui_internal.h
${PROJECT_SOURCE_DIR}/../../external/imgui/imconfig.h
${PROJECT_SOURCE_DIR}/../../external/imgui/imstb_rectpack.h
${PROJECT_SOURCE_DIR}/../../external/imgui/imstb_textedit.h
${PROJECT_SOURCE_DIR}/../../external/imgui/imstb_truetype.h)

if (WIN32)
list(APPEND gui_sources
main-windows.cpp
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/imgui_impl_win32.cpp
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/imgui_impl_win32.h
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/imgui_impl_dx12.h
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/imgui_impl_dx12.cpp)
else ()
find_package(glfw3 REQUIRED)
find_package(GLEW REQUIRED)
list(APPEND gui_sources
main-unix.cpp
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/imgui_impl_glfw.cpp
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/imgui_impl_glfw.h
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/imgui_impl_opengl3.cpp
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/imgui_impl_opengl3.h
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/libs/gl3w/GL/gl3w.c
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/libs/gl3w/GL/gl3w.h
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/libs/gl3w/GL/glcorearb.h)
endif ()

add_executable(irritator-gui ${gui_sources})

target_include_directories(irritator-gui
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/lib/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/lib/include>
$<INSTALL_INTERFACE:include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/../../external/imgui
${PROJECT_SOURCE_DIR}/../../external/imgui/examples
${PROJECT_SOURCE_DIR}/../../external/imgui/examples/libs/gl3w)

target_link_libraries(irritator-gui
PRIVATE
$<$<PLATFORM_ID:Linux>:GLEW::GLEW>
$<$<CXX_COMPILER_ID:GNU>:stdc++fs>
$<$<CXX_COMPILER_ID:Clang>:c++fs>
threads
$<$<PLATFORM_ID:Linux>:dl>
$<$<PLATFORM_ID:Linux>:GL>
$<$<PLATFORM_ID:Linux>:glfw>
$<$<PLATFORM_ID:Windows>:d3d12>
$<$<PLATFORM_ID:Windows>:dxguid>
$<$<PLATFORM_ID:Windows>:dxgi>
$<$<PLATFORM_ID:Windows>:d3dcompiler>
libirritator)

target_compile_definitions(irritator-gui
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS>
$<$<CXX_COMPILER_ID:MSVC>:_SCL_SECURE_NO_WARNINGS>
VERSION_MAJOR=${PROJECT_VERSION_MAJOR}
VERSION_MINOR=${PROJECT_VERSION_MINOR}
VERSION_PATCH=${PROJECT_VERSION_PATCH})

set_target_properties(irritator-gui PROPERTIES
OUTPUT_NAME "irritator-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
CXX_STANDARD 20)

install(TARGETS irritator-gui
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
19 changes: 19 additions & 0 deletions app/gui/gui.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) 2020 INRA Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifndef ORG_VLEPROJECT_IRRITATOR_APP_GUI_2020
#define ORG_VLEPROJECT_IRRITATOR_APP_GUI_2020

namespace irt {

void
node_editor_initialize();
void
node_editor_show();
void
node_editor_shutdown();

} // namespace irt

#endif
Loading