nmwsharp / nmwsharp/polyscope

How to create submenus (or multiple command UIs)

Aperta
#122 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C++
Stelle
2.2k
Fork
242
Merge medio
11m
PR unite (30g)
1

Descrizione

I have some UI

submenu

Everything into the Command UI is a Imgui::Button inside the callback

    ImGui::InputInt("Radius", &radius);

    ImGui::SameLine();

    //
    // Button
    if (ImGui::Button("Max Curvature"))
    {
        // get mesh
        polyscope::registerSurfaceMesh("mesh", V, F);
        
        // Compute curvature directions via quadric fitting
        MatrixXd PD1, PD2;
        VectorXd PV1, PV2;
        std::vector<Index> bv = {};
        
        igl::principal_curvature(V, F, PD1, PD2, PV1, PV2, bv, radius);
        
        polyscope::getSurfaceMesh("mesh")
            ->addVertexScalarQuantity("Max Curvature", PV1,
                                      polyscope::DataType::SYMMETRIC);
        
    }

pretty standard. Now I'd like to add the "radius" input inside the button scope, so that when I press the button all the relevant data is presented to the user.
Of course, if I simply put the input widget code inside the button one the input widget is just show for an instant then deleted, as the callback runs over and over.
The best option would be to create a separate sub-UI, possibly opening down below the command UI itself. Or to create multiple command UIs.
Is there a way?
Thank you

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con il callback di Command UI e l’uso di ImGui::InputInt e ImGui::Button mostrato nell’issue. Determina come un input del raggio persistente o un sottomenu separato potrebbe rimanere visibile tra le invocazioni del callback e definisci quale interazione debba essere considerata completata; l’issue non indica file né test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.