Open3D (C++ API)  0.16.1
VisualizerWithCustomAnimation.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-2021 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
30
31namespace open3d {
32namespace visualization {
33
35public:
39 delete;
41 const VisualizerWithCustomAnimation &) = delete;
42
43public:
44 void PrintVisualizerHelp() override;
45 void UpdateWindowTitle() override;
46 void Play(bool recording = false,
47 bool recording_depth = false,
48 bool close_window_when_animation_ends = false);
49 void RegisterRecordingImageFormat(const std::string &basedir,
50 const std::string &format,
51 const std::string &trajectory) {
55 }
56 void RegisterRecordingDepthFormat(const std::string &basedir,
57 const std::string &format,
58 const std::string &trajectory) {
62 }
63
64protected:
65 bool InitViewControl() override;
66 void MouseMoveCallback(GLFWwindow *window, double x, double y) override;
67 void MouseScrollCallback(GLFWwindow *window, double x, double y) override;
68 void MouseButtonCallback(GLFWwindow *window,
69 int button,
70 int action,
71 int mods) override;
72 void KeyPressCallback(GLFWwindow *window,
73 int key,
74 int scancode,
75 int action,
76 int mods) override;
77
78protected:
79 std::string recording_image_basedir_ = "image/";
80 std::string recording_image_filename_format_ = "image_{:06d}.png";
81 std::string recording_image_trajectory_filename_ = "image_trajectory.json";
82 std::string recording_depth_basedir_ = "depth/";
83 std::string recording_depth_filename_format_ = "depth_{:06d}.png";
84 std::string recording_depth_trajectory_filename_ = "depth_trajectory.json";
86};
87
88} // namespace visualization
89} // namespace open3d
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:214
The main Visualizer class.
Definition: Visualizer.h:62
Definition: VisualizerWithCustomAnimation.h:34
std::string recording_image_filename_format_
Definition: VisualizerWithCustomAnimation.h:80
~VisualizerWithCustomAnimation() override
Definition: VisualizerWithCustomAnimation.cpp:43
std::string recording_depth_basedir_
Definition: VisualizerWithCustomAnimation.h:82
std::string recording_depth_trajectory_filename_
Definition: VisualizerWithCustomAnimation.h:84
bool InitViewControl() override
Function to initialize ViewControl.
Definition: VisualizerWithCustomAnimation.cpp:170
void MouseButtonCallback(GLFWwindow *window, int button, int action, int mods) override
Definition: VisualizerWithCustomAnimation.cpp:305
void UpdateWindowTitle() override
Definition: VisualizerWithCustomAnimation.cpp:76
VisualizerWithCustomAnimation()
Definition: VisualizerWithCustomAnimation.cpp:41
void KeyPressCallback(GLFWwindow *window, int key, int scancode, int action, int mods) override
Definition: VisualizerWithCustomAnimation.cpp:177
void RegisterRecordingDepthFormat(const std::string &basedir, const std::string &format, const std::string &trajectory)
Definition: VisualizerWithCustomAnimation.h:56
void MouseScrollCallback(GLFWwindow *window, double x, double y) override
Definition: VisualizerWithCustomAnimation.cpp:288
VisualizerWithCustomAnimation(const VisualizerWithCustomAnimation &)=delete
std::string recording_image_basedir_
Definition: VisualizerWithCustomAnimation.h:79
std::string recording_image_trajectory_filename_
Definition: VisualizerWithCustomAnimation.h:81
std::string recording_depth_filename_format_
Definition: VisualizerWithCustomAnimation.h:83
VisualizerWithCustomAnimation & operator=(const VisualizerWithCustomAnimation &)=delete
void PrintVisualizerHelp() override
Definition: VisualizerWithCustomAnimation.cpp:45
void RegisterRecordingImageFormat(const std::string &basedir, const std::string &format, const std::string &trajectory)
Definition: VisualizerWithCustomAnimation.h:49
size_t recording_file_index_
Definition: VisualizerWithCustomAnimation.h:85
void MouseMoveCallback(GLFWwindow *window, double x, double y) override
Definition: VisualizerWithCustomAnimation.cpp:277
void Play(bool recording=false, bool recording_depth=false, bool close_window_when_animation_ends=false)
Definition: VisualizerWithCustomAnimation.cpp:86
Definition: PinholeCameraIntrinsic.cpp:35