|
AvogadroLibs 2.1.0-20261111
|
QOpenGLGLWidget derived object for displaying 3D molecular geometry. More...
#include <avogadro/qtopengl/glwidget.h>
Public Slots | |
| void | updateScene () |
| void | updateMolecule () |
| void | clearScene () |
| void | resetCamera () |
| void | resetGeometry () |
| void | setTools (const QList< QtGui::ToolPlugin * > &toolList) |
| void | addTool (QtGui::ToolPlugin *tool) |
| void | requestUpdate () |
| void | setActiveTool (const QString &name) |
| void | setActiveTool (QtGui::ToolPlugin *tool) |
| void | setDefaultTool (const QString &name) |
| void | setDefaultTool (QtGui::ToolPlugin *tool) |
Signals | |
| void | rendererInvalid () |
Public Member Functions | |
| GLWidget (QWidget *parent=nullptr) | |
| void | setMolecule (QtGui::Molecule *molecule) |
| Rendering::GLRenderer & | renderer () |
| QList< QtGui::ToolPlugin * > | tools () const |
| QtGui::ToolPlugin * | activeTool () const |
| QtGui::ToolPlugin * | defaultTool () const |
| bool | isValid () const |
| QString | error () const |
| Qt::KeyboardModifiers | navigationModifier () const |
| Modifier reserved for camera navigation. | |
| void | setNavigationModifier (Qt::KeyboardModifiers modifier) |
| QtGui::Molecule * | molecule () |
| const QtGui::Molecule * | molecule () const |
| QtGui::ScenePluginModel & | sceneModel () |
| const QtGui::ScenePluginModel & | sceneModel () const |
Protected Member Functions | |
| void | initializeGL () override |
| void | resizeGL (int width, int height) override |
| void | paintGL () override |
| void | mouseDoubleClickEvent (QMouseEvent *) override |
| void | mousePressEvent (QMouseEvent *) override |
| void | mouseMoveEvent (QMouseEvent *) override |
| void | mouseReleaseEvent (QMouseEvent *) override |
| void | wheelEvent (QWheelEvent *) override |
| void | keyPressEvent (QKeyEvent *) override |
| void | keyReleaseEvent (QKeyEvent *) override |
This class creates the GL context, and contains a renderer to render the 3D molecular geometry.
The GLWidget also manages a collection of ToolPlugins that are used to respond to user input events. Use setTools() or addTool() to add tools to the widget. Use setActiveTool() to indicate which tool is active. The active tool will be given the opportunity to handle input events first. If the active tool does not handle the event, the default tool will be used. If the default tool also ignores the event, it will be passed to QOpenGLWidget's handlers.
| void setMolecule | ( | QtGui::Molecule * | molecule | ) |
Set the molecule the widget will render.
| QtGui::Molecule * molecule | ( | ) |
Get the molecule being rendered by the widget.
| const QtGui::Molecule * molecule | ( | ) | const |
Get the molecule being rendered by the widget.
| Rendering::GLRenderer & renderer | ( | ) |
Get a reference to the renderer for the widget.
| QList< QtGui::ToolPlugin * > tools | ( | ) | const |
| QtGui::ToolPlugin * activeTool | ( | ) | const |
| QtGui::ToolPlugin * defaultTool | ( | ) | const |
| QtGui::ScenePluginModel & sceneModel | ( | ) |
Get the GLWidget's ScenePluginModel, used to add, delete and modify the scene plugin items.
| const QtGui::ScenePluginModel & sceneModel | ( | ) | const |
Get the GLWidget's ScenePluginModel, used to add, delete and modify the scene plugin items.
| bool isValid | ( | ) | const |
Check if the GLWidget was able to acquire a context, and set up the renderer correctly. If not valid, the error method may provide more information.
| QString error | ( | ) | const |
Get the error(s), if any, encountered when setting up the GLWidget.
| Qt::KeyboardModifiers navigationModifier | ( | ) | const |
A mouse gesture carrying this modifier is routed to the default (navigation) tool regardless of which tool is currently active. Defaults to Qt::AltModifier and is persisted in QSettings.
|
slot |
Update the scene plugins for the widget, this will generate geometry in the scene etc.
|
slot |
Request update of molecule properties (e.g., dipole moment)
|
slot |
Clear the contents of the scene.
|
slot |
Reset the view to fit the entire scene.
|
slot |
Reset the geometry when the molecule etc changes.
|
slot |
|
slot |
|
slot |
Set the active tool. This is the tool that will be used to handle input events first.
|
slot |
Set the active tool. This is the tool that will be used to handle input events first.
|
slot |
Set the default tool. This is the tool that will be used to handle input events that are ignored by the active tool.
|
slot |
Set the default tool. This is the tool that will be used to handle input events that are ignored by the active tool.
|
slot |
Request a repaint. Multiple requests before the next frame are compressed into one, so camera moves stay interactive.
|
overrideprotected |
This is where the GL context is initialized.
|
overrideprotected |
Take care of resizing the context.
|
overrideprotected |
Main entry point for all GL rendering.
|
overrideprotected |
Reimplemented from QOpenGLWidget
|
overrideprotected |
Reimplemented from QOpenGLWidget
|
overrideprotected |
Reimplemented from QOpenGLWidget
|
overrideprotected |
Reimplemented from QOpenGLWidget
|
overrideprotected |
Reimplemented from QOpenGLWidget
|
overrideprotected |
Reimplemented from QOpenGLWidget
|
overrideprotected |
Reimplemented from QOpenGLWidget