LibrePCB Developers Documentation
OpenGlView Class Referencefinal

OpenGL 3D viewer widget. More...

#include <openglview.h>

Inherits QOpenGLWidget, and QOpenGLFunctions.

+ Collaboration diagram for OpenGlView:

Public Member Functions

 OpenGlView (QWidget *parent=nullptr) noexcept
 
 OpenGlView (const OpenGlView &other)=delete
 
virtual ~OpenGlView () noexcept
 
qint64 getIdleTimeMs () const noexcept
 
void addObject (std::shared_ptr< OpenGlObject > obj) noexcept
 
void removeObject (std::shared_ptr< OpenGlObject > obj) noexcept
 
void setObjects (const QVector< std::shared_ptr< OpenGlObject >> &objs) noexcept
 
void zoomIn () noexcept
 
void zoomOut () noexcept
 
void zoomAll () noexcept
 
void startSpinning () noexcept
 
void stopSpinning (QString errorMsg) noexcept
 
OpenGlViewoperator= (const OpenGlView &rhs)=delete
 

Protected Member Functions

void mousePressEvent (QMouseEvent *e) override
 
void mouseMoveEvent (QMouseEvent *e) override
 
void wheelEvent (QWheelEvent *e) override
 
void smoothTo (const QMatrix4x4 &transform) noexcept
 
void initializeGL () override
 
void resizeGL (int w, int h) override
 
void paintGL () override
 

Private Attributes

QScopedPointer< QVBoxLayout > mLayout
 
QScopedPointer< QLabel > mErrorLabel
 
bool mInitialized
 
QOpenGLShaderProgram mProgram
 
QMatrix4x4 mProjection
 
QMatrix4x4 mTransform
 
QMatrix4x4 mMousePressTransform
 
QVector2D mMousePressPosition
 
qint64 mIdleTimeMs
 
QScopedPointer< WaitingSpinnerWidgetmWaitingSpinner
 
QMatrix4x4 mAnimationTransformStart
 
QMatrix4x4 mAnimationTransformDelta
 
QScopedPointer< QVariantAnimation > mAnimation
 
QVector< std::shared_ptr< OpenGlObject > > mObjects
 

Static Private Attributes

static constexpr qreal sZoomStepFactor = 1.3
 

Detailed Description

OpenGL 3D viewer widget.

Constructor & Destructor Documentation

◆ OpenGlView() [1/2]

OpenGlView ( QWidget *  parent = nullptr)
explicitnoexcept

◆ OpenGlView() [2/2]

OpenGlView ( const OpenGlView other)
delete

◆ ~OpenGlView()

~OpenGlView ( )
virtualnoexcept

Member Function Documentation

◆ getIdleTimeMs()

qint64 getIdleTimeMs ( ) const
inlinenoexcept
+ Here is the call graph for this function:

◆ addObject()

void addObject ( std::shared_ptr< OpenGlObject obj)
noexcept
+ Here is the caller graph for this function:

◆ removeObject()

void removeObject ( std::shared_ptr< OpenGlObject obj)
noexcept
+ Here is the caller graph for this function:

◆ setObjects()

void setObjects ( const QVector< std::shared_ptr< OpenGlObject >> &  objs)
noexcept
+ Here is the caller graph for this function:

◆ zoomIn()

void zoomIn ( )
noexcept
+ Here is the caller graph for this function:

◆ zoomOut()

void zoomOut ( )
noexcept
+ Here is the caller graph for this function:

◆ zoomAll()

void zoomAll ( )
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startSpinning()

void startSpinning ( )
noexcept
+ Here is the caller graph for this function:

◆ stopSpinning()

void stopSpinning ( QString  errorMsg)
noexcept
+ Here is the caller graph for this function:

◆ operator=()

OpenGlView& operator= ( const OpenGlView rhs)
delete
+ Here is the caller graph for this function:

◆ mousePressEvent()

void mousePressEvent ( QMouseEvent *  e)
overrideprotected
+ Here is the caller graph for this function:

◆ mouseMoveEvent()

void mouseMoveEvent ( QMouseEvent *  e)
overrideprotected
+ Here is the caller graph for this function:

◆ wheelEvent()

void wheelEvent ( QWheelEvent *  e)
overrideprotected
+ Here is the caller graph for this function:

◆ smoothTo()

void smoothTo ( const QMatrix4x4 &  transform)
protectednoexcept
+ Here is the caller graph for this function:

◆ initializeGL()

void initializeGL ( )
overrideprotected
+ Here is the caller graph for this function:

◆ resizeGL()

void resizeGL ( int  w,
int  h 
)
overrideprotected
+ Here is the caller graph for this function:

◆ paintGL()

void paintGL ( )
overrideprotected
+ Here is the caller graph for this function:

Member Data Documentation

◆ mLayout

QScopedPointer<QVBoxLayout> mLayout
private

◆ mErrorLabel

QScopedPointer<QLabel> mErrorLabel
private

◆ mInitialized

bool mInitialized
private

◆ mProgram

QOpenGLShaderProgram mProgram
private

◆ mProjection

QMatrix4x4 mProjection
private

◆ mTransform

QMatrix4x4 mTransform
private

◆ mMousePressTransform

QMatrix4x4 mMousePressTransform
private

◆ mMousePressPosition

QVector2D mMousePressPosition
private

◆ mIdleTimeMs

qint64 mIdleTimeMs
private

◆ mWaitingSpinner

QScopedPointer<WaitingSpinnerWidget> mWaitingSpinner
private

◆ mAnimationTransformStart

QMatrix4x4 mAnimationTransformStart
private

◆ mAnimationTransformDelta

QMatrix4x4 mAnimationTransformDelta
private

◆ mAnimation

QScopedPointer<QVariantAnimation> mAnimation
private

◆ mObjects

QVector<std::shared_ptr<OpenGlObject> > mObjects
private

◆ sZoomStepFactor

constexpr qreal sZoomStepFactor = 1.3
staticprivate

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