Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
SceneWindow.h
1/*
2Copyright (C) 2018,2019,2022,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGAMES_SCENEWINDOW_H
17#define AEONGAMES_SCENEWINDOW_H
18
19#include <QList>
20#include <memory>
21#include "ui_SceneWindow.h"
22#include "models/SceneModel.h"
23#include "models/ComponentListModel.h"
24#include "models/ComponentModel.h"
25#include "delegates/PropertyDelegate.h"
26
27namespace AeonGames
28{
29 class Renderer;
30 class EngineWindow;
32 class SceneWindow : public QWidget
33 {
34 Q_OBJECT
35 public:
41 SceneWindow ( QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags() );
43 virtual ~SceneWindow();
48 void Open ( const std::string& mFilename );
53 void Save ( const std::string& mFilename ) const;
58 void SetFieldOfView ( float aFieldOfView );
63 void SetNear ( float aNear );
68 void SetFar ( float aFar );
69 private slots:
70 void on_actionAddNode_triggered();
71 void on_actionRemoveNode_triggered();
72 void on_actionSetCameraNode_triggered();
73 void on_actionRemoveComponent_triggered();
74 void on_sceneContextMenuRequested ( const QPoint& aPoint );
75 void on_sceneTreeViewClicked ( const QModelIndex& aModelIndex );
76 void on_componentContextMenuRequested ( const QPoint& aPoint );
77 void on_componentListViewClicked ( const QModelIndex& aModelIndex );
78 void on_localTransformChanged();
79 void on_globalTransformChanged();
80 protected:
82 void closeEvent ( QCloseEvent *event ) override;
83 private:
84 void UpdateLocalTransformData ( const Node* aNode );
85 void UpdateGlobalTransformData ( const Node* aNode );
86 Ui::SceneWindow mUi;
88 SceneModel mSceneModel{};
89 ComponentListModel mComponentListModel{};
90 ComponentModel mComponentModel{};
91 PropertyDelegate mPropertyDelegate{};
92 EngineWindow* mEngineWindow{};
93 QList<QAction *> mComponentAddActions{};
94 };
95}
96#endif
List model that enumerates the components attached to a node.
Rendering window that hosts the engine viewport.
Scene graph node representing an entity in the game world.
Definition Node.hpp:54
Abstract base class for rendering backends.
Definition Renderer.hpp:44
Item model representing a scene's node tree for Qt views.
Definition SceneModel.h:28
SceneWindow(QWidget *parent=Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags())
Construct the scene window widget.
void Save(const std::string &mFilename) const
Save the scene to a file.
void Open(const std::string &mFilename)
Open a scene file.
virtual ~SceneWindow()
Destructor.
void closeEvent(QCloseEvent *event) override
Handle window close events.
void SetNear(float aNear)
Set the near clipping plane distance.
void SetFieldOfView(float aFieldOfView)
Set the camera field of view.
void SetFar(float aFar)
Set the far clipping plane distance.
<- This is here just for the literals
Definition AABB.hpp:31