From 368e5621d71baef47307774ca532426a75f781dc Mon Sep 17 00:00:00 2001 From: Adrian Scripca Date: Sun, 7 May 2023 23:06:12 +0300 Subject: [PATCH] More work on heightmap probing. --- docs/todo.txt | 6 ++ main.cpp | 113 +++++++++++++++++++++++++++-- render.cpp | 194 ++++++++++++++++++++++++++++++++++++++++++++++---- render.h | 12 +++- 4 files changed, 300 insertions(+), 25 deletions(-) diff --git a/docs/todo.txt b/docs/todo.txt index cce4036..c9d09b8 100644 --- a/docs/todo.txt +++ b/docs/todo.txt @@ -46,6 +46,12 @@ Corner finding - need to know the bit diameter - use G38.2 to probe X edge and set that as current X - diam/2 +Render arcs +Render quadratic splines +Render bezier splines +Synchronize executing program with render (show executed paths with different colors) +Show a progress bar when executing programs. +Add aggressive buffer execution policy and make it selectable. DONE - Show program extents diff --git a/main.cpp b/main.cpp index 6a7d1e7..33b949b 100644 --- a/main.cpp +++ b/main.cpp @@ -33,6 +33,7 @@ #include "render.h" #include "glm/gtx/quaternion.hpp" #include "nanogui/nanogui.h" +#include "glm/gtc/matrix_inverse.hpp" #include #include #include // glm::vec3 @@ -68,7 +69,7 @@ public: float cam_zoom = 0; glm::quat cam_src_rotation = glm::quat(1.0, 0.0, 0.0, 0.0); // identity quaternion - Widget *info_layer; + Widget *info_layer, *heightmap_layer; TabWidget *tab_widget; VScrollPanel *settings_vscroll; Widget *settings_layer; @@ -93,6 +94,7 @@ public: window->set_layout(new BoxLayout(nanogui::Orientation::Vertical)); tab_widget = window->add(); + tab_widget->set_tabs_draggable(true); tab_widget->set_callback([&](int index) { tab_widget->set_selected_index(index); }); @@ -107,8 +109,6 @@ public: probe_layer->set_layout(new GroupLayout(10, 20, 30, 0)); probe_layer->add