MeVisLab Toolbox Reference
mlOpenGLSystem.h File Reference
#include <ThirdPartyWarningsDisable.h>
#include <iostream>
#include <vector>
#include <string>
#include <ThirdPartyWarningsRestore.h>

Go to the source code of this file.

Macros

#define MLOPENGL_EXPORT   ML_LIBRARY_IMPORT_ATTRIBUTE
 
#define SO_MEVISLAB_ERR_POST(OSTREAM_VAL)
 Post an error string stream OSTREAM_VAL to the OpenInventor error handler which is redirected to the ML error handler; note that header Inventor/errors/SoDebugError.h, and the classes std::string and std::stringstream must be available to make this macro work.
 
#define MEVISLAB_CHECK_AND_POST_OPENGL_ERROR(FUNC_NAME)
 A helper macro to check and print OpenGL error states whose argument FUNC_NAME is the name of the function in which the error occurred; see SO_MEVISLAB_ERR_POST for requirements.
 
Namespace for mlUtils

System specific macro definitions

#define ML_OPENGL_NAMESPACE   ml
 Define the namespace name like in the ML. Default is 'ml'.
 
#define ML_OPENGL_START_NAMESPACE   namespace ML_OPENGL_NAMESPACE {
 Macro to put all following stuff into the namespace ML_NAMESPACE to avoid collisions with symbols of other libraries.
 
#define ML_OPENGL_END_NAMESPACE   }
 Closes the namespace for all ML stuff after the usage of ML_UTILS_START_NAMESPACE.
 

Macro Definition Documentation

◆ MEVISLAB_CHECK_AND_POST_OPENGL_ERROR

#define MEVISLAB_CHECK_AND_POST_OPENGL_ERROR ( FUNC_NAME)
Value:
{ \
const GLenum err = glGetError(); \
if (GL_OUT_OF_MEMORY == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Out of memory error" << std::endl); } \
else if (GL_INVALID_ENUM == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Invalid enum" << std::endl); } \
else if (GL_INVALID_VALUE == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Invalid value" << std::endl); } \
else if (GL_INVALID_OPERATION == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Invalid operation" << std::endl); } \
else if (GL_STACK_OVERFLOW == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Stack overflow" << std::endl); } \
else if (GL_STACK_UNDERFLOW == err){ SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Stack underflow" << std::endl); } \
else { SO_MEVISLAB_ERR_POST(FUNC_NAME << ":Non standard OpenGL error with id " << err << " detected" << std::endl); } \
} \
}
#define SO_MEVISLAB_ERR_POST(OSTREAM_VAL)
Post an error string stream OSTREAM_VAL to the OpenInventor error handler which is redirected to the ...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.

A helper macro to check and print OpenGL error states whose argument FUNC_NAME is the name of the function in which the error occurred; see SO_MEVISLAB_ERR_POST for requirements.

This macro will post errors with OpenInventor SoDebugError::post function.

Definition at line 79 of file mlOpenGLSystem.h.

◆ ML_OPENGL_END_NAMESPACE

#define ML_OPENGL_END_NAMESPACE   }

Closes the namespace for all ML stuff after the usage of ML_UTILS_START_NAMESPACE.

Definition at line 37 of file mlOpenGLSystem.h.

◆ ML_OPENGL_NAMESPACE

#define ML_OPENGL_NAMESPACE   ml

Define the namespace name like in the ML. Default is 'ml'.

Definition at line 25 of file mlOpenGLSystem.h.

◆ ML_OPENGL_START_NAMESPACE

#define ML_OPENGL_START_NAMESPACE   namespace ML_OPENGL_NAMESPACE {

Macro to put all following stuff into the namespace ML_NAMESPACE to avoid collisions with symbols of other libraries.

Use ML_OPENGL_END_NAMESPACE to close the namespace.

Definition at line 32 of file mlOpenGLSystem.h.

◆ MLOPENGL_EXPORT

#define MLOPENGL_EXPORT   ML_LIBRARY_IMPORT_ATTRIBUTE

Definition at line 54 of file mlOpenGLSystem.h.

◆ SO_MEVISLAB_ERR_POST

#define SO_MEVISLAB_ERR_POST ( OSTREAM_VAL)
Value:
{ \
std::stringstream stroutVal; \
std::string stdStrBuf = stroutVal.str(); \
SoDebugError::post(stdStrBuf.c_str(), ""); \
}

Post an error string stream OSTREAM_VAL to the OpenInventor error handler which is redirected to the ML error handler; note that header Inventor/errors/SoDebugError.h, and the classes std::string and std::stringstream must be available to make this macro work.

Definition at line 65 of file mlOpenGLSystem.h.