Open3D (C++ API)  0.12.0
Draw.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 
29 #include <vector>
30 
32 
33 namespace open3d {
34 namespace visualization {
35 
36 struct DrawObject {
37  std::string name;
38  std::shared_ptr<geometry::Geometry3D> geometry;
39  std::shared_ptr<t::geometry::Geometry> tgeometry;
40  bool is_visible;
41 
42  DrawObject(const std::string &n,
43  std::shared_ptr<geometry::Geometry3D> g,
44  bool vis = true);
45  DrawObject(const std::string &n,
46  std::shared_ptr<t::geometry::Geometry> tg,
47  bool vis = true);
48 };
49 
50 struct DrawAction {
51  std::string name;
52  std::function<void(visualizer::O3DVisualizer &)> callback;
53 };
54 
55 void Draw(const std::vector<std::shared_ptr<geometry::Geometry3D>> &geometries,
56  const std::string &window_name = "Open3D",
57  int width = 1024,
58  int height = 768,
59  const std::vector<DrawAction> &actions = {});
60 
61 void Draw(
62  const std::vector<std::shared_ptr<t::geometry::Geometry>> &tgeometries,
63  const std::string &window_name = "Open3D",
64  int width = 1024,
65  int height = 768,
66  const std::vector<DrawAction> &actions = {});
67 
68 void Draw(const std::vector<DrawObject> &objects,
69  const std::string &window_name = "Open3D",
70  int width = 1024,
71  int height = 768,
72  const std::vector<DrawAction> &actions = {});
73 
74 } // namespace visualization
75 } // namespace open3d
std::string name
Definition: Draw.h:51
void Draw(const std::vector< std::shared_ptr< geometry::Geometry3D >> &geometries, const std::string &window_name, int width, int height, const std::vector< DrawAction > &actions)
Definition: Draw.cpp:54
std::shared_ptr< t::geometry::Geometry > tgeometry
Definition: Draw.h:39
std::string name
Definition: Draw.h:37
std::shared_ptr< geometry::Geometry3D > geometry
Definition: Draw.h:38
DrawObject(const std::string &n, std::shared_ptr< geometry::Geometry3D > g, bool vis=true)
Definition: Draw.cpp:37
bool is_visible
Definition: Draw.h:40
Definition: PinholeCameraIntrinsic.cpp:35
int height
Definition: FilePCD.cpp:72
std::function< void(visualizer::O3DVisualizer &)> callback
Definition: Draw.h:52
int width
Definition: FilePCD.cpp:71