moveit2
The MoveIt Motion Planning Framework for ROS 2.
Public Member Functions | List of all members
mesh_filter::GLRenderer Class Reference

Abstracts the OpenGL frame buffer objects, and provides an interface to render meshes, and retrieve the color and depth ap from opengl. More...

#include <gl_renderer.h>

Public Member Functions

 GLRenderer (unsigned width, unsigned height, float near=0.1, float far=10.0)
 constructs the frame buffer object in a new OpenGL context. More...
 
 ~GLRenderer ()
 destructor, destroys frame buffer objects and OpenGL context More...
 
void begin () const
 initializes the frame buffers for rendering and or manipulating More...
 
void end () const
 finalizes the frame buffers after rendering and/or manipulating More...
 
void callList (GLuint list) const
 executes a OpenGL list More...
 
void getColorBuffer (unsigned char *buffer) const
 retrieves the color buffer from OpenGL More...
 
void getDepthBuffer (float *buffer) const
 retrieves the depth buffer from OpenGL More...
 
GLuint setShadersFromFile (const std::string &vertex_filename, const std::string &fragment_filename)
 loads, compiles, links and adds GLSL shaders from files to the current OpenGL context. More...
 
GLuint setShadersFromString (const std::string &vertex_shader, const std::string &fragment_shader)
 loads, compiles, links and adds GLSL shaders from string to the current OpenGL context. More...
 
void setCameraParameters (float fx, float fy, float cx, float cy)
 set the camera parameters More...
 
void setClippingRange (float near, float far)
 sets the near and far clipping plane distances in meters More...
 
const float & getNearClippingDistance () const
 returns the distance of the near clipping plane in meters More...
 
const float & getFarClippingDistance () const
 returns the distance of the far clipping plane in meters More...
 
unsigned getWidth () const
 returns the width of the frame buffer objectsin pixels More...
 
unsigned getHeight () const
 returns the height of the frame buffer objects in pixels More...
 
void setBufferSize (unsigned width, unsigned height)
 set the size of fram buffers More...
 
const GLuint & getProgramID () const
 
GLuint getDepthTexture () const
 returns the handle of the depth buffer as an OpenGL texture object More...
 
GLuint getColorTexture () const
 returns the handle of the color buffer as an OpenGL texture object More...
 

Detailed Description

Abstracts the OpenGL frame buffer objects, and provides an interface to render meshes, and retrieve the color and depth ap from opengl.

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)

Definition at line 62 of file gl_renderer.h.

Constructor & Destructor Documentation

◆ GLRenderer()

mesh_filter::GLRenderer::GLRenderer ( unsigned  width,
unsigned  height,
float  near = 0.1,
float  far = 10.0 
)

constructs the frame buffer object in a new OpenGL context.

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Parameters
[in]widththe width of the frame buffers
[in]heightheight of the framebuffers
[in]neardistance of the near clipping plane in meters
[in]fardistance of the far clipping plane in meters

Definition at line 58 of file gl_renderer.cpp.

◆ ~GLRenderer()

mesh_filter::GLRenderer::~GLRenderer ( )

destructor, destroys frame buffer objects and OpenGL context

Definition at line 77 of file gl_renderer.cpp.

Member Function Documentation

◆ begin()

void mesh_filter::GLRenderer::begin ( ) const

initializes the frame buffers for rendering and or manipulating

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)

Definition at line 185 of file gl_renderer.cpp.

◆ callList()

void mesh_filter::GLRenderer::callList ( GLuint  list) const

executes a OpenGL list

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Parameters
[in]listthe handle of the OpenGL list to be executed

Definition at line 195 of file gl_renderer.cpp.

◆ end()

void mesh_filter::GLRenderer::end ( ) const

finalizes the frame buffers after rendering and/or manipulating

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)

Definition at line 202 of file gl_renderer.cpp.

◆ getColorBuffer()

void mesh_filter::GLRenderer::getColorBuffer ( unsigned char *  buffer) const

retrieves the color buffer from OpenGL

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Parameters
[out]bufferpointer to memory where the color values need to be stored

Definition at line 209 of file gl_renderer.cpp.

◆ getColorTexture()

GLuint mesh_filter::GLRenderer::getColorTexture ( ) const

returns the handle of the color buffer as an OpenGL texture object

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Returns
handle of the OpenGL texture object for the color buffer

Definition at line 435 of file gl_renderer.cpp.

◆ getDepthBuffer()

void mesh_filter::GLRenderer::getDepthBuffer ( float *  buffer) const

retrieves the depth buffer from OpenGL

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Parameters
[out]bufferpointer to memory where the depth values need to be stored

Definition at line 217 of file gl_renderer.cpp.

◆ getDepthTexture()

GLuint mesh_filter::GLRenderer::getDepthTexture ( ) const

returns the handle of the depth buffer as an OpenGL texture object

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Returns
handle of the OpenGL texture object for the depth buffer

Definition at line 440 of file gl_renderer.cpp.

◆ getFarClippingDistance()

const float & mesh_filter::GLRenderer::getFarClippingDistance ( ) const

returns the distance of the far clipping plane in meters

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Returns
distance of the far clipping plane in meters

Definition at line 254 of file gl_renderer.cpp.

◆ getHeight()

unsigned mesh_filter::GLRenderer::getHeight ( ) const

returns the height of the frame buffer objects in pixels

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Returns
height of frame buffer in pixels

Definition at line 450 of file gl_renderer.cpp.

◆ getNearClippingDistance()

const float & mesh_filter::GLRenderer::getNearClippingDistance ( ) const

returns the distance of the near clipping plane in meters

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Returns
distance of near clipping plane in meters

Definition at line 249 of file gl_renderer.cpp.

◆ getProgramID()

const GLuint & mesh_filter::GLRenderer::getProgramID ( ) const
Returns
the current programID
Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Returns
current porgamID. 0 if no shaders are used.

Definition at line 244 of file gl_renderer.cpp.

Here is the caller graph for this function:

◆ getWidth()

unsigned mesh_filter::GLRenderer::getWidth ( ) const

returns the width of the frame buffer objectsin pixels

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Returns
width of frame buffer in pixels

Definition at line 445 of file gl_renderer.cpp.

◆ setBufferSize()

void mesh_filter::GLRenderer::setBufferSize ( unsigned  width,
unsigned  height 
)

set the size of fram buffers

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Parameters
[in]widthwidth of frame buffer in pixels
[in]heightheight of frame buffer in pixels

Definition at line 84 of file gl_renderer.cpp.

Here is the caller graph for this function:

◆ setCameraParameters()

void mesh_filter::GLRenderer::setCameraParameters ( float  fx,
float  fy,
float  cx,
float  cy 
)

set the camera parameters

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Parameters
[in]fxfocal length in x-direction
[in]fyfocal length in y-direction
[in]cxx component of principal point
[in]cyy component of principal point

Definition at line 105 of file gl_renderer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setClippingRange()

void mesh_filter::GLRenderer::setClippingRange ( float  near,
float  far 
)

sets the near and far clipping plane distances in meters

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Parameters
[in]neardistance of the near clipping plane in meters
[in]fardistance of the far clipping plane in meters

Definition at line 95 of file gl_renderer.cpp.

Here is the caller graph for this function:

◆ setShadersFromFile()

GLuint mesh_filter::GLRenderer::setShadersFromFile ( const std::string &  vertex_filename,
const std::string &  fragment_filename 
)

loads, compiles, links and adds GLSL shaders from files to the current OpenGL context.

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Parameters
[in]vertex_filenamepath to vertex shader source code. Can set to "" (empty string) if no vertex shader is used.
[in]fragment_filenamepath to fragemnt shader source code. Can be set to "" if no fragment shader is used.
Returns
the programID

Definition at line 225 of file gl_renderer.cpp.

◆ setShadersFromString()

GLuint mesh_filter::GLRenderer::setShadersFromString ( const std::string &  vertex_shader,
const std::string &  fragment_shader 
)

loads, compiles, links and adds GLSL shaders from string to the current OpenGL context.

Author
Suat Gedikli (gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m)
Parameters
[in]vertex_shadersource code of the vertex shader. Can be "" if no vertex shader is used.
[in]fragment_shadersource code of the fragment shader. Can be "" if no fragment shader is used.
Returns
programID

Definition at line 238 of file gl_renderer.cpp.


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