33 #include <GLFW/glfw3.h> 49 namespace visualization {
54 bool is_mouse_left_button_down =
false;
55 bool is_mouse_middle_button_down =
false;
56 bool is_control_key_down =
false;
57 bool is_shift_key_down =
false;
58 bool is_alt_key_down =
false;
59 bool is_super_key_down =
false;
60 double mouse_position_x = 0.0;
61 double mouse_position_y = 0.0;
74 bool CreateVisualizerWindow(
const std::string &window_name =
"Open3D",
75 const int width = 640,
79 const bool visible =
true);
83 void DestroyVisualizerWindow();
87 void RegisterAnimationCallback(
88 std::function<
bool(
Visualizer *)> callback_func);
117 virtual bool AddGeometry(
118 std::shared_ptr<const geometry::Geometry> geometry_ptr);
123 virtual bool UpdateGeometry();
124 virtual bool HasGeometry()
const;
127 virtual void UpdateRender();
129 virtual void PrintVisualizerHelp();
130 virtual void UpdateWindowTitle();
131 virtual void BuildUtilities();
135 std::shared_ptr<geometry::Image> CaptureScreenFloatBuffer(
136 bool do_render =
true);
137 void CaptureScreenImage(
const std::string &filename =
"",
138 bool do_render =
true);
139 std::shared_ptr<geometry::Image> CaptureDepthFloatBuffer(
140 bool do_render =
true);
141 void CaptureDepthImage(
const std::string &filename =
"",
142 bool do_render =
true,
143 double depth_scale = 1000.0);
144 void CaptureDepthPointCloud(
const std::string &filename =
"",
145 bool do_render =
true,
146 bool convert_to_world_coordinate =
false);
147 void CaptureRenderOption(
const std::string &filename =
"");
148 void ResetViewPoint(
bool reset_bounding_box =
false);
154 virtual bool InitOpenGL();
157 virtual bool InitViewControl();
160 virtual bool InitRenderOption();
165 virtual void Render();
167 void CopyViewStatusToClipboard();
169 void CopyViewStatusFromClipboard();
172 virtual void WindowRefreshCallback(GLFWwindow *window);
173 virtual void WindowResizeCallback(GLFWwindow *window,
int w,
int h);
174 virtual void MouseMoveCallback(GLFWwindow *window,
double x,
double y);
175 virtual void MouseScrollCallback(GLFWwindow *window,
double x,
double y);
176 virtual void MouseButtonCallback(GLFWwindow *window,
180 virtual void KeyPressCallback(
181 GLFWwindow *window,
int key,
int scancode,
int action,
int mods);
182 virtual void WindowCloseCallback(GLFWwindow *window);
186 GLFWwindow *window_ = NULL;
187 std::string window_name_ =
"Open3D";
188 std::function<bool(Visualizer *)> animation_callback_func_ =
nullptr;
193 std::function<bool(Visualizer *)> animation_callback_func_in_loop_ =
198 bool is_redraw_required_ =
true;
199 bool is_initialized_ =
false;
212 std::vector<std::shared_ptr<glsl::GeometryRenderer>>
223 std::shared_ptr<glsl::CoordinateFrameRenderer>
230 double pixel_to_screen_coordinate_ = 1.0;
std::vector< std::shared_ptr< const geometry::Geometry > > utility_ptrs_
Definition: Visualizer.h:216
std::vector< std::shared_ptr< glsl::GeometryRenderer > > utility_renderer_ptrs_
Definition: Visualizer.h:219
std::vector< std::shared_ptr< glsl::GeometryRenderer > > geometry_renderer_ptrs_
Definition: Visualizer.h:213
RenderOption & GetRenderOption()
Definition: Visualizer.h:134
Definition: ViewControl.h:38
std::shared_ptr< glsl::CoordinateFrameRenderer > coordinate_frame_mesh_renderer_ptr_
Definition: Visualizer.h:224
std::vector< std::shared_ptr< const geometry::Geometry > > geometry_ptrs_
Definition: Visualizer.h:209
std::unique_ptr< RenderOption > render_option_ptr_
Definition: Visualizer.h:206
std::shared_ptr< geometry::TriangleMesh > coordinate_frame_mesh_ptr_
Definition: Visualizer.h:222
ViewControl & GetViewControl()
Definition: Visualizer.h:133
Definition: RenderOption.h:36
std::unique_ptr< ViewControl > view_control_ptr_
Definition: Visualizer.h:203
GLuint vao_id_
Definition: Visualizer.h:200
const std::string & GetWindowName() const
Definition: Visualizer.h:150
Definition: PinholeCameraIntrinsic.cpp:33
Definition: Visualizer.h:50
MouseControl mouse_control_
Definition: Visualizer.h:197
Definition: Visualizer.h:52
int height
Definition: FilePCD.cpp:68
int width
Definition: FilePCD.cpp:67