Open3D (C++ API)
GuiVisualizer.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 <vector>
30 
31 #include "Open3D/GUI/Window.h"
32 
33 namespace open3d {
34 
35 namespace geometry {
36 class AxisAlignedBoundingBox;
37 class Geometry;
38 } // namespace geometry
39 
40 namespace gui {
41 struct Theme;
42 }
43 
44 namespace visualization {
45 class GuiVisualizer : public gui::Window {
46  using Super = gui::Window;
47 
48 public:
49  GuiVisualizer(const std::vector<std::shared_ptr<const geometry::Geometry>>&
50  geometries,
51  const std::string& title,
52  int width,
53  int height,
54  int left,
55  int top);
56  virtual ~GuiVisualizer();
57 
58  void SetTitle(const std::string& title);
59  void SetGeometry(
60  const std::vector<std::shared_ptr<const geometry::Geometry>>&
61  geometries);
62 
63  bool SetIBL(const char* path);
64 
65  bool LoadGeometry(const std::string& path);
66  void ExportCurrentImage(int width, int height, const std::string& path);
67 
68  void Layout(const gui::Theme& theme) override;
69 
70 protected:
71  void OnMenuItemSelected(gui::Menu::ItemId item_id) override;
72  void OnDragDropped(const char* path) override;
73 
74 private:
75  struct Impl;
76  std::unique_ptr<Impl> impl_;
77 };
78 
79 } // namespace visualization
80 } // namespace open3d
Definition: GuiVisualizer.cpp:464
Definition: Window.h:49
Definition: GuiVisualizer.h:45
Definition: Open3DViewer.h:29
int height
Definition: FilePCD.cpp:70
int ItemId
Definition: Menu.h:45
int width
Definition: FilePCD.cpp:69
Definition: Theme.h:38