libigl
v2.5.0
Loading...
Searching...
No Matches
ImGuiWidget.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
//
5
// This Source Code Form is subject to the terms of the Mozilla Public License
6
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
7
// obtain one at http://mozilla.org/MPL/2.0/.
8
#ifndef IGL_OPENGL_GLFW_IMGUI_IMGUIWIDGET_H
9
#define IGL_OPENGL_GLFW_IMGUI_IMGUIWIDGET_H
10
11
#include "
ImGuiPlugin.h
"
12
#include "
ImGuiWidget.h
"
13
#include "../../../igl_inline.h"
14
#include <memory>
15
16
namespace
igl
17
{
18
namespace
opengl
19
{
20
namespace
glfw
21
{
22
class
Viewer;
23
namespace
imgui
24
{
25
// Forward declaration of the parent plugin
26
class
ImGuiPlugin;
30
class
ImGuiWidget
31
{
32
public
:
33
IGL_INLINE
ImGuiWidget
(){
name
=
"dummy"
; }
34
virtual
~ImGuiWidget
(){}
35
IGL_INLINE
virtual
void
init
(
Viewer
*_viewer,
ImGuiPlugin
*_plugin)
36
{
viewer
= _viewer;
plugin
= _plugin; }
37
IGL_INLINE
virtual
void
shutdown
() {}
38
IGL_INLINE
virtual
void
draw
() {}
39
IGL_INLINE
virtual
bool
mouse_down
(
int
/*button*/
,
int
/*modifier*/
)
40
{
return
false
;}
41
IGL_INLINE
virtual
bool
mouse_up
(
int
/*button*/
,
int
/*modifier*/
)
42
{
return
false
;}
43
IGL_INLINE
virtual
bool
mouse_move
(
int
/*mouse_x*/
,
int
/*mouse_y*/
)
44
{
return
false
;}
45
IGL_INLINE
virtual
bool
key_pressed
(
unsigned
int
/*key*/
,
int
/*modifiers*/
)
46
{
return
false
;}
47
IGL_INLINE
virtual
bool
key_down
(
int
/*key*/
,
int
/*modifiers*/
)
48
{
return
false
;}
49
IGL_INLINE
virtual
bool
key_up
(
int
/*key*/
,
int
/*modifiers*/
)
50
{
return
false
;}
51
std::string
name
;
52
protected
:
53
// Pointer to ImGuiPlugin's parent viewer
54
Viewer
*
viewer
;
55
// Pointer to parent ImGuiPlugin class
56
ImGuiPlugin
*
plugin
;
57
};
58
59
}
60
}
61
}
62
}
63
64
#endif
65
ImGuiPlugin.h
ImGuiWidget.h
igl::opengl::glfw::Viewer
Definition
Viewer.h:43
igl::opengl::glfw::imgui::ImGuiPlugin
Plugin for the viewer to enable imgui widgets.
Definition
ImGuiPlugin.h:32
igl::opengl::glfw::imgui::ImGuiWidget
Abstract class for imgui "widgets".
Definition
ImGuiWidget.h:31
igl::opengl::glfw::imgui::ImGuiWidget::shutdown
virtual void shutdown()
Definition
ImGuiWidget.h:37
igl::opengl::glfw::imgui::ImGuiWidget::viewer
Viewer * viewer
Definition
ImGuiWidget.h:54
igl::opengl::glfw::imgui::ImGuiWidget::ImGuiWidget
ImGuiWidget()
Definition
ImGuiWidget.h:33
igl::opengl::glfw::imgui::ImGuiWidget::name
std::string name
Definition
ImGuiWidget.h:51
igl::opengl::glfw::imgui::ImGuiWidget::~ImGuiWidget
virtual ~ImGuiWidget()
Definition
ImGuiWidget.h:34
igl::opengl::glfw::imgui::ImGuiWidget::key_down
virtual bool key_down(int, int)
Definition
ImGuiWidget.h:47
igl::opengl::glfw::imgui::ImGuiWidget::key_pressed
virtual bool key_pressed(unsigned int, int)
Definition
ImGuiWidget.h:45
igl::opengl::glfw::imgui::ImGuiWidget::mouse_up
virtual bool mouse_up(int, int)
Definition
ImGuiWidget.h:41
igl::opengl::glfw::imgui::ImGuiWidget::key_up
virtual bool key_up(int, int)
Definition
ImGuiWidget.h:49
igl::opengl::glfw::imgui::ImGuiWidget::mouse_down
virtual bool mouse_down(int, int)
Definition
ImGuiWidget.h:39
igl::opengl::glfw::imgui::ImGuiWidget::draw
virtual void draw()
Definition
ImGuiWidget.h:38
igl::opengl::glfw::imgui::ImGuiWidget::mouse_move
virtual bool mouse_move(int, int)
Definition
ImGuiWidget.h:43
igl::opengl::glfw::imgui::ImGuiWidget::plugin
ImGuiPlugin * plugin
Definition
ImGuiWidget.h:56
igl::opengl::glfw::imgui::ImGuiWidget::init
virtual void init(Viewer *_viewer, ImGuiPlugin *_plugin)
Definition
ImGuiWidget.h:35
IGL_INLINE
#define IGL_INLINE
Definition
igl_inline.h:15
igl
Definition
AABB.h:17
include
igl
opengl
glfw
imgui
ImGuiWidget.h
Generated by
1.9.8