diff options
Diffstat (limited to 'src/render/framegraph')
-rw-r--r-- | src/render/framegraph/qcameraselector.cpp | 38 | ||||
-rw-r--r-- | src/render/framegraph/qclearbuffers.cpp | 56 | ||||
-rw-r--r-- | src/render/framegraph/qframegraphnode.cpp | 109 | ||||
-rw-r--r-- | src/render/framegraph/qlayerfilter.cpp | 32 | ||||
-rw-r--r-- | src/render/framegraph/qrendersurfaceselector.cpp | 106 | ||||
-rw-r--r-- | src/render/framegraph/qsortpolicy.cpp | 63 | ||||
-rw-r--r-- | src/render/framegraph/qviewport.cpp | 54 |
7 files changed, 299 insertions, 159 deletions
diff --git a/src/render/framegraph/qcameraselector.cpp b/src/render/framegraph/qcameraselector.cpp index a9188cd99..c7d299b9b 100644 --- a/src/render/framegraph/qcameraselector.cpp +++ b/src/render/framegraph/qcameraselector.cpp @@ -48,13 +48,15 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { /*! - \class Qt3DRender::QCameraSelector - \inmodule Qt3DRender - \since 5.5 - \ingroup framegraph + \class Qt3DRender::QCameraSelector + \inmodule Qt3DRender + \since 5.5 + \ingroup framegraph - \brief Class to allow for selection of camera to be used + \brief Class to allow for selection of camera to be used + A Qt3DRender::QCameraSelector can be used to select the camera, which is used + by the FrameGraph when drawing the entities. */ /*! @@ -63,9 +65,25 @@ namespace Qt3DRender { \instantiates Qt3DRender::QCameraSelector \inherits FrameGraphNode \since 5.5 - \qmlabstract + \brief Class to allow for selection of camera to be used + + A CameraSelector can be used to select the camera, which is used + by the FrameGraph when drawing the entities. +*/ + +/*! + \qmlproperty Entity Qt3D.Render::CameraSelector::camera + + Holds the currently selected camera. */ +/*! + \property Qt3DRender::QCameraSelector::camera + + Holds the currently selected camera. +*/ + + /*! \internal */ QCameraSelector::QCameraSelector(QCameraSelectorPrivate &dd, QNode *parent) : QFrameGraphNode(dd, parent) @@ -91,14 +109,6 @@ QCameraSelector::~QCameraSelector() { } -/*! - \property Qt3DRender::QCameraSelector::camera -*/ - -/*! - \qmlproperty Entity Qt3D.Render::CameraSelector::camera - -*/ void QCameraSelector::setCamera(Qt3DCore::QEntity *camera) { Q_D(QCameraSelector); diff --git a/src/render/framegraph/qclearbuffers.cpp b/src/render/framegraph/qclearbuffers.cpp index 1e8a5c6e3..6fec60364 100644 --- a/src/render/framegraph/qclearbuffers.cpp +++ b/src/render/framegraph/qclearbuffers.cpp @@ -45,12 +45,14 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { /*! - \class Qt3DRender::QClearBuffers - \inmodule Qt3DRender - \since 5.7 - \ingroup framegraph + \class Qt3DRender::QClearBuffers + \inmodule Qt3DRender + \since 5.7 + \ingroup framegraph + \brief Class to clear buffers - \brief Class to clear buffers + A Qt3DRender::QClearBuffers FrameGraph node enables clearing of the specific + render target buffers with specific values. */ /*! @@ -59,21 +61,24 @@ namespace Qt3DRender { \instantiates Qt3DRender::QClearBuffers \inherits FrameGraphNode \since 5.7 - \qmlabstract + \brief Class to clear buffers + + A Qt3DRender::QClearBuffers FrameGraph node enables clearing of the specific + render target buffers with specific values. */ /*! \enum QClearBuffers::BufferType This enum type describes types of buffer to be cleared. - \value None - \value ColorBuffer - \value DepthBuffer - \value StencilBuffer - \value DepthStencilBuffer - \value ColorDepthBuffer - \value ColorDepthStencilBuffer - \value AllBuffers + \value None No buffers will be cleared + \value ColorBuffer Clear color buffers + \value DepthBuffer Clear depth buffer + \value StencilBuffer Clear stencil buffer + \value DepthStencilBuffer Clear depth and stencil buffers + \value ColorDepthBuffer Clear color and depth buffers + \value ColorDepthStencilBuffer Clear color, depth and stencil buffers + \value AllBuffers Clear all buffers */ QClearBuffersPrivate::QClearBuffersPrivate() @@ -86,7 +91,7 @@ QClearBuffersPrivate::QClearBuffersPrivate() } /*! - The constructor creates an instance with the specified \a parent. + The constructor creates an instance with the specified \a parent. */ QClearBuffers::QClearBuffers(QNode *parent) : QFrameGraphNode(*new QClearBuffersPrivate, parent) @@ -141,8 +146,8 @@ QRenderTargetOutput *QClearBuffers::colorBuffer() const */ /*! - \qmlproperty BufferType Qt3D.Render::ClearBuffers::buffers - + \qmlproperty enumeration Qt3D.Render::ClearBuffers::buffers + Specifies the buffer type to be used. */ void QClearBuffers::setBuffers(QClearBuffers::BufferType buffers) { @@ -158,8 +163,8 @@ void QClearBuffers::setBuffers(QClearBuffers::BufferType buffers) Specifies the clear color to be used. */ /*! - \qmlproperty Color Qt3D.Render::ClearBuffers::color - + \qmlproperty color Qt3D.Render::ClearBuffers::color + Specifies the clear color to be used. */ void QClearBuffers::setClearColor(const QColor &color) { @@ -176,8 +181,8 @@ void QClearBuffers::setClearColor(const QColor &color) Specifies the clear depth value to be used. */ /*! - \qmlproperty float Qt3D.Render::ClearBuffers::clearDepthValue - + \qmlproperty real Qt3D.Render::ClearBuffers::clearDepthValue + Specifies the clear depth value to be used. */ void QClearBuffers::setClearDepthValue(float clearDepthValue) { @@ -196,8 +201,8 @@ void QClearBuffers::setClearDepthValue(float clearDepthValue) Specifies the stencil value to be used. */ /*! - \qmlproperty int Qt3D.Render::ClearBuffers::clearStencilValue - + \qmlproperty int Qt3D.Render::ClearBuffers::clearStencilValue + Specifies the stencil value to be used. */ void QClearBuffers::setClearStencilValue(int clearStencilValue) { @@ -214,8 +219,9 @@ void QClearBuffers::setClearStencilValue(int clearStencilValue) ColorBuffer flag is set, all color buffers will be cleared. */ /*! - \qmlproperty Qt3D.Render::RenderTargetOutput Qt3D.Render::ClearBuffers::colorbuffer - + \qmlproperty RenderTargetOutput Qt3D.Render::ClearBuffers::colorbuffer + Specifies a specific color buffer to clear. If set to NULL (default), and + ColorBuffer flag is set, all color buffers will be cleared. */ void QClearBuffers::setColorBuffer(QRenderTargetOutput *buffer) { diff --git a/src/render/framegraph/qframegraphnode.cpp b/src/render/framegraph/qframegraphnode.cpp index add8fc75d..c60c859ac 100644 --- a/src/render/framegraph/qframegraphnode.cpp +++ b/src/render/framegraph/qframegraphnode.cpp @@ -50,14 +50,57 @@ QFrameGraphNodePrivate::QFrameGraphNodePrivate() } /*! - \class Qt3DRender::QFrameGraphNode - \inmodule Qt3DRender - \since 5.5 - - \brief Base class of all FrameGraph configuration nodes. + \class Qt3DRender::QFrameGraphNode + \inmodule Qt3DRender + \since 5.5 - This is an abstract class so it cannot be instanced directly - but rather through one of its subclasses. + \brief Base class of all FrameGraph configuration nodes. + + This is an abstract class so it cannot be instanced directly + but rather through one of its subclasses. + + The subclasses are: + \table + \header + \li class + \li description + \row + \li Qt3DRender::QCameraSelector + \li Select camera from all available cameras in the scene + \row + \li Qt3DRender::QClearBuffers + \li Specify which buffers to clear and to what values + \row + \li Qt3DRender::QDispatchCompute + \li Specify Compute operation kernels + \row + \li Qt3DRender::QFrustumCulling + \li Enable frustum culling + \row + \li Qt3DRender::QLayerFilter + \li Select which layers to draw + \row + \li Qt3DRender::QNoDraw + \li Disable drawing + \row + \li Qt3DRender::QRenderPassFilter + \li Select which render passes to draw + \row + \li Qt3DRender::QRenderStateSet + \li Set render states + \row + \li Qt3DRender::QRenderSurfaceSelector + \li Select which surface to draw to + \row + \li Qt3DRender::QSortPolicy + \li Specify how entities are sorted to determine draw order + \row + \li Qt3DRender::QTechniqueFilter + \li Select which techniques to draw + \row + \li Qt3DRender::QViewport + \li Specify viewport + \endtable */ @@ -67,11 +110,57 @@ QFrameGraphNodePrivate::QFrameGraphNodePrivate() \instantiates Qt3DRender::QFrameGraphNode \inherits Node \since 5.5 - \qmlabstract + \brief Base class of all FrameGraph configuration nodes. + + This is an abstract class so it cannot be instanced directly + but rather through one of its subclasses. + + The subclasses are: + \table + \header + \li class + \li description + \row + \li CameraSelector + \li Select camera from all available cameras in the scene + \row + \li ClearBuffers + \li Specify which buffers to clear and to what values + \row + \li DispatchCompute + \li Specify Compute operation kernels + \row + \li FrustumCulling + \li Enable frustum culling + \row + \li LayerFilter + \li Select which layers to draw + \row + \li NoDraw + \li Disable drawing + \row + \li RenderPassFilter + \li Select which render passes to draw + \row + \li RenderStateSet + \li Set render states + \row + \li RenderSurfaceSelector + \li Select which surface to draw to + \row + \li SortPolicy + \li Specify how entities are sorted to determine draw order + \row + \li TechniqueFilter + \li Select which techniques to draw + \row + \li Viewport + \li Specify viewport + \endtable */ /*! - The constructor creates an instance with the specified \a parent. + The constructor creates an instance with the specified \a parent. */ QFrameGraphNode::QFrameGraphNode(QNode *parent) : QNode(*new QFrameGraphNodePrivate, parent) @@ -84,7 +173,7 @@ QFrameGraphNode::~QFrameGraphNode() } /*! - Returns a pointer to the parent. + Returns a pointer to the parent. */ QFrameGraphNode *QFrameGraphNode::parentFrameGraphNode() const { diff --git a/src/render/framegraph/qlayerfilter.cpp b/src/render/framegraph/qlayerfilter.cpp index 92c1e1266..f7f4dd12c 100644 --- a/src/render/framegraph/qlayerfilter.cpp +++ b/src/render/framegraph/qlayerfilter.cpp @@ -59,7 +59,10 @@ QLayerFilterPrivate::QLayerFilterPrivate() \since 5.5 \brief Controls layers Drawn in a frame graph branch. - A QLayerFiler can be used to instruct the renderer as to which layer(s) to draw in that branch of the frame graph. + A Qt3DRender::QLayerFilter can be used to instruct the renderer as to which layer(s) + to draw in that branch of the frame graph. The Qt3DRender::QLayerFilter selects which + entities to draw based on the Qt3DRender::QLayer instances added to the QLayerFilter + and as components to the \l Qt3DCore::QEntity. */ /*! @@ -70,12 +73,20 @@ QLayerFilterPrivate::QLayerFilterPrivate() \since 5.5 \brief Controls layers Drawn in a frame graph branch. - A QLayerFiler can be used to instruct the renderer as to which layer(s) to draw in that branch of the frame graph. + A LayerFilter can be used to instruct the renderer as to which layer(s) + to draw in that branch of the frame graph. The LayerFilter selects which + entities to draw based on the \l Layer instances added to the LayerFilter + and as components to the \l Entity. */ +/*! + \qmlproperty list<Layer> Qt3D.Render::LayerFilter::layers + Holds a list of layers specifying the layers to select for drawing. + \readonly + */ /*! - The constructor creates an instance with the specified \a parent. + The constructor creates an instance with the specified \a parent. */ QLayerFilter::QLayerFilter(QNode *parent) : QFrameGraphNode(*new QLayerFilterPrivate, parent) @@ -94,16 +105,7 @@ QLayerFilter::~QLayerFilter() } /*! - \property Qt3DRender::QLayerFilter::layers - - */ - -/*! - \qmlproperty stringlist Qt3D.Render::LayerFilter::layers - -*/ -/*! - Add \a layer to the current list of layers + Add \a layer to the current list of layers */ void QLayerFilter::addLayer(QLayer *layer) { @@ -131,7 +133,7 @@ void QLayerFilter::addLayer(QLayer *layer) } /*! - Remove \a layer from the current list of layers + Remove \a layer from the current list of layers */ void QLayerFilter::removeLayer(QLayer *layer) { @@ -148,7 +150,7 @@ void QLayerFilter::removeLayer(QLayer *layer) } /*! - \return the current list of layers + \return the current list of layers */ QVector<QLayer *> QLayerFilter::layers() const { diff --git a/src/render/framegraph/qrendersurfaceselector.cpp b/src/render/framegraph/qrendersurfaceselector.cpp index 4063f4997..905669ff9 100644 --- a/src/render/framegraph/qrendersurfaceselector.cpp +++ b/src/render/framegraph/qrendersurfaceselector.cpp @@ -52,57 +52,70 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { /*! - * \class Qt3DRender::QRenderSurfaceSelector - * \inmodule Qt3DRender - * \brief Provides a way of specifying the render surface - * \since 5.7 - * - * \inherits Qt3DRender::QFrameGraphNode - * - * Qt3DRender::QRenderSurfaceSelector specifies which window should be used for - * the rendering of a FrameGraph branch. In some cases you may also want to - * specify the size of what needs to be drawn when rendering with a frame - * buffer object. In such cases, the externalRenderTargetSize should be set and - * updated accordingly. If it is not set, the renderer will assume it should use - * the surface's size. - * + \class Qt3DRender::QRenderSurfaceSelector + \inmodule Qt3DRender + \brief Provides a way of specifying the render surface + \since 5.7 + + The Qt3DRender::QRenderSurfaceSelector can be used to select the surface, where + Qt3D renders the content. The surface can either be window surface or offscreen + surface. The externalRenderTargetSize is used to specify the actual size of the + surface when offscreen surface is used. + + When DPI scaling is used by the system, the logical surface size, which is used + by mouse events, and the actual 'physical' size of the surface can differ. + The surfacePixelRatio is the factor to convert the logical size to the physical + size. + + \sa QWindow, QOffscreenSurface, QSurface */ /*! - * \qmltype RenderSurfaceSelector - * \inqmlmodule Qt3D.Render - * \since 5.7 - * \ingroup - * \instantiates Qt3DRender::QRenderSurfaceSelector - * \brief Provides a way of specifying the render surface - * - * RenderSurfaceSelector specifies which window should be used for - * the rendering of a FrameGraph branch. In some cases you may also want to - * specify the size of what needs to be drawn when rendering with a frame - * buffer object. In such cases, the externalRenderTargetSize should be set and - * updated accordingly. If it is not set, the renderer will assume it should use - * the surface's size. - * + \qmltype RenderSurfaceSelector + \inqmlmodule Qt3D.Render + \since 5.7 + \instantiates Qt3DRender::QRenderSurfaceSelector + \inherits FrameGraphNode + \brief Provides a way of specifying the render surface + + The RenderSurfaceSelector can be used to select the surface, where + Qt3D renders the content. The surface can either be window surface or offscreen + surface. The externalRenderTargetSize is used to specify the actual size of the + render target when offscreen surface is used. + + When DPI scaling is used by the system, the logical surface size, which is used + by mouse events, and the actual 'physical' size of the surface can differ. + The surfacePixelRatio is the factor to convert the logical size to the physical + size. */ /*! \qmlproperty QSurface Qt3D.Render::RenderSurfaceSelector::surface - * - * Holds the surface. + Holds the surface. */ -/*! - * \property QRenderSurfaceSelector::surface - * Holds the surface +/*! \qmlproperty size Qt3D.Render::RenderSurfaceSelector::externalRenderTargetSize + + Holds the size of the external render target. + */ + +/*! \qmlproperty real Qt3D.Render::RenderSurfaceSelector::surfacePixelRatio + + Holds the surfacePixelRatio of the surface. */ -/*! \qmlproperty QSize Qt3D.Render::RenderSurfaceSelector::externalRenderTargetSize - * - * Holds the size of the external render target. +/*! + \property QRenderSurfaceSelector::surface + Holds the surface */ /*! - * \property QRenderSurfaceSelector::externalRenderTargetSize - * Holds the size of the external render target. + \property QRenderSurfaceSelector::externalRenderTargetSize + Holds the size of the external render target. + */ + +/*! \property QRenderSurfaceSelector::surfacePixelRatio + + Holds the surfacePixelRatio of the surface. */ QRenderSurfaceSelectorPrivate::QRenderSurfaceSelectorPrivate() @@ -150,7 +163,7 @@ void QRenderSurfaceSelectorPrivate::setExternalRenderTargetSize(const QSize &siz } /*! - * Constructs QRenderSurfaceSelector with given \a parent. + Constructs QRenderSurfaceSelector with given \a parent. */ QRenderSurfaceSelector::QRenderSurfaceSelector(Qt3DCore::QNode *parent) : Qt3DRender::QFrameGraphNode(*new QRenderSurfaceSelectorPrivate, parent) @@ -158,14 +171,14 @@ QRenderSurfaceSelector::QRenderSurfaceSelector(Qt3DCore::QNode *parent) } /*! - * \internal + \internal */ QRenderSurfaceSelector::~QRenderSurfaceSelector() { } /*! - * \internal + \internal */ QRenderSurfaceSelector::QRenderSurfaceSelector(QRenderSurfaceSelectorPrivate &dd, Qt3DCore::QNode *parent) : Qt3DRender::QFrameGraphNode(dd, parent) @@ -192,9 +205,8 @@ QObject *QRenderSurfaceSelector::surface() const return surfaceObj; } -/*! \property QRenderSurfaceSelector::surface - * - * Sets \a surface. +/*! + Sets \a surfaceObject. */ void QRenderSurfaceSelector::setSurface(QObject *surfaceObject) { @@ -211,7 +223,7 @@ void QRenderSurfaceSelector::setSurface(QObject *surfaceObject) surface = static_cast<QSurface *>(offscreen); } - Q_ASSERT_X(surface, Q_FUNC_INFO, "surfaceObject is not a valid QSurface * object"); + Q_ASSERT_X(surface, Q_FUNC_INFO, "surfaceObject is not a valid QSurface object"); } if (d->m_surface == surface) @@ -299,8 +311,8 @@ float QRenderSurfaceSelector::surfacePixelRatio() const return d->m_surfacePixelRatio; } /*! - * Sets render target \a size if different than underlying surface size. - * Tells picking the correct size. + Sets render target \a size if different than underlying surface size. + Tells picking the correct size. */ void QRenderSurfaceSelector::setExternalRenderTargetSize(const QSize &size) { diff --git a/src/render/framegraph/qsortpolicy.cpp b/src/render/framegraph/qsortpolicy.cpp index 50fcae50f..a20ebd201 100644 --- a/src/render/framegraph/qsortpolicy.cpp +++ b/src/render/framegraph/qsortpolicy.cpp @@ -53,23 +53,34 @@ QSortPolicyPrivate::QSortPolicyPrivate() } /*! - * \class Qt3DRender::QSortPolicy - * \inmodule Qt3DRender - * \brief Provides storage for the sort types to be used - * \since 5.7 - * - * \inherits Qt3DRender::QFrameGraphNode - * + \class Qt3DRender::QSortPolicy + \inmodule Qt3DRender + \brief Provides storage for the sort types to be used + \since 5.7 + + \inherits Qt3DRender::QFrameGraphNode + + A Qt3DRender::QSortPolicy class stores the sorting type used by the FrameGraph. + The sort types determine how drawable entities are sorted before drawing to + determine the drawing order. When QSortPolicy is present in the FrameGraph, + the sorting mechanism is determined by the SortTypes list. Multiple sort types + can be used simultanously. If QSortPolicy is not present in the FrameGraph, + entities are drawn in the order they appear in the entity hierarchy. */ /*! - * \qmltype SortPolicy - * \inqmlmodule Qt3D.Render - * \since 5.7 - * \ingroup - * \instantiates Qt3DRender::QSortPolicy - * \brief Provides storage for the sort types to be used - * + \qmltype SortPolicy + \inqmlmodule Qt3D.Render + \since 5.7 + \instantiates Qt3DRender::QSortPolicy + \brief Provides storage for the sort types to be used + + A SortPolicy class stores the sorting type used by the FrameGraph. + The sort types determine how drawable entities are sorted before drawing to + determine the drawing order. When SortPolicy is present in the FrameGraph, + the sorting mechanism is determined by the SortTypes list. Multiple sort + types can be used simultanously. If SortPolicy is not present in the FrameGraph, + entities are drawn in the order they appear in the entity hierarchy. */ /*! @@ -82,7 +93,17 @@ QSortPolicyPrivate::QSortPolicyPrivate() */ /*! - * Constructs QSortPolicy with given \a parent. + \property QSortPolicy::sortTypes + Specifies the sorting types to be used. +*/ + +/*! + \qmlproperty QVariantList SortPolicy::sortTypes + Specifies the sorting types to be used. +*/ + +/*! + Constructs QSortPolicy with given \a parent. */ QSortPolicy::QSortPolicy(QNode *parent) : QFrameGraphNode(*new QSortPolicyPrivate, parent) @@ -110,17 +131,7 @@ QNodeCreatedChangeBasePtr QSortPolicy::createNodeCreationChange() const } /*! - \property Qt3DRender::QSortPolicy::sortTypes - Specifies the sorting types to be used. -*/ - -/*! - \qmlproperty QVariantList Qt3D.Render::QSortPolicy::sortTypes - Specifies the sorting types to be used. - -*/ -/*! - * \return the current sort types in use + \return the current sort types in use */ QVector<QSortPolicy::SortType> QSortPolicy::sortTypes() const { diff --git a/src/render/framegraph/qviewport.cpp b/src/render/framegraph/qviewport.cpp index c68ff141f..cf7667289 100644 --- a/src/render/framegraph/qviewport.cpp +++ b/src/render/framegraph/qviewport.cpp @@ -53,27 +53,39 @@ QViewportPrivate::QViewportPrivate() } /*! - * \class Qt3DRender::QViewport - * \inmodule Qt3DRender - * \brief A viewport on the Qt3D Scene - * \since 5.7 - * - * \inherits Qt3DRender::QFrameGraphNode - * + \class Qt3DRender::QViewport + \inmodule Qt3DRender + \brief A viewport on the Qt3D Scene + \since 5.7 + + \inherits Qt3DRender::QFrameGraphNode + + Qt3DRender::QViewport of the scene specifies at which portion of the render surface Qt3D + is rendering to. Area outside the viewport is left untouched. */ /*! - * \qmltype Viewport - * \inqmlmodule Qt3D.Render - * \since 5.7 - * \ingroup - * \instantiates Qt3DRender::QViewport - * \brief A viewport on the Qt3D Scene - * + \qmltype Viewport + \inqmlmodule Qt3D.Render + \since 5.7 + \ingroup + \instantiates Qt3DRender::QViewport + \brief A viewport on the Qt3D Scene + + Viewport of the scene specifies at which portion of the render surface Qt3D is + rendering to. Area outside the viewport is left untouched. */ /*! - * Constructs QViewport with given \a parent. + \qmlproperty rect Viewport::normalizedRect + + Specifies the normalised rectangle for the viewport, i.e. the viewport rectangle + is specified relative to the render surface size. Whole surface sized viewport + is specified as [0.0, 0.0, 1.0, 1.0], which is the default. + */ + +/*! + Constructs QViewport with given \a parent. */ QViewport::QViewport(QNode *parent) : QFrameGraphNode(*new QViewportPrivate, parent) @@ -99,14 +111,12 @@ QRectF QViewport::normalizedRect() const } /*! - \property Qt3DRender::QViewport::normalizedRect - Specifies the normalise rect for the viewport -*/ - -/*! - \qmlproperty QRectF Qt3D.Render::QViewport::normalizedRect + \property QViewport::normalizedRect -*/ + Specifies the normalised rectangle for the viewport, i.e. the viewport rectangle + is specified relative to the render surface size. Whole surface sized viewport + is specified as [0.0, 0.0, 1.0, 1.0], which is the default. + */ void QViewport::setNormalizedRect(const QRectF &normalizedRect) { Q_D(QViewport); |