# kentakato/delaunayvoronoicpp architecture

> Architecture diagram of the GitHub repository kentakato/delaunayvoronoicpp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kentakato/delaunayvoronoicpp
- Repository: https://github.com/kentakato/delaunayvoronoicpp

## Overview

##### Main components
- Demo/Executable Applications: Identify the “apps” directory, which holds various C++ demo files (e.g., interactive Delaunay/Voronoi app, centroid Voronoi demo, and generalized Voronoi demonstration). These are the entry points showcasing how the core library is used.
- External Dependencies: Include symbols for libraries like OpenCV (for rendering graphics), YAML-CPP (for configuration or data loading), and CMake/C++ Compiler (in the build process). These affect the build and runtime behavior.

##### Relationships and interactions
- The demo applications (in “apps”) call functions and use classes provided by the core geometry library (from “include” and “src”).
- The interactive demos (such as “interactive_delaunay_voronoi.cpp”) incorporate input handling, graphical rendering (via OpenCV), and real-time feedback (like adding vertices and toggling views).
- External libraries provide the underlying support (e.g., OpenCV for rendering and YAML-CPP for any configuration needs).

##### Architectural patterns/design principles
- Separation of Concerns: Clearly separate the computational geometry algorithms (core library) from application logic (demos).
- Modular Design: The directory structure indicates a modular design where the algorithms are implemented in reusable headers and source files, making the library extensible to other projects.
- Demo & Interactive Layer: The interaction model in the demos (where users can add vertices, toggle component displays, and so forth) suggests an event-driven design for handling GUI events.

##### Specific recommendations
- Where applicable, note design features such as “Bowyer-Watson algorithm” within the core module for additional clarity.

## Diagram (Mermaid)

```mermaid
flowchart TD
    U["User"]:::user
    U -->|"triggers"| DemoApps

    DemoApps["Demo/Executable Applications"]:::demo

    DemoApps -->|"calls"| DelaunayTriangulation
    DemoApps -->|"calls"| VoronoiDiagram
    DemoApps -->|"calls"| GeometryPrimitives
    DemoApps -->|"calls"| DrawingUtils

    subgraph "Core Geometry Library"
        DelaunayTriangulation["Delaunay Triangulation Module"]:::core
        VoronoiDiagram["Voronoi Diagram Construction"]:::core
        GeometryPrimitives["Geometry Primitives"]:::core
        DrawingUtils["Drawing/Visualization Utilities"]:::core
    end

    subgraph "External Dependencies"
        OpenCV["OpenCV"]:::external
        YAMLCPP["YAML-CPP"]:::external
        BuildTools["CMake & C++ Compiler"]:::external
    end

    OpenCV -->|"supports"| DemoApps
    OpenCV -->|"supports"| DrawingUtils
    YAMLCPP -->|"configures"| DemoApps
    BuildTools -->|"builds"| DemoApps
    BuildTools -->|"builds"| DelaunayTriangulation
    BuildTools -->|"builds"| VoronoiDiagram
    BuildTools -->|"builds"| GeometryPrimitives
    BuildTools -->|"builds"| DrawingUtils

    click DelaunayTriangulation "https://github.com/kentakato/delaunayvoronoicpp/blob/main/include/DelaunayTriangulation/delaunay_triangulation.hpp"
    click DelaunayTriangulation "https://github.com/kentakato/delaunayvoronoicpp/blob/main/src/delaunay_triangulation.cpp"
    click VoronoiDiagram "https://github.com/kentakato/delaunayvoronoicpp/blob/main/include/DelaunayTriangulation/voronoi_diagram.hpp"
    click VoronoiDiagram "https://github.com/kentakato/delaunayvoronoicpp/blob/main/src/voronoi_diagram.cpp"
    click GeometryPrimitives "https://github.com/kentakato/delaunayvoronoicpp/blob/main/include/DelaunayTriangulation/geometry_primitives.hpp"
    click GeometryPrimitives "https://github.com/kentakato/delaunayvoronoicpp/blob/main/src/geometry_primitives.cpp"
    click DrawingUtils "https://github.com/kentakato/delaunayvoronoicpp/blob/main/include/DelaunayTriangulation/delaunay_triangulation_drawer.hpp"
    click DrawingUtils "https://github.com/kentakato/delaunayvoronoicpp/blob/main/src/delaunay_triangulation_drawer.cpp"
    click DemoApps "https://github.com/kentakato/delaunayvoronoicpp/tree/main/apps/"

    classDef user fill:#ffff99,stroke:#333,stroke-width:2px;
    classDef demo fill:#a1e3a1,stroke:#333,stroke-width:2px;
    classDef core fill:#a1c4fd,stroke:#333,stroke-width:2px;
    classDef external fill:#f9d5e5,stroke:#333,stroke-width:2px;
```
