Files
graph_explorer/CMakeLists.txt
T
egutierrez b767b5b85e feat: graph_explorer app — agnostic operations.db viewer (issue 0049k)
App C++ ImGui que abre cualquier operations.db del registry y lo visualiza
como grafo con shapes/iconos/layouts/filtros/labels.

Composicion del registry:
- viz/graph_renderer + graph_force_layout(_gpu) + graph_layouts +
  graph_viewport + graph_labels + graph_icons + graph_sources
- core: toolbar, modal_dialog, select, text_input, tree_view, page_header,
  fullscreen_window, button, badge, empty_state

Capas:
- data.{h,cpp}    — dispatcher GraphLoadFn (operations hoy; json/graphml manana).
- types_registry.{h,cpp} — parser YAML minimal + tabler_codepoint_by_name +
  apply_types_yaml + IconAtlas builder.
- views.{h,cpp}   — Toolbar, Legend, Inspector, Stats, modal Filters/Open.
- layout_store.{h,cpp} — graph_explorer.db SQLite con tabla layouts(graph_hash,
  node_id, x, y, pinned, updated_at). UPSERT por nodo.
- main.cpp        — CLI (--input/--types/--layout) + fn::run_app + bucle
  force layout (CPU/GPU toggle) + render con 3 columnas (Legend / Viewport /
  Inspector+Stats).

examples/types.yaml: 10 entidades OSINT (Person/Email/Domain/Phone/Org/IBAN/
Account/Document/Address/Url) + 5 relaciones (owns/knows/located_in/
transfers_to/member_of) con shapes Tabler reales.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 00:13:59 +02:00

67 lines
2.6 KiB
CMake

# SQLite3: el target SQLite::SQLite3 lo crea ya cpp/CMakeLists.txt (sistema en
# Linux, vendored amalgamation en Windows). Si esta app se construye en
# stand-alone, levantar SQLite desde el amalgamation vendoreado del registry.
find_package(SQLite3 QUIET)
if(NOT SQLite3_FOUND AND NOT TARGET sqlite3_vendored)
set(SQLITE3_AMALG_DIR ${FN_CPP_ROOT_DIR}/vendor/sqlite3)
add_library(sqlite3_vendored STATIC ${SQLITE3_AMALG_DIR}/sqlite3.c)
target_include_directories(sqlite3_vendored PUBLIC ${SQLITE3_AMALG_DIR})
target_compile_definitions(sqlite3_vendored PRIVATE
SQLITE_THREADSAFE=1
SQLITE_ENABLE_FTS5
SQLITE_ENABLE_JSON1
)
add_library(SQLite::SQLite3 ALIAS sqlite3_vendored)
endif()
add_imgui_app(graph_explorer
main.cpp
data.cpp
views.cpp
types_registry.cpp
layout_store.cpp
# --- viz ---
${FN_CPP_ROOT_DIR}/functions/viz/graph_renderer.cpp
${FN_CPP_ROOT_DIR}/functions/viz/graph_force_layout.cpp
${FN_CPP_ROOT_DIR}/functions/viz/graph_force_layout_gpu.cpp
${FN_CPP_ROOT_DIR}/functions/viz/graph_layouts.cpp
${FN_CPP_ROOT_DIR}/functions/viz/graph_viewport.cpp
${FN_CPP_ROOT_DIR}/functions/viz/graph_viewport_selection.cpp
${FN_CPP_ROOT_DIR}/functions/viz/graph_labels.cpp
${FN_CPP_ROOT_DIR}/functions/viz/graph_labels_select.cpp
${FN_CPP_ROOT_DIR}/functions/viz/graph_icons.cpp
${FN_CPP_ROOT_DIR}/functions/viz/graph_sources.cpp
${FN_CPP_ROOT_DIR}/functions/viz/graph_types.cpp
${FN_CPP_ROOT_DIR}/functions/core/graph_spatial_hash.cpp
# --- core UI ---
${FN_CPP_ROOT_DIR}/functions/core/button.cpp
${FN_CPP_ROOT_DIR}/functions/core/icon_button.cpp
${FN_CPP_ROOT_DIR}/functions/core/toolbar.cpp
${FN_CPP_ROOT_DIR}/functions/core/modal_dialog.cpp
${FN_CPP_ROOT_DIR}/functions/core/text_input.cpp
${FN_CPP_ROOT_DIR}/functions/core/select.cpp
${FN_CPP_ROOT_DIR}/functions/core/tree_view.cpp
${FN_CPP_ROOT_DIR}/functions/core/page_header.cpp
${FN_CPP_ROOT_DIR}/functions/core/fullscreen_window.cpp
${FN_CPP_ROOT_DIR}/functions/core/badge.cpp
${FN_CPP_ROOT_DIR}/functions/core/empty_state.cpp
)
target_include_directories(graph_explorer PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${FN_CPP_ROOT_DIR}/functions
)
target_link_libraries(graph_explorer PRIVATE SQLite::SQLite3)
# OpenGL: graph_renderer + graph_force_layout_gpu llaman gl* directamente.
# fn::run_app inicializa el loader cuando AppConfig::init_gl_loader = true.
if(NOT WIN32)
find_package(OpenGL REQUIRED)
target_link_libraries(graph_explorer PRIVATE OpenGL::GL)
endif()
if(WIN32)
set_target_properties(graph_explorer PROPERTIES WIN32_EXECUTABLE TRUE)
endif()