# leap71/picogkruntime architecture

> Architecture diagram of the GitHub repository leap71/picogkruntime, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/leap71/picogkruntime
- Repository: https://github.com/leap71/picogkruntime

## Overview

PicoGK Runtime is a C++ computational-geometry kernel exposed through a C-compatible handle-based API. A typical client creates a library instance, constructs or manipulates voxel geometry, and may convert it to a mesh or display geometry in a viewer. The tree and API excerpt also identify polyline, lattice, and OpenVDB file/field capabilities. The sampled implementation confirms instance-owned mesh and voxel handles and viewer event dispatch; links between other API subsystems are omitted where their implementation was not sampled.

Main entry points: [`Source/PicoGKLibrary.cpp`](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKLibrary.cpp) (Runtime facade), [`API/PicoGK.h`](https://github.com/leap71/picogkruntime/blob/main/API/PicoGK.h) (C API), [`Source/PicoGKGLViewerManager.cpp`](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLViewerManager.cpp) (Viewer manager), [`Source/PicoGKGLViewer.cpp`](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLViewer.cpp) (Viewer window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Public API"]
  node_api["C API<br/>[PicoGK.h]"]
  node_types["API types<br/>[PicoGKApiTypes.h]"]
  node_runtime["Runtime facade<br/>[PicoGKLibrary.cpp]"]
  node_handles["Handle manager"]
  node_viewerapi["Viewer API<br/>[PicoGK.h]"]
end

subgraph group_geometry["Geometry Data"]
  node_voxels["Voxel fields<br/>[PicoGKVdbVoxels.h]"]
  node_vdbfield["VDB fields<br/>[PicoGKVdbField.h]"]
  node_mesh["Mesh data<br/>[PicoGKMesh.h]"]
  node_polyline["Polylines<br/>[PicoGKPolyLine.h]"]
  node_lattice["Lattice data<br/>[PicoGKLattice.h]"]
end

subgraph group_vdb["VDB Interchange"]
  node_vdbfile["VDB files<br/>[PicoGKVdbFile.h]"]
  node_vdbmeta["VDB metadata<br/>[PicoGKVdbMeta.h]"]
end

subgraph group_viewer["Visualization"]
  node_viewermanager["Viewer manager"]
  node_viewer["Viewer window<br/>[PicoGKGLViewer.cpp]"]
  node_renderobjects["Render objects"]
  node_globjects["GPU objects"]
  node_shaders["Viewer shaders"]
  node_glfw["GLFW"]
  node_opengl["OpenGL"]
end

node_client(("Engineering client"))

node_client -->|"calls"| node_api
node_api -->|"implemented by"| node_runtime
node_api -->|"uses types"| node_types
node_runtime -->|"manages handles"| node_handles
node_runtime -->|"creates and reads"| node_mesh
node_runtime -->|"creates and reads"| node_voxels
node_runtime -->|"accesses"| node_vdbfile
node_runtime -->|"accesses"| node_vdbfield
node_viewerapi -->|"creates viewers"| node_viewermanager
node_viewermanager -->|"creates and dispatches"| node_viewer
node_viewermanager -->|"creates windows"| node_glfw
node_viewer -->|"displays"| node_renderobjects
node_renderobjects -->|"uses GPU objects"| node_globjects
node_globjects -->|"issues graphics calls"| node_opengl
node_viewer -->|"uses shaders"| node_shaders

click node_api "https://github.com/leap71/picogkruntime/blob/main/API/PicoGK.h"
click node_types "https://github.com/leap71/picogkruntime/blob/main/API/PicoGKApiTypes.h"
click node_runtime "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKLibrary.cpp"
click node_handles "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKHandleManager.h"
click node_voxels "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKVdbVoxels.h"
click node_vdbfield "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKVdbField.h"
click node_mesh "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKMesh.h"
click node_polyline "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKPolyLine.h"
click node_lattice "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKLattice.h"
click node_vdbfile "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKVdbFile.h"
click node_vdbmeta "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKVdbMeta.h"
click node_viewerapi "https://github.com/leap71/picogkruntime/blob/main/API/PicoGK.h"
click node_viewermanager "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLViewerManager.cpp"
click node_viewer "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLViewer.cpp"
click node_renderobjects "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLViewerObjects.cpp"
click node_globjects "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLObjects.cpp"
click node_shaders "https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLViewerShaders.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_types,node_runtime,node_handles,node_viewerapi,node_client toneBlue
class node_voxels,node_vdbfield,node_mesh,node_polyline,node_lattice toneAmber
class node_vdbfile,node_vdbmeta toneMint
class node_viewermanager,node_viewer,node_renderobjects,node_globjects,node_shaders,node_glfw,node_opengl toneRose
```

## Components

### Public API

- [C API](https://github.com/leap71/picogkruntime/blob/main/API/PicoGK.h): `API/PicoGK.h`
- [API types](https://github.com/leap71/picogkruntime/blob/main/API/PicoGKApiTypes.h): `API/PicoGKApiTypes.h`
- [Runtime facade](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKLibrary.cpp): `Source/PicoGKLibrary.cpp`
- [Handle manager](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKHandleManager.h): `Source/PicoGKHandleManager.h`
- [Viewer API](https://github.com/leap71/picogkruntime/blob/main/API/PicoGK.h): `API/PicoGK.h`

### Geometry Data

- [Voxel fields](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKVdbVoxels.h): `Source/PicoGKVdbVoxels.h`
- [VDB fields](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKVdbField.h): `Source/PicoGKVdbField.h`
- [Mesh data](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKMesh.h): `Source/PicoGKMesh.h`
- [Polylines](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKPolyLine.h): `Source/PicoGKPolyLine.h`
- [Lattice data](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKLattice.h): `Source/PicoGKLattice.h`

### VDB Interchange

- [VDB files](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKVdbFile.h): `Source/PicoGKVdbFile.h`
- [VDB metadata](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKVdbMeta.h): `Source/PicoGKVdbMeta.h`

### Visualization

- [Viewer manager](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLViewerManager.cpp): `Source/PicoGKGLViewerManager.cpp`
- [Viewer window](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLViewer.cpp): `Source/PicoGKGLViewer.cpp`
- [Render objects](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLViewerObjects.cpp): `Source/PicoGKGLViewerObjects.cpp`
- [GPU objects](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLObjects.cpp): `Source/PicoGKGLObjects.cpp`
- [Viewer shaders](https://github.com/leap71/picogkruntime/blob/main/Source/PicoGKGLViewerShaders.cpp): `Source/PicoGKGLViewerShaders.cpp`
- **GLFW**
- **OpenGL**

### Other components

- **Engineering client**

## Connections

- Engineering client → C API: calls
- C API → Runtime facade: implemented by
- C API → API types: uses types
- Runtime facade → Handle manager: manages handles
- Runtime facade → Mesh data: creates and reads
- Runtime facade → Voxel fields: creates and reads
- Runtime facade → VDB files: accesses
- Runtime facade → VDB fields: accesses
- Viewer API → Viewer manager: creates viewers
- Viewer manager → Viewer window: creates and dispatches
- Viewer manager → GLFW: creates windows
- Viewer window → Render objects: displays
- Render objects → GPU objects: uses GPU objects
- GPU objects → OpenGL: issues graphics calls
- Viewer window → Viewer shaders: uses shaders
