YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
PointCloudBase.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_SIG_POINTCLOUDBASE_H
7#define YARP_SIG_POINTCLOUDBASE_H
8
10
11#include <cstring>
12#include <map>
13#include <vector>
14
15namespace yarp::sig {
16
25{
26public:
27 virtual ~PointCloudBase() = default;
28
34 virtual size_t wireSizeBytes() const = 0;
35
41 virtual size_t dataSizeBytes() const = 0;
42
47 virtual size_t size() const = 0;
48
53 virtual const char* getRawData() const = 0;
54
55 bool read(yarp::os::ConnectionReader& connection) override = 0;
56
57 bool write(yarp::os::ConnectionWriter& writer) const override = 0;
58
59 virtual int getBottleTag() const = 0;
60
64 virtual size_t height() const;
65
69 virtual size_t width() const;
70
74 virtual int getPointType() const;
75
76 yarp::os::Type getType() const override;
77
81 virtual bool isOrganized() const;
82
86 virtual inline bool isDense() const
87 {
88 return header.isDense != 0;
89 }
90
91protected:
92 PointCloudBase() = default;
93
94 virtual void copyFromRawData(const char* dst, const char* source, std::vector<int>& recipe);
95
96 virtual std::vector<int> getComposition(int type_composite) const;
97
98 virtual size_t pointType2Size(int type) const;
99
100 virtual size_t getOffset(int type_composite, int type_basic) const;
101
103};
104
105
106} // namespace yarp::sig
107
108#endif
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
Definition Portable.h:25
The PointCloudBase class.
virtual size_t size() const =0
yarp::sig::PointCloudNetworkHeader header
virtual bool isDense() const
virtual ~PointCloudBase()=default
bool write(yarp::os::ConnectionWriter &writer) const override=0
Write this object to a network connection.
virtual const char * getRawData() const =0
Get the pointer to the data.
virtual int getBottleTag() const =0
virtual size_t dataSizeBytes() const =0
Get the size of the data in terms of number of bytes.
bool read(yarp::os::ConnectionReader &connection) override=0
Read this object from a network connection.
virtual size_t wireSizeBytes() const =0
Get the size of the data + the header in terms of number of bytes.
The yarp::sig::PointCloudNetworkHeader class.
#define YARP_sig_API
Definition api.h:18