Class GenericTableWidget

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class SmartPeak::GenericTableWidget : public SmartPeak::Widget

Base class for default tables.

TODO: features

  • row highlighting on focus

  • sorting

  • filtering

Subclassed by SmartPeak::ExplorerWidget, SmartPeak::SequenceSegmentWidget, SmartPeak::SequenceTableWidget

Public Types

typedef void (SessionHandler::* DataGetterMethod)(const SequenceHandler &sequence_handler, SessionHandler::GenericTableData &generic_table_data)
typedef Eigen::Tensor<bool, 1> (SessionHandler::* DataFilterMethod)(const Eigen::Tensor<std::string, 2> &to_filter) const

Public Functions

inline GenericTableWidget(const std::string &table_id, const std::string title = "", SessionHandler *session_handler = nullptr, SequenceHandler *sequence_handler = nullptr, DataGetterMethod data_getter = nullptr, DataFilterMethod data_filter = nullptr)
virtual void draw() override

Interface to show the widget

NOTE: free to override in inherited implmementations

bool searcher(const std::vector<ImEntry> &Im_table_entries, const int &selected_entry, const ImGuiTextFilter &filter, const size_t row) const
void updateTableContents(std::vector<ImEntry> &Im_table_entries, bool &is_scanned, const Eigen::Tensor<std::string, 2> &columns, const Eigen::Tensor<bool, 2> &checkbox_columns)
void sorter(std::vector<ImEntry> &Im_table_entries, ImGuiTableSortSpecs *sorts_specs, const bool &is_scanned)

Public Members

SessionHandler::GenericTableData table_data_
Eigen::Tensor<bool, 1> checked_rows_

Protected Functions

inline virtual bool isEditable(const size_t row, const size_t col) const
inline virtual void onEdit()
inline virtual void drawPopups()

Protected Attributes

const std::string table_id_
SessionHandler *session_handler_ = nullptr
SequenceHandler *sequence_handler_ = nullptr
DataGetterMethod data_getter_ = nullptr
DataFilterMethod data_filter_ = nullptr
std::vector<ImEntry> table_entries_
bool table_scanned_ = false
bool plot_all_ = false
bool plot_unplot_all_deactivated_ = false
int selected_col_ = 0
int plot_idx_ = -1
unsigned int table_entries_plot_col_ = 0
unsigned int checkbox_columns_plot_col_ = 0
std::string plot_switch_ = ""
std::vector<const char*> cols_
bool data_changed_ = false
std::vector<std::tuple<size_t, size_t>> selected_cells_