MCPcopy Create free account
hub / github.com/GeometryCollective/ddg-exercises / functionCallback

Function functionCallback

projects/poisson-problem/src/main.cpp:135–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135void functionCallback() {
136
137 int idx = polyscope::state::currVertexIndex;
138 ImGui::Text("Density: ");
139 ImGui::SameLine(); // put label on the left
140 ImGui::InputDouble("", idx == -1 ? &DENSITY : &RHO[idx], -std::numeric_limits<double>::infinity(),
141 std::numeric_limits<double>::infinity(), "%0.2f");
142
143 // Solve and update colors
144 if (ImGui::Button("Solve")) {
145 update();
146 redraw();
147 }
148 if (ImGui::Button("Reset")) {
149 polyscope::state::subset.vertices.clear();
150 polyscope::state::currVertexIndex = -1;
151 RHO = Vector<double>::Zero(mesh->nVertices());
152 psMesh->setSurfaceColor({1.0, 1.0, 1.0});
153 solnColors->setEnabled(false);
154 redraw();
155 }
156}
157
158
159int main(int argc, char** argv) {

Callers

nothing calls this directly

Calls 2

updateFunction · 0.85
redrawFunction · 0.70

Tested by

no test coverage detected