How to create submenus (or multiple command UIs)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start with the Command UI callback and the ImGui::InputInt and ImGui::Button usage shown in the issue. Determine how a persistent radius input or separate submenu could remain visible across callback invocations, and define the interaction that should count as done; the issue names no files or tests.
Written by the indexing model from the issue text.
Description
I have some UI
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
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 242
- Avg merge
- 11m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nmwsharp/polyscope
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
Rust Version Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in nmwsharp/polyscope
Similar issues
-
bug build
Difficulty 1/5 Under an hour Newbie friendliness 91/100
facebookincubator/velox#19194 ·
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW Openfuzz
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ClickHouse/ClickHouse#122114 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
module/agent platform/macos type/bug/regression
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement PyCDE
Difficulty 2/5 1-3 hours Newbie friendliness 78/100