libigl v2.5.0
Loading...
Searching...
No Matches
ImGuiMenu.h
Go to the documentation of this file.
1// This file is part of libigl, a simple c++ geometry processing library.
2//
3// Copyright (C) 2022 Alec Jacobson <alecjacobson@gmail.com>
4// Copyright (C) 2018 Jérémie Dumas <jeremie.dumas@ens-lyon.org>
5//
6// This Source Code Form is subject to the terms of the Mozilla Public License
7// v. 2.0. If a copy of the MPL was not distributed with this file, You can
8// obtain one at http://mozilla.org/MPL/2.0/.
9#ifndef IGL_OPENGL_GLFW_IMGUI_IMGUIMENU_H
10#define IGL_OPENGL_GLFW_IMGUI_IMGUIMENU_H
11
12#include "ImGuiPlugin.h"
13#include "ImGuiWidget.h"
14#include "../../../igl_inline.h"
15#include <memory>
16
17namespace igl
18{
19 namespace opengl
20 {
21 namespace glfw
22 {
23 namespace imgui
24 {
26 class ImGuiMenu : public ImGuiWidget
27 {
28 public:
29 IGL_INLINE virtual void init(Viewer *_viewer, ImGuiPlugin *_plugin) override;
30 IGL_INLINE virtual void shutdown() override;
31 IGL_INLINE virtual void draw() override;
32 // Can be overwritten by `callback_draw_viewer_window`
34 // Can be overwritten by `callback_draw_viewer_menu`
36 // Can be overwritten by `callback_draw_custom_window`
37 IGL_INLINE virtual void draw_custom_window() { }
38 // Customizable callbacks
39 std::function<void(void)> callback_draw_viewer_window;
40 std::function<void(void)> callback_draw_viewer_menu;
41 std::function<void(void)> callback_draw_custom_window;
43 { return plugin->hidpi_scaling() / plugin->pixel_ratio(); }
44 };
45
46 }
47 }
48 }
49}
50
51#ifndef IGL_STATIC_LIBRARY
52# include "ImGuiMenu.cpp"
53#endif
54
55#endif
Definition Viewer.h:43
Widget for a menu bar and a viewer window.
Definition ImGuiMenu.h:27
virtual void shutdown() override
std::function< void(void)> callback_draw_viewer_menu
Definition ImGuiMenu.h:40
virtual void init(Viewer *_viewer, ImGuiPlugin *_plugin) override
virtual void draw_custom_window()
Definition ImGuiMenu.h:37
std::function< void(void)> callback_draw_custom_window
Definition ImGuiMenu.h:41
float menu_scaling()
Definition ImGuiMenu.h:42
std::function< void(void)> callback_draw_viewer_window
Definition ImGuiMenu.h:39
virtual void draw() override
Plugin for the viewer to enable imgui widgets.
Definition ImGuiPlugin.h:32
Abstract class for imgui "widgets".
Definition ImGuiWidget.h:31
ImGuiPlugin * plugin
Definition ImGuiWidget.h:56
#define IGL_INLINE
Definition igl_inline.h:15
Definition AABB.h:17