1#ifndef TATOOINE_FLOWEXPLORER_NODES_AUTONOMOUS_PARTICLES_FLOWMAP_H
2#define TATOOINE_FLOWEXPLORER_NODES_AUTONOMOUS_PARTICLES_FLOWMAP_H
4#include <tatooine/flowexplorer/line_shader.h>
13 std::unique_ptr<unstructured_triangular_grid<double, 2>>
m_mesh;
20 "Autonomous Particles Flowmap", s,
27 ImGui::Text(
"no dataset read");
31 if (ImGui::Button(
"load double gyre autonomous adaptive forward")) {
33 "/home/steve/libs/tatooine2/build/autonomous_particles/"
34 "doublegyre_autonomous_forward_flowmap.vtk");
38 if (ImGui::Button(
"load double gyre autonomous adaptive backward")) {
40 "/home/steve/libs/tatooine2/build/autonomous_particles/"
41 "doublegyre_autonomous_backward_flowmap.vtk");
44 if (ImGui::Button(
"load double gyre regular forward")) {
46 "/home/steve/libs/tatooine2/build/autonomous_particles/"
47 "doublegyre_regular_forward_flowmap.vtk");
51 if (ImGui::Button(
"load double gyre regular backward")) {
53 "/home/steve/libs/tatooine2/build/autonomous_particles/"
54 "doublegyre_regular_backward_flowmap.vtk");
57 changed |= ImGui::SliderInt(
"line width", &
m_line_width, 1, 50);
58 changed |= ImGui::ColorEdit4(
"line color",
m_line_color.data());
62 auto load(filesystem::path
const& path) ->
void {
63 std::cerr <<
"loading ... ";
65 m_mesh = std::make_unique<unstructured_triangular_grid_2>(path);
69 for (
auto v :
m_mesh->vertices()) {
75 for (
auto c :
m_mesh->cells()) {
76 auto [v0, v1, v2] =
m_mesh->at(c);
77 m_edges.indexbuffer().push_back(v0.i);
78 m_edges.indexbuffer().push_back(v1.i);
79 m_edges.indexbuffer().push_back(v1.i);
80 m_edges.indexbuffer().push_back(v2.i);
81 m_edges.indexbuffer().push_back(v2.i);
82 m_edges.indexbuffer().push_back(v0.i);
84 std::cerr <<
"done\n";
88 if (
m_edges.indexbuffer().size() > 0) {
89 auto& shader = line_shader::get();
91 shader.set_projection_matrix(P);
92 shader.set_modelview_matrix(V);
110 TATOOINE_REFLECTION_INSERT_METHOD(line_width, m_line_width),
111 TATOOINE_REFLECTION_INSERT_METHOD(line_color, m_line_color))
Definition: indexeddata.h:13
TATOOINE_FLOWEXPLORER_REGISTER_RENDERABLE(tatooine::flowexplorer::nodes::aabb2d, TATOOINE_REFLECTION_INSERT_GETTER(min), TATOOINE_REFLECTION_INSERT_GETTER(max), TATOOINE_REFLECTION_INSERT_GETTER(line_width), TATOOINE_REFLECTION_INSERT_GETTER(line_color))
DLL_API auto line_width(GLfloat width) -> void
auto constexpr map(F &&f, Ts &&... ts)
maps unary function f to all single parameters of parameter pack ts
Definition: map.h:10
Definition: autonomous_particles_flowmap.h:11
std::array< GLfloat, 4 > m_line_color
Definition: autonomous_particles_flowmap.h:16
auto draw_properties() -> bool override
Definition: autonomous_particles_flowmap.h:24
autonomous_particles_flowmap(flowexplorer::scene &s)
Definition: autonomous_particles_flowmap.h:18
std::unique_ptr< unstructured_triangular_grid< double, 2 > > m_mesh
Definition: autonomous_particles_flowmap.h:13
auto load(filesystem::path const &path) -> void
Definition: autonomous_particles_flowmap.h:62
virtual ~autonomous_particles_flowmap()=default
int m_line_width
Definition: autonomous_particles_flowmap.h:15
auto render(mat4f const &P, mat4f const &V) -> void override
Definition: autonomous_particles_flowmap.h:87
std::string m_currently_read_path
Definition: autonomous_particles_flowmap.h:12
gl::indexeddata< vec3f > m_edges
Definition: autonomous_particles_flowmap.h:14
bool is_transparent() const override
Definition: autonomous_particles_flowmap.h:100
auto mesh() const -> auto const &
Definition: autonomous_particles_flowmap.h:103
auto data_available() const -> bool
Definition: autonomous_particles_flowmap.h:102
Definition: renderable.h:42