GLWidget Library
A minimal, plugin-based OpenGL widget
GLWidget Class Reference

#include <glwidget.h>

+ Inheritance diagram for GLWidget:

Public Slots

PLUGINGLWIDGET_EXPORT void addObject ()
 
PLUGINGLWIDGET_EXPORT void addObjectFromFile (const QString &filename)
 
PLUGINGLWIDGET_EXPORT void clearScene ()
 
PLUGINGLWIDGET_EXPORT void resetCamera ()
 
PLUGINGLWIDGET_EXPORT void drawAxes ()
 
PLUGINGLWIDGET_EXPORT void drawPoint (const Vector &pos, float r, float g, float b)
 
PLUGINGLWIDGET_EXPORT Box boundingBoxIncludingAxes ()
 
PLUGINGLWIDGET_EXPORT void loadPlugin ()
 
PLUGINGLWIDGET_EXPORT int loadPlugins (const QStringList &list)
 
PLUGINGLWIDGET_EXPORT void loadDefaultPlugins (QString &plugins)
 
void resetPluginsToDefaults ()
 
void unloadPlugin (int i)
 

Public Member Functions

PLUGINGLWIDGET_EXPORT GLWidget (const string &args)
 
PLUGINGLWIDGET_EXPORT Scene * scene ()
 
PLUGINGLWIDGET_EXPORT Camera * camera ()
 
PLUGINGLWIDGET_EXPORT QOpenGLShaderProgram * defaultProgram ()
 
PLUGINGLWIDGET_EXPORT void setPluginPath (const QString &)
 
PLUGINGLWIDGET_EXPORT const QString & getPluginPath () const
 

Detailed Description

/class GLWidget /brief The GLWidget class handles OpenGL rendering through plugins.

Constructor & Destructor Documentation

GLWidget::GLWidget ( const string &  args)

Creates a GLWidget.

Member Function Documentation

void GLWidget::addObject ( )
slot

Opens a file dialog enabling the user to select one or more OBJ files to add to the scene. All loaded plugins get their onObjectAdd() method invoked for each loaded object.

void GLWidget::addObjectFromFile ( const QString &  filename)
slot

Adds an OBJ file to the scene. All loaded plugins get their onObjectAdd() method invoked.

Box GLWidget::boundingBoxIncludingAxes ( )
slot

Returns the bounding box of the scene, enlarged to include also a representation of the world axes.

Camera * GLWidget::camera ( )

Returns a pointer to the camera.

void GLWidget::clearScene ( )
slot

Clears the scene (removes all OBJs) All loaded plugins get their onSceneClear() method invoked.

QOpenGLShaderProgram * GLWidget::defaultProgram ( )

Returns a basic, default shader program

void GLWidget::drawAxes ( )
slot

Draws three lines representing world space axes.

void GLWidget::drawPoint ( const Vector &  pos,
float  r,
float  g,
float  b 
)
slot

Draws a point at the given 3D position with the given color.

const QString & GLWidget::getPluginPath ( ) const

Gets the path where the plugin dynamic libraries are.

void GLWidget::loadDefaultPlugins ( QString &  plugins)
slot

Loads default plugins.

void GLWidget::loadPlugin ( )
slot

Opens a file dialog enabling the user to select one or more plugins to load. After loading each plugin, its onPluginLoad() method is invoked.

int GLWidget::loadPlugins ( const QStringList &  list)
slot

Loads one plugins and calls its onPluginLoad() method.

void GLWidget::resetCamera ( )
slot

Resets the camera so that the whole scene (including world axes) is visible.

void GLWidget::resetPluginsToDefaults ( )
slot

Unloads all non-default plugins.

Scene * GLWidget::scene ( )

Returns a pointer to the 3D scene.

void GLWidget::setPluginPath ( const QString &  p)

Sets the path where plugins will be searched into.

void GLWidget::unloadPlugin ( int  i)
slot

Unloads plugin at position i, if within range. otherwise == NOP.