SatDump 2.0.0-alpha-76a915210
|
SatDump's handler base class. More...
#include <handler.h>
Public Member Functions | |
virtual void | drawMenu ()=0 |
Render explorer menu left sidebar. | |
virtual void | drawContents (ImVec2 win_size)=0 |
Render explorer contents (center/left) | |
virtual void | drawMenuBar () |
Render explorer menu bar (in the left sidebar) | |
virtual bool | drawTreeMenu (std::shared_ptr< Handler > &h) |
Render explorer menu bar (in the left sidebar) | |
virtual std::string | getName () |
Get this handler's readable name. | |
std::string | getTreeID () |
Get this handler's ImGui ID for rendering in the tree. | |
bool | hasSubhandlers () |
Check if this handler contains any sub-handlers. | |
virtual void | addSubHandler (std::shared_ptr< Handler > handler, bool ontop=false) |
Add a new subhandler. | |
virtual void | delSubHandler (std::shared_ptr< Handler > handler, bool now=false) |
Delete a subhandler. | |
virtual std::vector< std::shared_ptr< Handler > > | getAllSubHandlers () |
Get all current subhandlers. | |
void | setCanBeSelected (bool v) |
Set if a handler can be select in the tree. | |
void | setCanBeDragged (bool v) |
Set if a handler can be dragged around in the tree. | |
void | setCanBeDraggedTo (bool v) |
Set if a handler can be dragged to in the tree. | |
void | setSubHandlersCanBeDragged (bool v) |
Set if a handler's subhandlers can be dragged to in the tree. | |
void | setCanSubBeReorgTo (bool v) |
Set if a handler's subhandlers can be reordered. | |
virtual void | setConfig (nlohmann::json p) |
Optional, allows setting a configuration/state from JSON. | |
virtual nlohmann::json | getConfig () |
Optional, allows getting a configuration/state as JSON. | |
virtual void | resetConfig () |
Optional, allows resetting the handler's configuration. | |
virtual std::string | getID ()=0 |
Public Attributes | |
std::string | handler_tree_icon = "N" |
Protected Attributes | |
std::vector< std::shared_ptr< Handler > > | subhandlers |
std::mutex | subhandlers_mtx |
SatDump's handler base class.
Handlers are meant to handle displaying and maniipulating data inside the explorer. To avoid code duplication, they may also serve as headless processors.
This implements all basic UI functions and handler tree system, as it is intended for handlers to be able to contain any other handler as a dependency.
|
virtual |
Add a new subhandler.
handler | the handler to add |
ontop | if true, adds the handler at the start of the list |
Reimplemented in satdump::handlers::ImageProductHandler, satdump::handlers::PunctiformProductHandler, and satdump::handlers::TrashHandler.
|
virtual |
Delete a subhandler.
handler | the handler to delete |
Reimplemented in satdump::handlers::ImageProductHandler, satdump::handlers::ProjectionHandler, and satdump::handlers::PunctiformProductHandler.
|
pure virtual |
Render explorer contents (center/left)
Implemented in satdump::handlers::CycloHelperHandler, satdump::handlers::DatasetHandler, satdump::handlers::DatasetProductHandler, satdump::handlers::DSPFlowGraphHandler, satdump::handlers::DummyHandler, satdump::handlers::ImageHandler, satdump::handlers::ImageProductHandler, satdump::handlers::NewRecHandler, satdump::handlers::OffProcessingHandler, satdump::handlers::ProjectionHandler, satdump::handlers::PunctiformProductHandler, satdump::handlers::ShapefileHandler, satdump::handlers::TrashHandler, and satdump::handlers::WaterfallTestHandler.
|
pure virtual |
Render explorer menu left sidebar.
Implemented in satdump::handlers::CycloHelperHandler, satdump::handlers::DatasetHandler, satdump::handlers::DatasetProductHandler, satdump::handlers::DSPFlowGraphHandler, satdump::handlers::DummyHandler, satdump::handlers::ImageHandler, satdump::handlers::ImageProductHandler, satdump::handlers::NewRecHandler, satdump::handlers::OffProcessingHandler, satdump::handlers::ProjectionHandler, satdump::handlers::PunctiformProductHandler, satdump::handlers::ShapefileHandler, satdump::handlers::TrashHandler, and satdump::handlers::WaterfallTestHandler.
|
inlinevirtual |
Render explorer menu bar (in the left sidebar)
Reimplemented in satdump::handlers::ImageHandler, satdump::handlers::ImageProductHandler, satdump::handlers::ProjectionHandler, satdump::handlers::PunctiformProductHandler, satdump::handlers::ShapefileHandler, and satdump::handlers::TrashHandler.
|
virtual |
Render explorer menu bar (in the left sidebar)
h | currently selected handler, to be replaced if another is selected |
Reimplemented in satdump::handlers::ImageProductHandler, and satdump::handlers::PunctiformProductHandler.
|
virtual |
Get all current subhandlers.
|
virtual |
Optional, allows getting a configuration/state as JSON.
Reimplemented in satdump::handlers::ImageHandler, satdump::handlers::ImageProductHandler, satdump::handlers::ProjectionHandler, satdump::handlers::PunctiformProductHandler, satdump::handlers::ShapefileHandler, and satdump::handlers::TrashHandler.
|
inlinevirtual |
Get this handler's readable name.
Reimplemented in satdump::handlers::CycloHelperHandler, satdump::handlers::DatasetHandler, satdump::handlers::DatasetProductHandler, satdump::handlers::DSPFlowGraphHandler, satdump::handlers::DummyHandler, satdump::handlers::ImageHandler, satdump::handlers::NewRecHandler, satdump::handlers::OffProcessingHandler, satdump::handlers::ProductHandler, satdump::handlers::ProjectionHandler, satdump::handlers::ShapefileHandler, satdump::handlers::TrashHandler, and satdump::handlers::WaterfallTestHandler.
|
inline |
Get this handler's ImGui ID for rendering in the tree.
bool satdump::handlers::Handler::hasSubhandlers | ( | ) |
Check if this handler contains any sub-handlers.
|
inlinevirtual |
Optional, allows resetting the handler's configuration.
Reimplemented in satdump::handlers::ImageHandler, and satdump::handlers::ImageProductHandler.
|
inline |
Set if a handler can be dragged around in the tree.
v | true to have it be draggable |
|
inline |
Set if a handler can be dragged to in the tree.
v | true to have it be a valid drag target |
|
inline |
Set if a handler can be select in the tree.
v | true to have it be selectable |
|
inline |
Set if a handler's subhandlers can be reordered.
v | true to have them be reorderable |
|
inlinevirtual |
Optional, allows setting a configuration/state from JSON.
p | JSON object |
Reimplemented in satdump::handlers::ImageHandler, satdump::handlers::ImageProductHandler, satdump::handlers::ProjectionHandler, satdump::handlers::PunctiformProductHandler, satdump::handlers::ShapefileHandler, and satdump::handlers::TrashHandler.
|
inline |
Set if a handler's subhandlers can be dragged to in the tree.
v | true to have them be draggable |