Loading [MathJax]/extensions/TeX/AMSsymbols.js
Open3D (C++ API)  0.14.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MessageUtils.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-2021 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 <map>
30 #include <tuple>
31 
32 #include "open3d/core/Tensor.h"
37 
38 namespace zmq {
39 class message_t;
40 }
41 
42 namespace open3d {
43 namespace io {
44 namespace rpc {
45 
46 namespace messages {
47 struct Array;
48 struct Status;
49 struct MeshData;
50 } // namespace messages
51 
65 std::shared_ptr<messages::Status> UnpackStatusFromReply(
66  const zmq::message_t& msg, size_t& offset, bool& ok);
67 
69 bool ReplyIsOKStatus(const zmq::message_t& msg);
70 
73 bool ReplyIsOKStatus(const zmq::message_t& msg, size_t& offset);
74 
76 std::string CreateSerializedRequestMessage(const std::string& msg_id);
77 
78 std::tuple<const void*, size_t> GetZMQMessageDataAndSize(
79  const zmq::message_t& msg);
80 
81 std::tuple<int32_t, std::string> GetStatusCodeAndStr(
82  const messages::Status& status);
83 
84 std::shared_ptr<zmq::message_t> CreateStatusOKMsg();
85 
91 std::shared_ptr<t::geometry::Geometry> MeshDataToGeometry(
92  const messages::MeshData& mesh_data);
93 
96 messages::MeshData GeometryToMeshData(const t::geometry::TriangleMesh& trimesh);
97 
100 messages::MeshData GeometryToMeshData(const t::geometry::PointCloud& pcd);
101 
104 messages::MeshData GeometryToMeshData(const t::geometry::LineSet& ls);
105 
110 std::tuple<std::string, double, std::shared_ptr<t::geometry::Geometry>>
111 DataBufferToMetaGeometry(std::string& data);
112 
113 } // namespace rpc
114 } // namespace io
115 } // namespace open3d
std::string CreateSerializedRequestMessage(const std::string &msg_id)
Creates a serialized Request message for testing purposes.
Definition: MessageUtils.cpp:85
std::tuple< int32_t, std::string > GetStatusCodeAndStr(const messages::Status &status)
Definition: MessageUtils.cpp:97
std::shared_ptr< t::geometry::Geometry > MeshDataToGeometry(const messages::MeshData &mesh_data)
Definition: MessageUtils.cpp:187
std::tuple< std::string, double, std::shared_ptr< t::geometry::Geometry > > DataBufferToMetaGeometry(std::string &data)
Definition: MessageUtils.cpp:359
messages::MeshData GeometryToMeshData(const t::geometry::TriangleMesh &trimesh)
Definition: MessageUtils.cpp:278
std::shared_ptr< zmq::message_t > CreateStatusOKMsg()
Definition: MessageUtils.cpp:102
std::tuple< const void *, size_t > GetZMQMessageDataAndSize(const zmq::message_t &msg)
Definition: MessageUtils.cpp:92
int offset
Definition: FilePCD.cpp:64
bool ReplyIsOKStatus(const zmq::message_t &msg)
Convenience function for checking if the message is an OK.
Definition: MessageUtils.cpp:71
Definition: PinholeCameraIntrinsic.cpp:35
Definition: ConnectionBase.h:31
std::shared_ptr< messages::Status > UnpackStatusFromReply(const zmq::message_t &msg, size_t &offset, bool &ok)
Definition: MessageUtils.cpp:42
const char const char value recording_handle imu_sample recording_handle uint8_t data
Definition: K4aPlugin.cpp:274