ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
GuiVisualizer.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <vector>
11 
13 
14 class ccBBox;
15 class ccHObject;
16 namespace cloudViewer {
17 
18 namespace visualization {
19 
20 namespace gui {
21 struct Theme;
22 }
23 
24 class GuiVisualizer : public gui::Window {
25  using Super = gui::Window;
26 
27 public:
28  GuiVisualizer(const std::string& title, int width, int height);
30  const std::vector<std::shared_ptr<const ccHObject>>& geometries,
31  const std::string& title,
32  int width,
33  int height,
34  int left,
35  int top);
36  virtual ~GuiVisualizer();
37 
38  void SetTitle(const std::string& title);
39  void SetGeometry(std::shared_ptr<const ccHObject> geometry,
40  bool loaded_model);
41 
42  bool SetIBL(const char* path);
43 
45  void LoadGeometry(const std::string& path);
46 
47  void ExportCurrentImage(const std::string& path);
48 
49  void Layout(const gui::LayoutContext& context) override;
50 
52  void StartRPCInterface(const std::string& address, int timeout);
53 
54  void StopRPCInterface();
55 
56 protected:
57  // Add custom items to the application menu (only relevant on macOS)
58  void AddItemsToAppMenu(
59  const std::vector<std::pair<std::string, gui::Menu::ItemId>>&
60  items);
61 
62  void OnMenuItemSelected(gui::Menu::ItemId item_id) override;
63  void OnDragDropped(const char* path) override;
64 
65 private:
66  struct Impl;
67  std::unique_ptr<Impl> impl_;
68 
69  void Init();
70 };
71 
72 } // namespace visualization
73 } // namespace cloudViewer
int width
int height
Bounding box structure.
Definition: ecvBBox.h:25
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
void ExportCurrentImage(const std::string &path)
void StartRPCInterface(const std::string &address, int timeout)
Starts the RPC interface. See io/rpc/ReceiverBase for the parameters.
void OnMenuItemSelected(gui::Menu::ItemId item_id) override
void Layout(const gui::LayoutContext &context) override
void LoadGeometry(const std::string &path)
Loads asynchronously, will return immediately.
void SetTitle(const std::string &title)
void AddItemsToAppMenu(const std::vector< std::pair< std::string, gui::Menu::ItemId >> &items)
void OnDragDropped(const char *path) override
void SetGeometry(std::shared_ptr< const ccHObject > geometry, bool loaded_model)
GuiVisualizer(const std::string &title, int width, int height)
GuiVisualizer(const std::vector< std::shared_ptr< const ccHObject >> &geometries, const std::string &title, int width, int height, int left, int top)
ImGuiContext * context
Definition: Window.cpp:76
static const std::string path
Definition: PointCloud.cpp:59
Generic file read and write utility for python interface.
struct Window Window
Definition: sqlite3.c:14678