Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sfml_gm / sfml_graphmaker

C++17

A lightweight C++ library for graph visualization and pathfinding using SFML. Create, visualize, and analyze graphs with an intuitive interface.

Легковесная C++ библиотека для визуализации графов и поиска путей с использованием SFML. Создавайте, визуализируйте и анализируйте графы с помощью интуитивного интерфейса.


📌 Features / Возможности

English:

  • Create vertices and edges with custom positions, colors, and sizes
  • Support for both directed and undirected edges
  • Weighted edges with visual weight display
  • Dijkstra's algorithm with path highlighting
  • Find vertices by screen coordinates (for interactive applications)
  • Clean separation of graph logic from visualization

Русский:

  • Создание вершин и рёбер с настраиваемыми позициями, цветами и размерами
  • Поддержка ориентированных и неориентированных рёбер
  • Взвешенные рёбра с отображением веса
  • Алгоритм Дейкстры с подсветкой найденного пути
  • Поиск вершин по координатам (для интерактивных приложений)
  • Чистое разделение логики графа и визуализации

🚀 Quick Start / Быстрый старт

Requirements / Требования

  • C++17 compiler

Manual compilation / Ручная сборка

g++ -std=c++17 -Iinclude \
    your_file.cpp \
    src/Graph.cpp src/Vertex.cpp src/Edge.cpp src/GraphPart.cpp \
    -o your_bin \
    -lsfml-graphics -lsfml-window -lsfml-system

📁 Project Structure / Структура проекта

sfml_gm/
├── include/           # Headers / Заголовочные файлы
├── src/               # Source files / Исходные файлы
├── examples/          # Usage examples / Примеры использования
│   ├── simple_graph.cpp
│   └── random_graph.cpp
├── assets/            # Resources (fonts) / Ресурсы (шрифты)
└── README.md

🛠️ API Overview / Обзор API

Graph

  • add_vertex(Vertex*) / remove_vertex(Vertex*)
  • add_edge(from, to, direction, thickness, weight, color)
  • dijkstra(start, target) / dijkstra_highlight(start, target)
  • find_vertex_at(position, tolerance)
  • draw(target)

Vertex

  • set_name(string) / set_radius(float) / set_color(Color)
  • get_position() / get_adj_vertices()

Edge

  • set_weight(float) / set_direction(int)
  • connects(v1, v2) / get_other_end(vertex)

🙏 Acknowledgements / Благодарности

English:

Русский:

  • SFML — простая и быстрая мультимедийная библиотека
  • DejaVu Fonts — свободные шрифты

📄 License / Лицензия

MIT License — free for personal and commercial use.
MIT Лицензия — свободно для личного и коммерческого использования.

Releases

Packages

Used by

Contributors

Languages