moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
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, double near=0.1, double far=10.0)
 constructs the frame buffer object in a new OpenGL context.
 
 ~GLRenderer ()
 destructor, destroys frame buffer objects and OpenGL context
 
void begin () const
 initializes the frame buffers for rendering and or manipulating
 
void end () const
 finalizes the frame buffers after rendering and/or manipulating
 
void callList (GLuint list) const
 executes a OpenGL list
 
void getColorBuffer (unsigned char *buffer) const
 retrieves the color buffer from OpenGL
 
void getDepthBuffer (float *buffer) const
 retrieves the depth buffer from OpenGL
 
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.
 
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.
 
void setCameraParameters (double fx, double fy, double cx, double cy)
 set the camera parameters
 
void setClippingRange (double near, double far)
 sets the near and far clipping plane distances in meters
 
const double & getNearClippingDistance () const
 returns the distance of the near clipping plane in meters
 
const double & getFarClippingDistance () const
 returns the distance of the far clipping plane in meters
 
unsigned getWidth () const
 returns the width of the frame buffer objectsin pixels
 
unsigned getHeight () const
 returns the height of the frame buffer objects in pixels
 
void setBufferSize (unsigned width, unsigned height)
 set the size of frame buffers
 
const GLuint & getProgramID () const
 
GLuint getDepthTexture () const
 returns the handle of the depth buffer as an OpenGL texture object
 
GLuint getColorTexture () const
 returns the handle of the color buffer as an OpenGL texture object
 

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,
double  near = 0.1,
double  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 57 of file gl_renderer.cpp.

◆ ~GLRenderer()

mesh_filter::GLRenderer::~GLRenderer ( )

destructor, destroys frame buffer objects and OpenGL context

Definition at line 76 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 184 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 194 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 201 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 208 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 436 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 216 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 441 of file gl_renderer.cpp.

◆ getFarClippingDistance()

const double & 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 253 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 451 of file gl_renderer.cpp.

◆ getNearClippingDistance()

const double & 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 248 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 243 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 446 of file gl_renderer.cpp.

◆ setBufferSize()

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

set the size of frame 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 83 of file gl_renderer.cpp.

Here is the caller graph for this function:

◆ setCameraParameters()

void mesh_filter::GLRenderer::setCameraParameters ( double  fx,
double  fy,
double  cx,
double  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 104 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 ( double  near,
double  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 94 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 224 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 237 of file gl_renderer.cpp.


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