3#include <cgv/render/drawable.h>
4#include "mesh_render_info.h"
5#include <cgv/math/mfunc.h>
6#include <cgv/media/axis_aligned_box.h>
7#include <cgv/media/mesh/simple_mesh.h>
8#include <cgv/media/mesh/streaming_mesh.h>
9#include <cgv/media/illum/surface_material.h>
10#include <cgv_gl/box_renderer.h>
11#include <cgv_gl/sphere_renderer.h>
12#include <cgv_gl/arrow_renderer.h>
13#include <cgv_gl/cone_renderer.h>
42 std::vector<vec3> nml_gradient_geometry;
43 std::vector<vec3> nml_mesh_geometry;
53 double normal_threshold;
55 double consistency_threshold;
57 unsigned int max_nr_iters;
71 bool show_sampling_locations;
73 bool show_sampling_grid;
74 float sampling_grid_alpha;
80 bool show_gradient_normals;
82 bool show_mesh_normals;
101 void add_normal(
const dvec3& p,
const dvec3& n, std::vector<vec3>& nml_gradient_geometry)
const;
104 void new_vertex(
unsigned int vi);
106 void new_polygon(
const std::vector<unsigned int>& vertex_indices);
108 void before_drop_vertex(
unsigned int vertex_index);
116 bool save(
const std::string& file_name);
118 virtual void surface_extraction();
120 dvec3 compute_face_normal(
const std::vector<unsigned int> &vis,
dvec3* c = 0)
const;
124 void draw_implicit_surface(
context& ctx);
130 void set_function(
F* _func_ptr);
131 F* get_function()
const;
133 void set_resolution(
unsigned int _res);
134 unsigned int get_resolution()
const;
136 void enable_wireframe(
bool do_enable =
true);
137 bool is_wireframe_enabled()
const;
139 void enable_sampling_grid(
bool do_enable =
true);
140 bool is_sampling_grid_enabled()
const;
142 void enable_sampling_locations(
bool do_enable =
true);
143 bool is_sampling_locations_enabled()
const;
145 void enable_box(
bool do_enable =
true);
146 bool is_box_enabled()
const;
148 void enable_normals(
bool do_enable =
true);
149 bool are_normals_enabled()
const;
151 void set_epsilon(
double _epsilon);
152 double get_epsilon()
const;
154 void set_grid_epsilon(
double _grid_epsilon);
155 double get_grid_epsilon()
const;
157 void set_box(
const dbox3& _box);
158 const dbox3& get_box()
const;
160 unsigned int get_nr_triangles_of_last_extraction()
const;
161 unsigned int get_nr_vertices_of_last_extraction()
const;
168 void finish_frame(
context& ctx);
176#include <cgv/config/lib_end.h>
specialization of a multivariate function to three independent variables, which only reimplements the...
base class for all drawables, which is independent of the used rendering API.
base class for all drawables, which is independent of the used rendering API.
drawable that visualizes implicit surfaces by contouring them with marching cubes or dual contouring.
std::ostream * obj_out
of this output stream is defined, use it to write currently extracted surface to it
unsigned normal_index
normal index for face normals
cgv::math::v3_func< double, double > F
type of the function describing the implicit surface
the mesh_render_info structure manages vertex buffer objects for attribute and element buffers as wel...
ContouringType
type of contouring method >
NormalComputationType
normal computation type >
void extract_mesh(const std::string &file_name, const fx::gltf::Document &doc, cgv::media::mesh::simple_mesh< float > &mesh, int mesh_index, int primitive_index)
extract simple mesh form gltf document
boxes use surface render styles
render style for sphere rendere