| 133 | } |
| 134 | |
| 135 | void 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 | |
| 159 | int main(int argc, char** argv) { |