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

Updates and refactoring of ltsview #1691

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
56f401d
Update AddMCRL2Binary.cmake
rvinktue Aug 5, 2022
0e7ffb5
Fix accidental removal of "resources" argument
rvinktue Aug 5, 2022
49b9c9e
Major structure overhaul
rvinktue Jul 29, 2022
3028d8d
Fix templating
rvinktue Aug 6, 2022
a6306ee
Added (some) default mesh factories and improved functor templating
rvinktue Aug 8, 2022
e549394
Update AddMCRL2Binary.cmake
rvinktue Aug 10, 2022
7553829
Generic visualizer overhaul
rvinktue Aug 10, 2022
cbdfc9c
Merge branch 'cmake-update' into ltsview-update
rvinktue Aug 10, 2022
2502d2b
Add template<> to fix MacOS compilation
rvinktue Aug 11, 2022
8fb75ec
Fix cmath include
rvinktue Aug 11, 2022
c7a8a46
Fix missing template<> for variable declarations
rvinktue Aug 12, 2022
79d514c
Update MacOS build fouten
rvinktue Aug 12, 2022
1a6145a
MacOS fix
rvinktue Aug 12, 2022
56276bb
Warning fixes + MacOS fix attempt
rvinktue Aug 12, 2022
3401170
Removed directory functionality
rvinktue Aug 15, 2022
7d3ae86
Intermediate commit
rvinktue Aug 18, 2022
7cafacd
Update cmakelists, add assert macros
rvinktue Aug 19, 2022
25ea826
Merge branch 'cmake-update' into ltsview-update
rvinktue Aug 19, 2022
2656735
Needs squash
rvinktue Aug 26, 2022
1be8fde
TestScene implemented for obtaining OpenGL debug output
rvinktue Sep 5, 2022
a175b1a
Not functional commit. Transfer to other machine
rvinktue Sep 23, 2022
cad39fc
Intermediate commit. To be squashed
rvinktue Sep 30, 2022
26e070e
Functional* build
rvinktue Oct 6, 2022
bfb9cd4
Amend to last commit - disable debug printing to allow large statespaces
rvinktue Oct 6, 2022
a3317a6
Compilation error fixes and small control changes
rvinktue Oct 7, 2022
6a1d53c
Moet nog gesquasht worden
rvinktue Mar 20, 2023
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
62 changes: 43 additions & 19 deletions build/cmake/AddMCRL2Binary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ include(CMakeParseArguments)
cmake_minimum_required(VERSION 3.1)
find_package(Threads)

macro(append_unique LIST_VAR VALUE)
list(FIND ${LIST_VAR} ${VALUE} _index)
if(_index EQUAL -1)
list(APPEND ${LIST_VAR} "${VALUE}")
endif()
endmacro()

function(_add_library_tests TARGET_NAME)
file(GLOB librarytest "test/*.cpp")
file(GLOB libraryexample "example/*.cpp")
Expand Down Expand Up @@ -145,7 +152,6 @@ function(_add_mcrl2_binary TARGET_NAME TARGET_TYPE)
set(VALUE_KW "SOURCEDIR" "INCLUDEDIR" "COMPONENT" "DESCRIPTION" "MENUNAME" "ICON")
set(LIST_KW "SOURCES" "DEPENDS" "INCLUDE" "RESOURCES" "NOHEADERTEST")
cmake_parse_arguments("ARG" "${OPTION_KW}" "${VALUE_KW}" "${LIST_KW}" ${ARGN})

if(NOT ARG_COMPONENT)
if("${TARGET_TYPE}" STREQUAL "LIBRARY")
set(ARG_COMPONENT "Libraries")
Expand Down Expand Up @@ -175,38 +181,55 @@ function(_add_mcrl2_binary TARGET_NAME TARGET_TYPE)
(IS_GUI_BINARY AND NOT MCRL2_ENABLE_GUI_TOOLS))
return()
endif()

get_filename_component(SOURCEDIR_ABS ${ARG_SOURCEDIR} ABSOLUTE)
get_filename_component(INCLUDEDIR_ABS ${ARG_INCLUDEDIR} ABSOLUTE)

foreach(SRC ${ARG_SOURCES})
get_filename_component(SRC_ABS ${SRC} ABSOLUTE)
if(NOT "${SRC_ABS}" STREQUAL "${SRC}")
get_filename_component(SRC_ABS ${ARG_SOURCEDIR}/${SRC} ABSOLUTE)
foreach(_SRC ${ARG_SOURCES})
get_filename_component(_SRC_ABS ${_SRC} ABSOLUTE)

# TODO: Is this necessary/wanted?
if(NOT EXISTS ${_SRC_ABS})
file(GLOB_RECURSE _SRC_ABS "${SOURCEDIR_ABS}/${_SRC}")
if(NOT _SRC_ABS)
message(WARNING " - ${TARGET_NAME} - No SRC_ABS with GLOB_RECURSE or get_filename_component for file: ${_SRC}")
endif()
endif()

get_filename_component(SRC_EXT ${SRC_ABS} EXT)
list(APPEND ARG_SOURCES_ABS ${_SRC_ABS})
endforeach()

foreach(_SRC_ABS ${ARG_SOURCES_ABS})
# Check if file extension requires extra work
get_filename_component(SRC_EXT ${_SRC_ABS} EXT)
if("${SRC_EXT}" STREQUAL ".g")
# This is a grammar file. Generate a .c file using DParser
get_filename_component(SRC_BASE ${SRC_ABS} NAME_WE)
get_filename_component(SRC_BASE ${_SRC_ABS} NAME_WE)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/source)
set(PARSER_CODE ${CMAKE_CURRENT_BINARY_DIR}/source/${SRC_BASE}.c)
string(REGEX REPLACE "(.*)_syntax" "\\1" GRAMMAR_IDENT ${SRC_BASE})
add_custom_command(
OUTPUT ${PARSER_CODE}
COMMAND make_dparser -A -H0 -i${GRAMMAR_IDENT} -o${PARSER_CODE} ${SRC_ABS}
DEPENDS make_dparser ${SRC_ABS}
COMMAND make_dparser -A -H0 -i${GRAMMAR_IDENT} -o${PARSER_CODE} ${_SRC_ABS}
DEPENDS make_dparser ${_SRC_ABS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating ${GRAMMAR_IDENT} parser"
)
add_custom_target(${LIBNAME}_${SRC_BASE} SOURCES ${SRC_ABS})
set(SRC_ABS ${PARSER_CODE})
set(DEPENDS ${DEPENDS} dparser)
set(ARG_INCLUDE ${ARG_INCLUDE} ${CMAKE_SOURCE_DIR}/3rd-party/dparser)
add_custom_target(${LIBNAME}_${SRC_BASE} SOURCES ${_SRC_ABS})
set(_SRC_ABS ${PARSER_CODE})

append_unique(DEPENDS dparser)
append_unique(ARG_INCLUDE ${CMAKE_SOURCE_DIR}/3rd-party/dparser)
endif()
set(ARG_INCLUDE ${ARG_INCLUDE} ${CMAKE_SOURCE_DIR}/3rd-party/sylvan/src)
set(SOURCES ${SRC_ABS} ${SOURCES})

append_unique(ARG_INCLUDE ${CMAKE_SOURCE_DIR}/3rd-party/sylvan/src)
append_unique(SOURCES ${_SRC_ABS})
endforeach()

file(GLOB_RECURSE TARGET_INCLUDE_FILES ${ARG_INCLUDEDIR}/*.h)

# TODO: Fix finding header files to not use GLOB_RECURSE.
# Potential fixes: - HEADERS list parameter
# - INCLUDE_DIR list parameter -> multiple include directories
file(GLOB_RECURSE TARGET_INCLUDE_FILES ${INCLUDEDIR_ABS}/*.h)

if("${TARGET_TYPE}" STREQUAL "LIBRARY")
if(NOT SOURCES)
# This is a header-only library. We're still going to make a static library
Expand Down Expand Up @@ -243,6 +266,7 @@ function(_add_mcrl2_binary TARGET_NAME TARGET_TYPE)
_add_resource_files(${TARGET_NAME} "${ARG_MENUNAME}" "${ARG_DESCRIPTION}" "${ARG_ICON}" SOURCES)
endif()


add_executable(${TARGET_NAME} ${SOURCES} ${TARGET_INCLUDE_FILES})

if(IS_GUI_BINARY)
Expand All @@ -257,7 +281,7 @@ function(_add_mcrl2_binary TARGET_NAME TARGET_TYPE)
get_target_property(IS_BUNDLE ${TARGET_NAME} MACOSX_BUNDLE)
endif()

target_include_directories(${TARGET_NAME} PUBLIC ${ARG_INCLUDEDIR} ${ARG_INCLUDE})
target_include_directories(${TARGET_NAME} PUBLIC ${ARG_INCLUDEDIR} ${ARG_INCLUDE} )

if(DEPENDS)
target_link_libraries(${TARGET_NAME} ${DEPENDS})
Expand Down
Binary file added examples/academic/abp/abp.lts
Binary file not shown.
2 changes: 1 addition & 1 deletion libraries/gui/include/mcrl2/gui/arcball.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace mcrl2
namespace gui
{

QQuaternion arcballRotation(const QPoint& p1, const QPoint& p2);
QQuaternion arcballRotation(const QPoint& p1, const QPoint& p2, const float rotation_speed = 1.0f);

void applyRotation(const QQuaternion& rotation, bool reverse = false);

Expand Down
4 changes: 2 additions & 2 deletions libraries/gui/source/arcball.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ static QVector3D arcballVector(const QPoint& p)
return QVector3D(x, y, z).normalized();
}

QQuaternion arcballRotation(const QPoint& p1, const QPoint& p2)
QQuaternion arcballRotation(const QPoint& p1, const QPoint& p2, const float rotation_speed)
{
// update rotation based on the difference in mouse coordinates
QVector3D v1 = arcballVector(p1).normalized();
QVector3D v2 = arcballVector(p2).normalized();
QVector3D v2 = arcballVector(p1 + rotation_speed * (p2 - p1)).normalized();
QVector3D cross = QVector3D::crossProduct(v1, v2);
float dot = QVector3D::dotProduct(v1, v2);
return QQuaternion(dot, cross);
Expand Down
5 changes: 0 additions & 5 deletions tools/release/ltsgraph/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,4 @@ class ArcballCameraView
QRect m_viewport;
};

class ArcballCameraController
{

};

#endif // MCRL2_LTSGRAPH_CAMERA_H
2 changes: 1 addition & 1 deletion tools/release/ltsgraph/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class MainWindow : public QMainWindow
void showEvent(QShowEvent* event) override;

private:
Ui::MainWindow m_ui; ///< The user interface generated by Qt.
Ui::MainWindow m_ui; ///< The user interface generated by Qt.
GLWidget* m_glwidget; ///< The GLWidget containing the visualisation of the graph.
Graph::Graph m_graph; ///< The current Graph.
Graph::SpringLayout* m_layout; ///< The SpringLayout algorithm which is applied to the graph.
Expand Down
1 change: 1 addition & 0 deletions tools/release/ltsgraph/shaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ bool GlobalShader::link()

namespace
{


/// \brief A vertex shader that produces a cubic Bezier curve.
const char* g_arcVertexShader =
Expand Down
89 changes: 54 additions & 35 deletions tools/release/ltsview/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,60 @@
# This file was autogenerated with genCMakeLists.py for LTSView
# Version: 1

# Make sure AUTOUIC knows where to find the .ui files.
set(CMAKE_AUTOUIC_SEARCH_PATHS "./include/ui/ui_files/")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE")
add_mcrl2_tool(ltsview
MENUNAME "LTSView"
DESCRIPTION "Visualisation tool for large state spaces (mCRL2 toolset)"
ICON "mcrl2-green"
SOURCES
infodock.ui
mainwindow.ui
markdock.ui
markstateruledialog.ui
savepicturedialog.ui
settingsdialog.ui
settingsdock.ui
simdock.ui
ltsview.qrc
cluster.cpp
conedb.cpp
fsm_state_positioner.cpp
infodock.cpp
lts.cpp
ltscanvas.cpp
ltsmanager.cpp
main.cpp
mainwindow.cpp
markdock.cpp
markmanager.cpp
markstateruledialog.cpp
primitivefactory.cpp
primitives.cpp
rtree.cpp
savepicturedialog.cpp
settingsdialog.cpp
settingsdock.cpp
simdock.cpp
simulation.cpp
sp_state_positioner.cpp
state.cpp
transition.cpp
vectors.cpp
visobjectfactory.cpp
visualizer.cpp
./deprecated/source/scene.cpp
./source/cluster.cpp
./source/fsm_state_positioner.cpp
./source/generic_visualizer/cameras/arcballcamera.cpp
./source/generic_visualizer/glutil/glcolor.cpp
./source/generic_visualizer/glutil/glluts.cpp
./source/generic_visualizer/glutil/glmeshes.cpp
./source/generic_visualizer/glutil/glprimitivefactories.cpp
./source/lts.cpp
./source/ltsmanager.cpp
./source/main.cpp
./source/markmanager.cpp
./source/rtree.cpp
./source/simulation.cpp
./source/sp_state_positioner.cpp
./source/state.cpp
./source/transition.cpp
./source/ui/graphicsinfodialog.cpp
./source/ui/infodock.cpp
./source/ui/mainwindow.cpp
./source/ui/markdock.cpp
./source/ui/markstateruledialog.cpp
./source/ui/savepicturedialog.cpp
./source/ui/settingsdialog.cpp
./source/ui/settingsdock.cpp
./source/ui/simdock.cpp
./source/vectors.cpp
./source/visualizer/conedb.cpp
./source/visualizer/glwidget.cpp
./source/visualizer/ltscanvas.cpp
./source/visualizer/ltsview_visualizer/testscene.cpp
./source/visualizer/ltsview_visualizer/vistreegenerator.cpp
./source/visualizer/primitivefactory.cpp
./source/visualizer/primitives.cpp
./source/visualizer/visobjectfactory.cpp
./source/visualizer/visualizer.cpp
# Qt wants .ui files in the sources variable.
./include/ui/ui_files/graphicsinfodialog.ui
./include/ui/ui_files/infodock.ui
./include/ui/ui_files/mainwindow.ui
./include/ui/ui_files/markdock.ui
./include/ui/ui_files/markstateruledialog.ui
./include/ui/ui_files/savepicturedialog.ui
./include/ui/ui_files/settingsdialog.ui
./include/ui/ui_files/settingsdock.ui
./include/ui/ui_files/simdock.ui
DEPENDS
mcrl2_lts
mcrl2_gui
Expand All @@ -51,4 +68,6 @@ add_mcrl2_tool(ltsview
INCLUDE
${OPENGL_INCLUDE_DIR}
${TR_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
"./include/generic_visualizer/;./include/generic_visualizer/glutil/;./include/ui/;./deprecated/include/;./include/visualizer/;./include/;./include/visualizer/ltsview_visualizer/;./include/generic_visualizer/cameras/"
)
Loading