class mrpt::graphslam::CWindowManager
Overview
Class acts as a container for storing pointers to mrpt::gui::CDisplayWindow3D, mrpt::graphslam::CWindowObserver instances.
CWindowManager also provides methods for adding/positioning textMessages and viewports in the CDisplayWindow in a compact and consistent way.
#include <mrpt/graphslam/misc/CWindowManager.h> class CWindowManager: public mrpt::system::COutputLogger { public: // fields mrpt::gui::CDisplayWindow3D* win; mrpt::graphslam::CWindowObserver* observer; // construction CWindowManager(); CWindowManager(mrpt::gui::CDisplayWindow3D* win_in); CWindowManager(mrpt::gui::CDisplayWindow3D* win_in, mrpt::graphslam::CWindowObserver* observer_in); // methods void setCDisplayWindow3DPtr(mrpt::gui::CDisplayWindow3D* win_in); void setWindowObserverPtr(mrpt::graphslam::CWindowObserver* obsever_in); void assignTextMessageParameters(double* offset_y, int* text_index); bool isOpen(); void addTextMessage( const double x, const double y, const std::string& text, ] const mrpt::img::TColorf& color = mrpt::img::TColorf(1.0, 1.0, 1.0), const size_t unique_index = 0 ); void assignViewportParameters(double* x, double* y, double* width, double* height); };
Inherited Members
public: // structs struct TMsg; // fields bool logging_enable_console_output {true}; bool logging_enable_keep_record {false}; // methods void logStr(const VerbosityLevel level, std::string_view msg_str) const; void logFmt(const VerbosityLevel level, const char* fmt, ...) const; void void logCond(const VerbosityLevel level, bool cond, const std::string& msg_str) const; void setLoggerName(const std::string& name); std::string getLoggerName() const; void setVerbosityLevel(const VerbosityLevel level); void setVerbosityLevelForCallbacks(const VerbosityLevel level); void setMinLoggingLevel(const VerbosityLevel level); VerbosityLevel getMinLoggingLevel() const; VerbosityLevel getMinLoggingLevelForCallbacks() const; bool isLoggingLevelVisible(VerbosityLevel level) const; void getLogAsString(std::string& log_contents) const; std::string getLogAsString() const; void writeLogToFile(const std::optional<std::string>& fname_in = std::nullopt) const; void dumpLogToConsole() const; std::string getLoggerLastMsg() const; void getLoggerLastMsg(std::string& msg_str) const; void loggerReset(); void logRegisterCallback(output_logger_callback_t userFunc); bool logDeregisterCallback(output_logger_callback_t userFunc); COutputLogger& operator = (const COutputLogger&); COutputLogger& operator = (COutputLogger&&); static std::array<mrpt::system::ConsoleForegroundColor, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_colors(); static const std::array<const char*, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_names();
Fields
mrpt::gui::CDisplayWindow3D* win
CDisplayWindow instance.
mrpt::graphslam::CWindowObserver* observer
CWindowObserver instance.
Construction
CWindowManager()
Default class constructor.
CWindowManager(mrpt::gui::CDisplayWindow3D* win_in)
Class constructor.
CWindowManager(mrpt::gui::CDisplayWindow3D* win_in, mrpt::graphslam::CWindowObserver* observer_in)
Class constructor.
Methods
void setCDisplayWindow3DPtr(mrpt::gui::CDisplayWindow3D* win_in)
Store the CDisplayWindow3D pointer in the CWindowManager instance.
See also:
void setWindowObserverPtr(mrpt::graphslam::CWindowObserver* obsever_in)
Store the CWindowObserver pointer in the CWindowManager instance.
See also:
void assignTextMessageParameters(double* offset_y, int* text_index)
Assign the next available offset_y and text_index for the textMessage under construction.
Used for consistent positioning of textMessages in the CDisplayWindow3D.
See also:
assignViewPortParameters
bool isOpen()
Wrapper call around the CWindowDisplay3D.
void addTextMessage( const double x, const double y, const std::string& text, ] const mrpt::img::TColorf& color = mrpt::img::TColorf(1.0, 1.0, 1.0), const size_t unique_index = 0 )
Wrapper around the CDisplayWindow3D::addTextMessage method, so that the user does not have to specify the font name and size.
see initCWindowManager method for the default fontName and fontSize used.
void assignViewportParameters( double* x, double* y, double* width, double* height )
Assign position and size values for the placement of the next viewport.
Used for consistent positioning of the Viewports in the CDisplayWindow3D
See also: