# irynaaksonkina/oop_1 architecture

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

- Interactive diagram: https://gitdiagram.com/irynaaksonkina/oop_1
- Repository: https://github.com/irynaaksonkina/oop_1

## Overview

This is a console-based ASCII shape-board editor. Users issue commands to add and inspect shapes, select them by ID or coordinates, then move, edit, paint, remove, clear, draw, save, or load the board. Board owns the shape collection and delegates drawing, hit-testing, editing, and serialization through the shape interface. The source excerpts show command handling, board behavior, and concrete shape implementations; no README capabilities are documented.

Main entry points: [`main.cpp`](https://github.com/irynaaksonkina/oop_1/blob/main/main.cpp) (Command loop), [`Shape.h`](https://github.com/irynaaksonkina/oop_1/blob/main/Shape.h) (Shape interface), [`Board.cpp`](https://github.com/irynaaksonkina/oop_1/blob/main/Board.cpp) (Board), [`Rectangle.cpp`](https://github.com/irynaaksonkina/oop_1/blob/main/Rectangle.cpp) (Rectangle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Command interface"]
  node_cli["Command loop<br/>[main.cpp]"]
end

subgraph group_board["Board operations"]
  node_board["Board<br/>[Board.cpp]"]
end

subgraph group_shapes["Shape model"]
  node_shape["Shape interface<br/>[Shape.h]"]
  node_rectangle["Rectangle<br/>[Rectangle.cpp]"]
  node_circle["Circle<br/>[Circle.cpp]"]
  node_triangle["Triangle<br/>[Triangle.cpp]"]
  node_line["Line<br/>[Line.cpp]"]
end

subgraph group_persistence["Persistence"]
  node_file["Board file"]
end

node_user(("User"))
node_terminal["Console"]

node_user -->|"enters commands"| node_cli
node_cli -->|"dispatches operations"| node_board
node_cli -->|"creates"| node_rectangle
node_cli -->|"creates"| node_circle
node_cli -->|"creates"| node_triangle
node_cli -->|"creates"| node_line
node_cli -->|"prints results"| node_terminal
node_board -->|"prints drawing"| node_terminal
node_board -->|"calls shape behavior"| node_shape
node_rectangle -.->|"implements"| node_shape
node_circle -.->|"implements"| node_shape
node_triangle -.->|"implements"| node_shape
node_line -.->|"implements"| node_shape
node_board -->|"reads and writes"| node_file

click node_cli "https://github.com/irynaaksonkina/oop_1/blob/main/main.cpp"
click node_board "https://github.com/irynaaksonkina/oop_1/blob/main/Board.cpp"
click node_shape "https://github.com/irynaaksonkina/oop_1/blob/main/Shape.h"
click node_rectangle "https://github.com/irynaaksonkina/oop_1/blob/main/Rectangle.cpp"
click node_circle "https://github.com/irynaaksonkina/oop_1/blob/main/Circle.cpp"
click node_triangle "https://github.com/irynaaksonkina/oop_1/blob/main/Triangle.cpp"
click node_line "https://github.com/irynaaksonkina/oop_1/blob/main/Line.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_cli,node_user toneBlue
class node_board toneAmber
class node_shape,node_rectangle,node_circle,node_triangle,node_line toneMint
class node_file toneRose
class node_terminal toneIndigo
```

## Components

### Command interface

- [Command loop](https://github.com/irynaaksonkina/oop_1/blob/main/main.cpp): `main.cpp`

### Board operations

- [Board](https://github.com/irynaaksonkina/oop_1/blob/main/Board.cpp): `Board.cpp`

### Shape model

- [Shape interface](https://github.com/irynaaksonkina/oop_1/blob/main/Shape.h): `Shape.h`
- [Rectangle](https://github.com/irynaaksonkina/oop_1/blob/main/Rectangle.cpp): `Rectangle.cpp`
- [Circle](https://github.com/irynaaksonkina/oop_1/blob/main/Circle.cpp): `Circle.cpp`
- [Triangle](https://github.com/irynaaksonkina/oop_1/blob/main/Triangle.cpp): `Triangle.cpp`
- [Line](https://github.com/irynaaksonkina/oop_1/blob/main/Line.cpp): `Line.cpp`

### Persistence

- **Board file**

### Other components

- **User**
- **Console**

## Connections

- User → Command loop: enters commands
- Command loop → Board: dispatches operations
- Command loop → Rectangle: creates
- Command loop → Circle: creates
- Command loop → Triangle: creates
- Command loop → Line: creates
- Command loop → Console: prints results
- Board → Console: prints drawing
- Board → Shape interface: calls shape behavior
- Rectangle → Shape interface: implements
- Circle → Shape interface: implements
- Triangle → Shape interface: implements
- Line → Shape interface: implements
- Board → Board file: reads and writes
