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>
36 bool renderers_reffed =
false;
43 std::vector<vec3> nml_gradient_geometry;
44 std::vector<vec3> nml_mesh_geometry;
54 double normal_threshold;
56 double consistency_threshold;
58 unsigned int max_nr_iters;
72 bool show_sampling_locations;
74 bool show_sampling_grid;
75 float sampling_grid_alpha;
81 bool show_gradient_normals;
83 bool show_mesh_normals;
102 void add_normal(
const dvec3& p,
const dvec3& n, std::vector<vec3>& nml_gradient_geometry)
const;
105 void new_vertex(
unsigned int vi);
107 void new_polygon(
const std::vector<unsigned int>& vertex_indices);
109 void before_drop_vertex(
unsigned int vertex_index);
117 bool save(
const std::string& file_name);
119 virtual void surface_extraction();
121 dvec3 compute_face_normal(
const std::vector<unsigned int> &vis,
dvec3* c = 0)
const;
125 void draw_implicit_surface(
context& ctx);
131 void set_function(
F* _func_ptr);
132 F* get_function()
const;
134 void set_resolution(
unsigned int _res);
135 unsigned int get_resolution()
const;
137 void enable_wireframe(
bool do_enable =
true);
138 bool is_wireframe_enabled()
const;
140 void enable_sampling_grid(
bool do_enable =
true);
141 bool is_sampling_grid_enabled()
const;
143 void enable_sampling_locations(
bool do_enable =
true);
144 bool is_sampling_locations_enabled()
const;
146 void enable_box(
bool do_enable =
true);
147 bool is_box_enabled()
const;
149 void enable_normals(
bool do_enable =
true);
150 bool are_normals_enabled()
const;
152 void set_epsilon(
double _epsilon);
153 double get_epsilon()
const;
155 void set_grid_epsilon(
double _grid_epsilon);
156 double get_grid_epsilon()
const;
158 void set_box(
const dbox3& _box);
159 const dbox3& get_box()
const;
161 unsigned int get_nr_triangles_of_last_extraction()
const;
162 unsigned int get_nr_vertices_of_last_extraction()
const;
169 void finish_frame(
context& ctx);
177#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