gtsam_points
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:
21 NormalDistributions(const float* means, const float* covs, int num_points, float scale = 1.0f);
22
23 template <typename T, int D>
24 NormalDistributions(const Eigen::Matrix<T, D, 1>* means, const Eigen::Matrix<T, D, D>* covs, int num_points, float scale = 1.0f);
25
26 template <typename T, int D, template <class> class Allocator>
28 const std::vector<Eigen::Matrix<T, D, 1>, Allocator<Eigen::Matrix<T, D, 1>>>& means,
29 const std::vector<Eigen::Matrix<T, D, D>, Allocator<Eigen::Matrix<T, D, D>>>& covs,
30 float scale = 1.0f)
31 : NormalDistributions(means.data(), covs.data(), means.size(), scale) {}
32
34
35 virtual void draw(glk::GLSLShader& shader) const override;
36
37private:
38 static std::shared_ptr<glk::GLSLShader> vertices_shader;
39 static std::shared_ptr<glk::GLSLShader> indices_shader;
40
41 int num_indices;
42
43 GLuint vao;
44 GLuint vbo;
45 GLuint ebo;
46};
47
49public:
50 template <typename T, int D>
51 NormalDistributions_old(const Eigen::Matrix<T, D, 1>* means, const Eigen::Matrix<T, D, D>* covs, int num_points, float scale = 1.0f);
52
53 template <typename T, int D, template <class> class Allocator>
55 const std::vector<Eigen::Matrix<T, D, 1>, Allocator<Eigen::Matrix<T, D, 1>>>& means,
56 const std::vector<Eigen::Matrix<T, D, D>, Allocator<Eigen::Matrix<T, D, D>>>& covs,
57 float scale = 1.0f)
58 : NormalDistributions_old(means.data(), covs.data(), means.size(), scale) {}
59
61
62 virtual void draw(glk::GLSLShader& shader) const override;
63
64private:
65 std::unique_ptr<glk::Mesh> mesh;
66};
67
68} // namespace glk
69
70#endif
Definition drawable.hpp:12
Definition glsl_shader.hpp:20
Definition normal_distributions.hpp:48
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 scale=1.0f)
Definition normal_distributions.hpp:54
virtual void draw(glk::GLSLShader &shader) const override
NormalDistributions_old(const Eigen::Matrix< T, D, 1 > *means, const Eigen::Matrix< T, D, D > *covs, int num_points, float scale=1.0f)
A drawable class to render a set of normal distributions as ellipsoids. This class efficiently perfor...
Definition normal_distributions.hpp:19
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 scale=1.0f)
NormalDistributions(const float *means, const float *covs, int num_points, float scale=1.0f)
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 scale=1.0f)
Definition normal_distributions.hpp:27
Definition async_buffer_copy.hpp:6
std::enable_if_t< needs_aligned_allocator< T >::value, std::shared_ptr< T > > make_shared(Args &&... args)
Definition make_shared.hpp:20