| 1 | // Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QT3DRENDER_RENDER_VIEWPORTNODE_H |
| 5 | #define QT3DRENDER_RENDER_VIEWPORTNODE_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists for the convenience |
| 12 | // of other Qt classes. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <Qt3DRender/private/framegraphnode_p.h> |
| 19 | #include <QColor> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | namespace Qt3DRender { |
| 24 | |
| 25 | class QViewport; |
| 26 | |
| 27 | namespace Render { |
| 28 | |
| 29 | class Renderer; |
| 30 | |
| 31 | class Q_3DRENDERSHARED_PRIVATE_EXPORT ViewportNode : public FrameGraphNode |
| 32 | { |
| 33 | public: |
| 34 | ViewportNode(); |
| 35 | |
| 36 | float xMin() const; |
| 37 | void setXMin(float xMin); |
| 38 | |
| 39 | float yMin() const; |
| 40 | void setYMin(float yMin); |
| 41 | |
| 42 | float xMax() const; |
| 43 | void setXMax(float xMax); |
| 44 | |
| 45 | float yMax() const; |
| 46 | void setYMax(float yMax); |
| 47 | |
| 48 | float gamma() const; |
| 49 | void setGamma(float gamma); |
| 50 | |
| 51 | void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; |
| 52 | |
| 53 | static QRectF computeViewport(const QRectF &childViewport, const ViewportNode *parentViewport); |
| 54 | |
| 55 | private: |
| 56 | float m_xMin; |
| 57 | float m_yMin; |
| 58 | float m_xMax; |
| 59 | float m_yMax; |
| 60 | float m_gamma; |
| 61 | }; |
| 62 | |
| 63 | |
| 64 | } // namespace Render |
| 65 | } // namespace Qt3DRender |
| 66 | |
| 67 | QT_END_NAMESPACE |
| 68 | |
| 69 | #endif // QT3DRENDER_RENDER_VIEWPORTNODE_H |
| 70 | |