3 #include "render_info.h"
4 #include <cgv/media/mesh/simple_mesh.h>
48 cgv::media::ColorType
ct;
51 std::vector<idx_type>& vertex_indices, std::vector<vec3i>& unique_triples,
52 std::vector<idx_type>& triangle_element_buffer, std::vector<idx_type>& edge_element_buffer);
55 const std::vector<idx_type>& triangle_element_buffer,
56 const std::vector<idx_type>& edge_element_buffer);
65 bool is_bound()
const {
return get_aas().size() > 0; }
71 std::vector<idx_type> vertex_indices;
72 std::vector<vec3i> unique_triples;
73 std::vector<idx_type> triangle_element_buffer;
74 std::vector<idx_type> edge_element_buffer;
75 construct_vbos_base(ctx, mesh, vertex_indices, unique_triples, triangle_element_buffer, edge_element_buffer);
76 std::vector<T> attrib_buffer;
77 color_increment = mesh.
extract_vertex_attribute_buffer(vertex_indices, unique_triples, include_tex_coords, include_normals, attrib_buffer, &include_colors);
79 ref_vbos().back()->create(ctx, attrib_buffer);
80 element_size =
sizeof(T);
81 position_descr = cgv::render::element_descriptor_traits<typename cgv::media::mesh::simple_mesh<T>::vec3>::get_type_descriptor(mesh.position(0));
83 finish_construct_vbos_base(ctx, triangle_element_buffer, edge_element_buffer);
84 construct_draw_calls(ctx);
98 void draw_primitive(
cgv::render::context& ctx,
size_t primitive_index,
bool skip_opaque =
false,
bool skip_blended =
false,
bool use_materials =
true);
111 #include <cgv/config/lib_end.h>
std::vector< vec3i > material_primitive_start
index triple storing the material index, the primitive index and the offset (element index) in the tr...
Definition: mesh_render_info.h:24
compact type description of data that can be sent to the context; convertible to int
Definition: context.h:36
size_t nr_triangle_elements
number of triangles in the triangulation
Definition: mesh_render_info.h:36
size_t nr_vertices
number of vertices
Definition: mesh_render_info.h:32
bool include_normals
store whether normals are in vbo
Definition: mesh_render_info.h:28
size_t element_size
size of single coordinate
Definition: mesh_render_info.h:38
size_t get_nr_primitives() const
return number of mesh primitives
Definition: mesh_render_info.h:87
Definition: vertex_buffer.h:13
size_t get_nr_fragments() const
return number of mesh fragments that are of distinct primitive and material
Definition: mesh_render_info.h:91
cgv::render::type_descriptor tex_coords_descr
type description of tex coordinate attribute
Definition: mesh_render_info.h:44
size_t nr_edge_elements
number of edges in the wireframe representation
Definition: mesh_render_info.h:34
Definition: shader_program.h:25
Definition: render_info.h:76
size_t color_increment
color type size in bytes
Definition: mesh_render_info.h:46
cgv::render::type_descriptor position_descr
type description of position attribute
Definition: mesh_render_info.h:42
draw_call wire_draw_call
draw call for wireframe rendering
Definition: mesh_render_info.h:40
bool include_tex_coords
store whether tex coords are in vbo
Definition: mesh_render_info.h:26
const std::string & get_primitive_name(size_t i) const
return name of i-th mesh primitive
Definition: mesh_render_info.h:89
bool is_constructed() const
check whether vbos are constructed
Definition: mesh_render_info.h:63
size_t get_material_index(size_t i) const
return material index of i-th fragment
Definition: mesh_render_info.h:93
cgv::math::fvec< idx_type, 3 > vec3i
index triple type
Definition: mesh_render_info.h:19
void construct(cgv::render::context &ctx, cgv::media::mesh::simple_mesh< T > &mesh)
construct mesh render info from a given simple mesh and store attributes in vertex buffer objects
Definition: mesh_render_info.h:68
Definition: mesh_render_info.h:16
size_t get_primitive_index(size_t i) const
return group index of i-th fragment
Definition: mesh_render_info.h:95
std::vector< std::string > primitive_names
store list of primitive names
Definition: mesh_render_info.h:22
the cgv namespace
Definition: vr_calib.cxx:9
Definition: context.h:525
bool is_bound() const
check whether attribute array binding is bound
Definition: mesh_render_info.h:65
cgv::media::ColorType ct
color type
Definition: mesh_render_info.h:48
bool include_colors
store whether colors are in vbo
Definition: mesh_render_info.h:30