2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2020 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2019-11-13 11:16:55 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QMetaType>
|
2022-05-31 16:19:29 +03:00
|
|
|
#include <QVariant>
|
2019-11-13 11:16:55 +01:00
|
|
|
|
|
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
2020-02-11 11:33:25 +02:00
|
|
|
class View3DActionCommand
|
2019-11-13 11:16:55 +01:00
|
|
|
{
|
2020-02-11 11:33:25 +02:00
|
|
|
friend QDataStream &operator>>(QDataStream &in, View3DActionCommand &command);
|
|
|
|
|
friend QDebug operator<<(QDebug debug, const View3DActionCommand &command);
|
2019-11-13 11:16:55 +01:00
|
|
|
|
|
|
|
|
public:
|
2020-02-11 11:33:25 +02:00
|
|
|
enum Type { Empty,
|
|
|
|
|
MoveTool,
|
|
|
|
|
ScaleTool,
|
|
|
|
|
RotateTool,
|
|
|
|
|
FitToView,
|
2021-08-12 05:31:36 +03:00
|
|
|
AlignCamerasToView,
|
|
|
|
|
AlignViewToCamera,
|
2020-02-11 11:33:25 +02:00
|
|
|
SelectionModeToggle,
|
|
|
|
|
CameraToggle,
|
|
|
|
|
OrientationToggle,
|
2020-03-27 20:16:29 +02:00
|
|
|
EditLightToggle,
|
2021-10-19 10:04:15 +03:00
|
|
|
ShowGrid,
|
2022-01-21 17:15:01 +02:00
|
|
|
ShowSelectionBox,
|
|
|
|
|
ShowIconGizmo,
|
|
|
|
|
ShowCameraFrustum,
|
2022-02-21 11:26:53 +02:00
|
|
|
ShowParticleEmitter,
|
2021-10-19 10:04:15 +03:00
|
|
|
Edit3DParticleModeToggle,
|
|
|
|
|
ParticlesPlay,
|
|
|
|
|
ParticlesRestart,
|
|
|
|
|
ParticlesSeek,
|
2022-05-31 16:19:29 +03:00
|
|
|
SelectBackgroundColor,
|
2022-06-08 18:00:09 +03:00
|
|
|
SelectGridColor,
|
2022-05-31 16:19:29 +03:00
|
|
|
ResetBackgroundColor,
|
2022-06-20 16:06:28 +03:00
|
|
|
SyncBackgroundColor,
|
2022-07-01 11:35:09 +03:00
|
|
|
GetModelAtPos
|
2020-02-11 11:33:25 +02:00
|
|
|
};
|
2019-11-13 11:16:55 +01:00
|
|
|
|
2022-07-01 11:35:09 +03:00
|
|
|
View3DActionCommand(Type type, const QVariant &value);
|
2021-10-19 10:04:15 +03:00
|
|
|
|
2020-02-11 11:33:25 +02:00
|
|
|
View3DActionCommand() = default;
|
|
|
|
|
|
|
|
|
|
bool isEnabled() const;
|
2022-05-31 16:19:29 +03:00
|
|
|
QVariant value() const;
|
2020-02-11 11:33:25 +02:00
|
|
|
Type type() const;
|
2021-10-19 10:04:15 +03:00
|
|
|
int position() const;
|
2019-11-13 11:16:55 +01:00
|
|
|
|
|
|
|
|
private:
|
2020-02-11 11:33:25 +02:00
|
|
|
Type m_type = Empty;
|
2022-05-31 16:19:29 +03:00
|
|
|
QVariant m_value;
|
2021-10-19 10:04:15 +03:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
View3DActionCommand(int pos);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class View3DSeekActionCommand : public View3DActionCommand
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
View3DSeekActionCommand(int pos) : View3DActionCommand(pos) {}
|
2019-11-13 11:16:55 +01:00
|
|
|
};
|
|
|
|
|
|
2020-02-11 11:33:25 +02:00
|
|
|
QDataStream &operator<<(QDataStream &out, const View3DActionCommand &command);
|
|
|
|
|
QDataStream &operator>>(QDataStream &in, View3DActionCommand &command);
|
2019-11-13 11:16:55 +01:00
|
|
|
|
2020-02-11 11:33:25 +02:00
|
|
|
QDebug operator<<(QDebug debug, const View3DActionCommand &command);
|
2019-11-13 11:16:55 +01:00
|
|
|
|
|
|
|
|
} // namespace QmlDesigner
|
|
|
|
|
|
2020-02-11 11:33:25 +02:00
|
|
|
Q_DECLARE_METATYPE(QmlDesigner::View3DActionCommand)
|