BlosSOM
Interactive dimensionality reduction on large datasets (EmbedSOM and FLOWER combined)
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
UiSaver Struct Reference

ImGUI handler for rendering the save file window. More...

#include <ui_save.h>

Public Types

enum  Types {
  POINTS_HD , LAND_HD , POINTS_2D , LAND_2D ,
  CLUSTERS , COUNT
}
 Types of data to be exported. More...
 

Public Member Functions

 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...
 

Public Attributes

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...
 

Static Public Attributes

static constexpr int file_name_size = 128
 Maximum size of the file name. More...
 

Detailed Description

ImGUI handler for rendering the save file window.

Definition at line 35 of file ui_save.h.

Member Enumeration Documentation

◆ 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.

Constructor & Destructor Documentation

◆ UiSaver()

UiSaver::UiSaver ( )

Initializes saver settings and initializes variables with default values.

Definition at line 30 of file ui_save.cpp.

Member Function Documentation

◆ 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
appApplication context.
window_flagsFlags used for rendered window.

Definition at line 46 of file ui_save.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_data()

void UiSaver::save_data ( const State state,
const std::string &  dir_name 
) const

Calls write() for selected export data types.

Parameters
stateSource of the exported data.
dir_nameName of the selected directory.

Definition at line 110 of file ui_save.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show()

void UiSaver::show ( )
inline

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
typeType of the exported data.
stateSource of the exported data.
dir_nameName of the selected directory.
Exceptions
std::domain_errorThrows when the file cannot be opened for writing.

Definition at line 177 of file ui_save.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ all

bool UiSaver::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: