958189227d
Auditoria del issue 0044: anota en notes: el contexto de consumo de
huerfanos que no pueden registrarse en uses_functions porque sus
consumidores no son funciones del registry:
- consumido por cpp/framework/app_base.cpp (framework no indexado)
- consumido por cpp/apps/{shaders_lab,chart_demo,text_editor_smoke}/main.cpp
- scaffolding/demo en primitives_gallery
31 huerfanas anotadas. Las que quedan en uses_functions=[] tras esto
son hojas legitimas (no llaman a nada) o realmente sin uso (lista
DEAD reportada en el issue 0044).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.3 KiB
2.3 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, framework, params, output, notes
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | framework | params | output | notes | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| scatter_3d | component | cpp | viz | 1.0.0 | pure | void scatter_3d(const char* title, const fn::Scatter3DConfig& cfg) | Scatter 3D ImPlot3D con tamano y color opcional por punto, orbit/zoom/pan nativos |
|
false |
|
false | cpp/functions/viz/scatter_3d.cpp | imgui |
|
Renderiza una nube de puntos 3D dentro del frame ImGui actual; soporta orbit (drag), zoom (wheel) y pan | scaffolding/demo en primitives_gallery |
scatter_3d
Scatter 3D usando ImPlot3D::PlotScatter. Soporta tamano y color opcional por punto via ImPlot3DSpec::MarkerSizes / MarkerFillColors.
Util para visualizaciones de PCA / clustering / nubes de puntos sinteticas. Llamar dentro de un frame ImGui activo.
Caracteristicas
- Per-point size: pasar
cfg.sizes(length = n, en pixeles) o dejarnullptrpara usar el tamano del estilo activo. - Per-point color: pasar
cfg.colors(length = n, ImU32 RGBA) o dejarnullptrpara que ImPlot3D use el color del colormap activo. - Orbit / zoom / pan: nativos de ImPlot3D.
Ejemplo
#include "viz/scatter_3d.h"
#include "imgui.h"
#include <vector>
#include <random>
const int N = 500;
std::vector<float> xs(N), ys(N), zs(N);
std::vector<ImU32> colors(N);
std::mt19937 rng(42);
std::normal_distribution<float> g(0.f, 0.4f);
const ImU32 palette[3] = {
IM_COL32(255, 99, 71, 255), // tomate
IM_COL32( 65,170,255, 255), // azul
IM_COL32(120,220,120, 255), // verde
};
const float cx[3] = {-1.5f, 1.5f, 0.f};
const float cy[3] = { 0.f, 0.f, 2.0f};
const float cz[3] = { 0.f, 1.0f,-1.0f};
for (int i = 0; i < N; ++i) {
int c = i % 3;
xs[i] = cx[c] + g(rng);
ys[i] = cy[c] + g(rng);
zs[i] = cz[c] + g(rng);
colors[i] = palette[c];
}
fn::Scatter3DConfig cfg{};
cfg.xs = xs.data(); cfg.ys = ys.data(); cfg.zs = zs.data();
cfg.colors = colors.data();
cfg.n = N;
fn::scatter_3d("##clusters", cfg);