From 0eab7f783b37fe1601cf7e493e1ec0a0e619a038 Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Sun, 29 Aug 2021 13:17:54 -0400 Subject: [PATCH] move perspective, lighting, and explode distance from configuration screen to view screen. --- src/confscreen.cpp | 49 ------------------------------------------ src/view.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/confscreen.cpp b/src/confscreen.cpp index 29a43591..2eb9534f 100644 --- a/src/confscreen.cpp +++ b/src/confscreen.cpp @@ -9,24 +9,6 @@ #include #endif -void TextWindow::ScreenChangeLightDirection(int link, uint32_t v) { - SS.TW.ShowEditControl(8, ssprintf("%.2f, %.2f, %.2f", CO(SS.lightDir[v]))); - SS.TW.edit.meaning = Edit::LIGHT_DIRECTION; - SS.TW.edit.i = v; -} - -void TextWindow::ScreenChangeLightIntensity(int link, uint32_t v) { - SS.TW.ShowEditControl(31, ssprintf("%.2f", SS.lightIntensity[v])); - SS.TW.edit.meaning = Edit::LIGHT_INTENSITY; - SS.TW.edit.i = v; -} - -void TextWindow::ScreenChangeLightAmbient(int link, uint32_t v) { - SS.TW.ShowEditControl(31, ssprintf("%.2f", SS.ambientIntensity)); - SS.TW.edit.meaning = Edit::LIGHT_AMBIENT; - SS.TW.edit.i = 0; -} - void TextWindow::ScreenChangeColor(int link, uint32_t v) { SS.TW.ShowEditControlWithColorPicker(13, SS.modelColor[v]); @@ -58,21 +40,11 @@ void TextWindow::ScreenChangeExportMaxSegments(int link, uint32_t v) { SS.TW.edit.i = 1; } -void TextWindow::ScreenChangeCameraTangent(int link, uint32_t v) { - SS.TW.ShowEditControl(3, ssprintf("%.3f", 1000*SS.cameraTangent)); - SS.TW.edit.meaning = Edit::CAMERA_TANGENT; -} - void TextWindow::ScreenChangeGridSpacing(int link, uint32_t v) { SS.TW.ShowEditControl(3, SS.MmToString(SS.gridSpacing, true)); SS.TW.edit.meaning = Edit::GRID_SPACING; } -void TextWindow::ScreenChangeExplodeDistance(int link, uint32_t v) { - SS.TW.ShowEditControl(3, SS.MmToString(SS.explodeDistance, true)); - SS.TW.edit.meaning = Edit::EXPLODE_DISTANCE; -} - void TextWindow::ScreenChangeDigitsAfterDecimal(int link, uint32_t v) { SS.TW.ShowEditControl(14, ssprintf("%d", SS.UnitDigitsAfterDecimal())); SS.TW.edit.meaning = Edit::DIGITS_AFTER_DECIMAL; @@ -232,18 +204,6 @@ void TextWindow::ShowConfiguration() { &ScreenChangeColor, i); } - Printf(false, ""); - Printf(false, "%Ft light direction intensity"); - for(i = 0; i < 2; i++) { - Printf(false, "%Bp #%d (%2,%2,%2)%Fl%D%f%Ll[c]%E " - "%2 %Fl%D%f%Ll[c]%E", - (i & 1) ? 'd' : 'a', i, - CO(SS.lightDir[i]), i, &ScreenChangeLightDirection, - SS.lightIntensity[i], i, &ScreenChangeLightIntensity); - } - Printf(false, "%Ba ambient lighting %2 %Fl%f%Ll[c]%E", - SS.ambientIntensity, &ScreenChangeLightAmbient); - Printf(false, ""); Printf(false, "%Ft chord tolerance (in percents)%E"); Printf(false, "%Ba %@ %% %Fl%Ll%f%D[change]%E; %@ mm, %d triangles", @@ -265,19 +225,10 @@ void TextWindow::ShowConfiguration() { SS.exportMaxSegments, &ScreenChangeExportMaxSegments); - Printf(false, ""); - Printf(false, "%Ft perspective factor (0 for parallel)%E"); - Printf(false, "%Ba %# %Fl%Ll%f%D[change]%E", - SS.cameraTangent*1000, - &ScreenChangeCameraTangent, 0); Printf(false, "%Ft snap grid spacing%E"); Printf(false, "%Ba %s %Fl%Ll%f%D[change]%E", SS.MmToString(SS.gridSpacing).c_str(), &ScreenChangeGridSpacing, 0); - Printf(false, "%Ft explode distance%E"); - Printf(false, "%Ba %s %Fl%Ll%f%D[change]%E", - SS.MmToString(SS.explodeDistance).c_str(), - &ScreenChangeExplodeDistance, 0); Printf(false, ""); Printf(false, "%Ft digits after decimal point to show%E"); diff --git a/src/view.cpp b/src/view.cpp index 9c85ce6b..99067bc5 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -35,8 +35,29 @@ void TextWindow::ShowEditView() { Printf(false, "%Ba %Ftout%E (%3, %3, %3)", CO(n)); Printf(false, ""); - Printf(false, "The perspective may be changed in the"); - Printf(false, "configuration screen."); + Printf(false, "%Ft perspective factor (0 for parallel)%E"); + Printf(false, "%Ba %# %Fl%Ll%f%D[change]%E", + SS.cameraTangent*1000, + &ScreenChangeCameraTangent, 0); + + Printf(false, ""); + Printf(false, "%Ft light direction intensity"); + for(int i = 0; i < 2; i++) { + Printf(false, "%Bp #%d (%2,%2,%2)%Fl%D%f%Ll[c]%E " + "%2 %Fl%D%f%Ll[c]%E", + (i & 1) ? 'd' : 'a', i, + CO(SS.lightDir[i]), i, &ScreenChangeLightDirection, + SS.lightIntensity[i], i, &ScreenChangeLightIntensity); + } + Printf(false, "%Ba ambient lighting %2 %Fl%f%Ll[c]%E", + SS.ambientIntensity, &ScreenChangeLightAmbient); + + Printf(false, ""); + Printf(false, "%Ft explode distance%E"); + Printf(false, "%Ba %s %Fl%Ll%f%D[change]%E", + SS.MmToString(SS.explodeDistance).c_str(), + &ScreenChangeExplodeDistance, 0); + } void TextWindow::ScreenChangeViewScale(int link, uint32_t v) { @@ -66,6 +87,34 @@ void TextWindow::ScreenChangeViewProjection(int link, uint32_t v) { SS.TW.ShowEditControl(10, edit_value); } +void TextWindow::ScreenChangeLightDirection(int link, uint32_t v) { + SS.TW.ShowEditControl(8, ssprintf("%.2f, %.2f, %.2f", CO(SS.lightDir[v]))); + SS.TW.edit.meaning = Edit::LIGHT_DIRECTION; + SS.TW.edit.i = v; +} + +void TextWindow::ScreenChangeLightIntensity(int link, uint32_t v) { + SS.TW.ShowEditControl(31, ssprintf("%.2f", SS.lightIntensity[v])); + SS.TW.edit.meaning = Edit::LIGHT_INTENSITY; + SS.TW.edit.i = v; +} + +void TextWindow::ScreenChangeLightAmbient(int link, uint32_t v) { + SS.TW.ShowEditControl(31, ssprintf("%.2f", SS.ambientIntensity)); + SS.TW.edit.meaning = Edit::LIGHT_AMBIENT; + SS.TW.edit.i = 0; +} + +void TextWindow::ScreenChangeCameraTangent(int link, uint32_t v) { + SS.TW.ShowEditControl(3, ssprintf("%.3f", 1000*SS.cameraTangent)); + SS.TW.edit.meaning = Edit::CAMERA_TANGENT; +} + +void TextWindow::ScreenChangeExplodeDistance(int link, uint32_t v) { + SS.TW.ShowEditControl(3, SS.MmToString(SS.explodeDistance, true)); + SS.TW.edit.meaning = Edit::EXPLODE_DISTANCE; +} + bool TextWindow::EditControlDoneForView(const std::string &s) { switch(edit.meaning) { case Edit::VIEW_SCALE: {