#include <ImGuiMenu.h>
Classes | |
struct | LabelParams |
struct | PluginsCache |
class | UiRenderManagerImpl |
Public Types | |
enum class | NameTagSelectionMode { selectOne , toggle } |
using | NameTagClickSignal = boost::signals2::signal<bool( Object& object, NameTagSelectionMode mode ), StopOnTrueCombiner> |
using | DrawSceneUiSignal = boost::signals2::signal<void( float menuScaling, ViewportId viewportId, UiRenderParams::UiTaskList& tasks )> |
Public Member Functions | |
virtual MRVIEWER_API void | init (MR::Viewer *_viewer) override |
virtual MRVIEWER_API void | initBackend () |
virtual MRVIEWER_API void | startFrame () |
virtual MRVIEWER_API void | finishFrame () |
virtual MRVIEWER_API void | load_font (int font_size=13) |
virtual MRVIEWER_API void | reload_font (int font_size=13) |
virtual MRVIEWER_API void | shutdown () override |
virtual MRVIEWER_API void | draw_menu () |
MRVIEWER_API void | draw_helpers () |
virtual MRVIEWER_API void | draw_viewer_window () |
MRVIEWER_API void | draw_mr_menu () |
virtual void | draw_custom_window () |
void | draw_labels_window () |
void | draw_labels (const VisualObject &obj) |
MRVIEWER_API void | draw_text (const Viewport &viewport, const Vector3f &pos, const Vector3f &normal, const std::string &text, const Color &color, bool clipByViewport) |
MRVIEWER_API float | pixel_ratio () |
MRVIEWER_API float | hidpi_scaling () |
MRVIEWER_API float | menu_scaling () const |
MRVIEWER_API ImGuiContext * | getCurrentContext () const |
ImGuiWindow * | getLastFocusedPlugin () const |
virtual MRVIEWER_API void | showModalMessage (const std::string &msg, NotificationType msgType) |
virtual MRVIEWER_API std::filesystem::path | getMenuFontPath () const |
MRVIEWER_API void | setDrawTimeMillisecThreshold (long long maxGoodTimeMillisec) |
MRVIEWER_API void | draw_scene_list () |
MRVIEWER_API void | draw_scene_list_content (const std::vector< std::shared_ptr< Object > > &selected, const std::vector< std::shared_ptr< Object > > &all) |
virtual MRVIEWER_API void | draw_selection_properties (const std::vector< std::shared_ptr< Object > > &selected) |
virtual MRVIEWER_API void | draw_selection_properties_content (const std::vector< std::shared_ptr< Object > > &selected) |
virtual MRVIEWER_API bool | drawCollapsingHeader_ (const char *label, ImGuiTreeNodeFlags flags=0) |
virtual MRVIEWER_API bool | drawCollapsingHeaderTransform_ () |
bool | make_visualize_checkbox (std::vector< std::shared_ptr< VisualObject > > selectedVisualObjs, const char *label, AnyVisualizeMaskEnum type, MR::ViewportMask viewportid, bool invert=false) |
template<typename ObjectT > | |
void | make_color_selector (std::vector< std::shared_ptr< ObjectT > > selectedVisualObjs, const char *label, std::function< Vector4f(const ObjectT *)> getter, std::function< void(ObjectT *, const Vector4f &)> setter) |
template<typename ObjType > | |
void | make_width (std::vector< std::shared_ptr< VisualObject > > selectedVisualObjs, const char *label, std::function< float(const ObjType *)> getter, std::function< void(ObjType *, const float &)> setter) |
void | make_light_strength (std::vector< std::shared_ptr< VisualObject > > selectedVisualObjs, const char *label, std::function< float(const VisualObject *)> getter, std::function< void(VisualObject *, const float &)> setter) |
template<typename T , typename ObjectType > | |
void | make_slider (std::vector< std::shared_ptr< ObjectType > > selectedVisualObjs, const char *label, std::function< T(const ObjectType *)> getter, std::function< void(ObjectType *, T)> setter, T min, T max) |
void | make_points_discretization (std::vector< std::shared_ptr< VisualObject > > selectedVisualObjs, const char *label, std::function< int(const ObjectPointsHolder *)> getter, std::function< void(ObjectPointsHolder *, const int &)> setter) |
MRVIEWER_API void | draw_custom_plugins () |
std::shared_ptr< ShortcutManager > | getShortcutManager () |
MRVIEWER_API void | add_modifier (std::shared_ptr< MR::MeshModifier > modifier) |
MRVIEWER_API void | allowSceneReorder (bool allow) |
bool | checkPossibilityObjectRemoval () |
MRVIEWER_API void | allowObjectsRemoval (bool allow) |
MRVIEWER_API void | tryRenameSelectedObject () |
MRVIEWER_API void | setObjectTreeState (const Object *obj, bool open) |
MRVIEWER_API void | setShowShortcuts (bool val) |
MRVIEWER_API bool | getShowShortcuts () const |
void | enableSavedDialogPositions (bool on) |
bool | isSavedDialogPositionsEnabled () const |
virtual MRVIEWER_API UiRenderManager & | getUiRenderManager () |
MRVIEWER_API const std::shared_ptr< SceneObjectsListDrawer > & | getSceneObjectsList () |
MRVIEWER_API bool | simulateNameTagClick (Object &object, NameTagSelectionMode mode) |
MRVIEWER_API bool | anyImGuiWindowIsHovered () const |
MRVIEWER_API bool | anyUiObjectIsHovered () const |
MRVIEWER_API SelectedTypesMask | calcSelectedTypesMask (const std::vector< std::shared_ptr< Object > > &selectedObjs) |
MRVIEWER_API bool | drawGeneralOptions (const std::vector< std::shared_ptr< Object > > &selectedObjs) |
MRVIEWER_API bool | drawAdvancedOptions (const std::vector< std::shared_ptr< VisualObject > > &selectedObjs, SelectedTypesMask selectedMask) |
MRVIEWER_API bool | drawRemoveButton (const std::vector< std::shared_ptr< Object > > &selectedObjs) |
MRVIEWER_API bool | drawDrawOptionsCheckboxes (const std::vector< std::shared_ptr< VisualObject > > &selectedObjs, SelectedTypesMask selectedMask) |
MRVIEWER_API bool | drawDrawOptionsColors (const std::vector< std::shared_ptr< VisualObject > > &selectedObjs) |
Public Member Functions inherited from MR::ViewerPlugin | |
virtual | ~ViewerPlugin () |
Public Member Functions inherited from MR::MultiListener< MouseDownListener, MouseMoveListener, MouseUpListener, MouseScrollListener, CursorEntranceListener, CharPressedListener, KeyDownListener, KeyUpListener, KeyRepeatListener, SpaceMouseMoveListener, SpaceMouseDownListener, TouchpadRotateGestureBeginListener, TouchpadRotateGestureUpdateListener, TouchpadRotateGestureEndListener, TouchpadSwipeGestureBeginListener, TouchpadSwipeGestureUpdateListener, TouchpadSwipeGestureEndListener, TouchpadZoomGestureBeginListener, TouchpadZoomGestureUpdateListener, TouchpadZoomGestureEndListener, PostResizeListener, PostRescaleListener > | |
virtual | ~MultiListener ()=default |
virtual void | connect (Viewer *viewer, int group=0, boost::signals2::connect_position pos=boost::signals2::connect_position::at_back) |
virtual void | disconnect () |
Static Public Member Functions | |
static MRVIEWER_API const std::shared_ptr< ImGuiMenu > & | instance () |
Public Attributes | |
std::function< void(void)> | callback_draw_viewer_window |
std::function< void(void)> | callback_draw_viewer_menu |
std::function< void(void)> | callback_draw_custom_window |
NameTagClickSignal | nameTagClickSignal |
DrawSceneUiSignal | drawSceneUiSignal |
Protected Types | |
enum | ViewportConfigurations { Single , Horizontal , Vertical , Quad } |
Protected Member Functions | |
virtual MRVIEWER_API void | setupShortcuts_ () |
Vector4f | getStoredColor_ (const std::string &str, const Color &defaultColor) const |
virtual MRVIEWER_API void | drawModalMessage_ () |
virtual MRVIEWER_API bool | onMouseDown_ (MouseButton button, int modifier) override |
virtual MRVIEWER_API bool | onMouseUp_ (MouseButton button, int modifier) override |
virtual MRVIEWER_API bool | onMouseMove_ (int mouse_x, int mouse_y) override |
virtual MRVIEWER_API bool | onMouseScroll_ (float delta_y) override |
virtual MRVIEWER_API void | cursorEntrance_ (bool entered) override |
virtual MRVIEWER_API bool | onCharPressed_ (unsigned key, int modifiers) override |
virtual MRVIEWER_API bool | onKeyDown_ (int key, int modifiers) override |
virtual MRVIEWER_API bool | onKeyUp_ (int key, int modifiers) override |
virtual MRVIEWER_API bool | onKeyRepeat_ (int key, int modifiers) override |
virtual MRVIEWER_API void | postResize_ (int width, int height) override |
virtual MRVIEWER_API void | postRescale_ (float x, float y) override |
virtual MRVIEWER_API bool | spaceMouseMove_ (const Vector3f &translate, const Vector3f &rotate) override |
virtual MRVIEWER_API bool | spaceMouseDown_ (int key) override |
virtual MRVIEWER_API bool | touchpadRotateGestureBegin_ () override |
virtual MRVIEWER_API bool | touchpadRotateGestureUpdate_ (float angle) override |
virtual MRVIEWER_API bool | touchpadRotateGestureEnd_ () override |
virtual MRVIEWER_API bool | touchpadSwipeGestureBegin_ () override |
virtual MRVIEWER_API bool | touchpadSwipeGestureUpdate_ (float deltaX, float deltaY, bool kinetic) override |
virtual MRVIEWER_API bool | touchpadSwipeGestureEnd_ () override |
virtual MRVIEWER_API bool | touchpadZoomGestureBegin_ () override |
virtual MRVIEWER_API bool | touchpadZoomGestureUpdate_ (float scale, bool kinetic) override |
virtual MRVIEWER_API bool | touchpadZoomGestureEnd_ () override |
virtual MRVIEWER_API void | rescaleStyle_ () |
virtual MRVIEWER_API void | addMenuFontRanges_ (ImFontGlyphRangesBuilder &builder) const |
MRVIEWER_API float | drawSelectionInformation_ () |
MRVIEWER_API void | drawFeaturePropertiesEditor_ (const std::shared_ptr< Object > &object) |
virtual MRVIEWER_API void | draw_custom_selection_properties (const std::vector< std::shared_ptr< Object > > &selected) |
MRVIEWER_API float | drawTransform_ () |
virtual MRVIEWER_API bool | drawTransformContextMenu_ (const std::shared_ptr< Object > &) |
void | draw_history_block_ () |
void | draw_open_recent_button_ () |
virtual MRVIEWER_API void | drawShortcutsWindow_ () |
MRVIEWER_API float | getSceneInfoItemWidth_ (int itemCount=1) |
using MR::ImGuiMenu::DrawSceneUiSignal = boost::signals2::signal<void( float menuScaling, ViewportId viewportId, UiRenderParams::UiTaskList& tasks )> |
using MR::ImGuiMenu::NameTagClickSignal = boost::signals2::signal<bool( Object& object, NameTagSelectionMode mode ), StopOnTrueCombiner> |
|
strong |
|
protected |
MRVIEWER_API void MR::ImGuiMenu::add_modifier | ( | std::shared_ptr< MR::MeshModifier > | modifier | ) |
|
protectedvirtual |
MRVIEWER_API void MR::ImGuiMenu::allowObjectsRemoval | ( | bool | allow | ) |
MRVIEWER_API void MR::ImGuiMenu::allowSceneReorder | ( | bool | allow | ) |
MRVIEWER_API bool MR::ImGuiMenu::anyImGuiWindowIsHovered | ( | ) | const |
MRVIEWER_API bool MR::ImGuiMenu::anyUiObjectIsHovered | ( | ) | const |
MRVIEWER_API SelectedTypesMask MR::ImGuiMenu::calcSelectedTypesMask | ( | const std::vector< std::shared_ptr< Object > > & | selectedObjs | ) |
|
inline |
|
overrideprotectedvirtual |
MRVIEWER_API void MR::ImGuiMenu::draw_custom_plugins | ( | ) |
|
protectedvirtual |
|
inlinevirtual |
MRVIEWER_API void MR::ImGuiMenu::draw_helpers | ( | ) |
|
protected |
void MR::ImGuiMenu::draw_labels | ( | const VisualObject & | obj | ) |
void MR::ImGuiMenu::draw_labels_window | ( | ) |
|
virtual |
MRVIEWER_API void MR::ImGuiMenu::draw_mr_menu | ( | ) |
|
protected |
MRVIEWER_API void MR::ImGuiMenu::draw_scene_list | ( | ) |
MRVIEWER_API void MR::ImGuiMenu::draw_scene_list_content | ( | const std::vector< std::shared_ptr< Object > > & | selected, |
const std::vector< std::shared_ptr< Object > > & | all ) |
|
virtual |
|
virtual |
MRVIEWER_API void MR::ImGuiMenu::draw_text | ( | const Viewport & | viewport, |
const Vector3f & | pos, | ||
const Vector3f & | normal, | ||
const std::string & | text, | ||
const Color & | color, | ||
bool | clipByViewport ) |
|
virtual |
MRVIEWER_API bool MR::ImGuiMenu::drawAdvancedOptions | ( | const std::vector< std::shared_ptr< VisualObject > > & | selectedObjs, |
SelectedTypesMask | selectedMask ) |
|
virtual |
Reimplemented in MR::RibbonMenu.
|
virtual |
Reimplemented in MR::RibbonMenu.
MRVIEWER_API bool MR::ImGuiMenu::drawDrawOptionsCheckboxes | ( | const std::vector< std::shared_ptr< VisualObject > > & | selectedObjs, |
SelectedTypesMask | selectedMask ) |
MRVIEWER_API bool MR::ImGuiMenu::drawDrawOptionsColors | ( | const std::vector< std::shared_ptr< VisualObject > > & | selectedObjs | ) |
|
protected |
MRVIEWER_API bool MR::ImGuiMenu::drawGeneralOptions | ( | const std::vector< std::shared_ptr< Object > > & | selectedObjs | ) |
|
protectedvirtual |
MRVIEWER_API bool MR::ImGuiMenu::drawRemoveButton | ( | const std::vector< std::shared_ptr< Object > > & | selectedObjs | ) |
|
protected |
|
protectedvirtual |
Reimplemented in MR::RibbonMenu.
|
protected |
|
inlineprotectedvirtual |
Reimplemented in MR::RibbonMenu.
|
inline |
|
virtual |
MRVIEWER_API ImGuiContext * MR::ImGuiMenu::getCurrentContext | ( | ) | const |
|
inline |
|
virtual |
Reimplemented in MR::RibbonMenu.
|
protected |
|
inline |
|
inline |
MRVIEWER_API bool MR::ImGuiMenu::getShowShortcuts | ( | ) | const |
|
protected |
|
virtual |
MRVIEWER_API float MR::ImGuiMenu::hidpi_scaling | ( | ) |
|
overridevirtual |
Reimplemented from MR::ViewerPlugin.
Reimplemented in MR::Menu, and MR::RibbonMenu.
|
virtual |
|
static |
|
inline |
|
virtual |
Reimplemented in MR::RibbonMenu.
void MR::ImGuiMenu::make_color_selector | ( | std::vector< std::shared_ptr< ObjectT > > | selectedVisualObjs, |
const char * | label, | ||
std::function< Vector4f(const ObjectT *)> | getter, | ||
std::function< void(ObjectT *, const Vector4f &)> | setter ) |
void MR::ImGuiMenu::make_light_strength | ( | std::vector< std::shared_ptr< VisualObject > > | selectedVisualObjs, |
const char * | label, | ||
std::function< float(const VisualObject *)> | getter, | ||
std::function< void(VisualObject *, const float &)> | setter ) |
void MR::ImGuiMenu::make_points_discretization | ( | std::vector< std::shared_ptr< VisualObject > > | selectedVisualObjs, |
const char * | label, | ||
std::function< int(const ObjectPointsHolder *)> | getter, | ||
std::function< void(ObjectPointsHolder *, const int &)> | setter ) |
void MR::ImGuiMenu::make_slider | ( | std::vector< std::shared_ptr< ObjectType > > | selectedVisualObjs, |
const char * | label, | ||
std::function< T(const ObjectType *)> | getter, | ||
std::function< void(ObjectType *, T)> | setter, | ||
T | min, | ||
T | max ) |
bool MR::ImGuiMenu::make_visualize_checkbox | ( | std::vector< std::shared_ptr< VisualObject > > | selectedVisualObjs, |
const char * | label, | ||
AnyVisualizeMaskEnum | type, | ||
MR::ViewportMask | viewportid, | ||
bool | invert = false ) |
void MR::ImGuiMenu::make_width | ( | std::vector< std::shared_ptr< VisualObject > > | selectedVisualObjs, |
const char * | label, | ||
std::function< float(const ObjType *)> | getter, | ||
std::function< void(ObjType *, const float &)> | setter ) |
MRVIEWER_API float MR::ImGuiMenu::menu_scaling | ( | ) | const |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
MRVIEWER_API float MR::ImGuiMenu::pixel_ratio | ( | ) |
|
overrideprotectedvirtual |
Reimplemented in MR::RibbonMenu.
|
overrideprotectedvirtual |
Reimplemented in MR::RibbonMenu.
|
virtual |
|
protectedvirtual |
MRVIEWER_API void MR::ImGuiMenu::setDrawTimeMillisecThreshold | ( | long long | maxGoodTimeMillisec | ) |
MRVIEWER_API void MR::ImGuiMenu::setObjectTreeState | ( | const Object * | obj, |
bool | open ) |
MRVIEWER_API void MR::ImGuiMenu::setShowShortcuts | ( | bool | val | ) |
|
protectedvirtual |
Reimplemented in MR::RibbonMenu.
|
virtual |
|
overridevirtual |
Reimplemented from MR::ViewerPlugin.
Reimplemented in MR::RibbonMenu.
MRVIEWER_API bool MR::ImGuiMenu::simulateNameTagClick | ( | Object & | object, |
NameTagSelectionMode | mode ) |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
virtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
MRVIEWER_API void MR::ImGuiMenu::tryRenameSelectedObject | ( | ) |
|
protected |
std::function<void(void)> MR::ImGuiMenu::callback_draw_custom_window |
std::function<void(void)> MR::ImGuiMenu::callback_draw_viewer_menu |
std::function<void(void)> MR::ImGuiMenu::callback_draw_viewer_window |
|
protected |
|
protected |
DrawSceneUiSignal MR::ImGuiMenu::drawSceneUiSignal |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
NameTagClickSignal MR::ImGuiMenu::nameTagClickSignal |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |