libigl v2.5.0
Loading...
Searching...
No Matches
igl::opengl::MeshGL Class Reference

Coverts mesh data inside a igl::ViewerData class in an OpenGL compatible format The class includes a shader and the opengl calls to plot the data. More...

#include <MeshGL.h>

Classes

struct  TextGL
 

Public Types

enum  DirtyFlags {
  DIRTY_NONE = 0x0000 , DIRTY_POSITION = 0x0001 , DIRTY_UV = 0x0002 , DIRTY_NORMAL = 0x0004 ,
  DIRTY_AMBIENT = 0x0008 , DIRTY_DIFFUSE = 0x0010 , DIRTY_SPECULAR = 0x0020 , DIRTY_TEXTURE = 0x0040 ,
  DIRTY_FACE = 0x0080 , DIRTY_MESH = 0x00FF , DIRTY_OVERLAY_LINES = 0x0100 , DIRTY_OVERLAY_POINTS = 0x0200 ,
  DIRTY_VERTEX_LABELS = 0x0400 , DIRTY_FACE_LABELS = 0x0800 , DIRTY_CUSTOM_LABELS = 0x1000 , DIRTY_ALL = 0xFFFF
}
 Bitmask flags for keeping track of what needs to be (re)-uploaded to the GPU. More...
 
typedef unsigned int GLuint
 
typedef unsigned int GLint
 
typedef Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > RowMatrixXf
 

Public Member Functions

 MeshGL ()
 
void init ()
 Initialize shaders and buffers.
 
void free ()
 Release all resources.
 
void init_buffers ()
 Create a new set of OpenGL buffer objects.
 
void bind_mesh ()
 Bind the underlying OpenGL buffer objects for subsequent mesh draw calls.
 
void draw_mesh (bool solid)
 Draw the currently buffered mesh (either solid or wireframe)
 
void bind_overlay_lines ()
 Bind the underlying OpenGL buffer objects for subsequent line overlay draw calls.
 
void draw_overlay_lines ()
 Draw the currently buffered line overlay.
 
void bind_overlay_points ()
 Bind the underlying OpenGL buffer objects for subsequent point overlay draw calls.
 
void draw_overlay_points ()
 Draw the currently buffered point overlay.
 
void init_text_rendering ()
 Text Binding and Draw functions.
 
void bind_labels (const TextGL &labels)
 Bind the underlying OpenGL buffer objects for subsequent text draw calls.
 
void draw_labels (const TextGL &labels)
 Draw the currently buffered text.
 
void free_buffers ()
 Release the OpenGL buffer objects.
 

Public Attributes

bool is_initialized = false
 
GLuint vao_mesh
 
GLuint vao_overlay_lines
 
GLuint vao_overlay_points
 
GLuint shader_mesh
 
GLuint shader_overlay_lines
 
GLuint shader_overlay_points
 
GLuint shader_text
 
GLuint vbo_V
 Vertices of the current mesh (#V x 3)
 
GLuint vbo_V_uv
 UV coordinates for the current mesh (#V x 2)
 
GLuint vbo_V_normals
 Vertices of the current mesh (#V x 3)
 
GLuint vbo_V_ambient
 Ambient material (#V x 3)
 
GLuint vbo_V_diffuse
 Diffuse material (#V x 3)
 
GLuint vbo_V_specular
 Specular material (#V x 3)
 
GLuint vbo_F
 Faces of the mesh (#F x 3)
 
GLuint vbo_tex
 Texture.
 
GLuint vbo_lines_F
 Indices of the line overlay.
 
GLuint vbo_lines_V
 Vertices of the line overlay.
 
GLuint vbo_lines_V_colors
 Color values of the line overlay.
 
GLuint vbo_points_F
 Indices of the point overlay.
 
GLuint vbo_points_V
 Vertices of the point overlay.
 
GLuint vbo_points_V_colors
 Color values of the point overlay.
 
RowMatrixXf V_vbo
 
RowMatrixXf V_normals_vbo
 
RowMatrixXf V_ambient_vbo
 
RowMatrixXf V_diffuse_vbo
 
RowMatrixXf V_specular_vbo
 
RowMatrixXf V_uv_vbo
 
RowMatrixXf lines_V_vbo
 
RowMatrixXf lines_V_colors_vbo
 
RowMatrixXf points_V_vbo
 
RowMatrixXf points_V_colors_vbo
 
TextGL vertex_labels
 
TextGL face_labels
 
TextGL custom_labels
 
GLuint font_atlas
 
int tex_u
 
int tex_v
 
GLint tex_filter
 
GLint tex_wrap
 
Eigen::Matrix< char, Eigen::Dynamic, 1 > tex
 
Eigen::Matrix< unsigned, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > F_vbo
 
Eigen::Matrix< unsigned, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > lines_F_vbo
 
Eigen::Matrix< unsigned, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > points_F_vbo
 
uint32_t dirty
 Marks dirty buffers that need to be uploaded to OpenGL.
 

Detailed Description

Coverts mesh data inside a igl::ViewerData class in an OpenGL compatible format The class includes a shader and the opengl calls to plot the data.

Member Typedef Documentation

◆ GLuint

typedef unsigned int igl::opengl::MeshGL::GLuint

◆ GLint

typedef unsigned int igl::opengl::MeshGL::GLint

◆ RowMatrixXf

typedef Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor> igl::opengl::MeshGL::RowMatrixXf

Member Enumeration Documentation

◆ DirtyFlags

Bitmask flags for keeping track of what needs to be (re)-uploaded to the GPU.

Enumerator
DIRTY_NONE 
DIRTY_POSITION 
DIRTY_UV 
DIRTY_NORMAL 
DIRTY_AMBIENT 
DIRTY_DIFFUSE 
DIRTY_SPECULAR 
DIRTY_TEXTURE 
DIRTY_FACE 
DIRTY_MESH 
DIRTY_OVERLAY_LINES 
DIRTY_OVERLAY_POINTS 
DIRTY_VERTEX_LABELS 
DIRTY_FACE_LABELS 
DIRTY_CUSTOM_LABELS 
DIRTY_ALL 

Constructor & Destructor Documentation

◆ MeshGL()

igl::opengl::MeshGL::MeshGL ( )

Member Function Documentation

◆ init()

void igl::opengl::MeshGL::init ( )

Initialize shaders and buffers.

◆ free()

void igl::opengl::MeshGL::free ( )

Release all resources.

◆ init_buffers()

void igl::opengl::MeshGL::init_buffers ( )

Create a new set of OpenGL buffer objects.

◆ bind_mesh()

void igl::opengl::MeshGL::bind_mesh ( )

Bind the underlying OpenGL buffer objects for subsequent mesh draw calls.

◆ draw_mesh()

void igl::opengl::MeshGL::draw_mesh ( bool  solid)

Draw the currently buffered mesh (either solid or wireframe)

Parameters
[in]solidWhether to draw the mesh as a solid or wireframe

◆ bind_overlay_lines()

void igl::opengl::MeshGL::bind_overlay_lines ( )

Bind the underlying OpenGL buffer objects for subsequent line overlay draw calls.

◆ draw_overlay_lines()

void igl::opengl::MeshGL::draw_overlay_lines ( )

Draw the currently buffered line overlay.

◆ bind_overlay_points()

void igl::opengl::MeshGL::bind_overlay_points ( )

Bind the underlying OpenGL buffer objects for subsequent point overlay draw calls.

◆ draw_overlay_points()

void igl::opengl::MeshGL::draw_overlay_points ( )

Draw the currently buffered point overlay.

◆ init_text_rendering()

void igl::opengl::MeshGL::init_text_rendering ( )

Text Binding and Draw functions.

◆ bind_labels()

void igl::opengl::MeshGL::bind_labels ( const TextGL labels)

Bind the underlying OpenGL buffer objects for subsequent text draw calls.

◆ draw_labels()

void igl::opengl::MeshGL::draw_labels ( const TextGL labels)

Draw the currently buffered text.

◆ free_buffers()

void igl::opengl::MeshGL::free_buffers ( )

Release the OpenGL buffer objects.

Member Data Documentation

◆ is_initialized

bool igl::opengl::MeshGL::is_initialized = false

◆ vao_mesh

GLuint igl::opengl::MeshGL::vao_mesh

◆ vao_overlay_lines

GLuint igl::opengl::MeshGL::vao_overlay_lines

◆ vao_overlay_points

GLuint igl::opengl::MeshGL::vao_overlay_points

◆ shader_mesh

GLuint igl::opengl::MeshGL::shader_mesh

◆ shader_overlay_lines

GLuint igl::opengl::MeshGL::shader_overlay_lines

◆ shader_overlay_points

GLuint igl::opengl::MeshGL::shader_overlay_points

◆ shader_text

GLuint igl::opengl::MeshGL::shader_text

◆ vbo_V

GLuint igl::opengl::MeshGL::vbo_V

Vertices of the current mesh (#V x 3)

◆ vbo_V_uv

GLuint igl::opengl::MeshGL::vbo_V_uv

UV coordinates for the current mesh (#V x 2)

◆ vbo_V_normals

GLuint igl::opengl::MeshGL::vbo_V_normals

Vertices of the current mesh (#V x 3)

◆ vbo_V_ambient

GLuint igl::opengl::MeshGL::vbo_V_ambient

Ambient material (#V x 3)

◆ vbo_V_diffuse

GLuint igl::opengl::MeshGL::vbo_V_diffuse

Diffuse material (#V x 3)

◆ vbo_V_specular

GLuint igl::opengl::MeshGL::vbo_V_specular

Specular material (#V x 3)

◆ vbo_F

GLuint igl::opengl::MeshGL::vbo_F

Faces of the mesh (#F x 3)

◆ vbo_tex

GLuint igl::opengl::MeshGL::vbo_tex

Texture.

◆ vbo_lines_F

GLuint igl::opengl::MeshGL::vbo_lines_F

Indices of the line overlay.

◆ vbo_lines_V

GLuint igl::opengl::MeshGL::vbo_lines_V

Vertices of the line overlay.

◆ vbo_lines_V_colors

GLuint igl::opengl::MeshGL::vbo_lines_V_colors

Color values of the line overlay.

◆ vbo_points_F

GLuint igl::opengl::MeshGL::vbo_points_F

Indices of the point overlay.

◆ vbo_points_V

GLuint igl::opengl::MeshGL::vbo_points_V

Vertices of the point overlay.

◆ vbo_points_V_colors

GLuint igl::opengl::MeshGL::vbo_points_V_colors

Color values of the point overlay.

◆ V_vbo

RowMatrixXf igl::opengl::MeshGL::V_vbo

◆ V_normals_vbo

RowMatrixXf igl::opengl::MeshGL::V_normals_vbo

◆ V_ambient_vbo

RowMatrixXf igl::opengl::MeshGL::V_ambient_vbo

◆ V_diffuse_vbo

RowMatrixXf igl::opengl::MeshGL::V_diffuse_vbo

◆ V_specular_vbo

RowMatrixXf igl::opengl::MeshGL::V_specular_vbo

◆ V_uv_vbo

RowMatrixXf igl::opengl::MeshGL::V_uv_vbo

◆ lines_V_vbo

RowMatrixXf igl::opengl::MeshGL::lines_V_vbo

◆ lines_V_colors_vbo

RowMatrixXf igl::opengl::MeshGL::lines_V_colors_vbo

◆ points_V_vbo

RowMatrixXf igl::opengl::MeshGL::points_V_vbo

◆ points_V_colors_vbo

RowMatrixXf igl::opengl::MeshGL::points_V_colors_vbo

◆ vertex_labels

TextGL igl::opengl::MeshGL::vertex_labels

◆ face_labels

TextGL igl::opengl::MeshGL::face_labels

◆ custom_labels

TextGL igl::opengl::MeshGL::custom_labels

◆ font_atlas

GLuint igl::opengl::MeshGL::font_atlas

◆ tex_u

int igl::opengl::MeshGL::tex_u

◆ tex_v

int igl::opengl::MeshGL::tex_v

◆ tex_filter

GLint igl::opengl::MeshGL::tex_filter

◆ tex_wrap

GLint igl::opengl::MeshGL::tex_wrap

◆ tex

Eigen::Matrix<char,Eigen::Dynamic,1> igl::opengl::MeshGL::tex

◆ F_vbo

Eigen::Matrix<unsigned, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> igl::opengl::MeshGL::F_vbo

◆ lines_F_vbo

Eigen::Matrix<unsigned, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> igl::opengl::MeshGL::lines_F_vbo

◆ points_F_vbo

Eigen::Matrix<unsigned, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> igl::opengl::MeshGL::points_F_vbo

◆ dirty

uint32_t igl::opengl::MeshGL::dirty

Marks dirty buffers that need to be uploaded to OpenGL.


The documentation for this class was generated from the following file: