ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
MessageProcessor.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 
11 
12 class ccHObject;
13 namespace cloudViewer {
14 
15 namespace visualization {
16 
17 namespace gui {
18 class Window;
19 } // namespace gui
20 
24 public:
26  std::function<void(std::shared_ptr<ccHObject>, // geometry
27  const std::string&, // path
28  int, // time
29  const std::string&)>; // layer
31  : MessageProcessorBase(), window_(window), on_geometry_(on_geometry) {}
32 
33  std::shared_ptr<zmq::message_t> ProcessMessage(
34  const io::rpc::messages::Request& req,
36  const msgpack::object_handle& obj) override;
37 
38 private:
39  gui::Window* window_;
40  OnGeometryFunc on_geometry_;
41 
42  void SetGeometry(std::shared_ptr<ccHObject> geom,
43  const std::string& path,
44  int time,
45  const std::string& layer);
46 };
47 
48 } // namespace visualization
49 } // namespace cloudViewer
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
MessageProcessorBase()
Constructs a receiver listening on the specified address.
std::function< void(std::shared_ptr< ccHObject >, const std::string &, int, const std::string &)> OnGeometryFunc
MessageProcessor(gui::Window *window, OnGeometryFunc on_geometry)
std::shared_ptr< zmq::message_t > ProcessMessage(const io::rpc::messages::Request &req, const io::rpc::messages::SetMeshData &msg, const msgpack::object_handle &obj) override
static const std::string path
Definition: PointCloud.cpp:59
Generic file read and write utility for python interface.