diff options
Diffstat (limited to 'src/render/frontend')
-rw-r--r-- | src/render/frontend/qabstractfunctor.cpp | 36 | ||||
-rw-r--r-- | src/render/frontend/qcamera.cpp | 391 | ||||
-rw-r--r-- | src/render/frontend/qcameralens.cpp | 287 | ||||
-rw-r--r-- | src/render/frontend/qpickingsettings.cpp | 89 | ||||
-rw-r--r-- | src/render/frontend/qrendersettings.cpp | 100 | ||||
-rw-r--r-- | src/render/frontend/qrendersettings.h | 1 | ||||
-rw-r--r-- | src/render/frontend/qrendersettings_p.h | 2 |
7 files changed, 645 insertions, 261 deletions
diff --git a/src/render/frontend/qabstractfunctor.cpp b/src/render/frontend/qabstractfunctor.cpp index f3367a2b5..817d06a27 100644 --- a/src/render/frontend/qabstractfunctor.cpp +++ b/src/render/frontend/qabstractfunctor.cpp @@ -43,8 +43,44 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { +/*! + \class Qt3DRender::QAbstractFunctor + \inmodule Qt3DRender + \since 5.7 + \brief QAbstractFunctor is an abstract base class for all functors. + + The QAbstractFunctor is used as a base class for all functors and data + generators in Qt3DRender module. + + When user defines a new functor or generator, they need to implement the + \l QAbstractFunctor::id() method, which should be done using the \c {QT3D_FUNCTOR} + macro in the class definition. + */ +/*! + \fn qintptr QAbstractFunctor::id() const + */ +/*! + \macro QT3D_FUNCTOR(Class) + \relates Qt3DRender::QAbstractFunctor + + This macro assigns functor id to the \a Class, which is used by QAbstractFunctor::functor_cast + to determine if the cast can be done. + */ + +/*! + \fn const T *QAbstractFunctor::functor_cast(const QAbstractFunctor *other) const + + This method is used to cast functor \a other to type T if the other is of + type T (or of subclass); otherwise returns 0. This method works similarly + to \l QObject::qobject_cast, except with functors derived from QAbstractFunctor. + + \warning If T was not declared with \l QT3D_FUNCTOR macro, then the results are undefined. + */ + +/*! Desctructor */ QAbstractFunctor::~QAbstractFunctor() { + } } // Qt3D diff --git a/src/render/frontend/qcamera.cpp b/src/render/frontend/qcamera.cpp index b28d3bbbb..7a1f133a8 100644 --- a/src/render/frontend/qcamera.cpp +++ b/src/render/frontend/qcamera.cpp @@ -78,6 +78,298 @@ QCameraPrivate::QCameraPrivate() */ /*! + * \enum Qt3DRender::QCamera::CameraTranslationOption + * + * This enum specifies how camera view center is translated + * \value TranslateViewCenter Translate the view center causing the view direction to remain the same + * \value DontTranslateViewCenter Don't translate the view center causing the view direction to change + */ + +/*! + * \qmlmethod quaternion Qt3D.Render::Camera::tiltRotation(real angle) + * + * Returns the calculated tilt rotation in relation to the \a angle in degrees taken in + * to adjust the camera's tilt or up/down rotation on the X axis. + */ + +/*! + * \qmlmethod quaternion Qt3D.Render::Camera::panRotation(real angle) + * + * Returns the calculated pan rotation in relation to the \a angle in degrees taken in + * to adjust the camera's pan or left/right rotation on the Y axis. + */ + +/*! + * \qmlmethod quaternion Qt3D.Render::Camera::rollRotation(real angle) + * + * Returns the calculated roll rotation in relation to the \a angle in degrees taken in + * to adjust the camera's roll or lean left/right rotation on the Z axis. + */ + +/*! + * \qmlmethod quaternion Qt3D.Render::Camera::rotation(real angle, vector3d axis) + * + * Returns the calculated rotation in relation to the \a angle in degrees and + * chosen \a axis taken in. + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::translate(vector3d vLocal, enumeration option) + * + * Translates the camera's position and its view vector by \a vLocal in local coordinates. + * The \a option allows for toggling whether the view center should be translated. + * \list + * \li Camera.TranslateViewCenter + * \li Camera.DontTranslateViewCenter + * \endlist + * \sa Qt3DRender::QCamera::CameraTranslationOption + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::translateWorld(vector3d vWorld, enumeration option) + * + * Translates the camera's position and its view vector by \a vWorld in world coordinates. + * The \a option allows for toggling whether the view center should be translated. + * \list + * \li Camera.TranslateViewCenter + * \li Camera.DontTranslateViewCenter + * \endlist + * \sa Qt3DRender::QCamera::CameraTranslationOption + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::tilt(real angle) + * + * Adjusts the tilt angle of the camera by \a angle in degrees. + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::pan(real angle) + * + * Adjusts the pan angle of the camera by \a angle in degrees. + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::pan(real angle, vector3d axis) + * + * Adjusts the camera pan about view center by \a angle in degrees on \a axis. + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::roll(real angle) + * + * Adjusts the camera roll by \a angle in degrees. + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::tiltAboutViewCenter(real angle) + * + * Adjusts the camera tilt about view center by \a angle in degrees. + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::panAboutViewCenter(real angle) + * + * Adjusts the camera pan about view center by \a angle in degrees. + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::panAboutViewCenter(real angle, vector3d axis) + * + * Adjusts the camera pan about view center by \a angle in degrees on \a axis. + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::rollAboutViewCenter(real angle) + * + * Adjusts the camera roll about view center by \a angle in degrees. + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::rotate(quaternion q) + * + * Rotates the camera with the use of a Quaternion in \a q. + */ + +/*! + * \qmlmethod void Qt3D.Render::Camera::rotateAboutViewCenter(quaternion q) + * + * Rotates the camera about the view center with the use of a Quaternion in \a q. + */ + +/*! + * \qmlproperty enumeration Qt3D.Render::Camera::projectionType + * + * Holds the type of the camera projection. + * + * \list + * \li CameraLens.OrthographicProjection + * \li CameraLens.PerspectiveProjection + * \li CameraLens.FrustumProjection + * \li CameraLens.CustomProjection + * \endlist + * \sa Qt3DRender::QCameraLens::ProjectionType + */ + +/*! + * \qmlproperty real Qt3D.Render::Camera::nearPlane + * Holds the current camera near plane of the camera. + */ + +/*! + * \qmlproperty real Qt3D.Render::Camera::farPlane + * Holds the current camera far plane of the camera. + */ + +/*! + * \qmlproperty real Qt3D.Render::Camera::fieldOfView + * Holds the current field of view of the camera in degrees. + */ + +/*! + * \qmlproperty real Qt3D.Render::Camera::aspectRatio + * Holds the current aspect ratio of the camera. + */ + +/*! + *\qmlproperty real Qt3D.Render::Camera::left + * Holds the current left of the camera. + */ + +/*! + * \qmlproperty real Qt3D.Render::Camera::right + * Holds the current right of the camera. + */ + +/*! + * \qmlproperty real Qt3D.Render::Camera::bottom + * Holds the current bottom of the camera. + */ + +/*! + * \qmlproperty real Qt3D.Render::Camera::top + * Holds the current top of the camera. + */ + +/*! + * \qmlproperty matrix4x4 Qt3D.Render::Camera::projectionMatrix + * Holds the current projection matrix of the camera. + */ + + +/*! + * \qmlproperty vector3d Qt3D.Render::Camera::position + * Holds the current position of the camera. + */ + +/*! + * \qmlproperty vector3d Qt3D.Render::Camera::upVector + * Holds the current up vector of the camera. + */ + +/*! + * \qmlproperty vector3d Qt3D.Render::Camera::viewCenter + * Holds the current view center of the camera. + * \readonly + */ + +/*! + * \qmlproperty vector3d Qt3D.Render::Camera::viewVector + * Holds the camera's view vector. + * \readonly + */ + +/*! + * \qmlproperty matrix4x4 Qt3D.Render::Camera::viewMatrix + * Holds the camera's view matrix. + * \readonly + */ + +/*! + * \property QCamera::projectionType + * + * Holds the type of the camera projection. + * + * \list + * \li CameraLens.OrthographicProjection + * \li CameraLens.PerspectiveProjection + * \li CameraLens.FrustumProjection + * \li CameraLens.CustomProjection + * \endlist + * \sa Qt3DRender::QCameraLens::ProjectionType + */ + +/*! + * \property QCamera::nearPlane + * Holds the current camera near plane. + */ + +/*! + * \property QCamera::farPlane + * Holds the current camera far plane. + */ + +/*! + * \property QCamera::fieldOfView + * Holds the current field of view in degrees. + */ + +/*! + * \property QCamera::aspectRatio + * Holds the current aspect ratio. + */ + +/*! + *\property QCamera::left + * Holds the current left of the camera. + */ + +/*! + * \property QCamera::right + * Holds the current right of the camera. + */ + +/*! + * \property QCamera::bottom + * Holds the current bottom of the camera. + */ + +/*! + * \property QCamera::top + * Holds the current top of the camera. + */ + +/*! + * \property QCamera::projectionMatrix + * Holds the current projection matrix of the camera. + */ + +/*! + * \property QCamera::position + * Holds the camera's position. + */ + +/*! + * \property QCamera::upVector + * Holds the camera's up vector. + */ + +/*! + * \property QCamera::viewCenter + * Holds the camera's view center. + */ + +/*! + * \property QCamera::viewVector + * Holds the camera's view vector. + */ + +/*! + * \property QCamera::viewMatrix + * Holds the camera's view matrix. + */ + +/*! * Creates a new QCamera instance with the * specified \a parent. */ @@ -202,8 +494,8 @@ void QCamera::translateWorld(const QVector3D &vWorld, CameraTranslationOption op } /*! - * Returns the calculated tilt rotation in relation to the \a angle taken in to adjust the camera's - * tilt or up/down rotation on the X axis. + * Returns the calculated tilt rotation in relation to the \a angle in degrees taken in + * to adjust the camera's tilt or up/down rotation on the X axis. */ QQuaternion QCamera::tiltRotation(float angle) const { @@ -213,8 +505,8 @@ QQuaternion QCamera::tiltRotation(float angle) const } /*! - * Returns the calculated pan rotation in relation to the \a angle taken in to adjust the camera's - * pan or left/right rotation on the Y axis. + * Returns the calculated pan rotation in relation to the \a angle in degrees taken in + * to adjust the camera's pan or left/right rotation on the Y axis. */ QQuaternion QCamera::panRotation(float angle) const { @@ -222,8 +514,8 @@ QQuaternion QCamera::panRotation(float angle) const } /*! - * Returns the calculated roll rotation in relation to the \a angle taken in to adjust the camera's - * roll or lean left/right rotation on the Z axis. + * Returns the calculated roll rotation in relation to the \a angle in degrees taken in + * to adjust the camera's roll or lean left/right rotation on the Z axis. */ QQuaternion QCamera::rollRotation(float angle) const { @@ -232,7 +524,8 @@ QQuaternion QCamera::rollRotation(float angle) const } /*! - * Returns the calculated rotation in relation to the \a angle and chosen \a axis taken in. + * Returns the calculated rotation in relation to the \a angle in degrees and + * chosen \a axis taken in. */ QQuaternion QCamera::rotation(float angle, const QVector3D &axis) const { @@ -240,7 +533,7 @@ QQuaternion QCamera::rotation(float angle, const QVector3D &axis) const } /*! - * Adjusts the tilt angle of the camera by \a angle. + * Adjusts the tilt angle of the camera by \a angle in degrees. */ void QCamera::tilt(float angle) { @@ -249,7 +542,7 @@ void QCamera::tilt(float angle) } /*! - * Adjusts the pan angle of the camera by \a angle. + * Adjusts the pan angle of the camera by \a angle in degrees. */ void QCamera::pan(float angle) { @@ -258,7 +551,7 @@ void QCamera::pan(float angle) } /*! - * Adjusts the pan angle of the camera by \a angle on a chosen \a axis. + * Adjusts the pan angle of the camera by \a angle in degrees on a chosen \a axis. */ void QCamera::pan(float angle, const QVector3D &axis) { @@ -267,7 +560,7 @@ void QCamera::pan(float angle, const QVector3D &axis) } /*! - * Adjusts the camera roll by \a angle. + * Adjusts the camera roll by \a angle in degrees. */ void QCamera::roll(float angle) { @@ -276,7 +569,7 @@ void QCamera::roll(float angle) } /*! - * Adjusts the camera tilt about view center by \a angle. + * Adjusts the camera tilt about view center by \a angle in degrees. */ void QCamera::tiltAboutViewCenter(float angle) { @@ -285,7 +578,7 @@ void QCamera::tiltAboutViewCenter(float angle) } /*! - * Adjusts the camera pan about view center by \a angle. + * Adjusts the camera pan about view center by \a angle in degrees. */ void QCamera::panAboutViewCenter(float angle) { @@ -294,7 +587,7 @@ void QCamera::panAboutViewCenter(float angle) } /*! - * Adjusts the camera pan about view center by \a angle on \a axis. + * Adjusts the camera pan about view center by \a angle in degrees on \a axis. */ void QCamera::panAboutViewCenter(float angle, const QVector3D &axis) { @@ -303,7 +596,7 @@ void QCamera::panAboutViewCenter(float angle, const QVector3D &axis) } /*! - * Adjusts the camera roll about view center by \a angle. + * Adjusts the camera roll about view center by \a angle in degrees. */ void QCamera::rollAboutViewCenter(float angle) { @@ -344,14 +637,6 @@ void QCamera::setProjectionType(QCameraLens::ProjectionType type) d->m_lens->setProjectionType(type); } -/*! - * \qmlproperty enumeration Qt3DCore::Camera::projectionType - * - * Holds the type of the camera projection (orthogonal or perspective). - * - * \value CameraLens.OrthographicProjection Orthographic projection - * \value CameraLens.PerspectiveProjection Perspective projection - */ QCameraLens::ProjectionType QCamera::projectionType() const { Q_D(const QCamera); @@ -367,10 +652,6 @@ void QCamera::setNearPlane(float nearPlane) d->m_lens->setNearPlane(nearPlane); } -/*! - * \qmlproperty float Qt3DCore::Camera::nearPlane - * The current camera near plane. - */ float QCamera::nearPlane() const { Q_D(const QCamera); @@ -386,10 +667,6 @@ void QCamera::setFarPlane(float farPlane) d->m_lens->setFarPlane(farPlane); } -/*! - * \qmlproperty float Qt3DCore::Camera::farPlane - * The current camera far plane. - */ float QCamera::farPlane() const { Q_D(const QCamera); @@ -397,7 +674,7 @@ float QCamera::farPlane() const } /*! - * Sets the camera's field of view to \a fiedOfView. + * Sets the camera's field of view to \a fieldOfView in degrees. */ void QCamera::setFieldOfView(float fieldOfView) { @@ -405,10 +682,6 @@ void QCamera::setFieldOfView(float fieldOfView) d->m_lens->setFieldOfView(fieldOfView); } -/*! - * \qmlproperty float Qt3DCore::Camera::fieldOfView - * The current field of view. - */ float QCamera::fieldOfView() const { Q_D(const QCamera); @@ -424,10 +697,6 @@ void QCamera::setAspectRatio(float aspectRatio) d->m_lens->setAspectRatio(aspectRatio); } -/*! - * \qmlproperty float Qt3DCore::Camera::aspectRatio - * The current aspect ratio. - */ float QCamera::aspectRatio() const { Q_D(const QCamera); @@ -443,10 +712,6 @@ void QCamera::setLeft(float left) d->m_lens->setLeft(left); } -/*! - *\qmlproperty float Qt3DCore::Camera::left - * The current left of the camera. - */ float QCamera::left() const { Q_D(const QCamera); @@ -462,10 +727,6 @@ void QCamera::setRight(float right) d->m_lens->setRight(right); } -/*! - * \qmlproperty float Qt3DCore::Camera::right - * The current right of the camera. - */ float QCamera::right() const { Q_D(const QCamera); @@ -481,10 +742,6 @@ void QCamera::setBottom(float bottom) d->m_lens->setBottom(bottom); } -/*! - * \qmlproperty float Qt3DCore::Camera::bottom - * The current bottom of the camera. - */ float QCamera::bottom() const { Q_D(const QCamera); @@ -500,10 +757,6 @@ void QCamera::setTop(float top) d->m_lens->setTop(top); } -/*! - * \qmlproperty float Qt3DCore::Camera::top - * The current top of the camera. - */ float QCamera::top() const { Q_D(const QCamera); @@ -511,7 +764,7 @@ float QCamera::top() const } /*! - * Sets the camera's projection matrix. + * Sets the camera's projection matrix to \a projectionMatrix. */ void QCamera::setProjectionMatrix(const QMatrix4x4 &projectionMatrix) { @@ -519,10 +772,6 @@ void QCamera::setProjectionMatrix(const QMatrix4x4 &projectionMatrix) d->m_lens->setProjectionMatrix(projectionMatrix); } -/*! - * \qmlproperty QMatri4x4 Qt3DCore::Camera:projectionMatrix - * The current projection matrix of the camera. - */ QMatrix4x4 QCamera::projectionMatrix() const { Q_D(const QCamera); @@ -545,10 +794,6 @@ void QCamera::setPosition(const QVector3D &position) } } -/*! - * \qmlproperty vector3d Qt3DCore::Camera::position - * The camera's position. - */ QVector3D QCamera::position() const { Q_D(const QCamera); @@ -569,10 +814,6 @@ void QCamera::setUpVector(const QVector3D &upVector) } } -/*! - * \qmlproperty vector3d Qt3DCore::Camera::upVector - * The camera's up vector. - */ QVector3D QCamera::upVector() const { Q_D(const QCamera); @@ -595,30 +836,18 @@ void QCamera::setViewCenter(const QVector3D &viewCenter) } } -/*! - * \qmlproperty vector3d Qt3DCore::Camera::viewCenter - * The camera's view center. - */ QVector3D QCamera::viewCenter() const { Q_D(const QCamera); return d->m_viewCenter; } -/*! - * \qmlproperty vector3d Qt3DCore::Camera::viewVector - * The camera's view vector. - */ QVector3D QCamera::viewVector() const { Q_D(const QCamera); return d->m_cameraToCenter; } -/*! - * \qmlproperty matrix4x4 Qt3DCore::Camera::viewMatrix - * The camera's view matrix. - */ QMatrix4x4 QCamera::viewMatrix() const { Q_D(const QCamera); diff --git a/src/render/frontend/qcameralens.cpp b/src/render/frontend/qcameralens.cpp index 8c730c763..4725251b5 100644 --- a/src/render/frontend/qcameralens.cpp +++ b/src/render/frontend/qcameralens.cpp @@ -45,8 +45,164 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { /*! - \internal -*/ + * \class Qt3DRender::QCameraLens + * \inmodule Qt3DRender + * + * \brief Qt3DRender::QCameraLens specifies the projection matrix that will be used to + * define a Camera for a 3D scene. + * + * \since 5.5 + */ + +/*! + * \qmltype CameraLens + * \instantiates Qt3DRender::QCameraLens + * \inqmlmodule Qt3D.Render + * \inherits Component3D + * \since 5.5 + * \brief Provides the projection matrix that is used to define a Camera for 3D scene. + */ + +/*! + * \enum Qt3DRender::QCameraLens::ProjectionType + * + * Specifies which parameters of Qt3DRender::QCameraLens are used to compute the projection matrix. + * + * \value OrthographicProjection Orthogonal projection + * \value PerspectiveProjection Perspective projection + * \value FrustumProjection Frustum projection + * \value CustomProjection Custom user-defined projection + */ + +/*! + * \qmlproperty enumeration CameraLens::projectionType + * + * Holds the type of the camera projection. + * + * \list + * \li CameraLens.OrthographicProjection + * \li CameraLens.PerspectiveProjection + * \li CameraLens.FrustumProjection + * \li CameraLens.CustomProjection + * \endlist + * \sa Qt3DRender::QCameraLens::ProjectionType + */ + +/*! + * \qmlproperty real CameraLens::nearPlane + * Holds the current near plane of the camera lens. + */ + +/*! + * \qmlproperty real CameraLens::farPlane + * Holds the current near plane of the camera lens. + */ + +/*! + * \qmlproperty real CameraLens::fieldOfView + * Holds the current field of view of the camera lens in degrees. + */ + +/*! + * \qmlproperty real CameraLens::aspectRatio + * Holds the current aspect ratio of the camera lens. + */ + +/*! + * \qmlproperty real CameraLens::left + * Holds the current left plane of the camera lens. + */ + +/*! + * \qmlproperty real CameraLens::right + * Holds the current right plane of the camera lens. + */ + +/*! + * \qmlproperty real CameraLens::bottom + * Holds the current bottom plane of the camera lens. + */ + +/*! + * \qmlproperty real CameraLens::top + * Holds the current top plane of the camera lens. + */ + +/*! + * \qmlproperty matrix4x4 CameraLens::projectionMatrix + * Holds the current projection matrix of the camera lens. + * \readonly + */ + + +/*! + * \property QCameraLens::projectionType + * + * Holds the type of the camera projection. + * \sa Qt3DRender::QCameraLens::ProjectionType + */ + +/*! + * \property QCameraLens::nearPlane + * Holds the current near plane of the camera lens. + */ + +/*! + * \property QCameraLens::farPlane + * Holds the current near plane of the camera lens. + */ + +/*! + * \property QCameraLens::fieldOfView + * Holds the current field of view of the camera lens. + * \note: The return value may be undefined if the projection type is not + * Qt3DRender::QCameraLens::PerspectiveProjection. + */ + +/*! + * \property QCameraLens::aspectRatio + * Holds the current aspect ratio of the camera lens. + * \note: The return value may be undefined if the projection type is not + * Qt3DRender::QCameraLens::PerspectiveProjection. + */ + +/*! + * \property QCameraLens::left + * Holds the current left plane of the camera lens. + * \note The return value may be undefined if the projection type is + * Qt3DRender::QCameraLens::PerspectiveProjection. + */ + +/*! + * \property QCameraLens::right + * Holds the current right plane of the camera lens. + * \note The return value may be undefined if the projection type is + * Qt3DRender::QCameraLens::PerspectiveProjection. + */ + +/*! + * \property QCameraLens::bottom + * Holds the current bottom plane of the camera lens. + * \note The return value may be undefined if the projection type is + * Qt3DRender::QCameraLens::PerspectiveProjection. + */ + +/*! + * \property QCameraLens::top + * Holds the current top plane of the camera lens. + * \note The return value may be undefined if the projection type is + * Qt3DRender::QCameraLens::PerspectiveProjection. + */ + +/*! + * \property QCameraLens::projectionMatrix + * Holds the current projection matrix of the camera lens. + * \readonly + */ + +/*! + * \internal + */ QCameraLensPrivate::QCameraLensPrivate() : Qt3DCore::QComponentPrivate() , m_projectionType(QCameraLens::PerspectiveProjection) @@ -61,6 +217,9 @@ QCameraLensPrivate::QCameraLensPrivate() { } +/*! + * Constructs a QCameraLens with given \a parent + */ QCameraLens::QCameraLens(QNode *parent) : Qt3DCore::QComponent(*new QCameraLensPrivate, parent) { @@ -73,14 +232,6 @@ QCameraLens::~QCameraLens() { } -/*! \class Qt3DRender::QCameraLens - * \inmodule Qt3DCore - * - * \brief Qt3DRender::QCameraLens specifies the projection matrix that will be used to - * define a Camera for a 3D scene. - * - * \since 5.5 - */ QCameraLens::QCameraLens(QCameraLensPrivate &dd, QNode *parent) : QComponent(dd, parent) { @@ -89,17 +240,6 @@ QCameraLens::QCameraLens(QCameraLensPrivate &dd, QNode *parent) } /*! - * \enum Qt3DRender::QCameraLens::ProjectionType - * - * Specifies which parameters of Qt3DRender::QCameraLens are used to compute the projection matrix. - * - * \value OrthographicProjection - * \value PerspectiveProjection - * \value FrustumProjection - * \value CustomProjection - */ - -/*! * Sets the lens' projection type \a projectionType. * * \note Qt3DRender::QCameraLens::Frustum and @@ -120,9 +260,6 @@ void QCameraLens::setProjectionType(QCameraLens::ProjectionType projectionType) } } -/*! - * Returns the lens' projection type. - */ QCameraLens::ProjectionType QCameraLens::projectionType() const { Q_D(const QCameraLens); @@ -207,9 +344,6 @@ void QCameraLens::setNearPlane(float nearPlane) d->updateProjectionMatrix(); } -/*! - * Returns the projection's near plane. - */ float QCameraLens::nearPlane() const { Q_D(const QCameraLens); @@ -234,9 +368,6 @@ void QCameraLens::setFarPlane(float farPlane) d->updateProjectionMatrix(); } -/*! - * Returns the projection's far plane. - */ float QCameraLens::farPlane() const { Q_D(const QCameraLens); @@ -264,12 +395,6 @@ void QCameraLens::setFieldOfView(float fieldOfView) d->updateProjectionMatrix(); } -/*! - * Returns the projection's field of view in degrees. - * - * \note: The return value may be undefined if the projection type is not - * Qt3DRender::QCameraLens::PerspectiveProjection. - */ float QCameraLens::fieldOfView() const { Q_D(const QCameraLens); @@ -297,12 +422,6 @@ void QCameraLens::setAspectRatio(float aspectRatio) d->updateProjectionMatrix(); } -/*! - * Returns the projection's aspect ratio. - * - * \note: The return value may be undefined if the projection type is not - * Qt3DRender::QCameraLens::PerspectiveProjection. - */ float QCameraLens::aspectRatio() const { Q_D(const QCameraLens); @@ -330,12 +449,6 @@ void QCameraLens::setLeft(float left) d->updateProjectionMatrix(); } -/*! - * Returns the lower left window coordinate of the projection. - * - * \note The return value may be undefined if the projection type is - * Qt3DRender::QCameraLens::PerspectiveProjection. - */ float QCameraLens::left() const { Q_D(const QCameraLens); @@ -363,12 +476,6 @@ void QCameraLens::setRight(float right) d->updateProjectionMatrix(); } -/*! - * Returns the upper right window coordinate of the projection. - * - * \note The return value may be undefined if the projection type is - * Qt3DRender::QCameraLens::PerspectiveProjection. - */ float QCameraLens::right() const { Q_D(const QCameraLens); @@ -396,12 +503,6 @@ void QCameraLens::setBottom(float bottom) d->updateProjectionMatrix(); } -/*! - * Returns the bottom window coordinate of the projection. - * - * \note The return value may be undefined if the projection type is - * Qt3DRender::QCameraLens::PerspectiveProjection. - */ float QCameraLens::bottom() const { Q_D(const QCameraLens); @@ -429,12 +530,6 @@ void QCameraLens::setTop(float top) d->updateProjectionMatrix(); } -/*! - * Returns the bottom window coordinate of the projection. - * - * \note The return value may be undefined if the projection type is - * Qt3DRender::QCameraLens::PerspectiveProjection. - */ float QCameraLens::top() const { Q_D(const QCameraLens); @@ -442,7 +537,7 @@ float QCameraLens::top() const } /*! - * Sets the project matrix. + * Sets the project matrix to \a projectionMatrix. * * \note This will set the projection type to Qt3DRender::QCameraLens::CustomProjection and thus * ignore all other camera parameters that might have been specified. @@ -457,9 +552,6 @@ void QCameraLens::setProjectionMatrix(const QMatrix4x4 &projectionMatrix) emit projectionMatrixChanged(projectionMatrix); } -/*! - * Returns the projection matrix. - */ QMatrix4x4 QCameraLens::projectionMatrix() const { Q_D(const QCameraLens); @@ -476,59 +568,4 @@ Qt3DCore::QNodeCreatedChangeBasePtr QCameraLens::createNodeCreationChange() cons } // Qt3DRender -/*! - \qmltype CameraLens - \instantiates Qt3DRender::QCameraLens - \inqmlmodule Qt3D.Core - \inherits Component3D - \since 5.5 - \brief Provides the projection matrix that is used to define a Camera for 3D scene. -*/ - -/*! - \qmlproperty enumeration Qt3DCore::CameraLens::projectionType - - Holds the type of the camera projection (orthogonal or perspective). - - \value CameraLens.OrthographicProjection Orthogonal projection - \value CameraLens.PerspectiveProjection Perspective projection -*/ - -/*! - \qmlproperty float Qt3DCore::CameraLens::nearPlane -*/ - -/*! - \qmlproperty float Qt3DCore::CameraLens::farPlane -*/ - -/*! - \qmlproperty float Qt3DCore::CameraLens::fieldOfView -*/ - -/*! - \qmlproperty float Qt3DCore::CameraLens::aspectRatio -*/ - -/*! - \qmlproperty float Qt3DCore::CameraLens::left -*/ - -/*! - \qmlproperty float Qt3DCore::CameraLens::right -*/ - -/*! - \qmlproperty float Qt3DCore::CameraLens::bottom -*/ - -/*! - \qmlproperty float Qt3DCore::CameraLens::top -*/ - -/*! - \qmlproperty matrix4x4 Qt3DCore::CameraLens::projectionMatrix - \readonly -*/ - QT_END_NAMESPACE diff --git a/src/render/frontend/qpickingsettings.cpp b/src/render/frontend/qpickingsettings.cpp index 2805ec5a8..c1524547c 100644 --- a/src/render/frontend/qpickingsettings.cpp +++ b/src/render/frontend/qpickingsettings.cpp @@ -45,12 +45,25 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { /*! - * \class Qt3DRender::QPickingSettings - * \brief The QPickingSettings class specifies the current framegraph to be used - * by the renderer and specifies whether rendering is always active or updated - * only on changes. - * \since 5.7 - * \inmodule Qt3DRender + \class Qt3DRender::QPickingSettings + \brief The QPickingSettings class specifies how entity picking is handled. + \since 5.7 + \inmodule Qt3DRender + \inherits Qt3DCore::QNode + + The picking settings determine how the entity picking is handled. For more details about + entity picking, see QObjectPicker component documentation. + */ + +/*! + \qmltype PickingSettings + \brief The PickingSettings class specifies how entity picking is handled. + \since 5.7 + \inqmlmodule Qt3D.Render + \instantiates Qt3DRender::QPickingSettings + + The picking settings determine how the entity picking is handled. For more details about + entity picking, see Qt3DRender::QObjectPicker component documentation. */ QPickingSettingsPrivate::QPickingSettingsPrivate() @@ -61,11 +74,6 @@ QPickingSettingsPrivate::QPickingSettingsPrivate() { } -/*! - * The constructor creates a new Qt3DRender::QPickingSettings - * instance with the specified \a parent. - * \param parent - */ QPickingSettings::QPickingSettings(Qt3DCore::QNode *parent) : Qt3DCore::QNode(*new QPickingSettingsPrivate, parent) { @@ -82,18 +90,12 @@ QPickingSettings::QPickingSettings(QPickingSettingsPrivate &dd, Qt3DCore::QNode { } -/*! - * \return the current pick method. - */ QPickingSettings::PickMethod QPickingSettings::pickMethod() const { Q_D(const QPickingSettings); return d->m_pickMethod; } -/*! - * \return the current pick result mode. - */ QPickingSettings::PickResultMode QPickingSettings::pickResultMode() const { Q_D(const QPickingSettings); @@ -112,16 +114,31 @@ QPickingSettings::FaceOrientationPickingMode QPickingSettings::faceOrientationPi /*! * \enum Qt3DRender::QPickingSettings::PickMethod * - * Specifies which parameters of Qt3DRender::QPickingSettings are used. + * Specifies the picking method. * - * \value BoundingVolumePicking - * \value TrianglePicking + * \value BoundingVolumePicking An entity is considered picked if the picking ray intersects + * the bounding volume of the entity. + * \value TrianglePicking An entity is considered picked if the picking ray intersects with + * any triangle of the entity's mesh component. */ /*! - * Sets the pick method to \a pickMethod - * \param pickMethod - */ + \qmlproperty enumeration PickingSettings::pickMethod + + Holds the current pick method. + + \list + \li PickingSettings.BoundingVolumePicking + \li PickingSettings.TrianglePicking + \endlist + + \sa Qt3DRender::QPickingSettings::PickMethod +*/ +/*! + \property QPickingSettings::pickMethod + + Holds the current pick method. +*/ void QPickingSettings::setPickMethod(QPickingSettings::PickMethod pickMethod) { Q_D(QPickingSettings); @@ -135,16 +152,30 @@ void QPickingSettings::setPickMethod(QPickingSettings::PickMethod pickMethod) /*! * \enum Qt3DRender::QPickingSettings::PickResultMode * - * Specifies which parameters of Qt3DRender::PickResultMode are used. + * Specifies what is included into the picking results. * - * \value NearestPick - * \value AllPicks + * \value NearestPick Only the nearest entity to picking ray origin intersected by the picking ray + * is picked. + * \value AllPicks All entities that intersect the picking ray are picked. */ /*! - * Sets the pick result mode to \a pickResultMode - * \param pickResultMode - */ + \qmlproperty enumeration PickingSettings::pickResultMode + + Holds the current pick results mode. + + \list + \li PickingSettings.NearestPick + \li PickingSettings.AllPicks + \endlist + + \sa Qt3DRender::QPickingSettings::PickResultMode +*/ +/*! + \property QPickingSettings::pickResultMode + + Holds the current pick results mode. +*/ void QPickingSettings::setPickResultMode(QPickingSettings::PickResultMode pickResultMode) { Q_D(QPickingSettings); diff --git a/src/render/frontend/qrendersettings.cpp b/src/render/frontend/qrendersettings.cpp index c15a7810c..616c3a64e 100644 --- a/src/render/frontend/qrendersettings.cpp +++ b/src/render/frontend/qrendersettings.cpp @@ -46,10 +46,29 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { /*! - * \class Qt3DRender::QRenderSettings - * \brief The QRenderSettings class - * \since 5.7 - * \inmodule Qt3DRender + \class Qt3DRender::QRenderSettings + \brief The QRenderSettings class holds settings related to rendering process and host the active + \l{Qt 3D Render Framegraph}{FrameGraph}. + \since 5.7 + \inmodule Qt3DRender + \inherits Qt3DCore::QComponent + + The QRenderSettings component must be set as a component of the scene root entity. It specifies + render policy and picking settings, as well as hosts the active + \l{Qt 3D Render Framegraph}{FrameGraph}. + */ + +/*! + \qmltype RenderSettings + \brief The RenderSettings type holds settings related to rendering process and host the active + \l{Qt 3D Render Framegraph}{FrameGraph}. + \since 5.7 + \inqmlmodule Qt3D.Render + \instantiates Qt3DRender::QRenderSettings + + The RenderSettings component must be set as a component of the scene root entity. It specifies + render policy and picking settings, as well as hosts the active + \l{Qt 3D Render Framegraph}{FrameGraph}. */ /*! \internal */ @@ -69,7 +88,7 @@ void QRenderSettingsPrivate::init() QObject::connect(&m_pickingSettings, SIGNAL(pickResultModeChanged(QPickingSettings::PickResultMode)), q, SLOT(_q_onPickResultModeChanged(QPickingSettings::PickResultMode))); QObject::connect(&m_pickingSettings, SIGNAL(faceOrientationPickingModeChanged(QPickingSettings::FaceOrientationPickingMode)), - q, SLOT(_q_onFaceOrientationPickingMode(QPickingSettings::FaceOrientationPickingMode))); + q, SLOT(_q_onFaceOrientationPickingModeChanged(QPickingSettings::FaceOrientationPickingMode))); } /*! \internal */ @@ -85,16 +104,11 @@ void QRenderSettingsPrivate::_q_onPickResultModeChanged(QPickingSettings::PickRe } /*! \internal */ -void QRenderSettingsPrivate::_q_onFaceOrientationPickingModeChanged(bool faceOrientationPickingMode) +void QRenderSettingsPrivate::_q_onFaceOrientationPickingModeChanged(QPickingSettings::FaceOrientationPickingMode faceOrientationPickingMode) { notifyPropertyChange("faceOrientationPickingMode", faceOrientationPickingMode); } -/*! - * The constructor creates a new QRenderSettings::QRenderSettings instance with the - * specified \a parent. - * \param parent - */ QRenderSettings::QRenderSettings(Qt3DCore::QNode *parent) : QRenderSettings(*new QRenderSettingsPrivate, parent) {} @@ -112,8 +126,19 @@ QRenderSettings::~QRenderSettings() } /*! - * \return the current picking settings. - */ + \qmlproperty PickingSettings RenderSettings::pickingSettings + + Holds the current pick settings for the \l{Qt 3D Render Framegraph}{FrameGraph}. + + \readonly +*/ +/*! + \property QRenderSettings::pickingSettings + + Holds the current pick settings for the \l{Qt 3D Render Framegraph}{FrameGraph}. + + \readonly +*/ QPickingSettings *QRenderSettings::pickingSettings() { Q_D(QRenderSettings); @@ -121,27 +146,56 @@ QPickingSettings *QRenderSettings::pickingSettings() } /*! - * \return the current active framegraph. - */ + \qmlproperty FrameGraphNode RenderSettings::activeFrameGraph + + Holds the currently active \l{Qt 3D Render Framegraph}{FrameGraph}. +*/ +/*! + \property QRenderSettings::activeFrameGraph + + Holds the currently active \l{Qt 3D Render Framegraph}{FrameGraph}. +*/ QFrameGraphNode *QRenderSettings::activeFrameGraph() const { Q_D(const QRenderSettings); return d->m_activeFrameGraph; } + /*! - * \return the current render policy - */ + \enum QRenderSettings::RenderPolicy + + The render policy. + + \value OnDemand The \l{Qt 3D Render Framegraph}{FrameGraph} is rendered only when something + changes. + \value Always The \l{Qt 3D Render Framegraph}{FrameGraph} is rendered continuously, even if + nothing has changed. +*/ + +/*! + \qmlproperty enumeration RenderSettings::renderPolicy + + Holds the current render policy. + + \list + \li RenderSettings.OnDemand + \li RenderSettings.Always + \endlist + + \sa Qt3DRender::QRenderSettings::RenderPolicy +*/ +/*! + \property QRenderSettings::renderPolicy + + Holds the current render policy. +*/ QRenderSettings::RenderPolicy QRenderSettings::renderPolicy() const { Q_D(const QRenderSettings); return d->m_renderPolicy; } -/*! - * Sets the active framegraph to \a activeFrameGraph. - * \param activeFrameGraph - */ void QRenderSettings::setActiveFrameGraph(QFrameGraphNode *activeFrameGraph) { Q_D(QRenderSettings); @@ -163,10 +217,6 @@ void QRenderSettings::setActiveFrameGraph(QFrameGraphNode *activeFrameGraph) emit activeFrameGraphChanged(activeFrameGraph); } -/*! - * Sets the render policy to \a renderPolicy. - * \param renderPolicy - */ void QRenderSettings::setRenderPolicy(QRenderSettings::RenderPolicy renderPolicy) { Q_D(QRenderSettings); diff --git a/src/render/frontend/qrendersettings.h b/src/render/frontend/qrendersettings.h index 55fe3007a..68e8f8d7f 100644 --- a/src/render/frontend/qrendersettings.h +++ b/src/render/frontend/qrendersettings.h @@ -89,6 +89,7 @@ protected: private: Q_PRIVATE_SLOT(d_func(), void _q_onPickingMethodChanged(QPickingSettings::PickMethod)) Q_PRIVATE_SLOT(d_func(), void _q_onPickResultModeChanged(QPickingSettings::PickResultMode)) + Q_PRIVATE_SLOT(d_func(), void _q_onFaceOrientationPickingModeChanged(QPickingSettings::FaceOrientationPickingMode)) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/frontend/qrendersettings_p.h b/src/render/frontend/qrendersettings_p.h index b590ada00..f05124296 100644 --- a/src/render/frontend/qrendersettings_p.h +++ b/src/render/frontend/qrendersettings_p.h @@ -72,7 +72,7 @@ public: void _q_onPickingMethodChanged(QPickingSettings::PickMethod pickMethod); void _q_onPickResultModeChanged(QPickingSettings::PickResultMode pickResultMode); - void _q_onFaceOrientationPickingModeChanged(bool faceOrientationPickingMode); + void _q_onFaceOrientationPickingModeChanged(QPickingSettings::FaceOrientationPickingMode faceOrientationPickingMode); Q_DECLARE_PUBLIC(QRenderSettings) }; |