Implemented picker for color map

This commit is contained in:
Martin committed 2025-01-15 19:44:16 +01:00
1 parent 33365a26a7
commit 4b95bb728d
5 files changed
+44 -6

No files matched your search

+18 -1
View File
@@ -71,6 +71,21 @@ void Widget::tick(double fps) {
}
ImGui::EndCombo();
}
// Same comments as above apply
const char* items2[] = {"Python-like", "BPR", "Greyscale", "..."};
if (ImGui::BeginCombo("ComboBox for color map", items2[this->tfComboSelectedColor]))
{
for (int n = 0; n < IM_ARRAYSIZE(items2); n++)
{
const bool is_selected = (this->tfComboSelectedColor == n);
if (ImGui::Selectable(items2[n], is_selected))
this->tfComboSelectedColor = n;
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
ImGui::End();
ImGui::Begin("Light Controls");
@@ -119,10 +134,12 @@ void Widget::copyToDevice() {
cudaMemcpyToSymbol(&d_sigmoidShift, &this->sigmoidShift, sizeof(float));
cudaMemcpyToSymbol(&d_sigmoidExp, &this->sigmoidExp, sizeof(float));
cudaMemcpyToSymbol(&d_tfComboSelected, &this->tfComboSelected, sizeof(float));
cudaMemcpyToSymbol(&d_tfComboSelected, &this->tfComboSelected, sizeof(int));
this->opacityConstReal = std::pow(10.0f, (-5 + 0.05 * this->opacityConst));
cudaMemcpyToSymbol(&d_opacityConst, &this->opacityConstReal, sizeof(float));
cudaMemcpyToSymbol(&d_tfComboSelectedColor, &this->tfComboSelectedColor, sizeof(int));
}
Widget::~Widget() {
+1
View File
@@ -19,6 +19,7 @@ public:
char* fps;
int tfComboSelected;
int tfComboSelectedColor;
int opacityK;
float opacityKReal;
float sigmoidShift;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.