iridescence
Loading...
Searching...
No Matches
normal_distributions.hpp
Go to the documentation of this file.
1#ifndef GLK_NORMAL_DISTRIBUTIONS_HPP
2#define GLK_NORMAL_DISTRIBUTIONS_HPP
3
4#include <vector>
5#include <Eigen/Core>
6
7#include <glk/drawable.hpp>
9
10namespace glk {
11
12class Mesh;
13
20public:
26 NormalDistributions(const float* means, const float* covs, int num_points, float sigma = 1.0f);
27
34 template <typename T, int D>
35 NormalDistributions(const Eigen::Matrix<T, D, 1>* means, const Eigen::Matrix<T, D, D>* covs, int num_points, float sigma = 1.0f);
36
42 template <typename T, int D, template <class> class Allocator>
44 const std::vector<Eigen::Matrix<T, D, 1>, Allocator<Eigen::Matrix<T, D, 1>>>& means,
45 const std::vector<Eigen::Matrix<T, D, D>, Allocator<Eigen::Matrix<T, D, D>>>& covs,
46 float sigma = 1.0f)
47 : NormalDistributions(means.data(), covs.data(), means.size(), sigma) {}
48
50
51 virtual void draw(glk::GLSLShader& shader) const override;
52
53private:
54 static std::shared_ptr<glk::GLSLShader> vertices_shader;
55 static std::shared_ptr<glk::GLSLShader> indices_shader;
56
57 int num_indices;
58
59 GLuint vao;
60 GLuint vbo;
61 GLuint ebo;
62};
63
66public:
67 template <typename T, int D>
68 NormalDistributions_old(const Eigen::Matrix<T, D, 1>* means, const Eigen::Matrix<T, D, D>* covs, int num_points, float sigma = 1.0f);
69
70 template <typename T, int D, template <class> class Allocator>
72 const std::vector<Eigen::Matrix<T, D, 1>, Allocator<Eigen::Matrix<T, D, 1>>>& means,
73 const std::vector<Eigen::Matrix<T, D, D>, Allocator<Eigen::Matrix<T, D, D>>>& covs,
74 float sigma = 1.0f)
75 : NormalDistributions_old(means.data(), covs.data(), means.size(), sigma) {}
76
78
79 virtual void draw(glk::GLSLShader& shader) const override;
80
81private:
82 std::unique_ptr<glk::Mesh> mesh;
83};
84
85} // namespace glk
86
87#endif
Definition drawable.hpp:12
GLSLShader is a wrapper for OpenGL shader programs.
Definition glsl_shader.hpp:49
Definition mesh.hpp:16
NormalDistributions_old(const Eigen::Matrix< T, D, 1 > *means, const Eigen::Matrix< T, D, D > *covs, int num_points, float sigma=1.0f)
virtual void draw(glk::GLSLShader &shader) const override
NormalDistributions_old(const std::vector< Eigen::Matrix< T, D, 1 >, Allocator< Eigen::Matrix< T, D, 1 > > > &means, const std::vector< Eigen::Matrix< T, D, D >, Allocator< Eigen::Matrix< T, D, D > > > &covs, float sigma=1.0f)
Definition normal_distributions.hpp:71
NormalDistributions(const float *means, const float *covs, int num_points, float sigma=1.0f)
Constructor.
virtual void draw(glk::GLSLShader &shader) const override
NormalDistributions(const Eigen::Matrix< T, D, 1 > *means, const Eigen::Matrix< T, D, D > *covs, int num_points, float sigma=1.0f)
Constructor.
NormalDistributions(const std::vector< Eigen::Matrix< T, D, 1 >, Allocator< Eigen::Matrix< T, D, 1 > > > &means, const std::vector< Eigen::Matrix< T, D, D >, Allocator< Eigen::Matrix< T, D, D > > > &covs, float sigma=1.0f)
Constructor.
Definition normal_distributions.hpp:43
Definition async_buffer_copy.hpp:6