LibrePCB Developers Documentation
Loading...
Searching...
No Matches
SlintOpenGlView Class Referencefinal

The SlintOpenGlView class. More...

#include <slintopenglview.h>

Inherits QObject, and QOpenGLFunctions.

+ Collaboration diagram for SlintOpenGlView:

Signals

void stateChanged ()
 
void contentChanged ()
 

Public Member Functions

 SlintOpenGlView (const OpenGlProjection &projection=OpenGlProjection(), QObject *parent=nullptr) noexcept
 
 SlintOpenGlView (const SlintOpenGlView &other)=delete
 
virtual ~SlintOpenGlView () noexcept
 
bool isPanning () const noexcept
 
const QStringList & getOpenGlErrors () const noexcept
 
const OpenGlProjectiongetProjection () const noexcept
 
const QHash< OpenGlObject::Type, float > & getAlpha () 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 setAlpha (const QHash< OpenGlObject::Type, float > &alpha) noexcept
 
slint::Image render (float width, float height) noexcept
 
bool pointerEvent (const QPointF &pos, slint::private_api::PointerEvent e) noexcept
 
bool scrollEvent (const QPointF &pos, slint::private_api::PointerScrollEvent e) noexcept
 
void zoomIn () noexcept
 
void zoomOut () noexcept
 
void zoomAll () noexcept
 
SlintOpenGlViewoperator= (const SlintOpenGlView &rhs)=delete
 

Static Public Member Functions

static QColor getBackgroundColor () noexcept
 

Private Member Functions

void initializeGl () noexcept
 
void zoom (const QPointF &center, qreal factor) noexcept
 
void smoothTo (const OpenGlProjection &projection) noexcept
 
bool applyOpenGlProjection (const OpenGlProjection &projection) noexcept
 
QPointF toNormalizedPos (const QPointF &pos) const noexcept
 
QPointF toModelPos (const QPointF &pos) const noexcept
 

Private Attributes

std::unique_ptr< QOffscreenSurface > mSurface
 
std::unique_ptr< QOpenGLContext > mContext
 
std::unique_ptr< QOpenGLShaderProgram > mProgram
 
std::unique_ptr< QOpenGLFramebufferObject > mFbo
 
QStringList mErrors
 
QSizeF mViewSize
 
OpenGlProjection mProjection
 
QHash< OpenGlObject::Type, float > mAlpha
 
QPointF mMousePressPosition
 
QMatrix4x4 mMousePressTransform
 
QPointF mMousePressCenter
 
QSet< slint::private_api::PointerEventButton > mPressedMouseButtons
 
OpenGlProjection mAnimationDataStart
 
OpenGlProjection mAnimationDataDelta
 
QScopedPointer< QVariantAnimation > mAnimation
 
QVector< std::shared_ptr< OpenGlObject > > mObjects
 

Static Private Attributes

static constexpr qreal sCameraPosZ = 5.0
 

Detailed Description

The SlintOpenGlView class.

Constructor & Destructor Documentation

◆ SlintOpenGlView() [1/2]

SlintOpenGlView ( const OpenGlProjection projection = OpenGlProjection(),
QObject *  parent = nullptr 
)
explicitnoexcept

◆ SlintOpenGlView() [2/2]

SlintOpenGlView ( const SlintOpenGlView other)
delete

◆ ~SlintOpenGlView()

~SlintOpenGlView ( )
virtualnoexcept

Member Function Documentation

◆ isPanning()

bool isPanning ( ) const
noexcept

◆ getOpenGlErrors()

const QStringList & getOpenGlErrors ( ) const
inlinenoexcept

◆ getProjection()

const OpenGlProjection & getProjection ( ) const
inlinenoexcept

◆ getAlpha()

const QHash< OpenGlObject::Type, float > & getAlpha ( ) const
inlinenoexcept

◆ getBackgroundColor()

static QColor getBackgroundColor ( )
inlinestaticnoexcept
+ Here is the caller graph for this function:

◆ addObject()

void addObject ( std::shared_ptr< OpenGlObject obj)
noexcept

◆ removeObject()

void removeObject ( std::shared_ptr< OpenGlObject obj)
noexcept

◆ setObjects()

void setObjects ( const QVector< std::shared_ptr< OpenGlObject > > &  objs)
noexcept

◆ setAlpha()

void setAlpha ( const QHash< OpenGlObject::Type, float > &  alpha)
noexcept

◆ render()

slint::Image render ( float  width,
float  height 
)
noexcept
+ Here is the call graph for this function:

◆ pointerEvent()

bool pointerEvent ( const QPointF &  pos,
slint::private_api::PointerEvent  e 
)
noexcept
+ Here is the call graph for this function:

◆ scrollEvent()

bool scrollEvent ( const QPointF &  pos,
slint::private_api::PointerScrollEvent  e 
)
noexcept

◆ zoomIn()

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

◆ zoomOut()

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

◆ zoomAll()

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

◆ operator=()

SlintOpenGlView & operator= ( const SlintOpenGlView rhs)
delete

◆ stateChanged

void stateChanged ( )
signal

◆ contentChanged

void contentChanged ( )
signal

◆ initializeGl()

void initializeGl ( )
privatenoexcept
+ Here is the call graph for this function:

◆ zoom()

void zoom ( const QPointF &  center,
qreal  factor 
)
privatenoexcept
+ Here is the caller graph for this function:

◆ smoothTo()

void smoothTo ( const OpenGlProjection projection)
privatenoexcept
+ Here is the caller graph for this function:

◆ applyOpenGlProjection()

bool applyOpenGlProjection ( const OpenGlProjection projection)
privatenoexcept

◆ toNormalizedPos()

QPointF toNormalizedPos ( const QPointF &  pos) const
privatenoexcept

◆ toModelPos()

QPointF toModelPos ( const QPointF &  pos) const
privatenoexcept
+ Here is the call graph for this function:

Member Data Documentation

◆ mSurface

std::unique_ptr<QOffscreenSurface> mSurface
private

◆ mContext

std::unique_ptr<QOpenGLContext> mContext
private

◆ mProgram

std::unique_ptr<QOpenGLShaderProgram> mProgram
private

◆ mFbo

std::unique_ptr<QOpenGLFramebufferObject> mFbo
private

◆ mErrors

QStringList mErrors
private

◆ mViewSize

QSizeF mViewSize
private

◆ mProjection

OpenGlProjection mProjection
private

◆ mAlpha

QHash<OpenGlObject::Type, float> mAlpha
private

◆ mMousePressPosition

QPointF mMousePressPosition
private

◆ mMousePressTransform

QMatrix4x4 mMousePressTransform
private

◆ mMousePressCenter

QPointF mMousePressCenter
private

◆ mPressedMouseButtons

QSet<slint::private_api::PointerEventButton> mPressedMouseButtons
private

◆ mAnimationDataStart

OpenGlProjection mAnimationDataStart
private

◆ mAnimationDataDelta

OpenGlProjection mAnimationDataDelta
private

◆ mAnimation

QScopedPointer<QVariantAnimation> mAnimation
private

◆ mObjects

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

◆ sCameraPosZ

constexpr qreal sCameraPosZ = 5.0
staticconstexprprivate

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