# icosa-foundation/open-brush architecture

> Architecture diagram of the GitHub repository icosa-foundation/open-brush, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/icosa-foundation/open-brush
- Repository: https://github.com/icosa-foundation/open-brush

## Overview

##### Main Components

a. Core Application Layer
- App Manager (App.cs)
- Scene Management (SceneScript.cs)
- Config Management (Config.cs, UserConfig.cs)
- Input Management (InputManager.cs, VrInput.cs)

b. VR Systems Layer
- VR SDK Integration (VrSdk.cs)
- Controller Management (BaseControllerBehavior.cs)
- Platform-specific implementations (Oculus, OpenXR, etc.)

c. Brush System
- Brush Management (BrushController.cs)
- Brush Catalog (BrushCatalog.cs)
- Stroke Management (Stroke.cs, StrokeData.cs)
- Brush Rendering Pipeline

d. UI/Panels System
- Panel Management (PanelManager.cs)
- GUI Components (under GUI/ directory)
- Tool System (under Tools/ directory)

e. File/Storage System
- Save/Load Management (SaveLoadScript.cs)
- Export System (Export/ directory)
- Sketch Management (SketchCatalog.cs)

f. Multiplayer System
- Photon Integration
- Multiplayer Manager (MultiplayerManager.cs)
- Voice Chat Integration

##### Relationships and Data Flow

- User input → Input Manager → Brush Controller → Stroke Creation
- Stroke Data → Rendering Pipeline → Display
- Panel Manager ↔ Tool System
- Save System → Storage/Cloud Services
- Config System → All Components

##### External Services Integration
- Google Drive
- Sketchfab
- YouTube
- Photon (Multiplayer)

##### Layered Architecture

Top to bottom:

##### Subsystem details

For Brush System:
- Brush Descriptors
- Geometry Generation
- Material Management
- Audio Reactive Features

For UI System:
- Panel Hierarchy
- Tool Management
- Input Processing
- Feedback Systems

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "User Interface Layer"
        PanelMgr["Panel Manager"]:::ui
        GUI["GUI Components"]:::ui
        Tools["Tool System"]:::ui
        dummy1[" "]:::dummy
    end

    subgraph "Application Logic Layer"
        AppMgr["App Manager"]:::core
        SceneMgr["Scene Management"]:::core
        ConfigMgr["Config Management"]:::core
        InputMgr["Input Management"]:::core
        dummy2[" "]:::dummy
    end

    subgraph "Brush System Layer"
        BrushCtrl["Brush Controller"]:::brush
        BrushCat["Brush Catalog"]:::brush
        StrokeMgr["Stroke Management"]:::brush
        RenderPipe["Rendering Pipeline"]:::brush
        dummy3[" "]:::dummy
    end

    subgraph "Platform Integration Layer"
        VRSDK["VR SDK"]:::vr
        CtrlMgr["Controller Management"]:::vr
        PlatImpl["Platform Implementations"]:::vr
        dummy4[" "]:::dummy
    end

    subgraph "File System Layer"
        SaveLoad["Save/Load Manager"]:::storage
        Export["Export System"]:::storage
        SketchCat["Sketch Catalog"]:::storage
        dummy5[" "]:::dummy
    end

    subgraph "Multiplayer Layer"
        MultiMgr["Multiplayer Manager"]:::multi
        PhotonInt["Photon Integration"]:::multi
        VoiceChat["Voice Chat"]:::multi
        dummy6[" "]:::dummy
    end

    subgraph "External Services"
        GDrive["Google Drive"]:::external
        Sketchfab["Sketchfab"]:::external
        YouTube["YouTube"]:::external
        dummy7[" "]:::dummy
    end

    dummy1 --> dummy2
    dummy2 --> dummy3
    dummy3 --> dummy4
    dummy4 --> dummy5
    dummy5 --> dummy6
    dummy6 --> dummy7

    InputMgr --> BrushCtrl
    BrushCtrl --> StrokeMgr
    StrokeMgr --> RenderPipe
    PanelMgr <--> Tools
    SaveLoad --> GDrive
    Export --> Sketchfab
    Export --> YouTube
    ConfigMgr --> AppMgr
    VRSDK --> CtrlMgr
    CtrlMgr --> InputMgr
    MultiMgr --> PhotonInt
    PhotonInt --> VoiceChat

    click AppMgr "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/App.cs"
    click SceneMgr "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/SceneScript.cs"
    click ConfigMgr "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/Config.cs"
    click InputMgr "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/InputManager.cs"
    click VRSDK "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/VrSdk.cs"
    click CtrlMgr "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/Input/BaseControllerBehavior.cs"
    click PlatImpl "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/Input/UnityXRControllerInfo.cs"
    click BrushCtrl "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/BrushController.cs"
    click BrushCat "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/BrushCatalog.cs"
    click StrokeMgr "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/Stroke.cs"
    click PanelMgr "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/GUI/PanelManager.cs"
    click GUI "https://github.com/icosa-foundation/open-brush/tree/main/Assets/Scripts/GUI/"
    click Tools "https://github.com/icosa-foundation/open-brush/tree/main/Assets/Scripts/Tools/"
    click SaveLoad "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/Save/SaveLoadScript.cs"
    click Export "https://github.com/icosa-foundation/open-brush/tree/main/Assets/Scripts/Export/"
    click SketchCat "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/Save/SketchCatalog.cs"
    click MultiMgr "https://github.com/icosa-foundation/open-brush/tree/main/Assets/Scripts/Multiplayer/"
    click PhotonInt "https://github.com/icosa-foundation/open-brush/tree/main/Assets/Scripts/Multiplayer/Photon/"
    click VoiceChat "https://github.com/icosa-foundation/open-brush/blob/main/Assets/Scripts/Multiplayer/Photon/PhotonVoiceManager.cs"

    classDef core fill:#f9f,stroke:#333,stroke-width:2px
    classDef ui fill:#bbf,stroke:#333,stroke-width:2px
    classDef brush fill:#bfb,stroke:#333,stroke-width:2px
    classDef vr fill:#fbf,stroke:#333,stroke-width:2px
    classDef storage fill:#ff9,stroke:#333,stroke-width:2px
    classDef multi fill:#9ff,stroke:#333,stroke-width:2px
    classDef external fill:#ddd,stroke:#333,stroke-width:2px
    classDef dummy fill:none,stroke:none
```
