SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
satdump::handlers::Handler Class Referenceabstract

SatDump's handler base class. More...

#include <handler.h>

Inheritance diagram for satdump::handlers::Handler:
satdump::handlers::CycloHelperHandler satdump::handlers::DSPFlowGraphHandler satdump::handlers::DatasetHandler satdump::handlers::DatasetProductHandler satdump::handlers::DummyHandler satdump::handlers::ImageHandler satdump::handlers::NewRecHandler satdump::handlers::OffProcessingHandler satdump::handlers::ProductHandler satdump::handlers::ProjectionHandler satdump::handlers::ShapefileHandler satdump::handlers::TrashHandler satdump::handlers::WaterfallTestHandler

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

Detailed Description

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.

Member Function Documentation

◆ addSubHandler()

void satdump::handlers::Handler::addSubHandler ( std::shared_ptr< Handler > handler,
bool ontop = false )
virtual

Add a new subhandler.

Parameters
handlerthe handler to add
ontopif true, adds the handler at the start of the list

Reimplemented in satdump::handlers::ImageProductHandler, satdump::handlers::PunctiformProductHandler, and satdump::handlers::TrashHandler.

◆ delSubHandler()

void satdump::handlers::Handler::delSubHandler ( std::shared_ptr< Handler > handler,
bool now = false )
virtual

Delete a subhandler.

Parameters
handlerthe handler to delete

Reimplemented in satdump::handlers::ImageProductHandler, satdump::handlers::ProjectionHandler, and satdump::handlers::PunctiformProductHandler.

◆ drawContents()

◆ drawMenu()

◆ drawMenuBar()

virtual void satdump::handlers::Handler::drawMenuBar ( )
inlinevirtual

◆ drawTreeMenu()

bool satdump::handlers::Handler::drawTreeMenu ( std::shared_ptr< Handler > & h)
virtual

Render explorer menu bar (in the left sidebar)

Parameters
hcurrently selected handler, to be replaced if another is selected
Returns
true if the handler provided is present in the tree

Reimplemented in satdump::handlers::ImageProductHandler, and satdump::handlers::PunctiformProductHandler.

◆ getAllSubHandlers()

std::vector< std::shared_ptr< Handler > > satdump::handlers::Handler::getAllSubHandlers ( )
virtual

Get all current subhandlers.

Returns
List of all subhandlers

◆ getConfig()

nlohmann::json satdump::handlers::Handler::getConfig ( )
virtual

◆ getName()

◆ getTreeID()

std::string satdump::handlers::Handler::getTreeID ( )
inline

Get this handler's ImGui ID for rendering in the tree.

Returns
ID as a string

◆ hasSubhandlers()

bool satdump::handlers::Handler::hasSubhandlers ( )

Check if this handler contains any sub-handlers.

Returns
true if subhandlers are present

◆ resetConfig()

virtual void satdump::handlers::Handler::resetConfig ( )
inlinevirtual

Optional, allows resetting the handler's configuration.

Reimplemented in satdump::handlers::ImageHandler, and satdump::handlers::ImageProductHandler.

◆ setCanBeDragged()

void satdump::handlers::Handler::setCanBeDragged ( bool v)
inline

Set if a handler can be dragged around in the tree.

Parameters
vtrue to have it be draggable

◆ setCanBeDraggedTo()

void satdump::handlers::Handler::setCanBeDraggedTo ( bool v)
inline

Set if a handler can be dragged to in the tree.

Parameters
vtrue to have it be a valid drag target

◆ setCanBeSelected()

void satdump::handlers::Handler::setCanBeSelected ( bool v)
inline

Set if a handler can be select in the tree.

Parameters
vtrue to have it be selectable

◆ setCanSubBeReorgTo()

void satdump::handlers::Handler::setCanSubBeReorgTo ( bool v)
inline

Set if a handler's subhandlers can be reordered.

Parameters
vtrue to have them be reorderable

◆ setConfig()

virtual void satdump::handlers::Handler::setConfig ( nlohmann::json p)
inlinevirtual

◆ setSubHandlersCanBeDragged()

void satdump::handlers::Handler::setSubHandlersCanBeDragged ( bool v)
inline

Set if a handler's subhandlers can be dragged to in the tree.

Parameters
vtrue to have them be draggable

The documentation for this class was generated from the following files:
  • src-core/handlers/handler.h
  • src-core/handlers/handler.cpp