Open3D (C++ API)
GeometryRenderer.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 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 
39 
40 namespace open3d {
41 namespace visualization {
42 
43 namespace glsl {
44 
46 public:
47  virtual ~GeometryRenderer() {}
48 
49 public:
50  virtual bool Render(const RenderOption &option,
51  const ViewControl &view) = 0;
52 
59  virtual bool AddGeometry(
60  std::shared_ptr<const geometry::Geometry> geometry_ptr) = 0;
61 
64  virtual bool UpdateGeometry() = 0;
65 
66  bool HasGeometry() const { return bool(geometry_ptr_); }
67 
68  bool IsVisible() const { return is_visible_; }
69  void SetVisible(bool visible) { is_visible_ = visible; };
70 
71 protected:
72  std::shared_ptr<const geometry::Geometry> geometry_ptr_;
73  bool is_visible_ = true;
74 };
75 
77 public:
78  ~PointCloudRenderer() override {}
79 
80 public:
81  bool Render(const RenderOption &option, const ViewControl &view) override;
82  bool AddGeometry(
83  std::shared_ptr<const geometry::Geometry> geometry_ptr) override;
84  bool UpdateGeometry() override;
85 
86 protected:
91 };
92 
94 public:
96 
97 public:
98  bool Render(const RenderOption &option, const ViewControl &view) override;
99  bool AddGeometry(
100  std::shared_ptr<const geometry::Geometry> geometry_ptr) override;
101  bool UpdateGeometry() override;
102 
103 protected:
105 };
106 
108 public:
109  ~LineSetRenderer() override {}
110 
111 public:
112  bool Render(const RenderOption &option, const ViewControl &view) override;
113  bool AddGeometry(
114  std::shared_ptr<const geometry::Geometry> geometry_ptr) override;
115  bool UpdateGeometry() override;
116 
117 protected:
119 };
120 
122 public:
123  ~TriangleMeshRenderer() override {}
124 
125 public:
126  bool Render(const RenderOption &option, const ViewControl &view) override;
127  bool AddGeometry(
128  std::shared_ptr<const geometry::Geometry> geometry_ptr) override;
129  bool UpdateGeometry() override;
130 
131 protected:
136 };
137 
139 public:
140  ~VoxelGridRenderer() override {}
141 
142 public:
143  bool Render(const RenderOption &option, const ViewControl &view) override;
144  bool AddGeometry(
145  std::shared_ptr<const geometry::Geometry> geometry_ptr) override;
146  bool UpdateGeometry() override;
147 
148 protected:
150 };
151 
153 public:
154  ~ImageRenderer() override {}
155 
156 public:
157  bool Render(const RenderOption &option, const ViewControl &view) override;
158  bool AddGeometry(
159  std::shared_ptr<const geometry::Geometry> geometry_ptr) override;
160  bool UpdateGeometry() override;
161 
162 protected:
164 };
165 
167 public:
169 
170 public:
171  bool Render(const RenderOption &option, const ViewControl &view) override;
172  bool AddGeometry(
173  std::shared_ptr<const geometry::Geometry> geometry_ptr) override;
174  bool UpdateGeometry() override;
175 
176 protected:
178 };
179 
181 public:
183 
184 public:
185  bool Render(const RenderOption &option, const ViewControl &view) override;
186  bool AddGeometry(
187  std::shared_ptr<const geometry::Geometry> geometry_ptr) override;
188  bool UpdateGeometry() override;
189 
190 protected:
193 };
194 
196 public:
198 
199 public:
200  bool Render(const RenderOption &option, const ViewControl &view) override;
201  bool AddGeometry(
202  std::shared_ptr<const geometry::Geometry> geometry_ptr) override;
203  bool UpdateGeometry() override;
204 
205 protected:
207 };
208 
209 } // namespace glsl
210 
211 } // namespace visualization
212 } // namespace open3d
PickingShaderForPointCloud picking_shader_
Definition: GeometryRenderer.h:104
Definition: GeometryRenderer.h:152
SimpleBlackShaderForPointCloudNormal simpleblack_normal_shader_
Definition: GeometryRenderer.h:90
~CoordinateFrameRenderer() override
Definition: GeometryRenderer.h:168
~SelectionPolygonRenderer() override
Definition: GeometryRenderer.h:182
NormalShaderForTriangleMesh normal_mesh_shader_
Definition: GeometryRenderer.h:134
Definition: GeometryRenderer.h:45
PhongShaderForTriangleMesh phong_shader_
Definition: GeometryRenderer.h:177
virtual bool Render(const RenderOption &option, const ViewControl &view)=0
ImageMaskShaderForImage image_mask_shader_
Definition: GeometryRenderer.h:192
Definition: GeometryRenderer.h:76
SimpleShaderForLineSet simple_lineset_shader_
Definition: GeometryRenderer.h:118
~PointCloudPickerRenderer() override
Definition: GeometryRenderer.h:197
Definition: ViewControl.h:38
SimpleShaderForVoxelGrid simple_voxelgrid_shader_
Definition: GeometryRenderer.h:149
~PointCloudRenderer() override
Definition: GeometryRenderer.h:78
Definition: GeometryRenderer.h:121
Definition: GeometryRenderer.h:138
virtual bool AddGeometry(std::shared_ptr< const geometry::Geometry > geometry_ptr)=0
PhongShaderForTriangleMesh phong_shader_
Definition: GeometryRenderer.h:206
~ImageRenderer() override
Definition: GeometryRenderer.h:154
Simple2DShaderForSelectionPolygon simple2d_shader_
Definition: GeometryRenderer.h:191
PhongShaderForPointCloud phong_point_shader_
Definition: GeometryRenderer.h:88
~LineSetRenderer() override
Definition: GeometryRenderer.h:109
Definition: RenderOption.h:36
PhongShaderForTriangleMesh phong_mesh_shader_
Definition: GeometryRenderer.h:133
NormalShaderForPointCloud normal_point_shader_
Definition: GeometryRenderer.h:89
bool HasGeometry() const
Definition: GeometryRenderer.h:66
bool IsVisible() const
Definition: GeometryRenderer.h:68
SimpleShaderForTriangleMesh simple_mesh_shader_
Definition: GeometryRenderer.h:132
Definition: PinholeCameraIntrinsic.cpp:33
Definition: GeometryRenderer.h:107
virtual ~GeometryRenderer()
Definition: GeometryRenderer.h:47
SimpleBlackShaderForTriangleMeshWireFrame simpleblack_wireframe_shader_
Definition: GeometryRenderer.h:135
std::shared_ptr< const geometry::Geometry > geometry_ptr_
Definition: GeometryRenderer.h:69
SimpleShaderForPointCloud simple_point_shader_
Definition: GeometryRenderer.h:87
void SetVisible(bool visible)
Definition: GeometryRenderer.h:69
~PointCloudPickingRenderer() override
Definition: GeometryRenderer.h:95
bool is_visible_
Definition: GeometryRenderer.h:73
~TriangleMeshRenderer() override
Definition: GeometryRenderer.h:123
ImageShaderForImage image_shader_
Definition: GeometryRenderer.h:163
~VoxelGridRenderer() override
Definition: GeometryRenderer.h:140