Open3D (C++ API)
0.11.0
cpp
open3d
visualization
gui
Button.h
Go to the documentation of this file.
1
// ----------------------------------------------------------------------------
2
// - Open3D: www.open3d.org -
3
// ----------------------------------------------------------------------------
4
// The MIT License (MIT)
5
//
6
// Copyright (c) 2018 www.open3d.org
7
//
8
// Permission is hereby granted, free of charge, to any person obtaining a copy
9
// of this software and associated documentation files (the "Software"), to deal
10
// in the Software without restriction, including without limitation the rights
11
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
// copies of the Software, and to permit persons to whom the Software is
13
// furnished to do so, subject to the following conditions:
14
//
15
// The above copyright notice and this permission notice shall be included in
16
// all copies or substantial portions of the Software.
17
//
18
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24
// IN THE SOFTWARE.
25
// ----------------------------------------------------------------------------
26
27
#pragma once
28
29
#include "
open3d/visualization/gui/Widget.h
"
30
31
#include <functional>
32
33
#include "
open3d/visualization/gui/UIImage.h
"
34
35
namespace
open3d
{
36
namespace
visualization {
37
namespace
gui {
38
39
class
Button
:
public
Widget
{
40
public
:
41
explicit
Button
(
const
char
* title);
42
explicit
Button
(std::shared_ptr<UIImage> image);
43
~Button
();
44
47
const
char
*
GetText
()
const
;
49
void
SetText
(
const
char
* text);
50
52
float
GetHorizontalPaddingEm
()
const
;
53
float
GetVerticalPaddingEm
()
const
;
60
void
SetPaddingEm
(
float
horiz_ems,
float
vert_ems);
61
62
bool
GetIsToggleable
()
const
;
63
void
SetToggleable
(
bool
toggles);
64
65
bool
GetIsOn
()
const
;
66
void
SetOn
(
bool
is_on);
67
68
Size
CalcPreferredSize
(
const
Theme
& theme)
const override
;
69
70
DrawResult
Draw
(
const
DrawContext
& context)
override
;
71
72
void
SetOnClicked
(std::function<
void
()> on_clicked);
73
74
private
:
75
struct
Impl
;
76
std::unique_ptr<Impl> impl_;
77
};
78
79
}
// namespace gui
80
}
// namespace visualization
81
}
// namespace open3d
open3d::visualization::gui::Button::SetText
void SetText(const char *text)
Sets the text of the button. Do not call if this is an image button.
Definition:
Button.cpp:63
open3d::visualization::gui::Theme
Definition:
Theme.h:39
open3d::visualization::gui::Button::~Button
~Button()
Definition:
Button.cpp:59
open3d::visualization::gui::Button::SetPaddingEm
void SetPaddingEm(float horiz_ems, float vert_ems)
Definition:
Button.cpp:73
open3d::visualization::gui::Button::Button
Button(const char *title)
Definition:
Button.cpp:51
Widget.h
open3d::visualization::gui::Button::GetVerticalPaddingEm
float GetVerticalPaddingEm() const
Definition:
Button.cpp:69
open3d::visualization::gui::Widget
Definition:
Widget.h:62
open3d::visualization::gui::Button::GetText
const char * GetText() const
Definition:
Button.cpp:61
open3d::visualization::gui::Button::Impl
Definition:
Button.cpp:41
UIImage.h
open3d::visualization::gui::Button::GetIsToggleable
bool GetIsToggleable() const
Definition:
Button.cpp:78
open3d::visualization::gui::Button::SetOnClicked
void SetOnClicked(std::function< void()> on_clicked)
Definition:
Button.cpp:90
open3d::visualization::gui::Button::GetIsOn
bool GetIsOn() const
Definition:
Button.cpp:82
open3d::visualization::gui::Button::GetHorizontalPaddingEm
float GetHorizontalPaddingEm() const
Returns the padding, in units of ems.
Definition:
Button.cpp:65
open3d::visualization::gui::Button::SetToggleable
void SetToggleable(bool toggles)
Definition:
Button.cpp:80
open3d
Definition:
PinholeCameraIntrinsic.cpp:35
open3d::visualization::gui::DrawContext
Definition:
Widget.h:51
open3d::visualization::gui::Size
Definition:
Gui.h:41
open3d::visualization::gui::Button
Definition:
Button.h:39
open3d::visualization::gui::Button::CalcPreferredSize
Size CalcPreferredSize(const Theme &theme) const override
Definition:
Button.cpp:94
open3d::visualization::gui::Widget::DrawResult
DrawResult
Definition:
Widget.h:98
open3d::visualization::gui::Button::Draw
DrawResult Draw(const DrawContext &context) override
Definition:
Button.cpp:126
open3d::visualization::gui::Button::SetOn
void SetOn(bool is_on)
Definition:
Button.cpp:84
Generated by
1.8.13