From 16fc5d2ae03e6e493021c022a98f536a8ef7f4a9 Mon Sep 17 00:00:00 2001 From: Djairo Date: Fri, 24 Jan 2025 14:26:43 +0100 Subject: [PATCH 1/2] real quick data loading --- src/gui/MainWindow.cpp | 6 +++--- src/gui/input/Widget.cpp | 2 ++ src/gui/input/Widget.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 5b60944..08cc757 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -16,7 +16,7 @@ // this is a blocking operation, and really does not follow any practices of code design // should really be a proper class like GpuBufferHandler. // also only loads temperature data -void loadData(float* d_data, const int idx) { +void loadData(float* d_data, const int idx, const int timestep) { std::vector h_data; std::string path = "data/trimmed"; @@ -32,7 +32,7 @@ void loadData(float* d_data, const int idx) { float* hostVolume = new float[VOLUME_WIDTH * VOLUME_HEIGHT * VOLUME_DEPTH]; for (int i = 0; i < VOLUME_WIDTH * VOLUME_HEIGHT * VOLUME_DEPTH; i++) { - hostVolume[i] = h_data[i + 0*VOLUME_DEPTH*VOLUME_HEIGHT*VOLUME_WIDTH]; + hostVolume[i] = h_data[i + timestep*VOLUME_DEPTH*VOLUME_HEIGHT*VOLUME_WIDTH]; // Discard missing values if (h_data[i + 0*VOLUME_DEPTH*VOLUME_HEIGHT*VOLUME_WIDTH] + epsilon >= infty) hostVolume[i] = -infty; } @@ -170,7 +170,7 @@ void Window::tick() { this->widget->tick(1000.0/diff); if (this->widget->dateChanged) { // TODO: Load new date file here - loadData(this->data, this->widget->date); + loadData(this->data, this->widget->date, this->widget->timestep); this->widget->dateChanged = false; } if (this->widget->saveImage) { diff --git a/src/gui/input/Widget.cpp b/src/gui/input/Widget.cpp index 57d4bd4..2d9b11d 100644 --- a/src/gui/input/Widget.cpp +++ b/src/gui/input/Widget.cpp @@ -51,6 +51,7 @@ void parseDate(char* string, int dayOfYear) { } Widget::Widget(GLFWwindow* window) : + timestep(0), opacityK(63), sigmoidShift(0.5f), sigmoidExp(-250.0f), @@ -168,6 +169,7 @@ void Widget::tick(double fps) { } ImGui::SameLine(); ImGui::Text(this->dateString); + ImGui::DragInt("time step to load", &this->timestep, 1, 0, 3, "%d", ImGuiSliderFlags_AlwaysClamp); ImGui::DragInt("Samples per pixel", &this->samplesPerPixel, 1, 1, 16, "%d", ImGuiSliderFlags_AlwaysClamp); if (ImGui::Button("Save render")) this->saveImage = true; ImGui::End(); diff --git a/src/gui/input/Widget.h b/src/gui/input/Widget.h index c72ea02..546caa7 100644 --- a/src/gui/input/Widget.h +++ b/src/gui/input/Widget.h @@ -34,6 +34,7 @@ private: ImGuiIO io; char *dateString; int samplesPerPixel; + int timestep; // transfer function controls int tfComboSelected; From 57f59638f7be524ddcefc1f779d8c127ad5161f2 Mon Sep 17 00:00:00 2001 From: Djairo Date: Fri, 24 Jan 2025 14:27:15 +0100 Subject: [PATCH 2/2] readme --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index aea0385..8515fb6 100644 --- a/README.md +++ b/README.md @@ -72,11 +72,6 @@ For example, using the date of the file in question is a good way of ensuring th Once the data is in place, the program may be executed as normal - again make sure to run this on an NVidia GPU. - - - +## Screenshots - - -