PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
Aabb.h
Go to the documentation of this file.
1
10
11#ifndef PBAT_GPU_GEOMETRY_AABB_H
12#define PBAT_GPU_GEOMETRY_AABB_H
13
14#include "PhysicsBasedAnimationToolkitExport.h"
15#include "pbat/gpu/Aliases.h"
16
17namespace pbat {
18namespace gpu {
19namespace geometry {
20
24class Aabb
25{
26 public:
33 PBAT_API Aabb(GpuIndex dims = 3, GpuIndex nBoxes = 0);
34
35 Aabb(Aabb const&) = delete;
36 Aabb& operator=(Aabb const&) = delete;
41 PBAT_API Aabb(Aabb&& other) noexcept;
47 PBAT_API Aabb& operator=(Aabb&& other) noexcept;
53 PBAT_API void
54 Construct(Eigen::Ref<GpuMatrixX const> const& L, Eigen::Ref<GpuMatrixX const> const& U);
61 PBAT_API void
62 Construct(Eigen::Ref<GpuMatrixX const> const& P, Eigen::Ref<GpuIndexMatrixX const> const& S);
68 PBAT_API void Resize(GpuIndex dims, GpuIndex nBoxes);
73 PBAT_API GpuIndex Size() const;
78 [[maybe_unused]] GpuIndex Dimensions() const { return mDims; }
83 [[maybe_unused]] void* Impl() { return mImpl; }
88 [[maybe_unused]] void* Impl() const { return mImpl; }
93 PBAT_API GpuMatrixX Lower() const;
98 PBAT_API GpuMatrixX Upper() const;
102 PBAT_API ~Aabb();
103
104 private:
105 void Deallocate();
106
107 GpuIndex mDims;
108 void* mImpl;
109};
110
111} // namespace geometry
112} // namespace gpu
113} // namespace pbat
114
115#endif // PBAT_GPU_GEOMETRY_AABB_H
PBAT_API GpuMatrixX Upper() const
Fetch the upper bounds from GPU and return as CPU matrix.
Definition Aabb.cu:135
PBAT_API GpuIndex Size() const
Get the number of boxes.
Definition Aabb.cu:110
PBAT_API void Resize(GpuIndex dims, GpuIndex nBoxes)
Resize the AABB buffer.
Definition Aabb.cu:82
void * Impl()
Handle to the implementation.
Definition Aabb.h:83
GpuIndex Dimensions() const
Get the embedding dimensionality.
Definition Aabb.h:78
PBAT_API Aabb(GpuIndex dims=3, GpuIndex nBoxes=0)
Construct a new Aabb object.
Definition Aabb.cu:18
PBAT_API GpuMatrixX Lower() const
Fetch the lower bounds from GPU and return as CPU matrix.
Definition Aabb.cu:122
void * Impl() const
Handle to the implementation.
Definition Aabb.h:88
PBAT_API void Construct(Eigen::Ref< GpuMatrixX const > const &L, Eigen::Ref< GpuMatrixX const > const &U)
Construct a new Aabb object from the lower and upper bounds matrices.
Definition Aabb.cu:39
PBAT_API ~Aabb()
Destroy the Aabb 3 D object.
Definition Aabb.cu:148
Type aliases for GPU code.
Public geometry API for GPU.
Definition Aabb.cu:16
GPU related public functionality.
Definition Buffer.cu:16
The main namespace of the library.
Definition Aliases.h:15
Eigen::Matrix< GpuScalar, Eigen::Dynamic, Eigen::Dynamic > GpuMatrixX
Matrix type for GPU code.
Definition Aliases.h:22
std::int32_t GpuIndex
Index type for GPU code.
Definition Aliases.h:20