Open3D (C++ API)  0.13.0
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 
33 
34 namespace open3d {
35 namespace visualization {
36 
37 struct DrawObject {
38  std::string name;
39  std::shared_ptr<geometry::Geometry3D> geometry;
40  std::shared_ptr<t::geometry::Geometry> tgeometry;
41  std::shared_ptr<rendering::TriangleMeshModel> model;
42  bool is_visible;
43 
44  DrawObject(const std::string &n,
45  std::shared_ptr<geometry::Geometry3D> g,
46  bool vis = true);
47  DrawObject(const std::string &n,
48  std::shared_ptr<t::geometry::Geometry> tg,
49  bool vis = true);
50  DrawObject(const std::string &n,
51  std::shared_ptr<rendering::TriangleMeshModel> m,
52  bool vis = true);
53 };
54 
55 struct DrawAction {
56  std::string name;
57  std::function<void(visualizer::O3DVisualizer &)> callback;
58 };
59 
60 void Draw(const std::vector<std::shared_ptr<geometry::Geometry3D>> &geometries,
61  const std::string &window_name = "Open3D",
62  int width = 1024,
63  int height = 768,
64  const std::vector<DrawAction> &actions = {});
65 
66 void Draw(
67  const std::vector<std::shared_ptr<t::geometry::Geometry>> &tgeometries,
68  const std::string &window_name = "Open3D",
69  int width = 1024,
70  int height = 768,
71  const std::vector<DrawAction> &actions = {});
72 
73 void Draw(const std::vector<std::shared_ptr<rendering::TriangleMeshModel>>
74  &models,
75  const std::string &window_name = "Open3D",
76  int width = 1024,
77  int height = 768,
78  const std::vector<DrawAction> &actions = {});
79 
80 void Draw(const std::vector<DrawObject> &objects,
81  const std::string &window_name = "Open3D",
82  int width = 1024,
83  int height = 768,
84  const std::vector<DrawAction> &actions = {});
85 
86 } // namespace visualization
87 } // namespace open3d
std::string name
Definition: Draw.h:56
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:63
std::shared_ptr< t::geometry::Geometry > tgeometry
Definition: Draw.h:40
std::string name
Definition: Draw.h:38
std::shared_ptr< geometry::Geometry3D > geometry
Definition: Draw.h:39
DrawObject(const std::string &n, std::shared_ptr< geometry::Geometry3D > g, bool vis=true)
Definition: Draw.cpp:38
std::shared_ptr< rendering::TriangleMeshModel > model
Definition: Draw.h:41
bool is_visible
Definition: Draw.h:42
Definition: PinholeCameraIntrinsic.cpp:35
int height
Definition: FilePCD.cpp:72
std::function< void(visualizer::O3DVisualizer &)> callback
Definition: Draw.h:57
int width
Definition: FilePCD.cpp:71