OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
point_cloud.hpp
Go to the documentation of this file.
1// OpenBEM - Copyright (C) 2026 Shashwat Sharma
2
3// This file is part of OpenBEM.
4
5// OpenBEM is free software: you can redistribute it and/or modify it under the terms of the
6// GNU General Public License as published by the Free Software Foundation, either version 3
7// of the License, or (at your option) any later version.
8
9// You should have received a copy of the GNU General Public License along with OpenBEM.
10// If not, see <https://www.gnu.org/licenses/>.
11
12
18#ifndef GEOM_POINT_CLOUD_H
19#define GEOM_POINT_CLOUD_H
20
21#include <vector>
22
23#include "types.hpp"
24
25
26namespace bem
27{
28
38template <uint8_t dim>
40{
41
42 static_assert((dim == 1 || dim == 2 || dim == 3), "PointCloud: `dim` must be 1, 2 or 3.");
43
44public:
45
50
51
61
62
72 void set_line_data(
75 const Index num_pts
76 );
77
78
85 void set_block_data(
89 );
90
91
99 void set_polar_data(
104 );
105
106
112
119 void clear_data();
120
121
127 { return points_; };
128
129
136 { return points_.col(idx); };
137
138
144 { return points_.cols(); };
145
146
147protected:
148
149 EigMatNX<Float, dim> points_;
150
151};
152
157}
158
159#ifndef BEM_LINKED
161#endif
162
163#endif
Point cloud class.
PointCloud(ConstEigRef< EigMatNX< Float, dim > > points)
Constructs a PointCloud with given point data.
void clear_data()
Clears the point cloud data.
void set_line_data(ConstEigRef< EigColVecN< Float, dim > > start, ConstEigRef< EigColVecN< Float, dim > > stop, const Index num_pts)
Sets PointCloud data as points along a straight line.
Index num_points() const
Returns the number of points in the cloud.
void set_block_data(ConstEigRef< EigColVecN< Float, dim > > start, ConstEigRef< EigColVecN< Float, dim > > stop, ConstEigRef< EigColVecN< Index, dim > > num_pts)
Sets PointCloud data as a block of points.
void set_data(ConstEigRef< EigMatNX< Float, dim > > points)
Sets the point cloud data.
PointCloud()
Constructs an empty PointCloud.
EigColVecN< Float, dim > points(Index idx) const
Returns the coordinates of the point at a specific index in the cloud.
void set_polar_data(ConstEigRef< EigColVecN< Float, dim > > start, ConstEigRef< EigColVecN< Float, dim > > stop, ConstEigRef< EigColVecN< Float, dim > > center, ConstEigRef< EigColVecN< Index, dim > > num_pts)
Sets PointCloud data as points of a polar grid.
const EigMatNX< Float, dim > & points() const
Returns the coordinates of the points in the cloud.
const Eigen::Ref< const EigObj > ConstEigRef
Read-only reference to an Eigen object.
Definition types.hpp:98
Eigen::Matrix< T, N, 1 > EigColVecN
Fixed-size column vector of size N containing type T.
Definition types.hpp:86
std::size_t Index
Unsigned integer type for indices and container sizes.
Definition types.hpp:54
Primary namespace for the OpenBEM library.
Definition constants.hpp:31