6#include <hrleVectorType.hpp>
13template <
class T,
int D>
class Sphere {
15 hrleVectorType<T, D>
origin = hrleVectorType<T, D>(
T(0));
20 Sphere(hrleVectorType<T, D> passedOrigin,
T passedRadius)
24 for (
unsigned i = 0; i <
D; ++i) {
25 origin[i] = passedOrigin[i];
29 Sphere(
const std::vector<T> &passedOrigin,
T passedRadius)
34template <
class T,
int D>
class Plane {
36 hrleVectorType<T, D>
origin = hrleVectorType<T, D>(
T(0));
37 hrleVectorType<T, D>
normal = hrleVectorType<T, D>(
T(0));
41 Plane(hrleVectorType<T, D> passedOrigin, hrleVectorType<T, D> passedNormal)
44 Plane(
const T *passedOrigin,
const T *passedNormal) {
45 for (
unsigned i = 0; i <
D; ++i) {
46 origin[i] = passedOrigin[i];
47 normal[i] = passedNormal[i];
51 Plane(
const std::vector<T> &passedOrigin,
const std::vector<T> &passedNormal)
56template <
class T,
int D>
class Box {
58 hrleVectorType<T, D>
minCorner = hrleVectorType<T, D>(
T(0));
59 hrleVectorType<T, D>
maxCorner = hrleVectorType<T, D>(
T(0));
63 Box(hrleVectorType<T, D> passedMinCorner,
64 hrleVectorType<T, D> passedMaxCorner)
67 Box(
const T *passedMinCorner,
const T *passedMaxCorner) {
68 for (
unsigned i = 0; i <
D; ++i) {
74 Box(
const std::vector<T> &passedMinCorner,
75 const std::vector<T> &passedMaxCorner)
83 hrleVectorType<T, 3>
origin = hrleVectorType<T, 3>(
T(0));
96 hrleVectorType<T, D> passedAxisDirection,
T passedHeight,
97 T passedRadius,
T passedTopRadius = 0)
102 Cylinder(
const T *passedOrigin,
const T *passedAxisDirection,
103 const T passedHeight,
const T passedRadius,
104 const T passedTopRadius = 0)
106 for (
unsigned i = 0; i <
D; ++i) {
107 origin[i] = passedOrigin[i];
112 Cylinder(std::vector<T> passedOrigin, std::vector<T> passedAxisDirection,
113 T passedHeight,
T passedRadius,
T passedTopRadius = 0)
123 std::vector<hrleVectorType<T, D>>
points;
130 PointCloud(
const std::vector<std::vector<T>> &passedPoints) {
131 for (
auto point : passedPoints) {
132 hrleVectorType<T, D> p(point);
138 points.push_back(newPoint);
142 hrleVectorType<T, D> point(newPoint);
147 hrleVectorType<T, D> point(newPoint);
148 points.push_back(std::move(point));
152 hrleVectorType<T, D> point(newPoint);
156 std::pair<typename std::vector<hrleVectorType<T, D>>::iterator,
bool>
158 for (
auto it =
points.begin(); it !=
points.end(); ++it) {
160 return std::make_pair(it,
false);
162 points.push_back(newPoint);
163 return std::make_pair(--
points.end(),
true);
166 typename std::vector<hrleVectorType<T, D>>::iterator
begin() {
170 typename std::vector<hrleVectorType<T, D>>::iterator
end() {
Class describing a square box from one coordinate to another.
Definition lsGeometries.hpp:56
Box()
Definition lsGeometries.hpp:61
hrleVectorType< T, D > maxCorner
Definition lsGeometries.hpp:59
Box(const T *passedMinCorner, const T *passedMaxCorner)
Definition lsGeometries.hpp:67
Box(hrleVectorType< T, D > passedMinCorner, hrleVectorType< T, D > passedMaxCorner)
Definition lsGeometries.hpp:63
hrleVectorType< T, D > minCorner
Definition lsGeometries.hpp:58
Box(const std::vector< T > &passedMinCorner, const std::vector< T > &passedMaxCorner)
Definition lsGeometries.hpp:74
Class describing a square box from one coordinate to another.
Definition lsGeometries.hpp:80
Cylinder(std::vector< T > passedOrigin, std::vector< T > passedAxisDirection, T passedHeight, T passedRadius, T passedTopRadius=0)
Definition lsGeometries.hpp:112
Cylinder(hrleVectorType< T, D > passedOrigin, hrleVectorType< T, D > passedAxisDirection, T passedHeight, T passedRadius, T passedTopRadius=0)
Definition lsGeometries.hpp:95
Cylinder(const T *passedOrigin, const T *passedAxisDirection, const T passedHeight, const T passedRadius, const T passedTopRadius=0)
Definition lsGeometries.hpp:102
hrleVectorType< T, 3 > axisDirection
This vector will be the main axis of the cylinder.
Definition lsGeometries.hpp:85
Cylinder()
Definition lsGeometries.hpp:93
T radius
radius of the base of the cylinder
Definition lsGeometries.hpp:89
T topRadius
radius of the top of the cylinder
Definition lsGeometries.hpp:91
T height
height of the cylinder
Definition lsGeometries.hpp:87
hrleVectorType< T, 3 > origin
This is the location of the center of the base of the cylinder.
Definition lsGeometries.hpp:83
Class describing a plane via a point in it and the plane normal.
Definition lsGeometries.hpp:34
hrleVectorType< T, D > normal
Definition lsGeometries.hpp:37
hrleVectorType< T, D > origin
Definition lsGeometries.hpp:36
Plane()
Definition lsGeometries.hpp:39
Plane(hrleVectorType< T, D > passedOrigin, hrleVectorType< T, D > passedNormal)
Definition lsGeometries.hpp:41
Plane(const std::vector< T > &passedOrigin, const std::vector< T > &passedNormal)
Definition lsGeometries.hpp:51
Plane(const T *passedOrigin, const T *passedNormal)
Definition lsGeometries.hpp:44
Class describing a point cloud, which can be used to create geometries from its convex hull mesh.
Definition lsGeometries.hpp:121
void insertNextPoint(hrleVectorType< T, D > newPoint)
Definition lsGeometries.hpp:137
std::vector< hrleVectorType< T, D > > points
Definition lsGeometries.hpp:123
std::vector< hrleVectorType< T, D > >::iterator end()
Definition lsGeometries.hpp:170
hrleVectorType< T, D > & operator[](std::size_t i)
Definition lsGeometries.hpp:176
PointCloud(const std::vector< std::vector< T > > &passedPoints)
Definition lsGeometries.hpp:130
void insertNextPoint(const std::array< T, D > newPoint)
Definition lsGeometries.hpp:146
std::size_t size()
Definition lsGeometries.hpp:174
std::vector< hrleVectorType< T, D > >::iterator begin()
Definition lsGeometries.hpp:166
void insertNextPoint(const std::vector< T > &newPoint)
Definition lsGeometries.hpp:151
std::pair< typename std::vector< hrleVectorType< T, D > >::iterator, bool > insertNextUniquePoint(hrleVectorType< T, D > newPoint)
Definition lsGeometries.hpp:157
PointCloud(std::vector< hrleVectorType< T, D > > passedPoints)
Definition lsGeometries.hpp:127
PointCloud()
Definition lsGeometries.hpp:125
void insertNextPoint(T *newPoint)
Definition lsGeometries.hpp:141
Class describing a sphere via origin and radius.
Definition lsGeometries.hpp:13
T radius
Definition lsGeometries.hpp:16
Sphere(hrleVectorType< T, D > passedOrigin, T passedRadius)
Definition lsGeometries.hpp:20
Sphere()
Definition lsGeometries.hpp:18
hrleVectorType< T, D > origin
Definition lsGeometries.hpp:15
Sphere(T *passedOrigin, T passedRadius)
Definition lsGeometries.hpp:23
Sphere(const std::vector< T > &passedOrigin, T passedRadius)
Definition lsGeometries.hpp:29
#define PRECOMPILE_PRECISION_DIMENSION(className)
Definition lsPreCompileMacros.hpp:24
Definition lsAdvect.hpp:46
constexpr int D
Definition pyWrap.cpp:65
double T
Definition pyWrap.cpp:63