Plasma Engine  2.0
Loading...
Searching...
No Matches
EditTool.h
1#pragma once
2
3#include <EditorFramework/Document/GameObjectDocument.h>
4#include <EditorFramework/EditorFrameworkDLL.h>
5
10
11class PL_EDITORFRAMEWORK_DLL plGameObjectGizmoInterface
12{
13public:
14 virtual plObjectAccessorBase* GetObjectAccessor() = 0;
15 virtual bool CanDuplicateSelection() const = 0;
16 virtual void DuplicateSelection() = 0;
17};
18
20
21enum class plEditToolSupportedSpaces
22{
23 LocalSpaceOnly,
24 WorldSpaceOnly,
25 LocalAndWorldSpace,
26};
27
28class PL_EDITORFRAMEWORK_DLL plGameObjectEditTool : public plReflectedClass
29{
30 PL_ADD_DYNAMIC_REFLECTION(plGameObjectEditTool, plReflectedClass);
31
32public:
34
35 void ConfigureTool(plGameObjectDocument* pDocument, plQtGameObjectDocumentWindow* pWindow, plGameObjectGizmoInterface* pInterface);
36
37 plGameObjectDocument* GetDocument() const { return m_pDocument; }
38 plQtGameObjectDocumentWindow* GetWindow() const { return m_pWindow; }
39 plGameObjectGizmoInterface* GetGizmoInterface() const { return m_pInterface; }
40 bool IsActive() const { return m_bIsActive; }
41 void SetActive(bool bActive);
42
43 virtual plEditorInputContext* GetEditorInputContextOverride() { return nullptr; }
44 virtual plEditToolSupportedSpaces GetSupportedSpaces() const { return plEditToolSupportedSpaces::WorldSpaceOnly; }
45 virtual bool GetSupportsMoveParentOnly() const { return false; }
46 virtual void GetGridSettings(plGridSettingsMsgToEngine& out_gridSettings) {}
47
48protected:
49 virtual void OnConfigured() = 0;
50 virtual void OnActiveChanged(bool bIsActive) {}
51
52private:
53 bool m_bIsActive = false;
54 plGameObjectDocument* m_pDocument = nullptr;
55 plQtGameObjectDocumentWindow* m_pWindow = nullptr;
56 plGameObjectGizmoInterface* m_pInterface = nullptr;
57};
Definition EditorInputContext.h:22
Definition GameObjectDocument.h:95
Definition EditTool.h:29
Definition EditTool.h:12
Definition EngineProcessMessages.h:508
Definition ObjectAccessorBase.h:8
Definition GameObjectDocumentWindow.moc.h:12
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86