ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Draw.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <vector>
11 
14 
15 class ccHObject;
16 
17 namespace cloudViewer {
18 namespace visualization {
19 
20 struct DrawObject {
21  std::string name;
22  std::shared_ptr<ccHObject> geometry;
23  std::shared_ptr<t::geometry::Geometry> tgeometry;
24  std::shared_ptr<rendering::TriangleMeshModel> model;
25  bool is_visible;
26 
27  DrawObject(const std::string &n,
28  std::shared_ptr<ccHObject> g,
29  bool vis = true);
30  DrawObject(const std::string &n,
31  std::shared_ptr<t::geometry::Geometry> tg,
32  bool vis = true);
33  DrawObject(const std::string &n,
34  std::shared_ptr<rendering::TriangleMeshModel> m,
35  bool vis = true);
36 };
37 
38 struct DrawAction {
39  std::string name;
40  std::function<void(visualizer::O3DVisualizer &)> callback;
41 };
42 
43 void Draw(const std::vector<std::shared_ptr<ccHObject>> &geometries,
44  const std::string &window_name = "CloudViewer",
45  int width = 1024,
46  int height = 768,
47  const std::vector<DrawAction> &actions = {});
48 
49 void Draw(
50  const std::vector<std::shared_ptr<t::geometry::Geometry>> &tgeometries,
51  const std::string &window_name = "CloudViewer",
52  int width = 1024,
53  int height = 768,
54  const std::vector<DrawAction> &actions = {});
55 
56 void Draw(const std::vector<std::shared_ptr<rendering::TriangleMeshModel>>
57  &models,
58  const std::string &window_name = "CloudViewer",
59  int width = 1024,
60  int height = 768,
61  const std::vector<DrawAction> &actions = {});
62 
63 void Draw(const std::vector<DrawObject> &objects,
64  const std::string &window_name = "CloudViewer",
65  int width = 1024,
66  int height = 768,
67  const std::vector<DrawAction> &actions = {});
68 
69 } // namespace visualization
70 } // namespace cloudViewer
int width
int height
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
void Draw(const std::vector< std::shared_ptr< ccHObject >> &geometries, const std::string &window_name, int width, int height, const std::vector< DrawAction > &actions)
Definition: Draw.cpp:45
Generic file read and write utility for python interface.
std::function< void(visualizer::O3DVisualizer &)> callback
Definition: Draw.h:40
std::shared_ptr< ccHObject > geometry
Definition: Draw.h:22
DrawObject(const std::string &n, std::shared_ptr< ccHObject > g, bool vis=true)
Definition: Draw.cpp:20
std::shared_ptr< t::geometry::Geometry > tgeometry
Definition: Draw.h:23
std::shared_ptr< rendering::TriangleMeshModel > model
Definition: Draw.h:24