8#include <vcSmartPointer.hpp>
9#include <vcVectorType.hpp>
12using namespace viennacore;
15template <
class T,
int D>
class Sphere {
20 Sphere(VectorType<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)
31 for (
unsigned i = 0; i <
D; ++i) {
32 origin[i] = passedOrigin[i];
36 template <
class... Args>
static auto New(Args &&...args) {
37 return SmartPointer<Sphere>::New(std::forward<Args>(args)...);
42template <
class T,
int D>
class Plane {
47 Plane(VectorType<T, D> passedOrigin, VectorType<T, D> passedNormal)
50 Plane(
const T *passedOrigin,
const T *passedNormal) {
51 for (
unsigned i = 0; i <
D; ++i) {
52 origin[i] = passedOrigin[i];
53 normal[i] = passedNormal[i];
57 Plane(
const std::vector<T> &passedOrigin,
58 const std::vector<T> &passedNormal) {
59 for (
unsigned i = 0; i <
D; ++i) {
60 origin[i] = passedOrigin[i];
61 normal[i] = passedNormal[i];
65 template <
class... Args>
static auto New(Args &&...args) {
66 return SmartPointer<Plane>::New(std::forward<Args>(args)...);
71template <
class T,
int D>
class Box {
76 Box(VectorType<T, D> passedMinCorner, VectorType<T, D> passedMaxCorner)
79 Box(
const T *passedMinCorner,
const T *passedMaxCorner) {
80 for (
unsigned i = 0; i <
D; ++i) {
86 Box(
const std::vector<T> &passedMinCorner,
87 const std::vector<T> &passedMaxCorner) {
88 for (
unsigned i = 0; i <
D; ++i) {
94 template <
class... Args>
static auto New(Args &&...args) {
95 return SmartPointer<Box>::New(std::forward<Args>(args)...);
113 Cylinder(VectorType<T, D> passedOrigin, VectorType<T, D> passedAxisDirection,
114 T passedHeight,
T passedRadius,
T passedTopRadius = 0)
119 Cylinder(
const T *passedOrigin,
const T *passedAxisDirection,
120 const T passedHeight,
const T passedRadius,
121 const T passedTopRadius = 0)
123 for (
unsigned i = 0; i <
D; ++i) {
124 origin[i] = passedOrigin[i];
129 Cylinder(std::vector<T> passedOrigin, std::vector<T> passedAxisDirection,
130 T passedHeight,
T passedRadius,
T passedTopRadius = 0)
132 for (
unsigned i = 0; i <
D; ++i) {
133 origin[i] = passedOrigin[i];
138 template <
class... Args>
static auto New(Args &&...args) {
139 return SmartPointer<Cylinder>::New(std::forward<Args>(args)...);
155 VectorType<T, D> point;
156 for (
unsigned i = 0; i <
D; ++i) {
157 point[i] = newPoint[i];
159 points.push_back(std::move(point));
163 VectorType<T, D> point(newPoint);
164 points.push_back(std::move(point));
167 std::pair<typename std::vector<VectorType<T, D>>::iterator,
bool>
169 for (
auto it =
points.begin(); it !=
points.end(); ++it) {
171 return std::make_pair(it,
false);
173 points.push_back(newPoint);
174 return std::make_pair(--
points.end(),
true);
177 typename std::vector<VectorType<T, D>>::iterator
begin() {
181 typename std::vector<VectorType<T, D>>::iterator
end() {
189 template <
class... Args>
static auto New(Args &&...args) {
190 return SmartPointer<PointCloud>::New(std::forward<Args>(args)...);
VectorType< T, D > maxCorner
Definition lsGeometries.hpp:74
Box(VectorType< T, D > passedMinCorner, VectorType< T, D > passedMaxCorner)
Definition lsGeometries.hpp:76
static auto New(Args &&...args)
Definition lsGeometries.hpp:94
Box(const T *passedMinCorner, const T *passedMaxCorner)
Definition lsGeometries.hpp:79
Box(const std::vector< T > &passedMinCorner, const std::vector< T > &passedMaxCorner)
Definition lsGeometries.hpp:86
VectorType< T, D > minCorner
Definition lsGeometries.hpp:73
Cylinder(std::vector< T > passedOrigin, std::vector< T > passedAxisDirection, T passedHeight, T passedRadius, T passedTopRadius=0)
Definition lsGeometries.hpp:129
static auto New(Args &&...args)
Definition lsGeometries.hpp:138
VectorType< T, 3 > axisDirection
This vector will be the main axis of the cylinder.
Definition lsGeometries.hpp:105
Cylinder(const T *passedOrigin, const T *passedAxisDirection, const T passedHeight, const T passedRadius, const T passedTopRadius=0)
Definition lsGeometries.hpp:119
Cylinder(VectorType< T, D > passedOrigin, VectorType< T, D > passedAxisDirection, T passedHeight, T passedRadius, T passedTopRadius=0)
Definition lsGeometries.hpp:113
T radius
radius of the base of the cylinder
Definition lsGeometries.hpp:109
T topRadius
radius of the top of the cylinder
Definition lsGeometries.hpp:111
T height
height of the cylinder
Definition lsGeometries.hpp:107
VectorType< T, 3 > origin
This is the location of the center of the base of the cylinder.
Definition lsGeometries.hpp:103
Plane(VectorType< T, D > passedOrigin, VectorType< T, D > passedNormal)
Definition lsGeometries.hpp:47
static auto New(Args &&...args)
Definition lsGeometries.hpp:65
VectorType< T, D > normal
Definition lsGeometries.hpp:45
VectorType< T, D > origin
Definition lsGeometries.hpp:44
Plane(const std::vector< T > &passedOrigin, const std::vector< T > &passedNormal)
Definition lsGeometries.hpp:57
Plane(const T *passedOrigin, const T *passedNormal)
Definition lsGeometries.hpp:50
void insertNextPoint(const VectorType< T, D > &newPoint)
Definition lsGeometries.hpp:162
std::vector< VectorType< T, D > > points
Definition lsGeometries.hpp:147
std::vector< VectorType< T, D > >::iterator end()
Definition lsGeometries.hpp:181
std::size_t size()
Definition lsGeometries.hpp:185
std::vector< VectorType< T, D > >::iterator begin()
Definition lsGeometries.hpp:177
std::pair< typename std::vector< VectorType< T, D > >::iterator, bool > insertNextUniquePoint(VectorType< T, D > newPoint)
Definition lsGeometries.hpp:168
static auto New(Args &&...args)
Definition lsGeometries.hpp:189
void insertNextPoint(T *newPoint)
Definition lsGeometries.hpp:154
VectorType< T, D > & operator[](std::size_t i)
Definition lsGeometries.hpp:187
PointCloud(std::vector< VectorType< T, D > > passedPoints)
Definition lsGeometries.hpp:151
T radius
Definition lsGeometries.hpp:18
Sphere(T *passedOrigin, T passedRadius)
Definition lsGeometries.hpp:23
Sphere(VectorType< T, D > passedOrigin, T passedRadius)
Definition lsGeometries.hpp:20
Sphere(const std::vector< T > &passedOrigin, T passedRadius)
Definition lsGeometries.hpp:29
VectorType< T, D > origin
Definition lsGeometries.hpp:17
static auto New(Args &&...args)
Definition lsGeometries.hpp:36
#define PRECOMPILE_PRECISION_DIMENSION(className)
Definition lsPreCompileMacros.hpp:24
Definition lsAdvect.hpp:36
constexpr int D
Definition pyWrap.cpp:71
double T
Definition pyWrap.cpp:69