cgv
Loading...
Searching...
No Matches
mesh_drawable.h
1
#pragma once
2
3
#include <cgv/render/textured_material.h>
4
#include <cgv/render/vertex_buffer.h>
5
#include <cgv/render/attribute_array_binding.h>
6
#include <cgv/media/mesh/simple_mesh.h>
7
#include <cgv/media/axis_aligned_box.h>
8
#include <cgv/render/drawable.h>
9
#include "mesh_render_info.h"
10
11
#include "lib_begin.h"
12
13
namespace
cgv
{
15
namespace
render {
17
namespace
gl {
18
19
21
class
CGV_API
mesh_drawable
:
public
cgv::render::drawable
22
{
23
public
:
25
typedef
cgv::media::mesh::simple_mesh<float>
mesh_type
;
26
protected
:
28
std::string
model_path
;
30
std::string
file_name
;
32
mesh_type
mesh;
34
mesh_render_info
mesh_info;
36
bool
rebuild_mesh_info;
38
box3
box
;
40
void
draw_mesh_primitive(
cgv::render::context
&ctx,
unsigned
pi,
bool
opaque,
bool
use_materials =
true
);
42
void
draw_mesh(
cgv::render::context
&ctx,
bool
opaque,
bool
use_materials =
true
);
44
46
void
center_view();
47
public
:
49
mesh_drawable
();
51
void
init_frame(
cgv::render::context
&ctx);
53
void
draw(
cgv::render::context
&ctx);
55
void
finish_draw(
context
&ctx);
57
virtual
bool
read_mesh(
const
std::string& file_name);
59
void
clear(
context
& ctx);
61
const
box3
& get_box()
const
;
62
};
63
64
}
65
}
66
}
67
#include <cgv/config/lib_end.h>
cgv::media::axis_aligned_box< float, 3 >
cgv::media::mesh::simple_mesh
the simple_mesh class is templated over the coordinate type that defaults to float
Definition
simple_mesh.h:249
cgv::render::context
base class for all drawables, which is independent of the used rendering API.
Definition
context.h:621
cgv::render::drawable
base class for all drawables, which is independent of the used rendering API.
Definition
drawable.h:15
cgv::render::gl::mesh_drawable
simple implementation of a drawable for a polygonal mesh with support for materials
Definition
mesh_drawable.h:22
cgv::render::gl::mesh_drawable::file_name
std::string file_name
currently loaded file name
Definition
mesh_drawable.h:30
cgv::render::gl::mesh_drawable::model_path
std::string model_path
default path to file names
Definition
mesh_drawable.h:28
cgv::render::gl::mesh_drawable::mesh_type
cgv::media::mesh::simple_mesh< float > mesh_type
type of mesh
Definition
mesh_drawable.h:25
cgv::render::gl::mesh_drawable::box
box3 box
the bounding box of the mesh is computed in the read_mesh method
Definition
mesh_drawable.h:38
cgv::render::mesh_render_info
the mesh_render_info structure manages vertex buffer objects for attribute and element buffers as wel...
Definition
mesh_render_info.h:16
cgv
the cgv namespace
Definition
print.h:11
libs
cgv_gl
gl
mesh_drawable.h
Generated by
1.9.8