Plasma Engine  2.0
Loading...
Searching...
No Matches
ComponentDragDropHandler.h
1#pragma once
2
3#include <EditorFramework/DragDrop/AssetDragDropHandler.h>
4
5class plDocument;
7
8class PL_EDITORFRAMEWORK_DLL plComponentDragDropHandler : public plAssetDragDropHandler
9{
10 PL_ADD_DYNAMIC_REFLECTION(plComponentDragDropHandler, plAssetDragDropHandler);
11
12protected:
13 void CreateDropObject(const plVec3& vPosition, const char* szType, const char* szProperty, const plVariant& value, plUuid parent, plInt32 iInsertChildIndex);
14
15 void AttachComponentToObject(const char* szType, const char* szProperty, const plVariant& value, plUuid ObjectGuid);
16
17 void MoveObjectToPosition(const plUuid& guid, const plVec3& vPosition, const plQuat& qRotation);
18
19 void MoveDraggedObjectsToPosition(plVec3 vPosition, bool bAllowSnap, const plVec3& normal);
20
21 void SelectCreatedObjects();
22
23 void BeginTemporaryCommands();
24
25 void EndTemporaryCommands();
26
27 void CancelTemporaryCommands();
28
29 plDocument* m_pDocument;
30 plHybridArray<plUuid, 16> m_DraggedObjects;
31
32 virtual void OnDragBegin(const plDragDropInfo* pInfo) override;
33
34 virtual void OnDragUpdate(const plDragDropInfo* pInfo) override;
35
36 virtual void OnDragCancel() override;
37
38 virtual void OnDrop(const plDragDropInfo* pInfo) override;
39
40 virtual float CanHandle(const plDragDropInfo* pInfo) const override;
41
42 plVec3 m_vAlignAxisWithNormal = plVec3::MakeZero();
43};
Definition AssetDragDropHandler.h:8
Definition ComponentDragDropHandler.h:9
Definition Document.h:57
virtual void OnDrop(const plDragDropInfo *pInfo)=0
Final call to finish the drag & drop operation. Handler is destroyed after this.
virtual void OnDragCancel()=0
Called when the drag operation leaves the designated area. The handler will be destroyed after this....
virtual float CanHandle(const plDragDropInfo *pInfo) const =0
Used to ask a handler whether it knows how to handle a certain drag & drop situation.
virtual void OnDragBegin(const plDragDropInfo *pInfo)=0
Called shortly after CanHandle returned true to begin handling a drag operation.
virtual void OnDragUpdate(const plDragDropInfo *pInfo)=0
Called to update the drag operation with the latest state.
This type is used to provide plDragDropHandler instances with all the important information for a dra...
Definition DragDropInfo.h:16
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
static plVec3Template< float > MakeZero()
Definition Vec3.h:38