Metadata-Version: 2.4
Name: tftree2d-vision
Version: 0.0.2
Summary: 2D TF tree viewer/editor UI built on tftree-manager services
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.20.0
Requires-Dist: PyYAML>=5.4.0
Requires-Dist: tftree-manager>=0.1.5
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Provides-Extra: ui
Requires-Dist: PySide6; extra == "ui"

# tftree2d-vision

`tftree2d-vision` contains the 2D graph/view/editor layer split out from
`tftree-manager`. It depends on D03 `tftree-manager>=0.1.5` for workspace
loading, topology queries, transform lookup, calibration-path replacement, and
direct relation writes. D15 owns GUI state, 2D layout, selections, path display,
PNG export, and action orchestration only.

D15 does not implement TF math, path search, transform composition, inverse
logic, old-edge deletion, or YAML write algorithms. Those operations are
delegated to `TransformQueryService`, `TopologyService`, and
`TransformOperationService`.

## API

```python
from tftree_manager import TFTreeWorkspace
from tftree2d_vision import (
    graph_data_from_workspace,
    graph_data_from_yaml,
    layout_graph,
    launch_tftree_graph_editor_ui,
    launch_tftree_graph_viewer_ui,
    launch_prune_ui,
)

workspace = TFTreeWorkspace.load_yaml("/path/to/yaml_dir")
graph = graph_data_from_workspace(workspace, selected_path=("A", "B"))
layout = layout_graph(graph, mode="auto")

graph2 = graph_data_from_yaml("/path/to/yaml_dir")
```

The package owns `GraphData`, layout helpers, and optional PySide6 canvas/viewer
widgets. PySide6 is only required for the `ui` extra or for showing the GUI.

## CLI

```bash
tftree2d-vision /path/to/yaml_dir --no-show
tftree2d-vision /path/to/yaml_dir --layout tree
tftree2d-vision /path/to/yaml_dir --editor
tftree2d-vision editor /path/to/yaml_dir --layout tree
tftree2d-vision prune-ui /path/to/yaml_dir A B --translation 10 0 0 --selected-edge M->B
```

`--no-show` prints a graph summary. Without it, the CLI launches the read-only Qt
viewer. `--editor` and the `editor` subcommand open the write-capable relation
editor. `prune-ui` delegates the selected replacement to `tftree-manager`; when
`--selected-edge` is omitted for a multi-hop path it opens the Qt edge-selection
window.

The 3D sensor orientation plot is intentionally not part of D15; it belongs to
the D14 package line.

## 设计原则

- [版本无关设计原则](../../design_principle.md)
