# tvqnhan18c4/mfc3dcube architecture

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

- Interactive diagram: https://gitdiagram.com/tvqnhan18c4/mfc3dcube
- Repository: https://github.com/tvqnhan18c4/mfc3dcube

## Overview

MFC3DCube is a Windows MFC desktop cube viewer. The user works through the cube-control dialog or view commands to change position, size, rotation, and zoom; the view renders the cube and XYZ axes with depth sorting and lighting. The app registers an SDI document, frame, and view. Rendering and cube state are supported by excerpts; some menu wiring and rendering call details are not shown, so those links are omitted. README capabilities that are listed as paused or unchecked are not represented as implemented.

Main entry points: [`MFC3DCube/MFC3DCube.cpp`](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCube.cpp) (Application startup), [`MFC3DCube/MFC3DCubeView.cpp`](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCubeView.cpp) (Cube view), [`MFC3DCube/CubeControlDlg.cpp`](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/CubeControlDlg.cpp) (Cube controls), [`MFC3DCube/MFC3DCubeDoc.cpp`](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCubeDoc.cpp) (SDI document)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["MFC application"]
  node_application["Application startup<br/>[MFC3DCube.cpp]"]
  node_document["SDI document<br/>[MFC3DCubeDoc.cpp]"]
  node_frame["Main window<br/>[MainFrm.cpp]"]
end

subgraph group_interaction["Cube interaction"]
  node_view["Cube view<br/>[MFC3DCubeView.cpp]"]
  node_controls["Cube controls<br/>[CubeControlDlg.cpp]"]
end

subgraph group_graphics["3D graphics"]
  node_cube["Cube state<br/>[Cube3D.cpp]"]
  node_renderer["Cube and axis rendering<br/>[MFC3DCubeView.cpp]"]
end

node_user(("Desktop user"))

node_user -->|"launches"| node_application
node_application -->|"registers"| node_document
node_application -->|"registers"| node_frame
node_application -->|"registers"| node_view
node_user -->|"edits controls"| node_controls
node_controls -->|"sets and reads"| node_view
node_view -->|"updates state"| node_cube
node_view -->|"draws"| node_renderer

click node_application "https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCube.cpp"
click node_document "https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCubeDoc.cpp"
click node_frame "https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MainFrm.cpp"
click node_view "https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCubeView.cpp"
click node_controls "https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/CubeControlDlg.cpp"
click node_cube "https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/Cube3D.cpp"
click node_renderer "https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCubeView.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_document,node_frame,node_user toneBlue
class node_view,node_controls toneAmber
class node_cube,node_renderer toneMint
```

## Components

### MFC application

- [Application startup](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCube.cpp): `MFC3DCube/MFC3DCube.cpp`
- [SDI document](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCubeDoc.cpp): `MFC3DCube/MFC3DCubeDoc.cpp`
- [Main window](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MainFrm.cpp): `MFC3DCube/MainFrm.cpp`

### Cube interaction

- [Cube view](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCubeView.cpp): `MFC3DCube/MFC3DCubeView.cpp`
- [Cube controls](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/CubeControlDlg.cpp): `MFC3DCube/CubeControlDlg.cpp`

### 3D graphics

- [Cube state](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/Cube3D.cpp): `MFC3DCube/Cube3D.cpp`
- [Cube and axis rendering](https://github.com/tvqnhan18c4/mfc3dcube/blob/master/MFC3DCube/MFC3DCubeView.cpp): `MFC3DCube/MFC3DCubeView.cpp`

### Other components

- **Desktop user**

## Connections

- Desktop user → Application startup: launches
- Application startup → SDI document: registers (evidence: `MFC3DCube/MFC3DCube.cpp`)
- Application startup → Main window: registers (evidence: `MFC3DCube/MFC3DCube.cpp`)
- Application startup → Cube view: registers (evidence: `MFC3DCube/MFC3DCube.cpp`)
- Desktop user → Cube controls: edits controls
- Cube controls → Cube view: sets and reads (evidence: `MFC3DCube/CubeControlDlg.cpp`)
- Cube view → Cube state: updates state (evidence: `MFC3DCube/MFC3DCubeView.cpp`)
- Cube view → Cube and axis rendering: draws (evidence: `MFC3DCube/MFC3DCubeView.cpp`)
