MCPcopy Create free account
hub / github.com/Theverat/NormalmapGenerator / autoUpdate

Method autoUpdate

src_gui/mainwindow.cpp:793–821  ·  view source on GitHub ↗

automatically update the preview if the calculation took only a certain amount of time in milliseconds, e.g. 500 (0.5 seconds) this Slot is for parameter input fields/buttons in the gui

Source from the content-addressed store, hash-verified

791//in milliseconds, e.g. 500 (0.5 seconds)
792//this Slot is for parameter input fields/buttons in the gui
793void MainWindow::autoUpdate() {
794 if(!ui->checkBox_autoUpdate->isChecked() || !ui->checkBox_autoUpdate->isEnabled())
795 return;
796
797 int autoUpdateThreshold_ms = ui->doubleSpinBox_autoUpdateThreshold->value() * 1000.0;
798
799 switch(ui->tabWidget->currentIndex()) {
800 case 0:
801 break;
802 case 1:
803 if(lastCalctime_normal < autoUpdateThreshold_ms)
804 calcNormalAndPreview();
805 break;
806 case 2:
807 if(lastCalctime_specular < autoUpdateThreshold_ms)
808 calcSpecAndPreview();
809 break;
810 case 3:
811 if(lastCalctime_displace < autoUpdateThreshold_ms)
812 calcDisplaceAndPreview();
813 break;
814 case 4:
815 if(lastCalctime_ssao < autoUpdateThreshold_ms)
816 calcSsaoAndPreview();
817 break;
818 default:
819 break;
820 }
821}
822
823//generate a message that shows the elapsed time of a calculation process
824//example output: "calculated normalmap (1.542 seconds)"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected