ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
wlPointCloud.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
10
// system
11
#include <vector>
12
13
namespace
wl
{
15
struct
Point
{
16
union
{
17
struct
{
18
float
x
;
19
float
y
;
20
float
z
;
21
};
22
float
u
[3];
23
};
24
25
Point
() :
x
(0),
y
(0),
z
(0) {}
26
};
27
28
class
PointCloud
:
public
std::vector<Point> {
29
public
:
30
void
computeBoundingBox
(
Point
& bbMin,
Point
& bbMax) {
31
if
(empty()) {
32
bbMin = bbMax =
Point
();
33
return
;
34
}
35
36
bbMin = bbMax =
at
(0);
37
for
(std::size_t i = 1; i <
size
(); i++) {
38
const
wl::Point
& P =
at
(i);
39
for
(
int
d = 0; d < 3; ++d) {
40
if
(P.
u
[d] < bbMin.
u
[d]) {
41
bbMin.
u
[d] = P.
u
[d];
42
}
else
if
(P.
u
[d] > bbMax.
u
[d]) {
43
bbMax.
u
[d] = P.
u
[d];
44
}
45
}
46
}
47
}
48
};
49
}
// namespace wl
size
int size
Definition:
FileIOFactory.cpp:130
wl::PointCloud
Definition:
wlPointCloud.h:28
wl::PointCloud::computeBoundingBox
void computeBoundingBox(Point &bbMin, Point &bbMax)
Definition:
wlPointCloud.h:30
ecvColor::LookUpTable::at
Rgb at(size_t color_id)
wl
Definition:
wlPointCloud.h:13
wl::Point
Point type.
Definition:
wlPointCloud.h:15
wl::Point::x
float x
Definition:
wlPointCloud.h:18
wl::Point::y
float y
Definition:
wlPointCloud.h:19
wl::Point::z
float z
Definition:
wlPointCloud.h:20
wl::Point::Point
Point()
Definition:
wlPointCloud.h:25
wl::Point::u
float u[3]
Definition:
wlPointCloud.h:22
plugins
core
Standard
qCSF
include
wlPointCloud.h
Generated on Wed Jan 28 2026 09:01:07 for ACloudViewer by
1.9.1