8#include <vcVectorType.hpp>
11using namespace viennacore;
14template <
class T,
int D>
class Sphere {
19 Sphere(VectorType<T, D> passedOrigin,
T passedRadius)
23 for (
unsigned i = 0; i <
D; ++i) {
24 origin[i] = passedOrigin[i];
28 Sphere(
const std::vector<T> &passedOrigin,
T passedRadius)
30 for (
unsigned i = 0; i <
D; ++i) {
31 origin[i] = passedOrigin[i];
37template <
class T,
int D>
class Plane {
42 Plane(VectorType<T, D> passedOrigin, VectorType<T, D> passedNormal)
45 Plane(
const T *passedOrigin,
const T *passedNormal) {
46 for (
unsigned i = 0; i <
D; ++i) {
47 origin[i] = passedOrigin[i];
48 normal[i] = passedNormal[i];
52 Plane(
const std::vector<T> &passedOrigin,
53 const std::vector<T> &passedNormal) {
54 for (
unsigned i = 0; i <
D; ++i) {
55 origin[i] = passedOrigin[i];
56 normal[i] = passedNormal[i];
62template <
class T,
int D>
class Box {
67 Box(VectorType<T, D> passedMinCorner, VectorType<T, D> passedMaxCorner)
70 Box(
const T *passedMinCorner,
const T *passedMaxCorner) {
71 for (
unsigned i = 0; i <
D; ++i) {
77 Box(
const std::vector<T> &passedMinCorner,
78 const std::vector<T> &passedMaxCorner) {
79 for (
unsigned i = 0; i <
D; ++i) {
100 Cylinder(VectorType<T, D> passedOrigin, VectorType<T, D> passedAxisDirection,
101 T passedHeight,
T passedRadius,
T passedTopRadius = 0)
106 Cylinder(
const T *passedOrigin,
const T *passedAxisDirection,
107 const T passedHeight,
const T passedRadius,
108 const T passedTopRadius = 0)
110 for (
unsigned i = 0; i <
D; ++i) {
111 origin[i] = passedOrigin[i];
116 Cylinder(std::vector<T> passedOrigin, std::vector<T> passedAxisDirection,
117 T passedHeight,
T passedRadius,
T passedTopRadius = 0)
119 for (
unsigned i = 0; i <
D; ++i) {
120 origin[i] = passedOrigin[i];
138 VectorType<T, D> point;
139 for (
unsigned i = 0; i <
D; ++i) {
140 point[i] = newPoint[i];
142 points.push_back(std::move(point));
146 VectorType<T, D> point(newPoint);
147 points.push_back(std::move(point));
150 std::pair<typename std::vector<VectorType<T, D>>::iterator,
bool>
152 for (
auto it =
points.begin(); it !=
points.end(); ++it) {
154 return std::make_pair(it,
false);
156 points.push_back(newPoint);
157 return std::make_pair(--
points.end(),
true);
160 typename std::vector<VectorType<T, D>>::iterator
begin() {
164 typename std::vector<VectorType<T, D>>::iterator
end() {
VectorType< T, D > maxCorner
Definition lsGeometries.hpp:65
Box(VectorType< T, D > passedMinCorner, VectorType< T, D > passedMaxCorner)
Definition lsGeometries.hpp:67
Box(const T *passedMinCorner, const T *passedMaxCorner)
Definition lsGeometries.hpp:70
Box(const std::vector< T > &passedMinCorner, const std::vector< T > &passedMaxCorner)
Definition lsGeometries.hpp:77
VectorType< T, D > minCorner
Definition lsGeometries.hpp:64
Cylinder(std::vector< T > passedOrigin, std::vector< T > passedAxisDirection, T passedHeight, T passedRadius, T passedTopRadius=0)
Definition lsGeometries.hpp:116
VectorType< T, 3 > axisDirection
This vector will be the main axis of the cylinder.
Definition lsGeometries.hpp:92
Cylinder(const T *passedOrigin, const T *passedAxisDirection, const T passedHeight, const T passedRadius, const T passedTopRadius=0)
Definition lsGeometries.hpp:106
Cylinder(VectorType< T, D > passedOrigin, VectorType< T, D > passedAxisDirection, T passedHeight, T passedRadius, T passedTopRadius=0)
Definition lsGeometries.hpp:100
T radius
radius of the base of the cylinder
Definition lsGeometries.hpp:96
T topRadius
radius of the top of the cylinder
Definition lsGeometries.hpp:98
T height
height of the cylinder
Definition lsGeometries.hpp:94
VectorType< T, 3 > origin
This is the location of the center of the base of the cylinder.
Definition lsGeometries.hpp:90
Plane(VectorType< T, D > passedOrigin, VectorType< T, D > passedNormal)
Definition lsGeometries.hpp:42
VectorType< T, D > normal
Definition lsGeometries.hpp:40
VectorType< T, D > origin
Definition lsGeometries.hpp:39
Plane(const std::vector< T > &passedOrigin, const std::vector< T > &passedNormal)
Definition lsGeometries.hpp:52
Plane(const T *passedOrigin, const T *passedNormal)
Definition lsGeometries.hpp:45
void insertNextPoint(const VectorType< T, D > &newPoint)
Definition lsGeometries.hpp:145
std::vector< VectorType< T, D > > points
Definition lsGeometries.hpp:130
std::vector< VectorType< T, D > >::iterator end()
Definition lsGeometries.hpp:164
std::size_t size()
Definition lsGeometries.hpp:168
std::vector< VectorType< T, D > >::iterator begin()
Definition lsGeometries.hpp:160
std::pair< typename std::vector< VectorType< T, D > >::iterator, bool > insertNextUniquePoint(VectorType< T, D > newPoint)
Definition lsGeometries.hpp:151
void insertNextPoint(T *newPoint)
Definition lsGeometries.hpp:137
VectorType< T, D > & operator[](std::size_t i)
Definition lsGeometries.hpp:170
PointCloud(std::vector< VectorType< T, D > > passedPoints)
Definition lsGeometries.hpp:134
T radius
Definition lsGeometries.hpp:17
Sphere(T *passedOrigin, T passedRadius)
Definition lsGeometries.hpp:22
Sphere(VectorType< T, D > passedOrigin, T passedRadius)
Definition lsGeometries.hpp:19
Sphere(const std::vector< T > &passedOrigin, T passedRadius)
Definition lsGeometries.hpp:28
VectorType< T, D > origin
Definition lsGeometries.hpp:16
#define PRECOMPILE_PRECISION_DIMENSION(className)
Definition lsPreCompileMacros.hpp:24
Definition lsAdvect.hpp:36
constexpr int D
Definition pyWrap.cpp:70
double T
Definition pyWrap.cpp:68