| 2821 | } |
| 2822 | |
| 2823 | std::string SimulatorBase::saveFileDialog(const std::string& defaultPath, const std::string &defaultName, const std::string filterName, const std::string fileFilter) |
| 2824 | { |
| 2825 | std::string fileName = ""; |
| 2826 | #ifdef USE_NFD_FILE_DIALOG |
| 2827 | NFD_Init(); |
| 2828 | |
| 2829 | nfdchar_t* outPath; |
| 2830 | nfdfilteritem_t filterItem[1] = { { filterName.c_str(), fileFilter.c_str() } }; |
| 2831 | nfdresult_t result = NFD_SaveDialog(&outPath, filterItem, 1, defaultPath.c_str(), defaultName.c_str()); |
| 2832 | if (result == NFD_OKAY) |
| 2833 | { |
| 2834 | fileName = outPath; |
| 2835 | NFD_FreePath(outPath); |
| 2836 | } |
| 2837 | else if (result == NFD_CANCEL) |
| 2838 | { |
| 2839 | } |
| 2840 | else |
| 2841 | { |
| 2842 | LOG_ERR << "Error: " << NFD_GetError(); |
| 2843 | } |
| 2844 | |
| 2845 | NFD_Quit(); |
| 2846 | #endif |
| 2847 | |
| 2848 | return fileName; |
| 2849 | } |
| 2850 | |
| 2851 | void SimulatorBase::writeScene() |
| 2852 | { |
nothing calls this directly
no test coverage detected