# rokn/vede architecture

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

- Interactive diagram: https://gitdiagram.com/rokn/vede
- Repository: https://github.com/rokn/vede

## Overview

VeDe is a Qt-based vector-graphics editor. Users create a canvas, choose drawing or manipulation tools, edit graphic objects and their properties, and save the canvas as SVG. The graph captures the documented-by-source UI, editing, rendering, and export components. Several runtime files are unsampled, so uncertain connections are omitted rather than inferred.

Main entry points: [`VeDe/mainwindow.cpp`](https://github.com/rokn/vede/blob/master/VeDe/mainwindow.cpp) (Main Window), [`VeDe-Graphics/objects/gobject.cpp`](https://github.com/rokn/vede/blob/master/VeDe-Graphics/objects/gobject.cpp) (Graphic Objects), [`VeDe/canvasimpl.cpp`](https://github.com/rokn/vede/blob/master/VeDe/canvasimpl.cpp) (Canvas Adapter), [`VeDe-Graphics/canvas.cpp`](https://github.com/rokn/vede/blob/master/VeDe-Graphics/canvas.cpp) (Canvas State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Editor UI"]
  node_mainwindow["Main Window<br/>[mainwindow.cpp]"]
  node_canvasimpl["Canvas Adapter<br/>[canvasimpl.cpp]"]
  node_workspace["Workspace<br/>[workspace.cpp]"]
  node_toolactions["Tool Actions<br/>[toolaction.cpp]"]
  node_propertywidgets["Property UI"]
end

subgraph group_interaction["Editing Tools"]
  node_toolframework["Tool Framework<br/>[tool.cpp]"]
  node_drawtools["Shape and Path Tools<br/>[shapetool.cpp]"]
  node_manipulatetool["Selection and Transform<br/>[manipulatetool.cpp]"]
end

subgraph group_model["Graphics Model"]
  node_canvas["Canvas State<br/>[canvas.cpp]"]
  node_commands["Edit Commands<br/>[canvascommand.cpp]"]
  node_graphicobjects["Graphic Objects<br/>[gobject.cpp]"]
  node_shapes["Shape Types<br/>[shape.cpp]"]
  node_properties["Object Properties<br/>[property.cpp]"]
end

subgraph group_render["Rendering and Export"]
  node_svgmanager["SVG Import Export"]
  node_qtitems["Graphics Items<br/>[baseshapeitem.cpp]"]
  node_painteradapter["Qt Painter Adapter"]
  node_guidrawer["Tool Overlay Drawer<br/>[guidrawer.cpp]"]
end

node_user(("Editor User"))

node_user -->|"uses"| node_mainwindow
node_mainwindow -->|"creates canvas"| node_canvasimpl
node_mainwindow -->|"creates tools"| node_drawtools
node_mainwindow -->|"creates tool"| node_manipulatetool
node_mainwindow -->|"registers tools"| node_toolactions
node_mainwindow -->|"saves SVG"| node_svgmanager
node_mainwindow -->|"undoes and redoes"| node_canvas
node_canvasimpl -->|"uses painter"| node_painteradapter
node_canvasimpl -->|"dispatches events"| node_toolframework
node_canvasimpl -->|"maps objects"| node_graphicobjects
node_drawtools -.->|"extends"| node_toolframework
node_manipulatetool -->|"reads selection"| node_canvas
node_manipulatetool -->|"creates commands"| node_commands
node_commands -->|"updates history"| node_canvas
node_canvas -->|"owns objects"| node_graphicobjects
node_graphicobjects -->|"inherits properties"| node_properties
node_graphicobjects -.->|"specializes as shapes"| node_shapes
node_svgmanager -->|"serializes shapes"| node_shapes
node_qtitems -->|"adapts objects"| node_graphicobjects
node_guidrawer -->|"uses painter"| node_painteradapter
node_guidrawer -->|"draws tool UI"| node_toolframework
node_propertywidgets -.->|"edits properties"| node_properties

click node_mainwindow "https://github.com/rokn/vede/blob/master/VeDe/mainwindow.cpp"
click node_canvasimpl "https://github.com/rokn/vede/blob/master/VeDe/canvasimpl.cpp"
click node_workspace "https://github.com/rokn/vede/blob/master/VeDe/workspace.cpp"
click node_toolactions "https://github.com/rokn/vede/blob/master/VeDe/toolaction.cpp"
click node_toolframework "https://github.com/rokn/vede/blob/master/VeDe-Graphics/tools/tool.cpp"
click node_drawtools "https://github.com/rokn/vede/blob/master/VeDe-Graphics/tools/shapetool.cpp"
click node_manipulatetool "https://github.com/rokn/vede/blob/master/VeDe-Graphics/tools/manipulatetool.cpp"
click node_canvas "https://github.com/rokn/vede/blob/master/VeDe-Graphics/canvas.cpp"
click node_commands "https://github.com/rokn/vede/blob/master/VeDe-Graphics/commands/canvascommand.cpp"
click node_graphicobjects "https://github.com/rokn/vede/blob/master/VeDe-Graphics/objects/gobject.cpp"
click node_shapes "https://github.com/rokn/vede/blob/master/VeDe-Graphics/objects/shape.cpp"
click node_properties "https://github.com/rokn/vede/blob/master/VeDe-Graphics/properties/property.cpp"
click node_propertywidgets "https://github.com/rokn/vede/blob/master/VeDe/propertywidgetfactory.cpp"
click node_svgmanager "https://github.com/rokn/vede/blob/master/VeDe-Graphics/canvasmanagersvg.cpp"
click node_qtitems "https://github.com/rokn/vede/blob/master/VeDe/objects/baseshapeitem.cpp"
click node_painteradapter "https://github.com/rokn/vede/blob/master/VeDe/qtcustompainter.cpp"
click node_guidrawer "https://github.com/rokn/vede/blob/master/VeDe/objects/guidrawer.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_mainwindow,node_canvasimpl,node_workspace,node_toolactions,node_propertywidgets,node_user toneBlue
class node_toolframework,node_drawtools,node_manipulatetool toneAmber
class node_canvas,node_commands,node_graphicobjects,node_shapes,node_properties toneMint
class node_svgmanager,node_qtitems,node_painteradapter,node_guidrawer toneRose
```

## Components

### Editor UI

- [Main Window](https://github.com/rokn/vede/blob/master/VeDe/mainwindow.cpp): `VeDe/mainwindow.cpp`
- [Canvas Adapter](https://github.com/rokn/vede/blob/master/VeDe/canvasimpl.cpp): `VeDe/canvasimpl.cpp`
- [Workspace](https://github.com/rokn/vede/blob/master/VeDe/workspace.cpp): `VeDe/workspace.cpp`
- [Tool Actions](https://github.com/rokn/vede/blob/master/VeDe/toolaction.cpp): `VeDe/toolaction.cpp`
- [Property UI](https://github.com/rokn/vede/blob/master/VeDe/propertywidgetfactory.cpp): `VeDe/propertywidgetfactory.cpp`

### Editing Tools

- [Tool Framework](https://github.com/rokn/vede/blob/master/VeDe-Graphics/tools/tool.cpp): `VeDe-Graphics/tools/tool.cpp`
- [Shape and Path Tools](https://github.com/rokn/vede/blob/master/VeDe-Graphics/tools/shapetool.cpp): `VeDe-Graphics/tools/shapetool.cpp`
- [Selection and Transform](https://github.com/rokn/vede/blob/master/VeDe-Graphics/tools/manipulatetool.cpp): `VeDe-Graphics/tools/manipulatetool.cpp`

### Graphics Model

- [Canvas State](https://github.com/rokn/vede/blob/master/VeDe-Graphics/canvas.cpp): `VeDe-Graphics/canvas.cpp`
- [Edit Commands](https://github.com/rokn/vede/blob/master/VeDe-Graphics/commands/canvascommand.cpp): `VeDe-Graphics/commands/canvascommand.cpp`
- [Graphic Objects](https://github.com/rokn/vede/blob/master/VeDe-Graphics/objects/gobject.cpp): `VeDe-Graphics/objects/gobject.cpp`
- [Shape Types](https://github.com/rokn/vede/blob/master/VeDe-Graphics/objects/shape.cpp): `VeDe-Graphics/objects/shape.cpp`
- [Object Properties](https://github.com/rokn/vede/blob/master/VeDe-Graphics/properties/property.cpp): `VeDe-Graphics/properties/property.cpp`

### Rendering and Export

- [SVG Import Export](https://github.com/rokn/vede/blob/master/VeDe-Graphics/canvasmanagersvg.cpp): `VeDe-Graphics/canvasmanagersvg.cpp`
- [Graphics Items](https://github.com/rokn/vede/blob/master/VeDe/objects/baseshapeitem.cpp): `VeDe/objects/baseshapeitem.cpp`
- [Qt Painter Adapter](https://github.com/rokn/vede/blob/master/VeDe/qtcustompainter.cpp): `VeDe/qtcustompainter.cpp`
- [Tool Overlay Drawer](https://github.com/rokn/vede/blob/master/VeDe/objects/guidrawer.cpp): `VeDe/objects/guidrawer.cpp`

### Other components

- **Editor User**

## Connections

- Editor User → Main Window: uses (evidence: `VeDe/mainwindow.cpp`)
- Main Window → Canvas Adapter: creates canvas (evidence: `VeDe/mainwindow.cpp`)
- Main Window → Shape and Path Tools: creates tools (evidence: `VeDe/mainwindow.cpp`)
- Main Window → Selection and Transform: creates tool (evidence: `VeDe/mainwindow.cpp`)
- Main Window → Tool Actions: registers tools (evidence: `VeDe/mainwindow.cpp`)
- Main Window → SVG Import Export: saves SVG (evidence: `VeDe/mainwindow.cpp`)
- Main Window → Canvas State: undoes and redoes (evidence: `VeDe/mainwindow.cpp`)
- Canvas Adapter → Qt Painter Adapter: uses painter (evidence: `VeDe/canvasimpl.cpp`)
- Canvas Adapter → Tool Framework: dispatches events (evidence: `VeDe/canvasimpl.cpp`)
- Canvas Adapter → Graphic Objects: maps objects (evidence: `VeDe/canvasimpl.cpp`)
- Shape and Path Tools → Tool Framework: extends
- Selection and Transform → Canvas State: reads selection (evidence: `VeDe-Graphics/tools/manipulatetool.cpp`)
- Selection and Transform → Edit Commands: creates commands (evidence: `VeDe-Graphics/tools/manipulatetool.cpp`)
- Edit Commands → Canvas State: updates history
- Canvas State → Graphic Objects: owns objects
- Graphic Objects → Object Properties: inherits properties
- Graphic Objects → Shape Types: specializes as shapes
- SVG Import Export → Shape Types: serializes shapes
- Graphics Items → Graphic Objects: adapts objects (evidence: `VeDe/objects/baseshapeitem.cpp`)
- Tool Overlay Drawer → Qt Painter Adapter: uses painter (evidence: `VeDe/objects/guidrawer.cpp`)
- Tool Overlay Drawer → Tool Framework: draws tool UI (evidence: `VeDe/objects/guidrawer.cpp`)
- Property UI → Object Properties: edits properties
