# dismine/valentina architecture

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

- Interactive diagram: https://gitdiagram.com/dismine/valentina
- Repository: https://github.com/dismine/valentina

## Overview

Valentina is a cross-platform clothing-pattern design application centered on drafting and modeling patterns from standard or personal measurements. Its main user workflow is to create or open a pattern, work with its geometry and measurement data, inspect/edit it in the desktop interface, and prepare pattern pieces for layout or export. The tree also shows companion measurement and puzzle applications. Most implementation excerpts are limited to export engines and history management, so broader domain links below rely on the README or are marked unverified rather than implying inspected call paths.

Main entry points: [`src/libs/vlayout/vlayoutpiece.h`](https://github.com/dismine/valentina/blob/develop/src/libs/vlayout/vlayoutpiece.h) (Layout pieces), [`src/app/valentina/main.cpp`](https://github.com/dismine/valentina/blob/develop/src/app/valentina/main.cpp) (Valentina editor), [`src/app/valentina/mainwindow.cpp`](https://github.com/dismine/valentina/blob/develop/src/app/valentina/mainwindow.cpp) (Pattern workspace), [`src/app/tape/main.cpp`](https://github.com/dismine/valentina/blob/develop/src/app/tape/main.cpp) (Tape measurements)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pattern["Pattern design"]
  node_pattern_doc["Pattern document<br/>[vpattern.cpp]"]
  node_drafting["Drafting tools<br/>[vcontainer.h]"]
  node_history["Draft history"]
  node_geometry["Pattern geometry<br/>[vgeometrydef.h]"]
end

subgraph group_measure["Measurements"]
  node_measure_data[("Measurement data<br/>[vmeasurements.cpp]")]
  node_known_sizes[("Known measurements")]
end

subgraph group_layout["Layout and export"]
  node_layout_engine["Piece layout"]
  node_layout_piece["Layout pieces<br/>[vlayoutpiece.h]"]
  node_text_labels["Piece labels<br/>[vtextmanager.cpp]"]
  node_dxf_export["DXF export<br/>[vdxfengine.cpp]"]
  node_hpgl_export["HPGL export<br/>[vhpglengine.cpp]"]
end

subgraph group_apps["Desktop applications"]
  node_valentina["Valentina editor<br/>[main.cpp]"]
  node_main_window["Pattern workspace<br/>[mainwindow.cpp]"]
  node_tape["Tape measurements<br/>[main.cpp]"]
  node_puzzle["Pattern puzzle<br/>[main.cpp]"]
end

subgraph group_shared["Shared services"]
  node_settings["Application settings<br/>[vcommonsettings.h]"]
  node_svg_fonts["SVG font rendering<br/>[vsvgfontengine.cpp]"]
end

node_designer(("Pattern designer"))

node_designer -->|"uses"| node_valentina
node_designer -->|"enters measurements"| node_tape
node_valentina -->|"opens workspace"| node_main_window
node_valentina -.->|"opens patterns"| node_pattern_doc
node_main_window -->|"edits pattern"| node_drafting
node_main_window -->|"manages edits"| node_history
node_drafting -.->|"uses geometry"| node_geometry
node_main_window -->|"uses measurements"| node_measure_data
node_tape -->|"manages sizing data"| node_known_sizes
node_tape -.->|"edits measurements"| node_measure_data
node_pattern_doc -.->|"prepares layout"| node_layout_engine
node_layout_engine -.->|"arranges pieces"| node_layout_piece
node_layout_piece -->|"provides label data"| node_text_labels
node_layout_piece -->|"exports DXF"| node_dxf_export
node_layout_piece -->|"plots HPGL"| node_hpgl_export
node_text_labels -.->|"renders label text"| node_svg_fonts
node_designer -.->|"uses puzzle tools"| node_puzzle
node_valentina -.->|"uses settings"| node_settings

click node_valentina "https://github.com/dismine/valentina/blob/develop/src/app/valentina/main.cpp"
click node_main_window "https://github.com/dismine/valentina/blob/develop/src/app/valentina/mainwindow.cpp"
click node_tape "https://github.com/dismine/valentina/blob/develop/src/app/tape/main.cpp"
click node_puzzle "https://github.com/dismine/valentina/blob/develop/src/app/puzzle/main.cpp"
click node_pattern_doc "https://github.com/dismine/valentina/blob/develop/src/app/valentina/xml/vpattern.cpp"
click node_drafting "https://github.com/dismine/valentina/blob/develop/src/libs/vpatterndb/vcontainer.h"
click node_history "https://github.com/dismine/valentina/blob/develop/src/app/valentina/core/vhistorymanager.cpp"
click node_geometry "https://github.com/dismine/valentina/blob/develop/src/libs/vgeometry/vgeometrydef.h"
click node_measure_data "https://github.com/dismine/valentina/blob/develop/src/libs/vformat/vmeasurements.cpp"
click node_known_sizes "https://github.com/dismine/valentina/blob/develop/src/libs/vformat/knownmeasurements/vknownmeasurementsdatabase.cpp"
click node_layout_engine "https://github.com/dismine/valentina/blob/develop/src/libs/vlayout/vlayoutgenerator.cpp"
click node_layout_piece "https://github.com/dismine/valentina/blob/develop/src/libs/vlayout/vlayoutpiece.h"
click node_text_labels "https://github.com/dismine/valentina/blob/develop/src/libs/vlayout/vtextmanager.cpp"
click node_dxf_export "https://github.com/dismine/valentina/blob/develop/src/libs/vdxf/vdxfengine.cpp"
click node_hpgl_export "https://github.com/dismine/valentina/blob/develop/src/libs/vhpgl/vhpglengine.cpp"
click node_settings "https://github.com/dismine/valentina/blob/develop/src/libs/vmisc/vcommonsettings.h"
click node_svg_fonts "https://github.com/dismine/valentina/blob/develop/src/libs/vmisc/svgfont/vsvgfontengine.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_pattern_doc,node_drafting,node_history,node_geometry toneBlue
class node_measure_data,node_known_sizes toneAmber
class node_layout_engine,node_layout_piece,node_text_labels,node_dxf_export,node_hpgl_export toneMint
class node_valentina,node_main_window,node_tape,node_puzzle toneRose
class node_settings,node_svg_fonts,node_designer toneIndigo
```

## Components

### Pattern design

- [Pattern document](https://github.com/dismine/valentina/blob/develop/src/app/valentina/xml/vpattern.cpp): `src/app/valentina/xml/vpattern.cpp`
- [Drafting tools](https://github.com/dismine/valentina/blob/develop/src/libs/vpatterndb/vcontainer.h): `src/libs/vpatterndb/vcontainer.h`
- [Draft history](https://github.com/dismine/valentina/blob/develop/src/app/valentina/core/vhistorymanager.cpp): `src/app/valentina/core/vhistorymanager.cpp`
- [Pattern geometry](https://github.com/dismine/valentina/blob/develop/src/libs/vgeometry/vgeometrydef.h): `src/libs/vgeometry/vgeometrydef.h`

### Measurements

- [Measurement data](https://github.com/dismine/valentina/blob/develop/src/libs/vformat/vmeasurements.cpp): `src/libs/vformat/vmeasurements.cpp`
- [Known measurements](https://github.com/dismine/valentina/blob/develop/src/libs/vformat/knownmeasurements/vknownmeasurementsdatabase.cpp): `src/libs/vformat/knownmeasurements/vknownmeasurementsdatabase.cpp`

### Layout and export

- [Piece layout](https://github.com/dismine/valentina/blob/develop/src/libs/vlayout/vlayoutgenerator.cpp): `src/libs/vlayout/vlayoutgenerator.cpp`
- [Layout pieces](https://github.com/dismine/valentina/blob/develop/src/libs/vlayout/vlayoutpiece.h): `src/libs/vlayout/vlayoutpiece.h`
- [Piece labels](https://github.com/dismine/valentina/blob/develop/src/libs/vlayout/vtextmanager.cpp): `src/libs/vlayout/vtextmanager.cpp`
- [DXF export](https://github.com/dismine/valentina/blob/develop/src/libs/vdxf/vdxfengine.cpp): `src/libs/vdxf/vdxfengine.cpp`
- [HPGL export](https://github.com/dismine/valentina/blob/develop/src/libs/vhpgl/vhpglengine.cpp): `src/libs/vhpgl/vhpglengine.cpp`

### Desktop applications

- [Valentina editor](https://github.com/dismine/valentina/blob/develop/src/app/valentina/main.cpp): `src/app/valentina/main.cpp`
- [Pattern workspace](https://github.com/dismine/valentina/blob/develop/src/app/valentina/mainwindow.cpp): `src/app/valentina/mainwindow.cpp`
- [Tape measurements](https://github.com/dismine/valentina/blob/develop/src/app/tape/main.cpp): `src/app/tape/main.cpp`
- [Pattern puzzle](https://github.com/dismine/valentina/blob/develop/src/app/puzzle/main.cpp): `src/app/puzzle/main.cpp`

### Shared services

- [Application settings](https://github.com/dismine/valentina/blob/develop/src/libs/vmisc/vcommonsettings.h): `src/libs/vmisc/vcommonsettings.h`
- [SVG font rendering](https://github.com/dismine/valentina/blob/develop/src/libs/vmisc/svgfont/vsvgfontengine.cpp): `src/libs/vmisc/svgfont/vsvgfontengine.cpp`

### Other components

- **Pattern designer**

## Connections

- Pattern designer → Valentina editor: uses
- Pattern designer → Tape measurements: enters measurements
- Valentina editor → Pattern workspace: opens workspace (evidence: `src/app/valentina/main.cpp`)
- Valentina editor → Pattern document: opens patterns
- Pattern workspace → Drafting tools: edits pattern
- Pattern workspace → Draft history: manages edits (evidence: `src/app/valentina/core/vhistorymanager.cpp`)
- Drafting tools → Pattern geometry: uses geometry
- Pattern workspace → Measurement data: uses measurements
- Tape measurements → Known measurements: manages sizing data
- Tape measurements → Measurement data: edits measurements
- Pattern document → Piece layout: prepares layout
- Piece layout → Layout pieces: arranges pieces
- Layout pieces → Piece labels: provides label data
- Layout pieces → DXF export: exports DXF (evidence: `src/libs/vdxf/vdxfengine.cpp`)
- Layout pieces → HPGL export: plots HPGL (evidence: `src/libs/vhpgl/vhpglengine.cpp`)
- Piece labels → SVG font rendering: renders label text
- Pattern designer → Pattern puzzle: uses puzzle tools
- Valentina editor → Application settings: uses settings
