Open3D (C++ API)  0.18.0
MessageUtils.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <map>
11 #include <tuple>
12 
13 #include "open3d/core/Tensor.h"
18 
19 namespace zmq {
20 class message_t;
21 }
22 
23 namespace open3d {
24 namespace io {
25 namespace rpc {
26 
27 namespace messages {
28 struct Array;
29 struct Status;
30 struct MeshData;
31 } // namespace messages
32 
46 std::shared_ptr<messages::Status> UnpackStatusFromReply(
47  const zmq::message_t& msg, size_t& offset, bool& ok);
48 
50 bool ReplyIsOKStatus(const zmq::message_t& msg);
51 
54 bool ReplyIsOKStatus(const zmq::message_t& msg, size_t& offset);
55 
57 std::string CreateSerializedRequestMessage(const std::string& msg_id);
58 
59 std::tuple<const void*, size_t> GetZMQMessageDataAndSize(
60  const zmq::message_t& msg);
61 
62 std::tuple<int32_t, std::string> GetStatusCodeAndStr(
63  const messages::Status& status);
64 
65 std::shared_ptr<zmq::message_t> CreateStatusOKMsg();
66 
72 std::shared_ptr<t::geometry::Geometry> MeshDataToGeometry(
73  const messages::MeshData& mesh_data);
74 
77 messages::MeshData GeometryToMeshData(const t::geometry::TriangleMesh& trimesh);
78 
81 messages::MeshData GeometryToMeshData(const t::geometry::PointCloud& pcd);
82 
85 messages::MeshData GeometryToMeshData(const t::geometry::LineSet& ls);
86 
91 std::tuple<std::string, double, std::shared_ptr<t::geometry::Geometry>>
92 DataBufferToMetaGeometry(std::string& data);
93 
94 } // namespace rpc
95 } // namespace io
96 } // namespace open3d
int offset
Definition: FilePCD.cpp:45
const char const char value recording_handle imu_sample recording_handle uint8_t data
Definition: K4aPlugin.cpp:269
bool ReplyIsOKStatus(const zmq::message_t &msg)
Convenience function for checking if the message is an OK.
Definition: MessageUtils.cpp:52
messages::MeshData GeometryToMeshData(const t::geometry::TriangleMesh &trimesh)
Definition: MessageUtils.cpp:259
std::string CreateSerializedRequestMessage(const std::string &msg_id)
Creates a serialized Request message for testing purposes.
Definition: MessageUtils.cpp:66
std::tuple< const void *, size_t > GetZMQMessageDataAndSize(const zmq::message_t &msg)
Definition: MessageUtils.cpp:73
std::tuple< int32_t, std::string > GetStatusCodeAndStr(const messages::Status &status)
Definition: MessageUtils.cpp:78
std::tuple< std::string, double, std::shared_ptr< t::geometry::Geometry > > DataBufferToMetaGeometry(std::string &data)
Definition: MessageUtils.cpp:340
std::shared_ptr< t::geometry::Geometry > MeshDataToGeometry(const messages::MeshData &mesh_data)
Definition: MessageUtils.cpp:168
std::shared_ptr< zmq::message_t > CreateStatusOKMsg()
Definition: MessageUtils.cpp:83
std::shared_ptr< messages::Status > UnpackStatusFromReply(const zmq::message_t &msg, size_t &offset, bool &ok)
Definition: MessageUtils.cpp:23
Definition: PinholeCameraIntrinsic.cpp:16
Definition: ConnectionBase.h:12