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:
25  using OnGeometryFunc =
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
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
cloudViewer::io::rpc::MessageProcessorBase
Definition: MessageProcessorBase.h:40
cloudViewer::visualization::MessageProcessor::OnGeometryFunc
std::function< void(std::shared_ptr< ccHObject >, const std::string &, int, const std::string &)> OnGeometryFunc
Definition: MessageProcessor.h:29
cloudViewer::io::rpc::messages::TypeStr< double >
std::string TypeStr< double >()
Definition: Messages.h:48
Messages.h
cloudViewer::visualization::MessageProcessor::ProcessMessage
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
Definition: MessageProcessor.cpp:27
Window
Definition: Window.h:20
PointCloud.h
ccObject::setLocked
virtual void setLocked(bool state)
Sets the "enabled" property.
Definition: ecvObject.h:117
ccPointCloud::reserveThePointsTable
bool reserveThePointsTable(unsigned _numberOfPoints)
Reserves memory to store the points coordinates.
Definition: ecvPointCloud.cpp:1191
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
Runtime::GetInstance
ccGuiPythonInstance * GetInstance() noexcept
Definition: Runtime.cpp:72
cloudViewer::visualization::gui::Window
Definition: Window.h:30
cloudViewer::io::rpc::MessageProcessorBase::MessageProcessorBase
MessageProcessorBase()
Constructs a receiver listening on the specified address.
Definition: MessageProcessorBase.cpp:49
cloudViewer::io::rpc::messages::MeshData::vertices
Array vertices
shape must be [num_verts,3]
Definition: Messages.h:265
MessageProcessor.h
cloudViewer::io::rpc::messages::Array::Ptr
const T * Ptr() const
Definition: Messages.h:146
cloudViewer::visualization::MessageProcessor::MessageProcessor
MessageProcessor(gui::Window *window, OnGeometryFunc on_geometry)
Definition: MessageProcessor.h:30
cloudViewer::io::rpc::messages::Array::CheckNonEmpty
bool CheckNonEmpty(std::string &errstr) const
Definition: Messages.h:212
cloudViewer::io::rpc::messages::TypeStr< float >
std::string TypeStr< float >()
Definition: Messages.h:44
cloudViewer::io::rpc::messages::SetMeshData
Definition: Messages.h:391
ccPointCloud::reserveTheNormsTable
bool reserveTheNormsTable()
Reserves memory to store the compressed normals.
Definition: ecvPointCloud.cpp:1253
cloudViewer::io::rpc::messages::Request
Definition: Messages.h:508
cloudViewer::t::geometry::path
static const std::string path
Definition: PointCloud.cpp:59
ccPointCloud::addNorm
void addNorm(const CCVector3 &N)
Pushes a normal vector on stack (shortcut)
Definition: ecvPointCloud.cpp:1754
MessageUtils.h
cloudViewer::io::rpc::messages::Array::shape
std::vector< int64_t > shape
Definition: Messages.h:142
cloudViewer::utility
Definition: Console.h:17
ecvMesh.h
ccPointCloud::hasNormals
bool hasNormals() const override
Returns whether normals are enabled or not.
Definition: ecvPointCloud.cpp:1693
cloudViewer::io::rpc::messages::SetMeshData::data
MeshData data
The data to be set.
Definition: Messages.h:404
cloudViewer::io::rpc::messages::TypeStr< int64_t >
std::string TypeStr< int64_t >()
Definition: Messages.h:64
cloudViewer::visualization::MessageProcessor
Definition: MessageProcessor.h:23
cloudViewer::io::rpc::messages::Array::CheckType
bool CheckType(const std::vector< std::string > &expected_types, std::string &errstr) const
Definition: Messages.h:233
cloudViewer::io::rpc::messages::Array::type
std::string type
Definition: Messages.h:141
cloudViewer::io::rpc::messages::Status::ErrorProcessingMessage
static Status ErrorProcessingMessage()
Definition: Messages.h:534
cloudViewer::io::rpc
Definition: BufferConnection.cpp:20
cloudViewer::io::rpc::messages::MeshData::faces
Array faces
Definition: Messages.h:276
LogInfo
#define LogInfo(...)
Definition: Logging.h:81
MessageProcessorBase.h
ecvColor::RgbTpl
RGB color structure.
Definition: ecvColorTypes.h:49
cloudViewer::io::rpc::messages::MeshData::CheckMessage
bool CheckMessage(std::string &errstr) const
Definition: Messages.h:368
Window.h
cloudViewer::io::rpc::messages::Reply
Definition: Messages.h:515
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
cloudViewer::io::rpc::messages::MeshData::vertex_attributes
std::map< std::string, Array > vertex_attributes
Definition: Messages.h:268
cloudViewer::PointCloudTpl::addPoint
void addPoint(const CCVector3 &P)
Adds a 3D point to the database.
Definition: PointCloudTpl.h:246
ColorCompType
unsigned char ColorCompType
Default color components type (R,G and B)
Definition: ecvColorTypes.h:29
cloudViewer::io::rpc::CreateStatusOKMsg
std::shared_ptr< zmq::message_t > CreateStatusOKMsg()
Definition: MessageUtils.cpp:84
ccObject::setEnabled
virtual void setEnabled(bool state)
Sets the "enabled" property.
Definition: ecvObject.h:102
Vector3Tpl< PointCoordinateType >::fromArray
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
Definition: CVGeom.h:268
cloudViewer::io::rpc::messages::TypeStr< int32_t >
std::string TypeStr< int32_t >()
Definition: Messages.h:60
Material.h
Application.h