Open3D (C++ API)  0.13.0
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Receiver.h
Go to the documentation of this file.
1 
2 // ----------------------------------------------------------------------------
3 // - Open3D: www.open3d.org -
4 // ----------------------------------------------------------------------------
5 // The MIT License (MIT)
6 //
7 // Copyright (c) 2020 www.open3d.org
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to deal
11 // in the Software without restriction, including without limitation the rights
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 // copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
15 //
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
18 //
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 // IN THE SOFTWARE.
26 // ----------------------------------------------------------------------------
27 
28 #pragma once
29 
31 
32 namespace open3d {
33 
34 namespace geometry {
35 class Geometry3D;
36 } // namespace geometry
37 
38 namespace visualization {
39 
40 namespace gui {
41 class Window;
42 } // namespace gui
43 
46 public:
47  using OnGeometryFunc = std::function<void(
48  std::shared_ptr<geometry::Geometry3D>, // geometry
49  const std::string&, // path
50  int, // time
51  const std::string&)>; // layer
52  Receiver(const std::string& address,
53  int timeout,
54  gui::Window* window,
55  OnGeometryFunc on_geometry)
56  : ReceiverBase(address, timeout),
57  window_(window),
58  on_geometry_(on_geometry) {}
59 
60  std::shared_ptr<zmq::message_t> ProcessMessage(
61  const io::rpc::messages::Request& req,
63  const MsgpackObject& obj) override;
64 
65 private:
66  gui::Window* window_;
67  OnGeometryFunc on_geometry_;
68 
69  void SetGeometry(std::shared_ptr<geometry::Geometry3D> geom,
70  const std::string& path,
71  int time,
72  const std::string& layer);
73 };
74 
75 } // namespace visualization
76 } // namespace open3d
Definition: Window.h:49
Definition: ReceiverBase.cpp:54
Definition: Messages.h:343
Definition: Messages.h:460
Receiver(const std::string &address, int timeout, gui::Window *window, OnGeometryFunc on_geometry)
Definition: Receiver.h:52
std::function< void(std::shared_ptr< geometry::Geometry3D >, const std::string &, int, const std::string &)> OnGeometryFunc
Definition: Receiver.h:51
const char const char value recording_handle imu_sample void
Definition: K4aPlugin.cpp:259
Receiver implementation which interfaces with the Open3DScene and a Window.
Definition: Receiver.h:45
Definition: PinholeCameraIntrinsic.cpp:35
Definition: ReceiverBase.h:58