├── .gitignore ├── LICENSE.GPL3-EXCEPT ├── creatorplugin ├── Qt3DSceneEditor.json.in ├── creatorplugin.pro ├── creatorplugin.qrc ├── mimetypes.xml ├── qt3dsceneeditor_global.h ├── qt3dsceneeditorconstants.h ├── qt3dsceneeditorcontext.cpp ├── qt3dsceneeditorcontext.h ├── qt3dsceneeditorplugin.cpp ├── qt3dsceneeditorplugin.h ├── qt3dsceneeditorwidget.cpp ├── qt3dsceneeditorwidget.h └── tocreator │ ├── README │ └── qt3dsceneeditor │ ├── GeneratedScene.qt3d.qrc │ ├── GeneratedScene_scene_res │ ├── GeneratedScene.qml │ └── r0_qtlogo.png │ └── wizard.json ├── editorlib ├── editorlib.pro ├── editorlib_en.qm ├── editorlib_en.ts ├── editorlib_fi.qm ├── editorlib_fi.ts ├── images.qrc ├── images │ ├── arrow.png │ ├── camera.png │ ├── camera_large.png │ ├── change_camera_position.png │ ├── check.png │ ├── copy.png │ ├── cut.png │ ├── duplicate.png │ ├── export_gltf.png │ ├── group.png │ ├── group_large.png │ ├── helperarrows_global.png │ ├── helperarrows_local.png │ ├── helperplane_none_deselected.png │ ├── helperplane_none_selected.png │ ├── helperplane_x_deselected.png │ ├── helperplane_x_selected.png │ ├── helperplane_y_deselected.png │ ├── helperplane_y_selected.png │ ├── helperplane_z_deselected.png │ ├── helperplane_z_selected.png │ ├── import.png │ ├── import_disabled.png │ ├── light.png │ ├── light_large.png │ ├── load.png │ ├── lock_locked.png │ ├── lock_open.png │ ├── mesh.png │ ├── mesh_cuboid.png │ ├── mesh_cuboid_large.png │ ├── mesh_custom.png │ ├── mesh_custom_large.png │ ├── mesh_cylinder.png │ ├── mesh_cylinder_large.png │ ├── mesh_large.png │ ├── mesh_plane.png │ ├── mesh_plane_large.png │ ├── mesh_sphere.png │ ├── mesh_sphere_large.png │ ├── mesh_torus.png │ ├── mesh_torus_large.png │ ├── minus.png │ ├── new.png │ ├── no_drag.png │ ├── paste.png │ ├── picker.png │ ├── plus.png │ ├── property_camera_hidden.png │ ├── property_camera_shown.png │ ├── property_grouping_line_locked.png │ ├── property_grouping_line_open.png │ ├── property_light_hidden.png │ ├── property_light_shown.png │ ├── property_material_hidden.png │ ├── property_material_shown.png │ ├── property_mesh_hidden.png │ ├── property_mesh_shown.png │ ├── property_transform_hidden.png │ ├── property_transform_shown.png │ ├── qtlogo.png │ ├── qtlogo_normal.png │ ├── qtlogo_specular.png │ ├── redo.png │ ├── redo_disabled.png │ ├── reset.png │ ├── reset_all.png │ ├── reset_camera_to_default.png │ ├── reset_camera_to_default_pressed.png │ ├── rotate_handle.png │ ├── save.png │ ├── save_as.png │ ├── settings.png │ ├── snap_to.png │ ├── snap_to_disabled.png │ ├── spinbox_down.png │ ├── spinbox_up.png │ ├── undo.png │ ├── undo_disabled.png │ ├── visible_off.png │ └── visible_on.png ├── meshes │ ├── arrow.obj │ ├── camera.obj │ ├── defaultmesh.obj │ ├── directionallight.obj │ └── spotlight.obj ├── qml.qrc ├── qml │ ├── ButtonViewHeader.qml │ ├── CameraEntityDelegate.qml │ ├── CameraPositionMenu.qml │ ├── ComponentDelegate.qml │ ├── ComponentMenu.qml │ ├── ComponentPropertiesDelegate.qml │ ├── DragEntity.qml │ ├── DragHandle.qml │ ├── EditorContent.qml │ ├── EditorToolbar.qml │ ├── EnableButton.qml │ ├── EntityLibrary.qml │ ├── EntityMenu.qml │ ├── EntityModel.qml │ ├── EntityTree.qml │ ├── ExportDialog.qml │ ├── GeneralPropertyView.qml │ ├── LightComponentDelegate.qml │ ├── MaterialComponentDelegate.qml │ ├── MaterialDelegate.qml │ ├── MeshComponentDelegate.qml │ ├── MeshDelegate.qml │ ├── ObjectPickerComponentDelegate.qml │ ├── PluginMain.qml │ ├── SettingsDialog.qml │ ├── StandaloneMain.qml │ ├── ToolbarButton.qml │ ├── ToolbarSeparator.qml │ ├── TransformComponentDelegate.qml │ ├── TransformDelegate.qml │ ├── UnknownComponentDelegate.qml │ ├── inputfields │ │ ├── CheckBoxPropertyInputField.qml │ │ ├── ColorPropertyInputField.qml │ │ ├── FilePropertyInputField.qml │ │ ├── FloatPropertyInputField.qml │ │ ├── FloatSliderInputField.qml │ │ ├── FloatSliderPropertyInputField.qml │ │ ├── IntPropertyInputField.qml │ │ ├── Matrix4x4InputField.qml │ │ ├── Matrix4x4PropertyInputField.qml │ │ ├── ModelRoleInputField.qml │ │ ├── PropertyInputField.qml │ │ ├── PropertyLockButton.qml │ │ ├── RotationPropertyInputField.qml │ │ ├── SizePropertyInputField.qml │ │ ├── StyledButton.qml │ │ ├── StyledCheckBox.qml │ │ ├── StyledLabel.qml │ │ ├── StyledRadioButton.qml │ │ ├── StyledSpinBox.qml │ │ ├── StyledTextField.qml │ │ ├── StyledTextInput.qml │ │ ├── TextFieldBackgroundStyle.qml │ │ ├── TextInputField.qml │ │ ├── TextureInputField.qml │ │ ├── Vector3DInputField.qml │ │ ├── Vector3DPropertyInputField.qml │ │ └── VisiblePropertyInputField.qml │ ├── lights │ │ ├── BasicLightDelegate.qml │ │ ├── DirectionalLightDelegate.qml │ │ ├── PointLightDelegate.qml │ │ ├── SpotLightDelegate.qml │ │ └── UnknownLightDelegate.qml │ ├── materials │ │ ├── DiffuseMapMaterialDelegate.qml │ │ ├── DiffuseSpecularMapMaterialDelegate.qml │ │ ├── GoochMaterialDelegate.qml │ │ ├── NormalDiffuseMapAlphaMaterialDelegate.qml │ │ ├── NormalDiffuseMapMaterialDelegate.qml │ │ ├── NormalDiffuseSpecularMapMaterialDelegate.qml │ │ ├── PerVertexColorMaterialDelegate.qml │ │ ├── PhongAlphaMaterialDelegate.qml │ │ ├── PhongMaterialDelegate.qml │ │ └── UnknownMaterialDelegate.qml │ ├── meshes │ │ ├── CuboidMeshDelegate.qml │ │ ├── CustomMeshDelegate.qml │ │ ├── CylinderMeshDelegate.qml │ │ ├── PlaneMeshDelegate.qml │ │ ├── SphereMeshDelegate.qml │ │ ├── TorusMeshDelegate.qml │ │ └── UnknownMeshDelegate.qml │ └── transforms │ │ ├── MatrixTransformDelegate.qml │ │ ├── SRTTransformDelegate.qml │ │ └── UnknownTransformDelegate.qml ├── shaders │ ├── ontopmaterial.frag │ └── ontopmaterial.vert └── src │ ├── components │ ├── editorsceneitemlightcomponentsmodel.cpp │ ├── editorsceneitemlightcomponentsmodel.h │ ├── editorsceneitemmaterialcomponentsmodel.cpp │ ├── editorsceneitemmaterialcomponentsmodel.h │ ├── editorsceneitemmeshcomponentsmodel.cpp │ ├── editorsceneitemmeshcomponentsmodel.h │ ├── editorsceneitemtransformcomponentsmodel.cpp │ ├── editorsceneitemtransformcomponentsmodel.h │ ├── lightcomponentproxyitem.cpp │ ├── lightcomponentproxyitem.h │ ├── materialcomponentproxyitem.cpp │ ├── materialcomponentproxyitem.h │ ├── meshcomponentproxyitem.cpp │ ├── meshcomponentproxyitem.h │ ├── qdummyobjectpicker.cpp │ ├── qdummyobjectpicker.h │ ├── transformcomponentproxyitem.cpp │ └── transformcomponentproxyitem.h │ ├── editorscene.cpp │ ├── editorscene.h │ ├── editorsceneitem.cpp │ ├── editorsceneitem.h │ ├── editorsceneitemcomponentsmodel.cpp │ ├── editorsceneitemcomponentsmodel.h │ ├── editorsceneitemmodel.cpp │ ├── editorsceneitemmodel.h │ ├── editorsceneparser.cpp │ ├── editorsceneparser.h │ ├── editorscenesaver.cpp │ ├── editorscenesaver.h │ ├── editorutils.cpp │ ├── editorutils.h │ ├── editorviewportitem.cpp │ ├── editorviewportitem.h │ ├── inputcontrols │ ├── editorcameracontroller.cpp │ └── editorcameracontroller.h │ ├── materials │ ├── ontopeffect.cpp │ └── ontopeffect.h │ ├── qt3dsceneeditor.cpp │ ├── qt3dsceneeditor.h │ └── undohandler │ ├── copycamerapropertiescommand.cpp │ ├── copycamerapropertiescommand.h │ ├── duplicateentitycommand.cpp │ ├── duplicateentitycommand.h │ ├── genericpropertychangecommand.cpp │ ├── genericpropertychangecommand.h │ ├── importentitycommand.cpp │ ├── importentitycommand.h │ ├── insertentitycommand.cpp │ ├── insertentitycommand.h │ ├── modelrolechangecommand.cpp │ ├── modelrolechangecommand.h │ ├── pasteentitycommand.cpp │ ├── pasteentitycommand.h │ ├── propertychangecommand.cpp │ ├── propertychangecommand.h │ ├── removeentitycommand.cpp │ ├── removeentitycommand.h │ ├── renameentitycommand.cpp │ ├── renameentitycommand.h │ ├── reparententitycommand.cpp │ ├── reparententitycommand.h │ ├── replacecomponentcommand.cpp │ ├── replacecomponentcommand.h │ ├── resetentitycommand.cpp │ ├── resetentitycommand.h │ ├── resettransformcommand.cpp │ ├── resettransformcommand.h │ ├── undohandler.cpp │ └── undohandler.h ├── qt3dsceneeditor.pro └── standalone ├── deployment.pri ├── main.cpp └── standalone.pro /creatorplugin/Qt3DSceneEditor.json.in: -------------------------------------------------------------------------------- 1 | { 2 | \"Name\" : \"Qt3DSceneEditor\", 3 | \"Version\" : \"0.0.1\", 4 | \"CompatVersion\" : \"0.0.1\", 5 | \"Vendor\" : \"The Qt Company Ltd\", 6 | \"Copyright\" : \"(C) 2016 TheQtCompany Ltd\", 7 | \"License\" : \"Commercial License Usage 8 | Licensees holding valid commercial Qt licenses may use this file in 9 | accordance with the commercial license agreement provided with the 10 | Software or, alternatively, in accordance with the terms contained in 11 | a written agreement between you and The Qt Company. For licensing terms 12 | and conditions see https://www.qt.io/terms-conditions. For further 13 | information use the contact form at https://www.qt.io/contact-us. 14 | 15 | GNU Lesser General Public License Usage 16 | Alternatively, this file may be used under the terms of the GNU Lesser 17 | General Public License version 3 as published by the Free Software 18 | Foundation and appearing in the file LICENSE.LGPL3 included in the 19 | packaging of this file. Please review the following information to 20 | ensure the GNU Lesser General Public License version 3 requirements 21 | will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 22 | 23 | GNU General Public License Usage 24 | Alternatively, this file may be used under the terms of the GNU 25 | General Public License version 2.0 or (at your option) the GNU General 26 | Public license version 3 or any later version approved by the KDE Free 27 | Qt Foundation. The licenses are as published by the Free Software 28 | Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 29 | included in the packaging of this file. Please review the following 30 | information to ensure the GNU General Public License requirements will 31 | be met: https://www.gnu.org/licenses/gpl-2.0.html and 32 | https://www.gnu.org/licenses/gpl-3.0.html.\", 33 | \"Description\" : \"Qt Creator plugin of Qt3D Scene Editor\", 34 | \"Url\" : \"http://www.qt.io\", 35 | $$dependencyList 36 | } 37 | -------------------------------------------------------------------------------- /creatorplugin/creatorplugin.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | mimetypes.xml 4 | 5 | 6 | -------------------------------------------------------------------------------- /creatorplugin/mimetypes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Qt3D Scene Editor file 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /creatorplugin/qt3dsceneeditor_global.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | 29 | #pragma once 30 | 31 | #include 32 | 33 | #if defined(QT3DSCENEEDITOR_LIBRARY) 34 | # define QT3DSCENEEDITORSHARED_EXPORT Q_DECL_EXPORT 35 | #else 36 | # define QT3DSCENEEDITORSHARED_EXPORT Q_DECL_IMPORT 37 | #endif 38 | -------------------------------------------------------------------------------- /creatorplugin/qt3dsceneeditorconstants.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | 29 | #pragma once 30 | 31 | namespace Qt3DSceneEditor { 32 | namespace Constants { 33 | 34 | const char C_QT3DSCENEEDITOR[] = "Qt5.Qt3DSceneEditor"; 35 | const char QT3DSCENEEDITOR_ID[] = "Qt5.Qt3DSceneEditor"; 36 | const char C_QT3DSCENEEDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "Qt3D Scene Editor"); 37 | 38 | const char C_QT3DSCENEEDITOR_MIMETYPE[] = "application/qt3dsceneeditor"; 39 | 40 | const char C_OPEN_EDITOR[] = "Qt3DSceneEditor.OpenEditor"; 41 | 42 | } // namespace Qt3DSceneEditor 43 | } // namespace Constants 44 | -------------------------------------------------------------------------------- /creatorplugin/qt3dsceneeditorcontext.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | 29 | #include "qt3dsceneeditorcontext.h" 30 | #include "qt3dsceneeditorconstants.h" 31 | #include "qt3dsceneeditorwidget.h" 32 | 33 | namespace Qt3DSceneEditor { 34 | namespace Internal { 35 | 36 | Qt3DSceneEditorContext::Qt3DSceneEditorContext(QWidget *widget) 37 | : IContext(widget) 38 | { 39 | setWidget(widget); 40 | } 41 | 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /creatorplugin/qt3dsceneeditorcontext.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | 29 | #pragma once 30 | 31 | #include 32 | 33 | namespace Qt3DSceneEditor { 34 | namespace Internal { 35 | 36 | class Qt3DSceneEditorContext : public Core::IContext 37 | { 38 | public: 39 | Qt3DSceneEditorContext(QWidget *widget); 40 | }; 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /creatorplugin/qt3dsceneeditorplugin.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | 29 | #pragma once 30 | 31 | #include "qt3dsceneeditor_global.h" 32 | #include 33 | #include 34 | 35 | namespace Qt3DSceneEditor { 36 | namespace Internal { 37 | 38 | class Qt3DSceneEditorWidget; 39 | class Qt3DSceneEditorContext; 40 | 41 | class Qt3DSceneEditorPlugin : public ExtensionSystem::IPlugin 42 | { 43 | Q_OBJECT 44 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Qt3DSceneEditor.json") 45 | 46 | public: 47 | Qt3DSceneEditorPlugin(); 48 | ~Qt3DSceneEditorPlugin(); 49 | 50 | bool initialize(const QStringList &arguments, QString *errorString); 51 | void extensionsInitialized(); 52 | ShutdownFlag aboutToShutdown(); 53 | 54 | Qt3DSceneEditorWidget *sceneEditorWidget() const { return m_sceneEditorWidget; } 55 | 56 | void showSceneEditor(); 57 | void hideSceneEditor(); 58 | 59 | private: 60 | void createSceneEditorWidget(); 61 | void fixProFile(const Utils::FileName &filePath); 62 | 63 | Qt3DSceneEditorWidget *m_sceneEditorWidget; 64 | Qt3DSceneEditorContext *m_context; 65 | Utils::FileName m_previouslyLoadedScene; 66 | bool m_proFileDirty; 67 | }; 68 | 69 | } // namespace Internal 70 | } // namespace Qt3DSceneEditor 71 | -------------------------------------------------------------------------------- /creatorplugin/qt3dsceneeditorwidget.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | 29 | #include "qt3dsceneeditorwidget.h" 30 | #include "../editorlib/src/qt3dsceneeditor.h" 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | using namespace Qt3DSceneEditor; 37 | 38 | namespace Qt3DSceneEditor { 39 | namespace Internal { 40 | 41 | Qt3DSceneEditorWidget::Qt3DSceneEditorWidget(QWidget *parent) 42 | : QWidget(parent) 43 | , m_sceneEditor(nullptr) 44 | , m_rootItem(nullptr) 45 | { 46 | } 47 | 48 | Qt3DSceneEditorWidget::~Qt3DSceneEditorWidget() 49 | { 50 | } 51 | 52 | void Qt3DSceneEditorWidget::setup() 53 | { 54 | Qt3DSceneEditorLib::register3DSceneEditorQML(); 55 | m_sceneEditor = new QQuickWidget(this); 56 | m_sceneEditor->setResizeMode(QQuickWidget::SizeRootObjectToView); 57 | m_sceneEditor->setSource(QUrl(QStringLiteral("qrc:/qt3deditorlib/PluginMain.qml"))); 58 | m_rootItem = m_sceneEditor->rootObject(); 59 | 60 | QVBoxLayout *layout = new QVBoxLayout(); 61 | layout->setMargin(0); 62 | layout->setSpacing(0); 63 | layout->addWidget(m_sceneEditor); 64 | setLayout(layout); 65 | 66 | show(); 67 | } 68 | 69 | void Qt3DSceneEditorWidget::initialize(const QUrl &fileName) 70 | { 71 | if (m_initStatus == NotInitialized) { 72 | m_initStatus = Initializing; 73 | setup(); 74 | } 75 | m_initStatus = Initialized; 76 | 77 | QMetaObject::invokeMethod(m_rootItem, "loadScene", Q_ARG(QVariant, fileName)); 78 | } 79 | 80 | } // namespace Internal 81 | } // namespace Qt3DSceneEditor 82 | -------------------------------------------------------------------------------- /creatorplugin/qt3dsceneeditorwidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | 29 | #pragma once 30 | 31 | #include 32 | 33 | QT_BEGIN_NAMESPACE 34 | class QQuickWidget; 35 | class QQuickItem; 36 | QT_END_NAMESPACE 37 | 38 | namespace Qt3DSceneEditor { 39 | namespace Internal { 40 | 41 | class Qt3DSceneEditorWidget : public QWidget 42 | { 43 | Q_OBJECT 44 | 45 | public: 46 | explicit Qt3DSceneEditorWidget(QWidget *parent = 0); 47 | 48 | ~Qt3DSceneEditorWidget(); 49 | 50 | void initialize(const QUrl &fileName); 51 | 52 | private: // functions 53 | enum InitializeStatus { NotInitialized, Initializing, Initialized }; 54 | void setup(); 55 | 56 | private: // variables 57 | InitializeStatus m_initStatus = NotInitialized; 58 | QQuickWidget *m_sceneEditor; 59 | QQuickItem *m_rootItem; 60 | }; 61 | 62 | } // namespace Internal 63 | } // namespace Qt3DSceneEditor 64 | -------------------------------------------------------------------------------- /creatorplugin/tocreator/README: -------------------------------------------------------------------------------- 1 | qt3dsceneeditor -> \Tools\QtCreator\share\qtcreator\templates\wizards\files 2 | -------------------------------------------------------------------------------- /creatorplugin/tocreator/qt3dsceneeditor/GeneratedScene.qt3d.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | %{SceneItemName}_scene_res/%{ItemName}.qml 4 | %{SceneItemName}_scene_res/r0_qtlogo.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /creatorplugin/tocreator/qt3dsceneeditor/GeneratedScene_scene_res/r0_qtlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/creatorplugin/tocreator/qt3dsceneeditor/GeneratedScene_scene_res/r0_qtlogo.png -------------------------------------------------------------------------------- /creatorplugin/tocreator/qt3dsceneeditor/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "supportedProjectTypes": [ ], 4 | "id": "Qt3DSceneEditor.Resource", 5 | "category": "R.Qt", 6 | "trDescription": "Creates Qt3D Scene Editor files.", 7 | "trDisplayName": "Qt3D Scene Editor Files", 8 | "trDisplayCategory": "Qt", 9 | "icon": "../../global/genericfilewizard.png", 10 | "platformIndependent": true, 11 | "enabled": "%{JS: [ %{Plugins} ].indexOf('Qt3DSceneEditor') >= 0}", 12 | 13 | "options": 14 | [ 15 | { "key": "TargetPath", "value": "%{Path}" }, 16 | { "key": "ItemName", "value": "%{JS: ('%{SceneItemName}'.charAt(0).toUpperCase() + '%{SceneItemName}'.slice(1))}" } 17 | ], 18 | 19 | "pages" : 20 | [ 21 | { 22 | "trDisplayName": "Define Scene Item", 23 | "trShortTitle": "Details", 24 | "typeId": "Fields", 25 | "data" : 26 | [ 27 | { 28 | "name": "SceneItemName", 29 | "trDisplayName": "Scene item name:", 30 | "mandatory": true, 31 | "type": "LineEdit", 32 | "data": { "validator": "^[a-zA-Z][a-zA-Z_0-9]*$" } 33 | }, 34 | { 35 | "name": "Path", 36 | "type": "PathChooser", 37 | "trDisplayName": "Path:", 38 | "mandatory": true, 39 | "data": 40 | { 41 | "kind": "existingDirectory", 42 | "basePath": "%{InitialPath}", 43 | "path": "%{InitialPath}" 44 | } 45 | } 46 | ] 47 | }, 48 | { 49 | "trDisplayName": "Project Management", 50 | "trShortTitle": "Summary", 51 | "typeId": "Summary" 52 | } 53 | ], 54 | "generators" : 55 | [ 56 | { 57 | "typeId": "File", 58 | "data": 59 | [ 60 | { 61 | "source": "GeneratedScene.qt3d.qrc", 62 | "target": "%{JS: Cpp.fileName('%{TargetPath}/%{SceneItemName}', '%{JS: Util.preferredSuffix('application/qt3dsceneeditor')}')}", 63 | "openInEditor": true 64 | }, 65 | { 66 | "source": "GeneratedScene_scene_res/GeneratedScene.qml", 67 | "target": "%{TargetPath}/%{SceneItemName}_scene_res/%{ItemName}.qml" 68 | }, 69 | { 70 | "source": "GeneratedScene_scene_res/r0_qtlogo.png", 71 | "target": "%{TargetPath}/%{SceneItemName}_scene_res/r0_qtlogo.png", 72 | "isBinary": true 73 | } 74 | ] 75 | } 76 | ] 77 | } 78 | -------------------------------------------------------------------------------- /editorlib/editorlib_en.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/editorlib_en.qm -------------------------------------------------------------------------------- /editorlib/editorlib_fi.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/editorlib_fi.qm -------------------------------------------------------------------------------- /editorlib/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/arrow.png -------------------------------------------------------------------------------- /editorlib/images/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/camera.png -------------------------------------------------------------------------------- /editorlib/images/camera_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/camera_large.png -------------------------------------------------------------------------------- /editorlib/images/change_camera_position.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/change_camera_position.png -------------------------------------------------------------------------------- /editorlib/images/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/check.png -------------------------------------------------------------------------------- /editorlib/images/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/copy.png -------------------------------------------------------------------------------- /editorlib/images/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/cut.png -------------------------------------------------------------------------------- /editorlib/images/duplicate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/duplicate.png -------------------------------------------------------------------------------- /editorlib/images/export_gltf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/export_gltf.png -------------------------------------------------------------------------------- /editorlib/images/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/group.png -------------------------------------------------------------------------------- /editorlib/images/group_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/group_large.png -------------------------------------------------------------------------------- /editorlib/images/helperarrows_global.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/helperarrows_global.png -------------------------------------------------------------------------------- /editorlib/images/helperarrows_local.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/helperarrows_local.png -------------------------------------------------------------------------------- /editorlib/images/helperplane_none_deselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/helperplane_none_deselected.png -------------------------------------------------------------------------------- /editorlib/images/helperplane_none_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/helperplane_none_selected.png -------------------------------------------------------------------------------- /editorlib/images/helperplane_x_deselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/helperplane_x_deselected.png -------------------------------------------------------------------------------- /editorlib/images/helperplane_x_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/helperplane_x_selected.png -------------------------------------------------------------------------------- /editorlib/images/helperplane_y_deselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/helperplane_y_deselected.png -------------------------------------------------------------------------------- /editorlib/images/helperplane_y_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/helperplane_y_selected.png -------------------------------------------------------------------------------- /editorlib/images/helperplane_z_deselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/helperplane_z_deselected.png -------------------------------------------------------------------------------- /editorlib/images/helperplane_z_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/helperplane_z_selected.png -------------------------------------------------------------------------------- /editorlib/images/import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/import.png -------------------------------------------------------------------------------- /editorlib/images/import_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/import_disabled.png -------------------------------------------------------------------------------- /editorlib/images/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/light.png -------------------------------------------------------------------------------- /editorlib/images/light_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/light_large.png -------------------------------------------------------------------------------- /editorlib/images/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/load.png -------------------------------------------------------------------------------- /editorlib/images/lock_locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/lock_locked.png -------------------------------------------------------------------------------- /editorlib/images/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/lock_open.png -------------------------------------------------------------------------------- /editorlib/images/mesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh.png -------------------------------------------------------------------------------- /editorlib/images/mesh_cuboid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_cuboid.png -------------------------------------------------------------------------------- /editorlib/images/mesh_cuboid_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_cuboid_large.png -------------------------------------------------------------------------------- /editorlib/images/mesh_custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_custom.png -------------------------------------------------------------------------------- /editorlib/images/mesh_custom_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_custom_large.png -------------------------------------------------------------------------------- /editorlib/images/mesh_cylinder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_cylinder.png -------------------------------------------------------------------------------- /editorlib/images/mesh_cylinder_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_cylinder_large.png -------------------------------------------------------------------------------- /editorlib/images/mesh_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_large.png -------------------------------------------------------------------------------- /editorlib/images/mesh_plane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_plane.png -------------------------------------------------------------------------------- /editorlib/images/mesh_plane_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_plane_large.png -------------------------------------------------------------------------------- /editorlib/images/mesh_sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_sphere.png -------------------------------------------------------------------------------- /editorlib/images/mesh_sphere_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_sphere_large.png -------------------------------------------------------------------------------- /editorlib/images/mesh_torus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_torus.png -------------------------------------------------------------------------------- /editorlib/images/mesh_torus_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/mesh_torus_large.png -------------------------------------------------------------------------------- /editorlib/images/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/minus.png -------------------------------------------------------------------------------- /editorlib/images/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/new.png -------------------------------------------------------------------------------- /editorlib/images/no_drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/no_drag.png -------------------------------------------------------------------------------- /editorlib/images/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/paste.png -------------------------------------------------------------------------------- /editorlib/images/picker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/picker.png -------------------------------------------------------------------------------- /editorlib/images/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/plus.png -------------------------------------------------------------------------------- /editorlib/images/property_camera_hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_camera_hidden.png -------------------------------------------------------------------------------- /editorlib/images/property_camera_shown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_camera_shown.png -------------------------------------------------------------------------------- /editorlib/images/property_grouping_line_locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_grouping_line_locked.png -------------------------------------------------------------------------------- /editorlib/images/property_grouping_line_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_grouping_line_open.png -------------------------------------------------------------------------------- /editorlib/images/property_light_hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_light_hidden.png -------------------------------------------------------------------------------- /editorlib/images/property_light_shown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_light_shown.png -------------------------------------------------------------------------------- /editorlib/images/property_material_hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_material_hidden.png -------------------------------------------------------------------------------- /editorlib/images/property_material_shown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_material_shown.png -------------------------------------------------------------------------------- /editorlib/images/property_mesh_hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_mesh_hidden.png -------------------------------------------------------------------------------- /editorlib/images/property_mesh_shown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_mesh_shown.png -------------------------------------------------------------------------------- /editorlib/images/property_transform_hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_transform_hidden.png -------------------------------------------------------------------------------- /editorlib/images/property_transform_shown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/property_transform_shown.png -------------------------------------------------------------------------------- /editorlib/images/qtlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/qtlogo.png -------------------------------------------------------------------------------- /editorlib/images/qtlogo_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/qtlogo_normal.png -------------------------------------------------------------------------------- /editorlib/images/qtlogo_specular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/qtlogo_specular.png -------------------------------------------------------------------------------- /editorlib/images/redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/redo.png -------------------------------------------------------------------------------- /editorlib/images/redo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/redo_disabled.png -------------------------------------------------------------------------------- /editorlib/images/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/reset.png -------------------------------------------------------------------------------- /editorlib/images/reset_all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/reset_all.png -------------------------------------------------------------------------------- /editorlib/images/reset_camera_to_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/reset_camera_to_default.png -------------------------------------------------------------------------------- /editorlib/images/reset_camera_to_default_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/reset_camera_to_default_pressed.png -------------------------------------------------------------------------------- /editorlib/images/rotate_handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/rotate_handle.png -------------------------------------------------------------------------------- /editorlib/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/save.png -------------------------------------------------------------------------------- /editorlib/images/save_as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/save_as.png -------------------------------------------------------------------------------- /editorlib/images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/settings.png -------------------------------------------------------------------------------- /editorlib/images/snap_to.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/snap_to.png -------------------------------------------------------------------------------- /editorlib/images/snap_to_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/snap_to_disabled.png -------------------------------------------------------------------------------- /editorlib/images/spinbox_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/spinbox_down.png -------------------------------------------------------------------------------- /editorlib/images/spinbox_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/spinbox_up.png -------------------------------------------------------------------------------- /editorlib/images/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/undo.png -------------------------------------------------------------------------------- /editorlib/images/undo_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/undo_disabled.png -------------------------------------------------------------------------------- /editorlib/images/visible_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/visible_off.png -------------------------------------------------------------------------------- /editorlib/images/visible_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt-labs/qt3d-editor/9f4d089f5d2868c79242c76b8f29c8834f304887/editorlib/images/visible_on.png -------------------------------------------------------------------------------- /editorlib/meshes/defaultmesh.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.70 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | v 0.707107 -0.707107 -1.414213 4 | v -0.292894 -1.707107 -0.000000 5 | v -1.707107 -0.292893 -0.000001 6 | v -0.707106 0.707107 -1.414214 7 | v 1.707107 0.292892 0.000001 8 | v 0.707105 -0.707107 1.414214 9 | v -0.707107 0.707107 1.414213 10 | v 0.292894 1.707107 0.000000 11 | vn -0.500000 -0.500000 -0.707107 12 | vn 0.500000 0.500000 0.707107 13 | vn 0.707106 -0.707107 0.000000 14 | vn -0.500001 -0.500000 0.707106 15 | vn -0.707107 0.707107 -0.000000 16 | vn 0.500001 0.500000 -0.707106 17 | vn 0.707107 -0.707107 0.000000 18 | vn -0.500000 -0.500000 0.707107 19 | s off 20 | f 2//1 3//1 4//1 21 | f 8//2 7//2 6//2 22 | f 1//3 5//3 6//3 23 | f 2//4 6//4 7//4 24 | f 7//5 8//5 4//5 25 | f 1//6 4//6 8//6 26 | f 1//1 2//1 4//1 27 | f 5//2 8//2 6//2 28 | f 2//7 1//7 6//7 29 | f 3//8 2//8 7//8 30 | f 3//5 7//5 4//5 31 | f 5//6 1//6 8//6 32 | -------------------------------------------------------------------------------- /editorlib/qml/CameraPositionMenu.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import QtQuick.Controls 1.4 30 | import QtQml.Models 2.2 31 | import com.theqtcompany.SceneEditor3D 1.0 32 | 33 | Menu { 34 | property bool isPopup: false 35 | 36 | title: qsTr("Camera Position") + editorScene.emptyString 37 | 38 | MenuItem { 39 | text: qsTr("Camera Position") + editorScene.emptyString 40 | enabled: false 41 | visible: isPopup 42 | } 43 | MenuSeparator { 44 | visible: isPopup 45 | } 46 | 47 | MenuItem { 48 | text: qsTr("Top (7)") + editorScene.emptyString 49 | onTriggered: editorScene.changeCameraPosition(EditorScene.CameraPositionTop) 50 | } 51 | MenuItem { 52 | text: qsTr("Bottom (Ctrl+7)") + editorScene.emptyString 53 | onTriggered: editorScene.changeCameraPosition(EditorScene.CameraPositionBottom) 54 | } 55 | MenuItem { 56 | text: qsTr("Left (8)") + editorScene.emptyString 57 | onTriggered: editorScene.changeCameraPosition(EditorScene.CameraPositionLeft) 58 | } 59 | MenuItem { 60 | text: qsTr("Right (Ctrl+8)") + editorScene.emptyString 61 | onTriggered: editorScene.changeCameraPosition(EditorScene.CameraPositionRight) 62 | } 63 | MenuItem { 64 | text: qsTr("Front (9)") + editorScene.emptyString 65 | onTriggered: editorScene.changeCameraPosition(EditorScene.CameraPositionFront) 66 | } 67 | MenuItem { 68 | text: qsTr("Back (Ctrl+9)") + editorScene.emptyString 69 | onTriggered: editorScene.changeCameraPosition(EditorScene.CameraPositionBack) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /editorlib/qml/ComponentPropertiesDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | Loader { 32 | id: componentDelegateLoader 33 | width: parent.width 34 | 35 | function componentTypeToDelegateSource(componentType) { 36 | if (componentType == EditorSceneItemComponentsModel.CameraEntity) 37 | return "CameraEntityDelegate.qml" 38 | if (componentType == EditorSceneItemComponentsModel.KeyboardInput) 39 | return "KeyboardInputComponentDelegate.qml" 40 | if (componentType == EditorSceneItemComponentsModel.Layer) 41 | return "LayerComponentDelegate.qml" 42 | if (componentType == EditorSceneItemComponentsModel.Light) 43 | return "LightComponentDelegate.qml" 44 | if (componentType == EditorSceneItemComponentsModel.Logic) 45 | return "LogicComponentDelegate.qml" 46 | if (componentType == EditorSceneItemComponentsModel.Material) 47 | return "MaterialComponentDelegate.qml" 48 | if (componentType == EditorSceneItemComponentsModel.Mesh) 49 | return "MeshComponentDelegate.qml" 50 | if (componentType == EditorSceneItemComponentsModel.MouseInput) 51 | return "MouseInputComponentDelegate.qml" 52 | if (componentType == EditorSceneItemComponentsModel.ObjectPicker) 53 | return "ObjectPickerComponentDelegate.qml" 54 | if (componentType == EditorSceneItemComponentsModel.Transform) 55 | return "TransformComponentDelegate.qml" 56 | if (componentType == EditorSceneItemComponentsModel.Internal) 57 | return "" 58 | 59 | return "UnknownComponentDelegate.qml" 60 | } 61 | 62 | source: componentTypeToDelegateSource(type) 63 | } 64 | -------------------------------------------------------------------------------- /editorlib/qml/DragEntity.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | Image { 31 | z: 5 32 | width: 32 33 | height: 32 34 | visible: false 35 | 36 | property int xDiff: width / 2 37 | property int yDiff: height / 2 38 | property var entityType 39 | property string entityName 40 | property string dragKey 41 | 42 | function startDrag(dragSource, image, key, startX, startY, meshType, startOpacity, name) { 43 | source = image 44 | Drag.source = dragSource 45 | Drag.hotSpot.x = -xDiff 46 | Drag.hotSpot.y = -yDiff 47 | Drag.keys = [ key ] 48 | dragKey = key 49 | x = startX + xDiff 50 | y = startY + yDiff 51 | visible = true 52 | entityType = meshType 53 | if (name) 54 | entityName = name 55 | if (startOpacity) 56 | opacity = startOpacity 57 | else 58 | opacity = 1.0 59 | Drag.active = true 60 | } 61 | 62 | function endDrag(drop) { 63 | var dropResult = Qt.IgnoreAction 64 | if (drop) 65 | dropResult = Drag.drop() 66 | 67 | x = 0 68 | y = 0 69 | Drag.active = false 70 | dragKey = "" 71 | visible = false 72 | 73 | return dropResult 74 | } 75 | 76 | function setPosition(xPos, yPos) { 77 | x = xPos + xDiff 78 | y = yPos + yDiff 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /editorlib/qml/EntityMenu.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import QtQuick.Controls 1.4 30 | import QtQml.Models 2.2 31 | import com.theqtcompany.SceneEditor3D 1.0 32 | 33 | Menu { 34 | property bool isPopup: false 35 | 36 | title: qsTr("Add Entity (A)") + editorScene.emptyString 37 | 38 | MenuItem { 39 | text: qsTr("Add Entity") + editorScene.emptyString 40 | enabled: false 41 | visible: isPopup 42 | } 43 | MenuSeparator { 44 | visible: isPopup 45 | } 46 | 47 | MenuItem { 48 | text: qsTr("Mesh") + editorScene.emptyString 49 | iconSource: "images/mesh.png" 50 | enabled: !entityTree.view.cameraSelected 51 | onTriggered: { 52 | entityTree.addNewEntity(EditorUtils.CuboidEntity) 53 | } 54 | } 55 | MenuItem { 56 | text: qsTr("Camera") + editorScene.emptyString 57 | iconSource: "images/camera.png" 58 | enabled: entityTree.view.sceneRootSelected 59 | onTriggered: { 60 | entityTree.addNewEntity(EditorUtils.CameraEntity) 61 | } 62 | } 63 | MenuItem { 64 | text: qsTr("Light") + editorScene.emptyString 65 | iconSource: "images/light.png" 66 | enabled: !entityTree.view.cameraSelected 67 | onTriggered: { 68 | entityTree.addNewEntity(EditorUtils.LightEntity) 69 | } 70 | } 71 | MenuItem { 72 | text: qsTr("Group") + editorScene.emptyString 73 | iconSource: "images/group.png" 74 | enabled: entityTree.view.groupSelected || entityTree.view.sceneRootSelected 75 | onTriggered: { 76 | entityTree.addNewEntity(EditorUtils.GroupEntity) 77 | } 78 | } 79 | } 80 | 81 | -------------------------------------------------------------------------------- /editorlib/qml/MeshDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | Item { 32 | width: parent.width 33 | height: columnLayout.y + columnLayout.height + 8 34 | 35 | default property alias _contentChildren: columnLayout.data 36 | property int componentType: EditorSceneItemComponentsModel.Unknown 37 | 38 | Column { 39 | id: columnLayout 40 | spacing: 4 41 | anchors.top: parent.top 42 | anchors.topMargin: 8 43 | anchors.left: parent.left 44 | anchors.leftMargin: 8 45 | anchors.right: parent.right 46 | anchors.rightMargin: 8 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /editorlib/qml/ObjectPickerComponentDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | ComponentDelegate { 32 | id: thisDelegate 33 | componentType: EditorSceneItemComponentsModel.ObjectPicker 34 | title: qsTr("Object Picker") + editorScene.emptyString 35 | 36 | CheckBoxPropertyInputField { 37 | checkBoxLabel: qsTr("Hover Enabled") + editorScene.emptyString 38 | propertyName: "hoverEnabled" 39 | component: componentData 40 | componentType: thisDelegate.componentType 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /editorlib/qml/PluginMain.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | Rectangle { 31 | color: editorContent.paneBackgroundColor 32 | 33 | function loadScene(url) { 34 | var folder = url.toString(); 35 | folder = decodeURIComponent(folder.replace(/\/[^\/]*$/, "")); 36 | editorContent.loadScene(url, folder) 37 | } 38 | 39 | EditorContent { 40 | id: editorContent 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /editorlib/qml/StandaloneMain.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import QtQuick.Controls 2.0 as QQC2 30 | import Qt.labs.settings 1.0 31 | import com.theqtcompany.SceneEditor3D 1.0 32 | 33 | QQC2.ApplicationWindow { 34 | id: standaloneWindow 35 | title: qsTr("Qt 3D Scene Editor") + editorContent.editorScene.emptyString + editorContent.saveFileTitleAddition 36 | width: 1280 37 | height: 800 38 | visible: false 39 | color: editorContent.paneBackgroundColor 40 | minimumHeight: 400 41 | minimumWidth: 640 42 | 43 | EditorContent { 44 | id: editorContent 45 | visible: false 46 | } 47 | 48 | onClosing: { 49 | close.accepted = editorContent.checkUnsavedChanges() 50 | } 51 | 52 | Component.onCompleted: { 53 | Qt.application.organization = "The Qt Company" 54 | Qt.application.domain = "qt.io" 55 | Qt.application.name = "Qt 3D Scene Editor" 56 | // Redraw everything to get rid of artifacts 57 | showMaximized() 58 | show() 59 | editorContent.visible = true 60 | } 61 | 62 | Settings { 63 | // Save window placement, size 64 | category: "Qt 3D SceneEditor Window" 65 | property alias x: standaloneWindow.x 66 | property alias y: standaloneWindow.y 67 | property alias width: standaloneWindow.width 68 | property alias height: standaloneWindow.height 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /editorlib/qml/ToolbarButton.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | EnableButton { 31 | height: 32 32 | width: 32 33 | anchors.verticalCenter: parent.verticalCenter 34 | hoveredBgColor: editorContent.listHighlightColor 35 | selectedBgColor: buttonEnabled === true ? editorContent.iconHighlightColor : "transparent" 36 | buttonEnabled: true 37 | } 38 | -------------------------------------------------------------------------------- /editorlib/qml/ToolbarSeparator.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | Rectangle { 31 | id: menuSeparator 32 | height: 24 33 | width: 1 34 | color: editorContent.listHighlightColor 35 | border.color: editorContent.itemBackgroundColor 36 | border.width: 1 37 | } 38 | -------------------------------------------------------------------------------- /editorlib/qml/TransformDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | Item { 32 | width: parent.width 33 | height: columnLayout.y + columnLayout.height + 8 34 | 35 | default property alias _contentChildren: columnLayout.data 36 | property bool editable: true 37 | property bool enabledField: true 38 | property int componentType: EditorSceneItemComponentsModel.Unknown 39 | 40 | Column { 41 | id: columnLayout 42 | spacing: 4 43 | anchors.top: parent.top 44 | anchors.topMargin: 8 45 | anchors.left: parent.left 46 | anchors.leftMargin: 8 47 | anchors.right: parent.right 48 | anchors.rightMargin: 8 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/CheckBoxPropertyInputField.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | PropertyInputField { 31 | id: checkBoxInput 32 | width: parent.width 33 | height: checkBox.height 34 | 35 | property string checkBoxLabel: checkBox.text 36 | property bool blockChanges: false 37 | property alias tooltip: checkBoxLabelItem.tooltip 38 | 39 | onComponentValueChanged: { 40 | blockChanges = true 41 | if (component !== null) 42 | checkBox.checked = component[propertyName] 43 | blockChanges = false 44 | } 45 | 46 | StyledLabel { 47 | id: checkBoxLabelItem 48 | text: checkBoxLabel 49 | anchors.left: parent.left 50 | anchors.verticalCenter: checkBox.verticalCenter 51 | horizontalAlignment: Text.AlignLeft 52 | verticalAlignment: Text.AlignVCenter 53 | } 54 | 55 | Rectangle { 56 | color: editorContent.paneBackgroundColor 57 | height: checkBoxInput.height 58 | width: checkBox.width + editorContent.controlMargin 59 | anchors.right: checkBox.right 60 | } 61 | 62 | StyledCheckBox { 63 | id: checkBox 64 | anchors.right: parent.right 65 | anchors.rightMargin: 11 66 | onCheckedChanged: { 67 | if (!blockChanges) 68 | handleEditingFinished(checked) 69 | } 70 | } 71 | } 72 | 73 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/FloatSliderPropertyInputField.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | PropertyInputField { 31 | id: floatSliderPropertyInputField 32 | width: parent.width 33 | height: sliderInputfield.height 34 | 35 | property alias label: sliderInputfield.label 36 | property alias stepSize: sliderInputfield.stepSize 37 | property alias minimum: sliderInputfield.minimum 38 | property alias maximum: sliderInputfield.maximum 39 | property alias roundDigits: sliderInputfield.roundDigits 40 | property alias tooltip: sliderInputfield.tooltip 41 | 42 | onComponentValueChanged: { 43 | if (component !== null) 44 | sliderInputfield.value = component[propertyName] 45 | } 46 | 47 | FloatSliderInputField { 48 | id: sliderInputfield 49 | lockProperty: floatSliderPropertyInputField.propertyName + editorScene.lockPropertySuffix 50 | lockComponent: floatSliderPropertyInputField.component 51 | value: 0 52 | onValueChanged: { 53 | handleEditingFinished(value) 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/Matrix4x4PropertyInputField.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | PropertyInputField { 31 | id: matrix4x4PropertyInputField 32 | width: parent.width 33 | height: matrix4x4InputField.height 34 | 35 | property alias label: matrix4x4InputField.label 36 | property alias cellwidth: matrix4x4InputField.cellwidth 37 | property alias roundDigits: matrix4x4InputField.roundDigits 38 | property alias affine: matrix4x4InputField.affine 39 | property bool lockedField: false 40 | property alias tooltip: matrix4x4InputField.tooltip 41 | 42 | onComponentValueChanged: { 43 | if (component !== null) 44 | matrix4x4InputField.value = component[propertyName] 45 | } 46 | 47 | Matrix4x4InputField { 48 | id: matrix4x4InputField 49 | onValueEdited: { 50 | handleEditingFinished(value) 51 | } 52 | enabled: !lockedField 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/ModelRoleInputField.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | Item { 32 | property int componentType: EditorSceneItemComponentsModel.Unknown 33 | property int modelRole: -1 34 | property var currentValue: null 35 | property string undoText: "" 36 | 37 | function handleEditingFinished(newValue) { 38 | if (currentValue !== newValue) { 39 | editorScene.undoHandler.createChangeModelRoleCommand( 40 | editorContent.selectedEntityName, componentType, 41 | modelRole, newValue, currentValue, undoText); 42 | } 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/PropertyInputField.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | Item { 32 | property string propertyName: "" 33 | property string entityName: editorContent.selectedEntityName 34 | property var component: null 35 | property int componentType: EditorSceneItemComponentsModel.Unknown 36 | property var componentValue: (component === null) ? "" : component[propertyName] 37 | 38 | // Inserts property change command to undostack (which also executes the command). 39 | // oldValue parameter can be used by subclass to control the undo value in cases 40 | // where temporary property changes are done before editing is finished. 41 | function handleEditingFinished(newValue, oldValue) { 42 | if (!oldValue) 43 | oldValue = component[propertyName] 44 | if (oldValue !== newValue) { 45 | editorScene.undoHandler.createChangePropertyCommand( 46 | entityName, componentType, 47 | propertyName, newValue, oldValue, true) 48 | } 49 | } 50 | 51 | // Changes the property without pushing it to undo stack. 52 | // Useful for changes that can be rejected, such as previewing color selection from ColorDialor. 53 | function doTemporaryPropertyChange(newValue) { 54 | var oldValue = component[propertyName]; 55 | if (oldValue !== newValue) { 56 | // Execute temporary command 57 | editorScene.undoHandler.createChangePropertyCommand( 58 | entityName, componentType, 59 | propertyName, newValue, oldValue, false) 60 | } 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/PropertyLockButton.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | EnableButton { 31 | property string lockProperty: editorScene.lockPropertySuffix 32 | property string label: "" // Dummy label, needs to be set by using component 33 | property var lockComponent: null 34 | property bool locked: false 35 | 36 | enabledIconSource: "images/lock_open.png" 37 | disabledIconSource: "images/lock_locked.png" 38 | tooltip: qsTr("Lock '%1' Properties").arg(label) + editorScene.emptyString 39 | buttonEnabled: !locked 40 | 41 | Component.onCompleted: { 42 | if (editorContent.selectedEntity) { 43 | var propertyLocked = editorContent.selectedEntity.customProperty(lockComponent, lockProperty) 44 | if (propertyLocked != undefined) 45 | locked = propertyLocked 46 | } 47 | } 48 | 49 | onEnabledButtonClicked: { 50 | locked = !locked 51 | editorContent.selectedEntity.setCustomProperty(lockComponent, lockProperty, locked) 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/StyledButton.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | Item { 31 | property alias text: buttonText.text 32 | property int margins: 4 33 | width: 100 34 | height: 32 35 | 36 | signal buttonClicked() 37 | 38 | Rectangle { 39 | id: control 40 | anchors.fill: parent 41 | anchors.margins: parent.margins 42 | color: { 43 | if (mouseArea.containsPress) 44 | editorContent.iconHighlightColor 45 | else if (mouseArea.containsMouse) // hover 46 | editorContent.listHighlightColor 47 | else 48 | "transparent" 49 | } 50 | border.color: listHighlightColor 51 | border.width: 1 52 | 53 | Text { 54 | id: buttonText 55 | anchors.centerIn: parent 56 | color: editorContent.textColor 57 | font.family: editorContent.labelFontFamily 58 | font.weight: editorContent.labelFontWeight 59 | font.pixelSize: editorContent.labelFontPixelSize 60 | } 61 | 62 | MouseArea { 63 | id: mouseArea 64 | anchors.fill: parent 65 | hoverEnabled: true 66 | activeFocusOnTab: true 67 | 68 | onClicked: { 69 | buttonClicked() 70 | } 71 | 72 | 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/StyledCheckBox.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import QtQuick.Controls 2.0 as QQC2 30 | 31 | QQC2.CheckBox { 32 | id: autoSaveCheckBox 33 | property alias indicatorWidth: indicatorRect.implicitWidth 34 | property alias indicatorHeight: indicatorRect.implicitHeight 35 | 36 | indicator: Rectangle { 37 | id: indicatorRect 38 | implicitWidth: 16 39 | implicitHeight: 16 40 | x: autoSaveCheckBox.leftPadding + (autoSaveCheckBox.availableWidth - width) / 2 41 | y: autoSaveCheckBox.topPadding + (autoSaveCheckBox.availableHeight - height) / 2 42 | color: editorContent.itemColor 43 | 44 | Image { 45 | x: (parent.width - width) / 2 46 | y: (parent.height - height) / 2 47 | source: "images/check.png" 48 | visible: autoSaveCheckBox.checkState === Qt.Checked 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/StyledLabel.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import QtQuick.Controls 1.4 30 | import QtQuick.Controls.Styles 1.4 31 | import QtQuick.Controls 2.0 as QQC2 32 | 33 | QQC2.Label { 34 | property alias tooltip: button.tooltip 35 | color: enabled ? editorContent.textColor : editorContent.disabledTextColor 36 | font.family: editorContent.labelFontFamily 37 | font.weight: editorContent.labelFontWeight 38 | font.pixelSize: editorContent.labelFontPixelSize 39 | 40 | Button { 41 | id: button 42 | anchors.fill: parent 43 | style: ButtonStyle { 44 | background: Rectangle { 45 | border.width: 0 46 | color: "transparent" 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/StyledRadioButton.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import QtQuick.Controls 2.0 as QQC2 30 | 31 | QQC2.RadioButton { 32 | id: radioButton 33 | indicator: Rectangle { 34 | implicitWidth: 20 35 | implicitHeight: 20 36 | x: radioButton.text ? 37 | (radioButton.mirrored ? radioButton.width - width 38 | - radioButton.rightPadding : 39 | radioButton.leftPadding) : 40 | radioButton.leftPadding + (radioButton.availableWidth 41 | - width) / 2 42 | y: radioButton.topPadding + (radioButton.availableHeight 43 | - height) / 2 44 | 45 | radius: width / 2 46 | border.width: 1 47 | border.color: radioButton.pressed ? editorContent.listHighlightColor 48 | : "#353637" 49 | color: radioButton.pressed ? editorContent.paneBackgroundColor 50 | : editorContent.itemColor 51 | 52 | Rectangle { 53 | x: (parent.width - width) / 2 54 | y: (parent.height - height) / 2 55 | width: 14 56 | height: 14 57 | radius: width / 2 58 | color: radioButton.pressed ? editorContent.textColor 59 | : editorContent.selectionColor 60 | visible: radioButton.checked 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/StyledSpinBox.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import QtQuick.Controls 2.0 as QQC2 30 | 31 | QQC2.SpinBox { 32 | id: control 33 | font.family: editorContent.labelFontFamily 34 | font.weight: editorContent.labelFontWeight 35 | font.pixelSize: editorContent.labelFontPixelSize 36 | 37 | background: Rectangle { 38 | border.color: editorContent.listHighlightColor 39 | color: editorContent.paneBackgroundColor 40 | } 41 | 42 | down.indicator: Rectangle { 43 | x: control.mirrored ? parent.width - width : 0 44 | height: parent.height 45 | implicitWidth: 40 46 | implicitHeight: 40 47 | border.color: editorContent.listHighlightColor 48 | color: editorContent.listHighlightColor 49 | Image { 50 | anchors.centerIn: parent 51 | source: "images/spinbox_down.png" 52 | } 53 | } 54 | 55 | up.indicator: Rectangle { 56 | x: control.mirrored ? 0 : parent.width - width 57 | height: parent.height 58 | implicitWidth: 40 59 | implicitHeight: 40 60 | border.color: editorContent.listHighlightColor 61 | color: editorContent.listHighlightColor 62 | Image { 63 | anchors.centerIn: parent 64 | source: "images/spinbox_up.png" 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/StyledTextField.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import QtQuick.Controls 2.0 as QQC2 30 | 31 | QQC2.TextField { 32 | background: TextFieldBackgroundStyle {} 33 | color: editorContent.textColor 34 | selectionColor: editorContent.selectionColor 35 | selectedTextColor: editorContent.textColor 36 | font.family: editorContent.labelFontFamily 37 | font.weight: editorContent.labelFontWeight 38 | font.pixelSize: editorContent.labelFontPixelSize 39 | } 40 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/StyledTextInput.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | TextInput { 31 | text: parent.textFromValue(parent.value, parent.locale) 32 | font: parent.font 33 | color: editorContent.textColor 34 | selectionColor: editorContent.selectionColor 35 | selectedTextColor: editorContent.textColor 36 | 37 | horizontalAlignment: Qt.AlignHCenter 38 | verticalAlignment: Qt.AlignVCenter 39 | validator: parent.validator 40 | selectByMouse: true 41 | } 42 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/TextFieldBackgroundStyle.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | Rectangle { 31 | color: parent.enabled ? editorContent.paneBackgroundColor : "transparent" 32 | border.color: parent.enabled ? editorContent.listHighlightColor : "white" 33 | } 34 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/Vector3DPropertyInputField.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | PropertyInputField { 31 | id: vectorPropertyInputField 32 | width: parent.width 33 | height: vectorInputField.height 34 | 35 | property alias label: vectorInputField.label 36 | property alias xLabel: vectorInputField.xLabel 37 | property alias yLabel: vectorInputField.yLabel 38 | property alias zLabel: vectorInputField.zLabel 39 | property alias minimum: vectorInputField.minimum 40 | property alias maximum: vectorInputField.maximum 41 | property alias roundDigits: vectorInputField.roundDigits 42 | property alias step: vectorInputField.step 43 | property vector3d fieldValue: component[propertyName] 44 | property bool lockedField: false 45 | property alias tooltip: vectorInputField.tooltip 46 | property alias tooltipArgs: vectorInputField.tooltipArgs 47 | 48 | onComponentValueChanged: { 49 | if (component !== null) 50 | vectorInputField.value = component[propertyName] 51 | } 52 | 53 | Vector3DInputField { 54 | id: vectorInputField 55 | lockProperty: vectorPropertyInputField.propertyName + editorScene.lockPropertySuffix 56 | lockComponent: vectorPropertyInputField.component 57 | onValueEdited: { 58 | handleEditingFinished(value) 59 | } 60 | enabled: !lockedField 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /editorlib/qml/inputfields/VisiblePropertyInputField.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | PropertyInputField { 32 | id: visibleInput 33 | width: parent.width 34 | 35 | property bool entityEnabled: true 36 | property string visibleOnImage 37 | property string visibleOffImage 38 | property bool propertyImagevisible: true 39 | componentType: EditorSceneItemComponentsModel.GeneralEntity 40 | 41 | onComponentValueChanged: { 42 | if (component !== null) 43 | entityEnabled = component[propertyName] 44 | } 45 | 46 | Image { 47 | id: visibleImage 48 | anchors.verticalCenter: parent.verticalCenter 49 | visible: propertyImagevisible 50 | source: { entityEnabled ? visibleOnImage : visibleOffImage } 51 | } 52 | 53 | function visibleImageClicked() { 54 | handleEditingFinished(entityEnabled) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /editorlib/qml/lights/DirectionalLightDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | BasicLightDelegate { 32 | id: thisItem 33 | 34 | Component.onCompleted: { 35 | initialState = false 36 | if (parent.repeater.directionSet) 37 | directionField.component[directionField.propertyName] = parent.repeater.lightDirection 38 | else 39 | parent.setNewDirection(directionField.component[directionField.propertyName]) 40 | } 41 | 42 | Vector3DPropertyInputField { 43 | id: directionField 44 | parent: inputLayout 45 | label: qsTr("Direction") + editorScene.emptyString 46 | propertyName: "worldDirection" 47 | component: lightComponentData 48 | componentType: thisItem.componentType 49 | onFieldValueChanged: { 50 | if (!thisItem.initialState) 51 | thisItem.parent.setNewDirection(fieldValue) 52 | } 53 | tooltip: qsTr("The point the light is\nfacing at on the %1 axis.") 54 | + editorScene.emptyString 55 | tooltipArgs: ["X", "Y", "Z"] 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /editorlib/qml/lights/UnknownLightDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | ComponentDelegate { 32 | title: qsTr("Unknown Light") + editorScene.emptyString 33 | } 34 | 35 | -------------------------------------------------------------------------------- /editorlib/qml/materials/PerVertexColorMaterialDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | MaterialDelegate { 31 | } 32 | 33 | -------------------------------------------------------------------------------- /editorlib/qml/materials/PhongAlphaMaterialDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | MaterialDelegate { 32 | id: thisDelegate 33 | componentType: EditorSceneItemComponentsModel.Material 34 | 35 | ColorPropertyInputField { 36 | label: qsTr("Ambient Color") + editorScene.emptyString 37 | propertyName: "ambient" 38 | component: materialComponentData 39 | componentType: thisDelegate.componentType 40 | tooltip: ambientColorTooltip 41 | } 42 | 43 | ColorPropertyInputField { 44 | label: qsTr("Diffuse Color") + editorScene.emptyString 45 | propertyName: "diffuse" 46 | component: materialComponentData 47 | componentType: thisDelegate.componentType 48 | tooltip: diffuseColorTooltip 49 | } 50 | 51 | ColorPropertyInputField { 52 | label: qsTr("Specular Color") + editorScene.emptyString 53 | propertyName: "specular" 54 | component: materialComponentData 55 | componentType: thisDelegate.componentType 56 | tooltip: specularColorTooltip 57 | } 58 | 59 | FloatPropertyInputField { 60 | label: qsTr("Alpha") + editorScene.emptyString 61 | propertyName: "alpha" 62 | component: materialComponentData 63 | componentType: thisDelegate.componentType 64 | minimum: 0 65 | maximum: 1 66 | step: 1000 // = 0.1 67 | tooltip: qsTr("Alpha is the transparency of the material.\n0 is fully transparent, and 1 is fully\nopaque.") 68 | + editorScene.emptyString 69 | } 70 | } 71 | 72 | -------------------------------------------------------------------------------- /editorlib/qml/materials/PhongMaterialDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | MaterialDelegate { 32 | id: thisDelegate 33 | componentType: EditorSceneItemComponentsModel.Material 34 | 35 | ColorPropertyInputField { 36 | label: qsTr("Ambient Color") + editorScene.emptyString 37 | propertyName: "ambient" 38 | component: materialComponentData 39 | componentType: thisDelegate.componentType 40 | tooltip: ambientColorTooltip 41 | } 42 | 43 | ColorPropertyInputField { 44 | label: qsTr("Diffuse Color") + editorScene.emptyString 45 | propertyName: "diffuse" 46 | component: materialComponentData 47 | componentType: thisDelegate.componentType 48 | tooltip: diffuseColorTooltip 49 | } 50 | 51 | ColorPropertyInputField { 52 | label: qsTr("Specular Color") + editorScene.emptyString 53 | propertyName: "specular" 54 | component: materialComponentData 55 | componentType: thisDelegate.componentType 56 | tooltip: specularColorTooltip 57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /editorlib/qml/materials/UnknownMaterialDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | MaterialDelegate { 31 | } 32 | 33 | -------------------------------------------------------------------------------- /editorlib/qml/meshes/CustomMeshDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | MeshDelegate { 32 | id: thisDelegate 33 | componentType: EditorSceneItemComponentsModel.Mesh 34 | 35 | FilePropertyInputField { 36 | label: qsTr("Source") + editorScene.emptyString 37 | propertyName: "source" 38 | component: meshComponentData 39 | componentType: thisDelegate.componentType 40 | dialog.nameFilters: [qsTr("Wavefront files (*.obj)") + editorScene.emptyString] 41 | defaultUrl: "qrc:/qt3deditorlib/meshes/defaultmesh.obj" 42 | tooltip: qsTr("The path to the object\nfile to be loaded.") + editorScene.emptyString 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /editorlib/qml/meshes/CylinderMeshDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | MeshDelegate { 32 | id: thisDelegate 33 | componentType: EditorSceneItemComponentsModel.Mesh 34 | 35 | IntPropertyInputField { 36 | label: qsTr("Rings") + editorScene.emptyString 37 | propertyName: "rings" 38 | component: meshComponentData 39 | componentType: thisDelegate.componentType 40 | minimum: 2 41 | tooltip: qsTr("Ring count of the cylinder.\nMinimum is 2.") + editorScene.emptyString 42 | } 43 | 44 | IntPropertyInputField { 45 | label: qsTr("Slices") + editorScene.emptyString 46 | propertyName: "slices" 47 | component: meshComponentData 48 | componentType: thisDelegate.componentType 49 | minimum: 2 50 | tooltip: qsTr("Slice count of the cylinder.\nMinimum is 2.") + editorScene.emptyString 51 | } 52 | 53 | FloatPropertyInputField { 54 | label: qsTr("Radius") + editorScene.emptyString 55 | propertyName: "radius" 56 | component: meshComponentData 57 | componentType: thisDelegate.componentType 58 | tooltip: qsTr("Radius of the cylinder.") + editorScene.emptyString 59 | } 60 | 61 | FloatPropertyInputField { 62 | label: qsTr("Length") + editorScene.emptyString 63 | propertyName: "length" 64 | component: meshComponentData 65 | componentType: thisDelegate.componentType 66 | tooltip: qsTr("Length of the cylinder.") + editorScene.emptyString 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /editorlib/qml/meshes/PlaneMeshDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | import QtQuick.Layouts 1.2 31 | 32 | MeshDelegate { 33 | id: thisDelegate 34 | componentType: EditorSceneItemComponentsModel.Mesh 35 | 36 | FloatPropertyInputField { 37 | label: qsTr("Width") + editorScene.emptyString 38 | propertyName: "width" 39 | component: meshComponentData 40 | componentType: thisDelegate.componentType 41 | minimum: 0.00001 42 | tooltip: qsTr("Width of the plane.") + editorScene.emptyString 43 | } 44 | 45 | FloatPropertyInputField { 46 | label: qsTr("Height") + editorScene.emptyString 47 | propertyName: "height" 48 | component: meshComponentData 49 | componentType: thisDelegate.componentType 50 | minimum: 0.00001 51 | tooltip: qsTr("Height of the plane.") + editorScene.emptyString 52 | } 53 | 54 | StyledLabel { 55 | text: qsTr("Resolution") + editorScene.emptyString 56 | Layout.alignment: Qt.AlignLeft 57 | } 58 | 59 | SizePropertyInputField { 60 | label: qsTr("W - H") + editorScene.emptyString 61 | widthLabel: editorScene.emptyString 62 | heightLabel: " - " 63 | propertyName: "meshResolution" 64 | component: meshComponentData 65 | componentType: thisDelegate.componentType 66 | minimum: 2 67 | tooltip: qsTr("Resolution of the plane, i.e. how\nmany strips the mesh is divided into.") 68 | + editorScene.emptyString 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /editorlib/qml/meshes/SphereMeshDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | MeshDelegate { 32 | id: thisDelegate 33 | componentType: EditorSceneItemComponentsModel.Mesh 34 | 35 | IntPropertyInputField { 36 | label: qsTr("Rings") + editorScene.emptyString 37 | propertyName: "rings" 38 | component: meshComponentData 39 | componentType: thisDelegate.componentType 40 | minimum: 2 41 | tooltip: qsTr("Ring count of the sphere.\nMinimum is 2.") + editorScene.emptyString 42 | } 43 | 44 | IntPropertyInputField { 45 | label: qsTr("Slices") + editorScene.emptyString 46 | propertyName: "slices" 47 | component: meshComponentData 48 | componentType: thisDelegate.componentType 49 | minimum: 2 50 | tooltip: qsTr("Slice count of the sphere.\nMinimum is 2.") + editorScene.emptyString 51 | } 52 | 53 | FloatPropertyInputField { 54 | label: qsTr("Radius") + editorScene.emptyString 55 | propertyName: "radius" 56 | component: meshComponentData 57 | componentType: thisDelegate.componentType 58 | tooltip: qsTr("Radius of the sphere.") + editorScene.emptyString 59 | } 60 | 61 | CheckBoxPropertyInputField { 62 | checkBoxLabel: qsTr("Generate Tangents") + editorScene.emptyString 63 | propertyName: "generateTangents" 64 | component: meshComponentData 65 | componentType: thisDelegate.componentType 66 | tooltip: qsTr("Check to enable automatic tangent generation\nfor the sphere. Needs to be checked\nfor textures to work properly.") 67 | + editorScene.emptyString 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /editorlib/qml/meshes/TorusMeshDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | MeshDelegate { 32 | id: thisDelegate 33 | componentType: EditorSceneItemComponentsModel.Mesh 34 | 35 | IntPropertyInputField { 36 | label: qsTr("Rings") + editorScene.emptyString 37 | propertyName: "rings" 38 | component: meshComponentData 39 | componentType: thisDelegate.componentType 40 | minimum: 2 41 | tooltip: qsTr("Ring count of the torus.\nMinimum is 2.") + editorScene.emptyString 42 | } 43 | 44 | IntPropertyInputField { 45 | label: qsTr("Slices") + editorScene.emptyString 46 | propertyName: "slices" 47 | component: meshComponentData 48 | componentType: thisDelegate.componentType 49 | minimum: 2 50 | tooltip: qsTr("Slice count of the torus.\nMinimum is 2.") + editorScene.emptyString 51 | } 52 | 53 | FloatPropertyInputField { 54 | label: qsTr("Ring Radius") + editorScene.emptyString 55 | propertyName: "radius" 56 | component: meshComponentData 57 | componentType: thisDelegate.componentType 58 | tooltip: qsTr("Ring radius, i.e. the size of the torus.") 59 | + editorScene.emptyString 60 | } 61 | 62 | FloatPropertyInputField { 63 | id: innerRadius 64 | label: qsTr("Tube Radius") + editorScene.emptyString 65 | propertyName: "minorRadius" 66 | component: meshComponentData 67 | componentType: thisDelegate.componentType 68 | tooltip: qsTr("Tube radius, i.e. the radius of the tube.") 69 | + editorScene.emptyString 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /editorlib/qml/meshes/UnknownMeshDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | MeshDelegate { 31 | } 32 | 33 | -------------------------------------------------------------------------------- /editorlib/qml/transforms/MatrixTransformDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | import com.theqtcompany.SceneEditor3D 1.0 30 | 31 | TransformDelegate { 32 | id: thisDelegate 33 | componentType: EditorSceneItemComponentsModel.Transform 34 | editable: false 35 | enabledField: parent.enabledFields 36 | 37 | Matrix4x4PropertyInputField { 38 | id: positionVectorField 39 | label: qsTr("Transform Matrix") + editorScene.emptyString 40 | propertyName: "matrix" 41 | component: transformComponentData 42 | componentType: thisDelegate.componentType 43 | lockedField: enabledField 44 | tooltip: qsTr("Transform matrix of the entity.") + editorScene.emptyString 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /editorlib/qml/transforms/UnknownTransformDelegate.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | import QtQuick 2.5 29 | 30 | TransformDelegate { 31 | } 32 | 33 | -------------------------------------------------------------------------------- /editorlib/shaders/ontopmaterial.frag: -------------------------------------------------------------------------------- 1 | #define FP highp 2 | 3 | uniform lowp vec4 handleColor; 4 | 5 | void main() 6 | { 7 | gl_FragColor = handleColor; 8 | } 9 | -------------------------------------------------------------------------------- /editorlib/shaders/ontopmaterial.vert: -------------------------------------------------------------------------------- 1 | attribute highp vec3 vertexPosition; 2 | 3 | uniform highp mat4 modelViewProjection; 4 | 5 | void main() 6 | { 7 | gl_Position = modelViewProjection * vec4( vertexPosition, 1.0 ); 8 | // Set the Z value of the vertex so that it'll always get drawn on top of everything else 9 | gl_Position.z = 0.0; 10 | } 11 | -------------------------------------------------------------------------------- /editorlib/src/components/lightcomponentproxyitem.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "lightcomponentproxyitem.h" 29 | #include "editorsceneitemlightcomponentsmodel.h" 30 | 31 | #include 32 | 33 | LightComponentProxyItem::LightComponentProxyItem(EditorSceneItemComponentsModel *sceneItemModel, 34 | Qt3DRender::QAbstractLight *component, 35 | QObject *parent) 36 | : QObject(parent) 37 | , m_component(component) 38 | , m_model(new EditorSceneItemLightComponentsModel(m_component, sceneItemModel, this)) 39 | { 40 | } 41 | 42 | LightComponentProxyItem::~LightComponentProxyItem() 43 | { 44 | 45 | } 46 | 47 | Qt3DRender::QAbstractLight *LightComponentProxyItem::component() const 48 | { 49 | return m_component; 50 | } 51 | 52 | EditorSceneItemLightComponentsModel *LightComponentProxyItem::model() const 53 | { 54 | return m_model; 55 | } 56 | 57 | void LightComponentProxyItem::beginResetComponent(Qt3DRender::QAbstractLight *component) 58 | { 59 | m_model->beginReplace(); 60 | m_component = component; 61 | } 62 | 63 | void LightComponentProxyItem::endResetComponent() 64 | { 65 | m_model->endReplace(m_component); 66 | } 67 | -------------------------------------------------------------------------------- /editorlib/src/components/lightcomponentproxyitem.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef LIGHTCOMPONENTPROXYITEM_H 29 | #define LIGHTCOMPONENTPROXYITEM_H 30 | 31 | #include 32 | 33 | namespace Qt3DRender { 34 | class QAbstractLight; 35 | class QPhongAlphaMaterial; 36 | } 37 | 38 | class EditorSceneItemLightComponentsModel; 39 | class EditorSceneItemComponentsModel; 40 | 41 | class LightComponentProxyItem : public QObject 42 | { 43 | Q_OBJECT 44 | Q_PROPERTY(Qt3DRender::QAbstractLight* component READ component CONSTANT) 45 | Q_PROPERTY(EditorSceneItemLightComponentsModel* model READ model CONSTANT) 46 | public: 47 | explicit LightComponentProxyItem(EditorSceneItemComponentsModel *sceneItemModel, 48 | Qt3DRender::QAbstractLight *component, 49 | QObject *parent = 0); 50 | ~LightComponentProxyItem(); 51 | 52 | Qt3DRender::QAbstractLight* component() const; 53 | 54 | EditorSceneItemLightComponentsModel* model() const; 55 | 56 | void beginResetComponent(Qt3DRender::QAbstractLight *component); 57 | void endResetComponent(); 58 | private: 59 | Qt3DRender::QAbstractLight *m_component; 60 | EditorSceneItemLightComponentsModel *m_model; 61 | }; 62 | 63 | Q_DECLARE_METATYPE(LightComponentProxyItem*) 64 | 65 | #endif // LIGHTCOMPONENTPROXYITEM_H 66 | -------------------------------------------------------------------------------- /editorlib/src/components/materialcomponentproxyitem.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "materialcomponentproxyitem.h" 29 | #include "editorsceneitemmaterialcomponentsmodel.h" 30 | 31 | #include 32 | 33 | MaterialComponentProxyItem::MaterialComponentProxyItem(EditorSceneItemComponentsModel *sceneItemModel, 34 | Qt3DRender::QMaterial *component, 35 | QObject *parent) 36 | : QObject(parent) 37 | , m_component(component) 38 | , m_model(new EditorSceneItemMaterialComponentsModel(m_component, sceneItemModel, this)) 39 | { 40 | } 41 | 42 | MaterialComponentProxyItem::~MaterialComponentProxyItem() 43 | { 44 | 45 | } 46 | 47 | Qt3DRender::QMaterial *MaterialComponentProxyItem::component() const 48 | { 49 | return m_component; 50 | } 51 | 52 | EditorSceneItemMaterialComponentsModel *MaterialComponentProxyItem::model() const 53 | { 54 | return m_model; 55 | } 56 | 57 | void MaterialComponentProxyItem::beginResetComponent(Qt3DRender::QMaterial *component) 58 | { 59 | m_model->beginReplace(); 60 | m_component = component; 61 | } 62 | 63 | void MaterialComponentProxyItem::endResetComponent() 64 | { 65 | m_model->endReplace(m_component); 66 | } 67 | -------------------------------------------------------------------------------- /editorlib/src/components/materialcomponentproxyitem.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef MATERIALCOMPONENTPROXYITEM_H 29 | #define MATERIALCOMPONENTPROXYITEM_H 30 | 31 | #include 32 | 33 | namespace Qt3DRender { 34 | class QMaterial; 35 | } 36 | 37 | class EditorSceneItemMaterialComponentsModel; 38 | class EditorSceneItemComponentsModel; 39 | 40 | class MaterialComponentProxyItem : public QObject 41 | { 42 | Q_OBJECT 43 | Q_PROPERTY(Qt3DRender::QMaterial* component READ component CONSTANT) 44 | Q_PROPERTY(EditorSceneItemMaterialComponentsModel* model READ model CONSTANT) 45 | public: 46 | explicit MaterialComponentProxyItem(EditorSceneItemComponentsModel *sceneItemModel, 47 | Qt3DRender::QMaterial *component, QObject *parent = 0); 48 | ~MaterialComponentProxyItem(); 49 | 50 | Qt3DRender::QMaterial* component() const; 51 | 52 | EditorSceneItemMaterialComponentsModel* model() const; 53 | 54 | void beginResetComponent(Qt3DRender::QMaterial *component); 55 | void endResetComponent(); 56 | 57 | private: 58 | Qt3DRender::QMaterial *m_component; 59 | EditorSceneItemMaterialComponentsModel* m_model; 60 | }; 61 | 62 | Q_DECLARE_METATYPE(MaterialComponentProxyItem*) 63 | 64 | #endif // MATERIALCOMPONENTPROXYITEM_H 65 | -------------------------------------------------------------------------------- /editorlib/src/components/meshcomponentproxyitem.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "meshcomponentproxyitem.h" 29 | #include "editorsceneitemmeshcomponentsmodel.h" 30 | 31 | #include 32 | 33 | MeshComponentProxyItem::MeshComponentProxyItem(EditorSceneItemComponentsModel *sceneItemModel, 34 | Qt3DRender::QGeometryRenderer *component, 35 | QObject *parent) 36 | : QObject(parent) 37 | , m_component(component) 38 | , m_model(new EditorSceneItemMeshComponentsModel(m_component, sceneItemModel, this)) 39 | { 40 | } 41 | 42 | MeshComponentProxyItem::~MeshComponentProxyItem() 43 | { 44 | 45 | } 46 | 47 | Qt3DRender::QGeometryRenderer *MeshComponentProxyItem::component() const 48 | { 49 | return m_component; 50 | } 51 | 52 | EditorSceneItemMeshComponentsModel *MeshComponentProxyItem::model() const 53 | { 54 | return m_model; 55 | } 56 | 57 | void MeshComponentProxyItem::beginResetComponent(Qt3DRender::QGeometryRenderer *component) 58 | { 59 | m_model->beginReplace(); 60 | m_component = component; 61 | } 62 | 63 | void MeshComponentProxyItem::endResetComponent() 64 | { 65 | m_model->endReplace(m_component); 66 | } 67 | -------------------------------------------------------------------------------- /editorlib/src/components/meshcomponentproxyitem.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef MESHCOMPONENTPROXYITEM_H 29 | #define MESHCOMPONENTPROXYITEM_H 30 | 31 | #include 32 | 33 | namespace Qt3DRender { 34 | class QGeometryRenderer; 35 | } 36 | 37 | class EditorSceneItemMeshComponentsModel; 38 | class EditorSceneItemComponentsModel; 39 | 40 | class MeshComponentProxyItem : public QObject 41 | { 42 | Q_OBJECT 43 | Q_PROPERTY(Qt3DRender::QGeometryRenderer* component READ component CONSTANT) 44 | Q_PROPERTY(EditorSceneItemMeshComponentsModel* model READ model CONSTANT) 45 | public: 46 | explicit MeshComponentProxyItem(EditorSceneItemComponentsModel *sceneItemModel, 47 | Qt3DRender::QGeometryRenderer *component, 48 | QObject *parent = 0); 49 | ~MeshComponentProxyItem(); 50 | 51 | Qt3DRender::QGeometryRenderer* component() const; 52 | 53 | EditorSceneItemMeshComponentsModel* model() const; 54 | 55 | void beginResetComponent(Qt3DRender::QGeometryRenderer *component); 56 | void endResetComponent(); 57 | 58 | private: 59 | Qt3DRender::QGeometryRenderer *m_component; 60 | EditorSceneItemMeshComponentsModel *m_model; 61 | }; 62 | 63 | Q_DECLARE_METATYPE(MeshComponentProxyItem*) 64 | 65 | #endif // MESHCOMPONENTPROXYITEM_H 66 | -------------------------------------------------------------------------------- /editorlib/src/components/qdummyobjectpicker.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "qdummyobjectpicker.h" 29 | 30 | QT_BEGIN_NAMESPACE 31 | 32 | QDummyObjectPicker::QDummyObjectPicker(Qt3DCore::QNode *parent) 33 | : m_hoverEnabled(false) 34 | { 35 | Q_UNUSED(parent) 36 | } 37 | 38 | void QDummyObjectPicker::setHoverEnabled(bool hoverEnabled) 39 | { 40 | if (hoverEnabled != m_hoverEnabled) { 41 | m_hoverEnabled = hoverEnabled; 42 | emit hoverEnabledChanged(); 43 | } 44 | } 45 | 46 | bool QDummyObjectPicker::hoverEnabled() const 47 | { 48 | return m_hoverEnabled; 49 | } 50 | 51 | void QDummyObjectPicker::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) 52 | { 53 | Q_UNUSED(change) 54 | } 55 | 56 | QT_END_NAMESPACE 57 | -------------------------------------------------------------------------------- /editorlib/src/components/qdummyobjectpicker.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef QDUMMYOBJECTPICKER_H 29 | #define QDUMMYOBJECTPICKER_H 30 | 31 | #include 32 | 33 | QT_BEGIN_NAMESPACE 34 | 35 | class QDummyObjectPicker : public Qt3DCore::QComponent 36 | { 37 | Q_OBJECT 38 | Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged) 39 | 40 | public: 41 | explicit QDummyObjectPicker(Qt3DCore::QNode *parent = nullptr); 42 | 43 | void setHoverEnabled(bool hoverEnabled); 44 | bool hoverEnabled() const; 45 | 46 | signals: 47 | void hoverEnabledChanged(); 48 | 49 | protected: 50 | void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; 51 | 52 | private: 53 | bool m_hoverEnabled; 54 | }; 55 | 56 | QT_END_NAMESPACE 57 | 58 | #endif // QDUMMYOBJECTPICKER_H 59 | -------------------------------------------------------------------------------- /editorlib/src/components/transformcomponentproxyitem.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "transformcomponentproxyitem.h" 29 | #include "editorsceneitemtransformcomponentsmodel.h" 30 | 31 | #include 32 | 33 | TransformComponentProxyItem::TransformComponentProxyItem(EditorSceneItemComponentsModel *sceneItemModel, 34 | Qt3DCore::QTransform *component, 35 | QObject *parent) 36 | : QObject(parent) 37 | , m_component(component) 38 | , m_model(new EditorSceneItemTransformComponentsModel(sceneItemModel, m_component, this)) 39 | { 40 | } 41 | 42 | TransformComponentProxyItem::~TransformComponentProxyItem() 43 | { 44 | 45 | } 46 | 47 | Qt3DCore::QTransform *TransformComponentProxyItem::component() const 48 | { 49 | return m_component; 50 | } 51 | 52 | EditorSceneItemTransformComponentsModel *TransformComponentProxyItem::model() const 53 | { 54 | return m_model; 55 | } 56 | 57 | void TransformComponentProxyItem::beginResetComponent(Qt3DCore::QTransform *component) 58 | { 59 | // Currently no transform replace is supported, as it is not needed 60 | // Might change if we want to support custom transform orderings 61 | m_component = component; 62 | } 63 | 64 | void TransformComponentProxyItem::endResetComponent() 65 | { 66 | // Currently no transform replace is supported, as it is not needed 67 | // Might change if we want to support custom transform orderings 68 | } 69 | -------------------------------------------------------------------------------- /editorlib/src/components/transformcomponentproxyitem.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef TRANSFORMCOMPONENTPROXYITEM_H 29 | #define TRANSFORMCOMPONENTPROXYITEM_H 30 | 31 | #include 32 | 33 | namespace Qt3DCore { 34 | class QTransform; 35 | } 36 | 37 | class EditorSceneItemTransformComponentsModel; 38 | class EditorSceneItemComponentsModel; 39 | 40 | class TransformComponentProxyItem : public QObject 41 | { 42 | Q_OBJECT 43 | Q_PROPERTY(Qt3DCore::QTransform* component READ component CONSTANT) 44 | Q_PROPERTY(EditorSceneItemTransformComponentsModel* model READ model CONSTANT) 45 | public: 46 | explicit TransformComponentProxyItem(EditorSceneItemComponentsModel *sceneItemModel, 47 | Qt3DCore::QTransform *component, QObject *parent = 0); 48 | ~TransformComponentProxyItem(); 49 | 50 | Qt3DCore::QTransform* component() const; 51 | 52 | EditorSceneItemTransformComponentsModel* model() const; 53 | 54 | void beginResetComponent(Qt3DCore::QTransform *component); 55 | void endResetComponent(); 56 | 57 | private: 58 | Qt3DCore::QTransform *m_component; 59 | EditorSceneItemTransformComponentsModel* m_model; 60 | }; 61 | 62 | Q_DECLARE_METATYPE(TransformComponentProxyItem*) 63 | 64 | #endif // TRANSFORMCOMPONENTPROXYITEM_H 65 | -------------------------------------------------------------------------------- /editorlib/src/editorscenesaver.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef EDITORSCENESAVER_H 29 | #define EDITORSCENESAVER_H 30 | 31 | #include 32 | 33 | namespace Qt3DCore { 34 | class QEntity; 35 | } 36 | 37 | class QTemporaryDir; 38 | 39 | class EditorSceneSaver : public QObject 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | explicit EditorSceneSaver(QObject *parent = 0); 45 | ~EditorSceneSaver(); 46 | 47 | bool saveScene(Qt3DCore::QEntity *sceneEntity, const QString &activeSceneCamera, 48 | const QString &saveFileName, bool autosave = false); 49 | 50 | Qt3DCore::QEntity *loadScene(const QString &fileName, Qt3DCore::QEntity *camera); 51 | void deleteSavedScene(const QString &saveFileName, bool autosave = false); 52 | 53 | private: 54 | QTemporaryDir *m_loadDir; 55 | }; 56 | 57 | #endif // EDITORSCENESAVER_H 58 | -------------------------------------------------------------------------------- /editorlib/src/materials/ontopeffect.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | 29 | #pragma once 30 | 31 | #include 32 | #include 33 | 34 | class OnTopEffect : public Qt3DRender::QEffect 35 | { 36 | public: 37 | explicit OnTopEffect(Qt3DCore::QNode *parent = 0); 38 | }; 39 | -------------------------------------------------------------------------------- /editorlib/src/qt3dsceneeditor.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | 29 | #ifndef QT3DSCENEEDITOR_H 30 | #define QT3DSCENEEDITOR_H 31 | 32 | #include 33 | 34 | #if defined(QT3D_SCENE_EDITOR_LIBRARY) 35 | # define QT3D_SCENE_EDITOR_EXPORT Q_DECL_EXPORT 36 | #else 37 | # define QT3D_SCENE_EDITOR_EXPORT Q_DECL_IMPORT 38 | #endif 39 | 40 | namespace Qt3DSceneEditorLib { 41 | 42 | QT3D_SCENE_EDITOR_EXPORT void register3DSceneEditorQML(); 43 | 44 | } 45 | 46 | #endif // QT3DSCENEEDITOR_H 47 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/copycamerapropertiescommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef COPYCAMERAPROPERTIESCOMMAND_H 29 | #define COPYCAMERAPROPERTIESCOMMAND_H 30 | 31 | #include "editorsceneitemmodel.h" 32 | 33 | #include 34 | 35 | class EditorSceneItemModel; 36 | 37 | namespace Qt3DRender { 38 | class QCamera; 39 | } 40 | 41 | class CopyCameraPropertiesCommand : public QUndoCommand 42 | { 43 | public: 44 | CopyCameraPropertiesCommand(const QString &text, EditorSceneItemModel *sceneModel, 45 | const QString &sourceCamera, 46 | const QString &targetCamera); 47 | ~CopyCameraPropertiesCommand(); 48 | 49 | virtual void undo(); 50 | virtual void redo(); 51 | 52 | private: 53 | Qt3DRender::QCamera *cameraEntity(const QString &cameraName); 54 | 55 | EditorSceneItemModel *m_sceneModel; 56 | QString m_sourceCamera; 57 | QString m_targetCamera; 58 | Qt3DRender::QCamera *m_originalSource; 59 | Qt3DRender::QCamera *m_originalTarget; 60 | }; 61 | 62 | #endif // COPYCAMERAPROPERTIESCOMMAND_H 63 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/duplicateentitycommand.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "duplicateentitycommand.h" 29 | 30 | #include "editorscene.h" 31 | #include "editorsceneitemmodel.h" 32 | #include "editorsceneitem.h" 33 | 34 | #include 35 | 36 | DuplicateEntityCommand::DuplicateEntityCommand(EditorSceneItemModel *sceneModel, 37 | const QString &entityName) : 38 | m_sceneModel(sceneModel), 39 | m_entityName(entityName) 40 | { 41 | setText(QObject::tr("Duplicate entity")); 42 | } 43 | 44 | void DuplicateEntityCommand::undo() 45 | { 46 | if (!m_duplicateName.isEmpty()) { 47 | QModelIndex index = m_sceneModel->getModelIndexByName(m_duplicateName); 48 | EditorSceneItem *item = m_sceneModel->editorSceneItemFromIndex(index); 49 | item->scene()->decrementDuplicateCount(); 50 | m_sceneModel->removeEntity(index); 51 | m_duplicateName.clear(); 52 | } 53 | } 54 | 55 | void DuplicateEntityCommand::redo() 56 | { 57 | QModelIndex index = m_sceneModel->getModelIndexByName(m_entityName); 58 | EditorSceneItem *item = m_sceneModel->editorSceneItemFromIndex(index); 59 | 60 | m_duplicateName = item->scene()->duplicateEntity(item->entity()); 61 | } 62 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/duplicateentitycommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef DUPLICATEENTITYCOMMAND_H 29 | #define DUPLICATEENTITYCOMMAND_H 30 | 31 | #include "editorutils.h" 32 | 33 | #include 34 | #include 35 | 36 | class EditorSceneItemModel; 37 | 38 | namespace Qt3DCore { 39 | class QEntity; 40 | } 41 | 42 | class DuplicateEntityCommand : public QUndoCommand 43 | { 44 | public: 45 | DuplicateEntityCommand(EditorSceneItemModel *sceneModel, const QString &entityName); 46 | 47 | virtual void undo(); 48 | virtual void redo(); 49 | 50 | private: 51 | EditorSceneItemModel *m_sceneModel; 52 | QString m_entityName; 53 | QString m_duplicateName; 54 | }; 55 | 56 | #endif // DUPLICATEENTITYCOMMAND_H 57 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/genericpropertychangecommand.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "genericpropertychangecommand.h" 29 | #include "undohandler.h" 30 | 31 | GenericPropertyChangeCommand::GenericPropertyChangeCommand(const QString &text, QObject *obj, 32 | const QString &propertyName, 33 | const QVariant &newValue, 34 | const QVariant &oldValue) : 35 | m_object(obj), 36 | m_propertyName(propertyName.toLatin1()), 37 | m_newValue(newValue), 38 | m_oldValue(oldValue) 39 | { 40 | if (text.isEmpty()) 41 | setText(QObject::tr("Change property")); 42 | else 43 | setText(text); 44 | } 45 | 46 | void GenericPropertyChangeCommand::undo() 47 | { 48 | if (isNonOp()) 49 | return; 50 | if (m_object) 51 | m_object->setProperty(m_propertyName, m_oldValue); 52 | } 53 | 54 | void GenericPropertyChangeCommand::redo() 55 | { 56 | if (isNonOp()) 57 | return; 58 | m_object->setProperty(m_propertyName, m_newValue); 59 | } 60 | 61 | bool GenericPropertyChangeCommand::isNonOp() const 62 | { 63 | return m_newValue == m_oldValue; 64 | } 65 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/genericpropertychangecommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef GENERICPROPERTYCHANGECOMMAND_H 29 | #define GENERICPROPERTYCHANGECOMMAND_H 30 | 31 | #include "editorsceneitemcomponentsmodel.h" 32 | 33 | #include 34 | 35 | class GenericPropertyChangeCommand : public QUndoCommand 36 | { 37 | public: 38 | GenericPropertyChangeCommand(const QString &text, 39 | QObject *obj, 40 | const QString &propertyName, 41 | const QVariant &newValue, 42 | const QVariant &oldValue); 43 | 44 | virtual void undo(); 45 | virtual void redo(); 46 | 47 | bool isNonOp() const; 48 | 49 | private: 50 | QObject *m_object; 51 | QByteArray m_propertyName; 52 | QVariant m_newValue; 53 | QVariant m_oldValue; 54 | }; 55 | 56 | #endif // GENERICPROPERTYCHANGECOMMAND_H 57 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/importentitycommand.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "importentitycommand.h" 29 | 30 | #include "editorsceneitem.h" 31 | #include "editorsceneitemmodel.h" 32 | 33 | #include 34 | #include 35 | 36 | ImportEntityCommand::ImportEntityCommand(EditorSceneItemModel *sceneModel, const QUrl &url) : 37 | m_sceneModel(sceneModel), 38 | m_url(url), 39 | m_importedEntity(nullptr) 40 | { 41 | setText(QObject::tr("Import entity")); 42 | } 43 | 44 | ImportEntityCommand::~ImportEntityCommand() 45 | { 46 | delete m_importedEntity; 47 | } 48 | 49 | void ImportEntityCommand::undo() 50 | { 51 | if (m_sceneModel->importEntityInProgress()) { 52 | m_sceneModel->abortImportEntity(); 53 | } else { 54 | QModelIndex index = m_sceneModel->getModelIndexByName(m_importedEntityName); 55 | EditorSceneItem *item = m_sceneModel->editorSceneItemFromIndex(index); 56 | m_importedEntity = m_sceneModel->duplicateEntity(item->entity(), nullptr); 57 | // Grab explicit ownership of the duplicated entity, 58 | // otherwise QML garbage collector may clean it up. 59 | QQmlEngine::setObjectOwnership(m_importedEntity, QQmlEngine::CppOwnership); 60 | 61 | m_sceneModel->removeEntity(index); 62 | } 63 | } 64 | 65 | void ImportEntityCommand::redo() 66 | { 67 | if (m_importedEntity) { 68 | m_sceneModel->insertExistingEntity(m_importedEntity, -1, m_sceneModel->sceneEntityIndex()); 69 | m_importedEntity = nullptr; 70 | } else { 71 | m_importedEntityName = m_sceneModel->importEntity(m_url); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/importentitycommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef IMPORTENTITYCOMMAND_H 29 | #define IMPORTENTITYCOMMAND_H 30 | 31 | #include 32 | #include 33 | 34 | class EditorSceneItemModel; 35 | 36 | namespace Qt3DCore { 37 | class QEntity; 38 | } 39 | 40 | class ImportEntityCommand : public QUndoCommand 41 | { 42 | public: 43 | ImportEntityCommand(EditorSceneItemModel *sceneModel, const QUrl &url); 44 | virtual ~ImportEntityCommand(); 45 | 46 | virtual void undo(); 47 | virtual void redo(); 48 | 49 | private: 50 | EditorSceneItemModel *m_sceneModel; 51 | QUrl m_url; 52 | QString m_importedEntityName; 53 | Qt3DCore::QEntity *m_importedEntity; 54 | }; 55 | 56 | #endif // IMPORTENTITYCOMMAND_H 57 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/insertentitycommand.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "insertentitycommand.h" 29 | 30 | #include "editorscene.h" 31 | #include "editorsceneitemmodel.h" 32 | 33 | #include 34 | 35 | InsertEntityCommand::InsertEntityCommand(EditorSceneItemModel *sceneModel, 36 | EditorUtils::InsertableEntities type, 37 | const QString &parentName, const QVector3D &pos) : 38 | m_sceneModel(sceneModel), 39 | m_type(type), 40 | m_parentName(parentName), 41 | m_insertPosition(pos) 42 | { 43 | setText(QObject::tr("Add new entity")); 44 | } 45 | 46 | void InsertEntityCommand::undo() 47 | { 48 | QModelIndex index = m_sceneModel->getModelIndexByName(m_insertedEntityName); 49 | m_sceneModel->removeEntity(index); 50 | m_insertedEntityName.clear(); 51 | } 52 | 53 | void InsertEntityCommand::redo() 54 | { 55 | QModelIndex parentIndex = m_sceneModel->getModelIndexByName(m_parentName); 56 | Qt3DCore::QEntity *entity = m_sceneModel->insertEntity(m_type, m_insertPosition, parentIndex); 57 | m_insertedEntityName = entity->objectName(); 58 | } 59 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/insertentitycommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef INSERTENTITYCOMMAND_H 29 | #define INSERTENTITYCOMMAND_H 30 | 31 | #include "editorutils.h" 32 | 33 | #include 34 | #include 35 | 36 | class EditorSceneItemModel; 37 | 38 | namespace Qt3DCore { 39 | class QEntity; 40 | } 41 | 42 | class InsertEntityCommand : public QUndoCommand 43 | { 44 | public: 45 | InsertEntityCommand(EditorSceneItemModel *sceneModel, 46 | EditorUtils::InsertableEntities type, 47 | const QString &parentName, const QVector3D &pos); 48 | 49 | virtual void undo(); 50 | virtual void redo(); 51 | 52 | private: 53 | EditorSceneItemModel *m_sceneModel; 54 | EditorUtils::InsertableEntities m_type; 55 | QString m_parentName; 56 | QString m_insertedEntityName; 57 | QVector3D m_insertPosition; 58 | }; 59 | 60 | #endif // INSERTENTITYCOMMAND_H 61 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/modelrolechangecommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef MODELROLECHANGECOMMAND_H 29 | #define MODELROLECHANGECOMMAND_H 30 | 31 | #include "editorsceneitemcomponentsmodel.h" 32 | 33 | #include 34 | 35 | class EditorSceneItemModel; 36 | 37 | class ModelRoleChangeCommand : public QUndoCommand 38 | { 39 | public: 40 | ModelRoleChangeCommand(const QString &text, EditorSceneItemModel *sceneModel, 41 | const QString &entityName, 42 | EditorSceneItemComponentsModel::EditorSceneItemComponentTypes componentType, 43 | int roleIndex, 44 | const QVariant &newValue, 45 | const QVariant &oldValue); 46 | 47 | virtual void undo(); 48 | virtual void redo(); 49 | 50 | private: 51 | QAbstractItemModel *getTargetModel() const; 52 | int getRoleIndex(QAbstractItemModel *model) const; 53 | 54 | EditorSceneItemModel *m_sceneModel; 55 | QString m_entityName; 56 | EditorSceneItemComponentsModel::EditorSceneItemComponentTypes m_componentType; 57 | int m_modelRoleIndex; 58 | QVariant m_newValue; 59 | QVariant m_oldValue; 60 | }; 61 | 62 | #endif // MODELROLECHANGECOMMAND_H 63 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/pasteentitycommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef PASTEENTITYCOMMAND_H 29 | #define PASTEENTITYCOMMAND_H 30 | 31 | #include "editorutils.h" 32 | #include "editorscene.h" 33 | 34 | #include 35 | #include 36 | 37 | class EditorSceneItemModel; 38 | 39 | namespace Qt3DCore { 40 | class QEntity; 41 | } 42 | 43 | class PasteEntityCommand : public QUndoCommand 44 | { 45 | public: 46 | PasteEntityCommand(EditorSceneItemModel *sceneModel, EditorScene::ClipboardOperation operation, 47 | const QString &entityName, const QString &parentName, const QVector3D &pos); 48 | virtual ~PasteEntityCommand(); 49 | 50 | virtual void undo(); 51 | virtual void redo(); 52 | 53 | private: 54 | EditorSceneItemModel *m_sceneModel; 55 | EditorScene::ClipboardOperation m_operation; 56 | QString m_pastedEntityName; 57 | Qt3DCore::QEntity *m_cutEntity; 58 | QString m_cutEntityName; 59 | QString m_parentName; 60 | QVector3D m_pastePosition; 61 | QString m_cutParentEntityName; 62 | int m_cutFromRow; 63 | }; 64 | 65 | #endif // PASTEENTITYCOMMAND_H 66 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/removeentitycommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef REMOVEENTITYCOMMAND_H 29 | #define REMOVEENTITYCOMMAND_H 30 | 31 | #include 32 | 33 | class EditorSceneItemModel; 34 | 35 | namespace Qt3DCore { 36 | class QEntity; 37 | } 38 | 39 | class RemoveEntityCommand : public QUndoCommand 40 | { 41 | public: 42 | RemoveEntityCommand(EditorSceneItemModel *sceneModel, const QString &entityName); 43 | virtual ~RemoveEntityCommand(); 44 | 45 | virtual void undo(); 46 | virtual void redo(); 47 | 48 | private: 49 | EditorSceneItemModel *m_sceneModel; 50 | QString m_entityName; 51 | QString m_parentEntityName; 52 | int m_row; 53 | Qt3DCore::QEntity *m_removedEntity; 54 | }; 55 | 56 | #endif // REMOVEENTITYCOMMAND_H 57 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/renameentitycommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef RENAMEENTITYCOMMAND_H 29 | #define RENAMEENTITYCOMMAND_H 30 | 31 | #include "editorsceneitemmodel.h" 32 | 33 | #include 34 | 35 | class EditorSceneItemModel; 36 | 37 | class RenameEntityCommand : public QUndoCommand 38 | { 39 | public: 40 | RenameEntityCommand(EditorSceneItemModel *sceneModel, 41 | const QString &oldName, const QString& newName); 42 | 43 | virtual void undo(); 44 | virtual void redo(); 45 | 46 | virtual bool mergeWith(const QUndoCommand *other); 47 | virtual int id() const; 48 | 49 | bool isNonOp() const; 50 | 51 | private: 52 | EditorSceneItemModel *m_sceneModel; 53 | QString m_oldName; 54 | QString m_newName; 55 | }; 56 | 57 | #endif // RENAMEENTITYCOMMAND_H 58 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/reparententitycommand.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "reparententitycommand.h" 29 | 30 | #include "editorscene.h" 31 | #include "editorsceneitemmodel.h" 32 | 33 | #include 34 | 35 | ReparentEntityCommand::ReparentEntityCommand(EditorSceneItemModel *sceneModel, 36 | const QString &newParentName, 37 | const QString &entityName) : 38 | m_sceneModel(sceneModel), 39 | m_newParentName(newParentName), 40 | m_entityName(entityName) 41 | { 42 | setText(QObject::tr("Reparent entity")); 43 | } 44 | 45 | void ReparentEntityCommand::undo() 46 | { 47 | QModelIndex newParentIndex = m_sceneModel->getModelIndexByName(m_originalParentName); 48 | QModelIndex entityIndex = m_sceneModel->getModelIndexByName(m_entityName); 49 | m_sceneModel->reparentEntity(newParentIndex, entityIndex); 50 | } 51 | 52 | void ReparentEntityCommand::redo() 53 | { 54 | QModelIndex newParentIndex = m_sceneModel->getModelIndexByName(m_newParentName); 55 | QModelIndex entityIndex = m_sceneModel->getModelIndexByName(m_entityName); 56 | if (m_originalParentName.isEmpty()) 57 | m_originalParentName = m_sceneModel->entityName(m_sceneModel->parent(entityIndex)); 58 | m_sceneModel->reparentEntity(newParentIndex, entityIndex); 59 | } 60 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/reparententitycommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef REPARENTENTITYCOMMAND_H 29 | #define REPARENTENTITYCOMMAND_H 30 | 31 | #include "editorutils.h" 32 | 33 | #include 34 | #include 35 | 36 | class EditorSceneItemModel; 37 | 38 | namespace Qt3DCore { 39 | class QEntity; 40 | } 41 | 42 | class ReparentEntityCommand : public QUndoCommand 43 | { 44 | public: 45 | ReparentEntityCommand(EditorSceneItemModel *sceneModel, 46 | const QString &newParentName, const QString &entityName); 47 | 48 | virtual void undo(); 49 | virtual void redo(); 50 | 51 | private: 52 | EditorSceneItemModel *m_sceneModel; 53 | QString m_originalParentName; 54 | QString m_newParentName; 55 | QString m_entityName; 56 | }; 57 | 58 | #endif // REPARENTENTITYCOMMAND_H 59 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/replacecomponentcommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef REPLACECOMPONENTCOMMAND_H 29 | #define REPLACECOMPONENTCOMMAND_H 30 | 31 | #include "editorsceneitemcomponentsmodel.h" 32 | 33 | #include 34 | 35 | class EditorSceneItemModel; 36 | 37 | namespace Qt3DCore { 38 | class QComponent; 39 | } 40 | 41 | class ReplaceComponentCommand : public QUndoCommand 42 | { 43 | public: 44 | ReplaceComponentCommand(EditorSceneItemModel *sceneModel, 45 | const QString &entityName, 46 | EditorSceneItemComponentsModel::EditorSceneItemComponentTypes componentType, 47 | Qt3DCore::QComponent *newComponent, Qt3DCore::QComponent *oldComponent); 48 | virtual ~ReplaceComponentCommand(); 49 | 50 | virtual void undo(); 51 | virtual void redo(); 52 | 53 | private: 54 | void replaceAndSwap(); 55 | 56 | EditorSceneItemModel *m_sceneModel; 57 | QString m_entityName; 58 | EditorSceneItemComponentsModel::EditorSceneItemComponentTypes m_componentType; 59 | Qt3DCore::QComponent *m_component1; 60 | Qt3DCore::QComponent *m_component2; 61 | }; 62 | 63 | #endif // REPLACECOMPONENTCOMMAND_H 64 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/resetentitycommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef RESETENTITYCOMMAND_H 29 | #define RESETENTITYCOMMAND_H 30 | 31 | #include "editorutils.h" 32 | 33 | #include 34 | 35 | class EditorSceneItemModel; 36 | 37 | namespace Qt3DCore { 38 | class QEntity; 39 | } 40 | 41 | class ResetEntityCommand : public QUndoCommand 42 | { 43 | public: 44 | ResetEntityCommand(EditorSceneItemModel *sceneModel, 45 | const QString &entityName); 46 | virtual ~ResetEntityCommand(); 47 | 48 | virtual void undo(); 49 | virtual void redo(); 50 | 51 | private: 52 | EditorSceneItemModel *m_sceneModel; 53 | EditorUtils::InsertableEntities m_type; 54 | int m_row; 55 | QString m_entityName; 56 | QString m_parentEntityName; 57 | Qt3DCore::QEntity *m_removedEntity; 58 | }; 59 | 60 | #endif // RESETENTITYCOMMAND_H 61 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/resettransformcommand.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include "resettransformcommand.h" 29 | 30 | #include "editorscene.h" 31 | #include "editorsceneitem.h" 32 | #include "editorsceneitemmodel.h" 33 | #include "editorutils.h" 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | ResetTransformCommand::ResetTransformCommand(EditorSceneItemModel *sceneModel, 40 | const QString &entityName) : 41 | m_sceneModel(sceneModel), 42 | m_entityName(entityName), 43 | m_transformMatrix(QMatrix4x4()) 44 | { 45 | setText(QObject::tr("Reset transform")); 46 | } 47 | 48 | ResetTransformCommand::~ResetTransformCommand() 49 | { 50 | } 51 | 52 | void ResetTransformCommand::undo() 53 | { 54 | QModelIndex index = m_sceneModel->getModelIndexByName(m_entityName); 55 | EditorSceneItem *item = m_sceneModel->editorSceneItemFromIndex(index); 56 | Qt3DCore::QTransform *transform = EditorUtils::entityTransform(item->entity()); 57 | transform->setMatrix(m_transformMatrix); 58 | m_sceneModel->scene()->queueUpdateGroupSelectionBoxes(); 59 | } 60 | 61 | void ResetTransformCommand::redo() 62 | { 63 | QModelIndex index = m_sceneModel->getModelIndexByName(m_entityName); 64 | EditorSceneItem *item = m_sceneModel->editorSceneItemFromIndex(index); 65 | Qt3DCore::QTransform *transform = EditorUtils::entityTransform(item->entity()); 66 | m_transformMatrix = transform->matrix(); 67 | transform->setMatrix(QMatrix4x4()); 68 | m_sceneModel->scene()->queueUpdateGroupSelectionBoxes(); 69 | } 70 | -------------------------------------------------------------------------------- /editorlib/src/undohandler/resettransformcommand.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #ifndef RESETTRANSFORMCOMMAND_H 29 | #define RESETTRANSFORMCOMMAND_H 30 | 31 | #include "editorutils.h" 32 | 33 | #include 34 | #include 35 | 36 | class EditorSceneItemModel; 37 | 38 | namespace Qt3DCore { 39 | class QEntity; 40 | } 41 | 42 | class ResetTransformCommand : public QUndoCommand 43 | { 44 | public: 45 | ResetTransformCommand(EditorSceneItemModel *sceneModel, const QString &entityName); 46 | virtual ~ResetTransformCommand(); 47 | 48 | virtual void undo(); 49 | virtual void redo(); 50 | 51 | private: 52 | EditorSceneItemModel *m_sceneModel; 53 | QString m_entityName; 54 | QMatrix4x4 m_transformMatrix; 55 | }; 56 | 57 | #endif // RESETTRANSFORMCOMMAND_H 58 | -------------------------------------------------------------------------------- /qt3dsceneeditor.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | CONFIG += ordered 3 | SUBDIRS += editorlib standalone 4 | 5 | CREATOR_BUILD = $$(QTC_BUILD) 6 | CREATOR_SOURCE = $$(QTC_SOURCE) 7 | if(isEmpty(CREATOR_BUILD) | isEmpty(CREATOR_SOURCE)) { 8 | warning(Missing Qt Creator source or build tree. Skipping plugin. Set QTC_BUILD and QTC_SOURCE if you want to build qt creator plugin.) 9 | } else { 10 | SUBDIRS += creatorplugin 11 | } 12 | -------------------------------------------------------------------------------- /standalone/deployment.pri: -------------------------------------------------------------------------------- 1 | unix:!android { 2 | isEmpty(target.path) { 3 | qnx { 4 | target.path = /tmp/$${TARGET}/bin 5 | } else { 6 | target.path = /opt/$${TARGET}/bin 7 | } 8 | export(target.path) 9 | } 10 | INSTALLS += target 11 | } 12 | 13 | export(INSTALLS) 14 | -------------------------------------------------------------------------------- /standalone/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt3D Editor of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 as published by the Free Software 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT 21 | ** included in the packaging of this file. Please review the following 22 | ** information to ensure the GNU General Public License requirements will 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 24 | ** 25 | ** $QT_END_LICENSE$ 26 | ** 27 | ****************************************************************************/ 28 | #include 29 | #include 30 | #include "../editorlib/src/qt3dsceneeditor.h" 31 | 32 | int main(int argc, char *argv[]) 33 | { 34 | QApplication app(argc, argv); 35 | 36 | app.setOrganizationName("The Qt Company"); 37 | app.setOrganizationDomain("qt.io"); 38 | app.setApplicationName("Qt 3D Scene Editor"); 39 | 40 | Qt3DSceneEditorLib::register3DSceneEditorQML(); 41 | 42 | QQmlApplicationEngine engine; 43 | engine.load(QUrl(QStringLiteral("qrc:/qt3deditorlib/StandaloneMain.qml"))); 44 | 45 | return app.exec(); 46 | } 47 | -------------------------------------------------------------------------------- /standalone/standalone.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | TARGET = qt3dsceneeditor 4 | 5 | QT += qml quick widgets 6 | 7 | DEPENDPATH += ../editorlib 8 | INCLUDEPATH += ../editorlib 9 | 10 | win32:CONFIG (release, debug|release): LIBS += -L$$OUT_PWD/../editorlib/release -lqt3dsceneeditor 11 | else:win32:CONFIG (debug, debug|release): LIBS += -L$$OUT_PWD/../editorlib/debug -lqt3dsceneeditor 12 | else: LIBS += -L$$OUT_PWD/../editorlib -lqt3dsceneeditor 13 | 14 | CONFIG += c++11 15 | 16 | SOURCES += main.cpp 17 | 18 | # Default rules for deployment. 19 | include(deployment.pri) 20 | --------------------------------------------------------------------------------