Class GenericTableWidget

Inheritance Relationships

Base Type

Derived Type

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

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 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_
int selected_col = 0
std::vector<const char*> cols