Open3D (C++ API)  0.18.0+252c867
VisualizerWithCustomAnimation.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
11 
12 namespace open3d {
13 namespace visualization {
14 
16 public:
20  delete;
22  const VisualizerWithCustomAnimation &) = delete;
23 
24 public:
25  void PrintVisualizerHelp() override;
26  void UpdateWindowTitle() override;
27  void Play(bool recording = false,
28  bool recording_depth = false,
29  bool close_window_when_animation_ends = false);
30  void RegisterRecordingImageFormat(const std::string &basedir,
31  const std::string &format,
32  const std::string &trajectory) {
33  recording_image_basedir_ = basedir;
36  }
37  void RegisterRecordingDepthFormat(const std::string &basedir,
38  const std::string &format,
39  const std::string &trajectory) {
40  recording_depth_basedir_ = basedir;
43  }
44 
45 protected:
46  bool InitViewControl() override;
47  void MouseMoveCallback(GLFWwindow *window, double x, double y) override;
48  void MouseScrollCallback(GLFWwindow *window, double x, double y) override;
49  void MouseButtonCallback(GLFWwindow *window,
50  int button,
51  int action,
52  int mods) override;
53  void KeyPressCallback(GLFWwindow *window,
54  int key,
55  int scancode,
56  int action,
57  int mods) override;
58 
59 protected:
60  std::string recording_image_basedir_ = "image/";
61  std::string recording_image_filename_format_ = "image_{:06d}.png";
62  std::string recording_image_trajectory_filename_ = "image_trajectory.json";
63  std::string recording_depth_basedir_ = "depth/";
64  std::string recording_depth_filename_format_ = "depth_{:06d}.png";
65  std::string recording_depth_trajectory_filename_ = "depth_trajectory.json";
67 };
68 
69 } // namespace visualization
70 } // namespace open3d
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:195
The main Visualizer class.
Definition: Visualizer.h:45
Definition: VisualizerWithCustomAnimation.h:15
std::string recording_image_filename_format_
Definition: VisualizerWithCustomAnimation.h:61
~VisualizerWithCustomAnimation() override
Definition: VisualizerWithCustomAnimation.cpp:24
std::string recording_depth_basedir_
Definition: VisualizerWithCustomAnimation.h:63
std::string recording_depth_trajectory_filename_
Definition: VisualizerWithCustomAnimation.h:65
bool InitViewControl() override
Function to initialize ViewControl.
Definition: VisualizerWithCustomAnimation.cpp:151
void MouseButtonCallback(GLFWwindow *window, int button, int action, int mods) override
Definition: VisualizerWithCustomAnimation.cpp:286
void UpdateWindowTitle() override
Definition: VisualizerWithCustomAnimation.cpp:57
VisualizerWithCustomAnimation()
Definition: VisualizerWithCustomAnimation.cpp:22
void KeyPressCallback(GLFWwindow *window, int key, int scancode, int action, int mods) override
Definition: VisualizerWithCustomAnimation.cpp:158
void RegisterRecordingDepthFormat(const std::string &basedir, const std::string &format, const std::string &trajectory)
Definition: VisualizerWithCustomAnimation.h:37
void MouseScrollCallback(GLFWwindow *window, double x, double y) override
Definition: VisualizerWithCustomAnimation.cpp:269
VisualizerWithCustomAnimation(const VisualizerWithCustomAnimation &)=delete
std::string recording_image_basedir_
Definition: VisualizerWithCustomAnimation.h:60
std::string recording_image_trajectory_filename_
Definition: VisualizerWithCustomAnimation.h:62
std::string recording_depth_filename_format_
Definition: VisualizerWithCustomAnimation.h:64
void PrintVisualizerHelp() override
Definition: VisualizerWithCustomAnimation.cpp:26
void RegisterRecordingImageFormat(const std::string &basedir, const std::string &format, const std::string &trajectory)
Definition: VisualizerWithCustomAnimation.h:30
VisualizerWithCustomAnimation & operator=(const VisualizerWithCustomAnimation &)=delete
size_t recording_file_index_
Definition: VisualizerWithCustomAnimation.h:66
void MouseMoveCallback(GLFWwindow *window, double x, double y) override
Definition: VisualizerWithCustomAnimation.cpp:258
void Play(bool recording=false, bool recording_depth=false, bool close_window_when_animation_ends=false)
Definition: VisualizerWithCustomAnimation.cpp:67
Definition: PinholeCameraIntrinsic.cpp:16