ImGUI handler for rendering the save file window.
More...
#include <ui_save.h>
|
| | UiSaver () |
| | Initializes saver settings and initializes variables with default values. More...
|
| |
| void | show () |
| | Enables window to render. More...
|
| |
| void | render (State &state, ImGuiWindowFlags window_flags) |
| | Renders save file window, opens save file dialog window and calls save_data() if a directory was selected. More...
|
| |
| void | save_data (const State &state, const std::string &dir_name) const |
| | Calls write() for selected export data types. More...
|
| |
| void | write (UiSaver::Types type, const State &state, const std::string &dir_name) const |
| | Writes given data into the file in the tsv format. More...
|
| |
|
| bool | show_window |
| | If the save file window should be rendered. More...
|
| |
| ImGui::FileBrowser | saver |
| | ImGui file system dialog window handler. More...
|
| |
| std::string | saving_error |
| | Error message of the saving file that will be shown in the error window. More...
|
| |
| bool | all |
| | If all types of data should be exported. More...
|
| |
| std::array< bool, UiSaver::Types::COUNT > | data_flags |
| | Array of flags for each export data type indicating which data should be exported and which not. More...
|
| |
| std::array< std::string, UiSaver::Types::COUNT > | file_names |
| | Names of the exported files for each export data type. More...
|
| |
ImGUI handler for rendering the save file window.
Definition at line 35 of file ui_save.h.
◆ Types
Types of data to be exported.
| Enumerator |
|---|
| POINTS_HD | |
| LAND_HD | |
| POINTS_2D | |
| LAND_2D | |
| CLUSTERS | |
| COUNT | |
Definition at line 41 of file ui_save.h.
◆ UiSaver()
Initializes saver settings and initializes variables with default values.
Definition at line 30 of file ui_save.cpp.
◆ render()
| void UiSaver::render |
( |
State & |
state, |
|
|
ImGuiWindowFlags |
window_flags |
|
) |
| |
Renders save file window, opens save file dialog window and calls save_data() if a directory was selected.
- Parameters
-
| app | Application context. |
| window_flags | Flags used for rendered window. |
Definition at line 46 of file ui_save.cpp.
◆ save_data()
| void UiSaver::save_data |
( |
const State & |
state, |
|
|
const std::string & |
dir_name |
|
) |
| const |
Calls write() for selected export data types.
- Parameters
-
| state | Source of the exported data. |
| dir_name | Name of the selected directory. |
Definition at line 110 of file ui_save.cpp.
◆ show()
Enables window to render.
Definition at line 80 of file ui_save.h.
◆ write()
| void UiSaver::write |
( |
UiSaver::Types |
type, |
|
|
const State & |
state, |
|
|
const std::string & |
dir_name |
|
) |
| const |
Writes given data into the file in the tsv format.
- Parameters
-
| type | Type of the exported data. |
| state | Source of the exported data. |
| dir_name | Name of the selected directory. |
- Exceptions
-
| std::domain_error | Throws when the file cannot be opened for writing. |
Definition at line 177 of file ui_save.cpp.
◆ all
If all types of data should be exported.
Definition at line 63 of file ui_save.h.
◆ data_flags
| std::array<bool, UiSaver::Types::COUNT> UiSaver::data_flags |
Array of flags for each export data type indicating which data should be exported and which not.
Definition at line 66 of file ui_save.h.
◆ file_name_size
| constexpr int UiSaver::file_name_size = 128 |
|
staticconstexpr |
Maximum size of the file name.
Definition at line 52 of file ui_save.h.
◆ file_names
| std::array<std::string, UiSaver::Types::COUNT> UiSaver::file_names |
Names of the exported files for each export data type.
Definition at line 68 of file ui_save.h.
◆ saver
| ImGui::FileBrowser UiSaver::saver |
ImGui file system dialog window handler.
Definition at line 57 of file ui_save.h.
◆ saving_error
| std::string UiSaver::saving_error |
Error message of the saving file that will be shown in the error window.
Definition at line 60 of file ui_save.h.
◆ show_window
| bool UiSaver::show_window |
If the save file window should be rendered.
Definition at line 55 of file ui_save.h.
The documentation for this struct was generated from the following files: