30 #include <GLFW/glfw3.h> 33 #include <unordered_set> 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);
126 virtual bool RemoveGeometry(
127 std::shared_ptr<const geometry::Geometry> geometry_ptr);
132 virtual bool UpdateGeometry();
133 virtual bool HasGeometry()
const;
136 virtual void UpdateRender();
138 virtual void PrintVisualizerHelp();
139 virtual void UpdateWindowTitle();
140 virtual void BuildUtilities();
144 std::shared_ptr<geometry::Image> CaptureScreenFloatBuffer(
145 bool do_render =
true);
146 void CaptureScreenImage(
const std::string &filename =
"",
147 bool do_render =
true);
148 std::shared_ptr<geometry::Image> CaptureDepthFloatBuffer(
149 bool do_render =
true);
150 void CaptureDepthImage(
const std::string &filename =
"",
151 bool do_render =
true,
152 double depth_scale = 1000.0);
153 void CaptureDepthPointCloud(
const std::string &filename =
"",
154 bool do_render =
true,
155 bool convert_to_world_coordinate =
false);
156 void CaptureRenderOption(
const std::string &filename =
"");
157 void ResetViewPoint(
bool reset_bounding_box =
false);
163 virtual bool InitOpenGL();
166 virtual bool InitViewControl();
169 virtual bool InitRenderOption();
174 virtual void Render();
176 void CopyViewStatusToClipboard();
178 void CopyViewStatusFromClipboard();
181 virtual void WindowRefreshCallback(GLFWwindow *window);
182 virtual void WindowResizeCallback(GLFWwindow *window,
int w,
int h);
183 virtual void MouseMoveCallback(GLFWwindow *window,
double x,
double y);
184 virtual void MouseScrollCallback(GLFWwindow *window,
double x,
double y);
185 virtual void MouseButtonCallback(GLFWwindow *window,
189 virtual void KeyPressCallback(
190 GLFWwindow *window,
int key,
int scancode,
int action,
int mods);
191 virtual void WindowCloseCallback(GLFWwindow *window);
195 GLFWwindow *window_ = NULL;
196 std::string window_name_ =
"Open3D";
197 std::function<bool(Visualizer *)> animation_callback_func_ =
nullptr;
202 std::function<bool(Visualizer *)> animation_callback_func_in_loop_ =
207 bool is_redraw_required_ =
true;
208 bool is_initialized_ =
false;
218 std::unordered_set<std::shared_ptr<const geometry::Geometry>>
222 std::unordered_set<std::shared_ptr<glsl::GeometryRenderer>>
233 std::shared_ptr<glsl::CoordinateFrameRenderer>
240 double pixel_to_screen_coordinate_ = 1.0;
std::vector< std::shared_ptr< const geometry::Geometry > > utility_ptrs_
Definition: Visualizer.h:226
std::vector< std::shared_ptr< glsl::GeometryRenderer > > utility_renderer_ptrs_
Definition: Visualizer.h:229
std::unordered_set< std::shared_ptr< glsl::GeometryRenderer > > geometry_renderer_ptrs_
Definition: Visualizer.h:223
RenderOption & GetRenderOption()
Definition: Visualizer.h:143
Definition: ViewControl.h:38
std::shared_ptr< glsl::CoordinateFrameRenderer > coordinate_frame_mesh_renderer_ptr_
Definition: Visualizer.h:234
std::unique_ptr< RenderOption > render_option_ptr_
Definition: Visualizer.h:215
std::shared_ptr< geometry::TriangleMesh > coordinate_frame_mesh_ptr_
Definition: Visualizer.h:232
ViewControl & GetViewControl()
Definition: Visualizer.h:142
Definition: RenderOption.h:36
std::unique_ptr< ViewControl > view_control_ptr_
Definition: Visualizer.h:212
GLuint vao_id_
Definition: Visualizer.h:209
std::unordered_set< std::shared_ptr< const geometry::Geometry > > geometry_ptrs_
Definition: Visualizer.h:219
const std::string & GetWindowName() const
Definition: Visualizer.h:159
Definition: PinholeCameraIntrinsic.cpp:34
Definition: Visualizer.h:50
MouseControl mouse_control_
Definition: Visualizer.h:206
Definition: Visualizer.h:52
int height
Definition: FilePCD.cpp:68
int width
Definition: FilePCD.cpp:67