---
name: EntityType
lang: cpp
domain: viz
version: "1.0.0"
algebraic: product
definition: |
  struct EntityType {
      uint32_t color;
      uint8_t  shape;
      uint16_t icon_id;
      float    default_size;
      const char* name;
  };
description: "Clase visual de un nodo. La tabla EntityType[] vive en GraphData::types y los nodos referencian por indice (GraphNode::type_id). Define color (RGBA8), shape (SHAPE_*), icon_id (issue 0049f), default_size en pixels y nombre para UI/debug."
tags: [graph, type, entity, visual, icon, shape, color]
uses_types: []
file_path: "cpp/functions/viz/graph_types.h"
---

## Campos

| Campo | Descripcion |
|---|---|
| `color` | RGBA8 (R en LSB, mismo formato que `pack_rgba8`) |
| `shape` | `SHAPE_*` (CIRCLE, SQUARE, DIAMOND, HEX, TRIANGLE, ROUNDED_SQUARE). Issue 0049f anadira el dispatch real al GPU |
| `icon_id` | 0 = sin icono. Issue 0049f popula los iconos via Tabler atlas |
| `default_size` | Diametro en pixels para nodos que no tienen `size_override > 0` |
| `name` | C-string propiedad del caller. Solo para UI/debug, no se renderiza |

## Helper

```cpp
EntityType person = entity_type(0xFF5B8DEFu, SHAPE_CIRCLE, 5.0f, "person");
EntityType org    = entity_type(0xFFF5973Eu, SHAPE_SQUARE, 6.0f, "org");
```

## Uso tipico

La app construye un array fijo de tipos y lo asigna a `GraphData::types`:

```cpp
EntityType types[] = {
    entity_type(0xFF5B8DEFu, SHAPE_CIRCLE, 5.0f, "person"),
    entity_type(0xFFF5973Eu, SHAPE_SQUARE, 6.0f, "org"),
};
graph.types      = types;
graph.type_count = 2;
```

`GraphNode::type_id` es uint16_t — soporta 65k tipos distintos, suficiente
para cualquier ontologia razonable.
