summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Qt3DStudio/Render/IStudioRenderer.h
blob: fc543a897cc65a28dc5ec4d0094850aff42b2bab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/****************************************************************************
**
** Copyright (C) 2006 NVIDIA Corporation.
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt 3D Studio.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QT3DS_STUDIO_RENDERER
#define QT3DS_STUDIO_RENDERER
#pragma once

#include "IDocSceneGraph.h"
#include <EASTL/vector.h>
#include <EASTL/string.h>
#include "Doc.h"

#include <QRect>

QT_BEGIN_NAMESPACE
class QWidget;
QT_END_NAMESPACE

namespace Q3DStudio {
using qt3ds::QT3DSI32;
class IStudioRenderer : public IDocSceneGraph
{
protected:
    virtual ~IStudioRenderer() {}

public:
    friend class std::shared_ptr<IStudioRenderer>;

    virtual bool IsInitialized() = 0;

    virtual void Initialize(QWidget *inWindow) = 0;

    virtual void SetViewRect(const QRect &inRect) = 0;
    virtual void setFullSizePreview(bool enabled) = 0;
    virtual void setIsSceneCameraView(bool sceneCameraView) = 0;

    virtual void GetEditCameraList(QStringList &outCameras) = 0;
    virtual void SetPolygonFillModeEnabled(bool inEnableFillMode) = 0;
    virtual bool IsPolygonFillModeEnabled() const = 0;
    virtual bool DoesEditCameraSupportRotation(QT3DSI32 inIndex) = 0;
    virtual bool AreGuidesEnabled() const = 0;
    virtual void SetGuidesEnabled(bool val) = 0;
    virtual bool AreGuidesEditable() const = 0;
    virtual void SetGuidesEditable(bool val) = 0;
    // Setting the camera to -1 disables the edit cameras
    // So setting the camera to 0- (numcameras - 1) will set change the active
    // edit camera.
    virtual void SetEditCamera(QT3DSI32 inIndex) = 0;
    virtual QT3DSI32 GetEditCamera() const = 0;
    virtual void EditCameraZoomToFit() = 0;

    virtual bool isMouseDown() const = 0;

    // This must be safe to call from multiple places
    virtual void Close() = 0;

    // synchronously render the content
    virtual void RenderNow() = 0;
    virtual void getPreviewFbo(QSize &outFboDim, qt3ds::QT3DSU32 &outFboTexture) = 0;

    virtual void MakeContextCurrent() = 0;
    virtual void ReleaseContext() = 0;

    virtual void RegisterSubpresentations(
            const QVector<SubPresentationRecord> &subpresentations) = 0;

    // Uses the global studio app to get the doc and dispatch.
    static std::shared_ptr<IStudioRenderer> CreateStudioRenderer();
};
};

#endif