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;
107 void new_polygon(
const std::vector<unsigned int>& vertex_indices);
117 bool save(
const std::string& file_name);
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;
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.
drawable()
default construction
std::ostream * obj_out
of this output stream is defined, use it to write currently extracted surface to it
bool save(const std::string &file_name)
function used to save to obj file
gl_implicit_surface_drawable_base()
standard constructor does not initialize the function pointer such that nothing is drawn
unsigned normal_index
normal index for face normals
void draw_implicit_surface(context &ctx)
helper function to tesselate the implicit surface
void before_drop_vertex(unsigned int vertex_index)
drop the currently first vertex that has the given global vertex index
dvec3 compute_face_normal(const std::vector< unsigned int > &vis, dvec3 *c=0) const
compute the normal of a face
void post_rebuild()
use this as callback to ask for a re-tesselation of the implicit surface
void draw(context &ctx)
overload to draw the content of this drawable
bool init(context &ctx)
this method is called after creation or recreation of the context, return whether all necessary funct...
void new_vertex(unsigned int vi)
allows to augment a newly computed vertex by additional data
void finish_frame(context &ctx)
this method is called in one pass over all drawables after drawing
virtual void extract_mesh()
helper function to extract mesh from implicit surface
virtual void surface_extraction()
call the selected surface extraction method
void new_polygon(const std::vector< unsigned int > &vertex_indices)
announces a new quad
cgv::math::v3_func< double, double > F
type of the function describing the implicit surface
void clear(context &ctx)
clear all objects living in the context like textures or display lists
the mesh_render_info structure manages vertex buffer objects for attribute and element buffers as wel...
namespace for opengl specific GPU programming
ContouringType
type of contouring method >
NormalComputationType
normal computation type >
namespace for api independent GPU programming
this header is dependency free
cgv::math::fvec< double, 3 > dvec3
declare type of 3d double precision floating point vectors
cgv::media::axis_aligned_box< double, 3 > dbox3
declare type of 3d double precision floating point axis-aligned boxes
boxes use surface render styles
render style for sphere rendere