# katelap/paint architecture

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

- Interactive diagram: https://gitdiagram.com/katelap/paint
- Repository: https://github.com/katelap/paint

## Overview

Paint is a WinAPI graphics editor: users draw geometric shapes with configurable outline and fill colors, can undo the last action, and can save the image. The sampled sources show shape drawing and shared painting settings; the main application, history, and save implementations were not sampled, so their internal connections are documented at the capability level only.

Main entry points: [`MYpaint/11111/MYpaint.cpp`](https://github.com/katelap/paint/blob/master/MYpaint/11111/MYpaint.cpp) (Paint UI), [`MYpaint/11111/Shape.h`](https://github.com/katelap/paint/blob/master/MYpaint/11111/Shape.h) (Shape Base), [`MYpaint/11111/TwoPointsShapes.h`](https://github.com/katelap/paint/blob/master/MYpaint/11111/TwoPointsShapes.h) (Two-Point Shapes), [`MYpaint/11111/Point.cpp`](https://github.com/katelap/paint/blob/master/MYpaint/11111/Point.cpp) (Point Tool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_application["Paint UI<br/>[MYpaint.cpp]"]
end

subgraph group_drawing["Drawing Model"]
  node_shape["Shape Base<br/>[Shape.h]"]
  node_two_points["Two-Point Shapes<br/>[TwoPointsShapes.h]"]
  node_point["Point Tool<br/>[Point.cpp]"]
  node_line["Line Tool<br/>[Line.cpp]"]
  node_circle["Circle Tool<br/>[Circle.cpp]"]
  node_rectangle["Rectangle Tool<br/>[Rectangles.cpp]"]
end

subgraph group_state["Drawing State"]
  node_painting["Paint Settings<br/>[Painting.h]"]
  node_history["Undo History<br/>[Stack.h]"]
end

subgraph group_output["Image Actions"]
  node_save["Image Save<br/>[MYpaint.cpp]"]
end

node_user(("User"))
node_gdi["WinAPI GDI"]

node_user -->|"uses"| node_application
node_application -->|"draws shapes"| node_shape
node_application -->|"undoes action"| node_history
node_application -->|"saves image"| node_save
node_shape -->|"specialized by"| node_two_points
node_two_points -->|"specialized by"| node_line
node_two_points -->|"specialized by"| node_circle
node_two_points -->|"specialized by"| node_rectangle
node_shape -->|"specialized by"| node_point
node_shape -->|"draw uses settings"| node_painting
node_point -->|"draws via"| node_gdi
node_circle -->|"draws via"| node_gdi
node_rectangle -->|"draws via"| node_gdi

click node_application "https://github.com/katelap/paint/blob/master/MYpaint/11111/MYpaint.cpp"
click node_shape "https://github.com/katelap/paint/blob/master/MYpaint/11111/Shape.h"
click node_two_points "https://github.com/katelap/paint/blob/master/MYpaint/11111/TwoPointsShapes.h"
click node_point "https://github.com/katelap/paint/blob/master/MYpaint/11111/Point.cpp"
click node_line "https://github.com/katelap/paint/blob/master/MYpaint/11111/Line.cpp"
click node_circle "https://github.com/katelap/paint/blob/master/MYpaint/11111/Circle.cpp"
click node_rectangle "https://github.com/katelap/paint/blob/master/MYpaint/11111/Rectangles.cpp"
click node_painting "https://github.com/katelap/paint/blob/master/MYpaint/11111/Painting.h"
click node_history "https://github.com/katelap/paint/blob/master/MYpaint/11111/Stack.h"
click node_save "https://github.com/katelap/paint/blob/master/MYpaint/11111/MYpaint.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_application,node_user toneBlue
class node_shape,node_two_points,node_point,node_line,node_circle,node_rectangle toneAmber
class node_painting,node_history,node_gdi toneMint
class node_save toneRose
```

## Components

### Application

- [Paint UI](https://github.com/katelap/paint/blob/master/MYpaint/11111/MYpaint.cpp): `MYpaint/11111/MYpaint.cpp`

### Drawing Model

- [Shape Base](https://github.com/katelap/paint/blob/master/MYpaint/11111/Shape.h): `MYpaint/11111/Shape.h`
- [Two-Point Shapes](https://github.com/katelap/paint/blob/master/MYpaint/11111/TwoPointsShapes.h): `MYpaint/11111/TwoPointsShapes.h`
- [Point Tool](https://github.com/katelap/paint/blob/master/MYpaint/11111/Point.cpp): `MYpaint/11111/Point.cpp`
- [Line Tool](https://github.com/katelap/paint/blob/master/MYpaint/11111/Line.cpp): `MYpaint/11111/Line.cpp`
- [Circle Tool](https://github.com/katelap/paint/blob/master/MYpaint/11111/Circle.cpp): `MYpaint/11111/Circle.cpp`
- [Rectangle Tool](https://github.com/katelap/paint/blob/master/MYpaint/11111/Rectangles.cpp): `MYpaint/11111/Rectangles.cpp`

### Drawing State

- [Paint Settings](https://github.com/katelap/paint/blob/master/MYpaint/11111/Painting.h): `MYpaint/11111/Painting.h`
- [Undo History](https://github.com/katelap/paint/blob/master/MYpaint/11111/Stack.h): `MYpaint/11111/Stack.h`

### Image Actions

- [Image Save](https://github.com/katelap/paint/blob/master/MYpaint/11111/MYpaint.cpp): `MYpaint/11111/MYpaint.cpp`

### Other components

- **User**
- **WinAPI GDI**

## Connections

- User → Paint UI: uses (evidence: `README.md`)
- Paint UI → Shape Base: draws shapes (evidence: `README.md`)
- Paint UI → Undo History: undoes action (evidence: `README.md`)
- Paint UI → Image Save: saves image (evidence: `README.md`)
- Shape Base → Two-Point Shapes: specialized by (evidence: `MYpaint/11111/TwoPointsShapes.h`)
- Two-Point Shapes → Line Tool: specialized by
- Two-Point Shapes → Circle Tool: specialized by
- Two-Point Shapes → Rectangle Tool: specialized by
- Shape Base → Point Tool: specialized by
- Shape Base → Paint Settings: draw uses settings (evidence: `MYpaint/11111/Shape.h`)
- Point Tool → WinAPI GDI: draws via (evidence: `MYpaint/11111/Point.cpp`)
- Circle Tool → WinAPI GDI: draws via (evidence: `MYpaint/11111/Circle.cpp`)
- Rectangle Tool → WinAPI GDI: draws via (evidence: `MYpaint/11111/Rectangles.cpp`)
