Plasma Engine  2.0
Loading...
Searching...
No Matches
PropertyAnimAssetWindow.moc.h
1#pragma once
2
3#include <EditorFramework/DocumentWindow/GameObjectDocumentWindow.moc.h>
4#include <EditorFramework/EditTools/EditTool.h>
5#include <Foundation/Basics.h>
6#include <GuiFoundation/Widgets/CurveEditData.h>
7#include <QTreeView>
8#include <ToolsFoundation/Object/DocumentObjectManager.h>
9
11class QItemSelection;
12class QItemSelectionModel;
23class QKeyEvent;
25
26class plQtPropertyAnimAssetTreeView : public QTreeView
27{
28 Q_OBJECT
29
30public:
31 plQtPropertyAnimAssetTreeView(QWidget* pParent);
32 void initialize();
33
34Q_SIGNALS:
35 void DeleteSelectedItemsEvent();
36 void FrameSelectedItemsEvent();
37 void RebindSelectedItemsEvent();
38
39protected slots:
40 void onBeforeModelReset();
41 void onAfterModelReset();
42
43protected:
44 virtual void keyPressEvent(QKeyEvent* e) override;
45 virtual void contextMenuEvent(QContextMenuEvent* event) override;
46 void storeExpandState(const QModelIndex& parent);
47 void restoreExpandState(const QModelIndex& parent, QModelIndexList& newSelection);
48
49 QSet<QString> m_NotExpandedState;
50 QSet<QString> m_SelectedItems;
51};
52
54{
55 Q_OBJECT
56
57public:
60
61 virtual const char* GetWindowLayoutGroupName() const override { return "PropertyAnimAsset"; }
62
63public Q_SLOTS:
64 void ToggleViews(QWidget* pView);
65
66public:
69 virtual plObjectAccessorBase* GetObjectAccessor() override;
70 virtual bool CanDuplicateSelection() const override;
71 virtual void DuplicateSelection() override;
73
74protected:
75 virtual void InternalRedraw() override;
76 void PropertyAnimAssetEventHandler(const plPropertyAnimAssetDocumentEvent& e);
77
78private Q_SLOTS:
79 void onSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
80 void onScrubberPosChanged(plUInt64 uiTick);
81 void onDeleteSelectedItems();
82 void onRebindSelectedItems();
83 void onPlaybackTick();
84 void onPlayPauseClicked();
85 void onRepeatClicked();
86 void onAdjustDurationClicked();
87 void onDurationChangedEvent(double duration);
88 void onTreeItemDoubleClicked(const QModelIndex& index);
89 void onFrameSelectedTracks();
90
92 // Curve editor events
93
94 void onCurveInsertCpAt(plUInt32 uiCurveIdx, plInt64 tickX, double newPosY);
95 void onCurveCpMoved(plUInt32 curveIdx, plUInt32 cpIdx, plInt64 iTickX, double newPosY);
96 void onCurveCpDeleted(plUInt32 curveIdx, plUInt32 cpIdx);
97 void onCurveTangentMoved(plUInt32 curveIdx, plUInt32 cpIdx, float newPosX, float newPosY, bool rightTangent);
98 void onLinkCurveTangents(plUInt32 curveIdx, plUInt32 cpIdx, bool bLink);
99 void onCurveTangentModeChanged(plUInt32 curveIdx, plUInt32 cpIdx, bool rightTangent, int mode);
100
101 void onCurveBeginOperation(QString name);
102 void onCurveEndOperation(bool commit);
103 void onCurveBeginCpChanges(QString name);
104 void onCurveEndCpChanges();
105
107 // Color gradient editor events
108
109 void onGradientColorCpAdded(double posX, const plColorGammaUB& color);
110 void onGradientAlphaCpAdded(double posX, plUInt8 alpha);
111 void onGradientIntensityCpAdded(double posX, float intensity);
112 void MoveGradientCP(plInt32 idx, double newPosX, const char* szArrayName);
113 void onGradientColorCpMoved(plInt32 idx, double newPosX);
114 void onGradientAlphaCpMoved(plInt32 idx, double newPosX);
115 void onGradientIntensityCpMoved(plInt32 idx, double newPosX);
116 void RemoveGradientCP(plInt32 idx, const char* szArrayName);
117 void onGradientColorCpDeleted(plInt32 idx);
118 void onGradientAlphaCpDeleted(plInt32 idx);
119 void onGradientIntensityCpDeleted(plInt32 idx);
120 void onGradientColorCpChanged(plInt32 idx, const plColorGammaUB& color);
121 void onGradientAlphaCpChanged(plInt32 idx, plUInt8 alpha);
122 void onGradientIntensityCpChanged(plInt32 idx, float intensity);
123 void onGradientBeginOperation();
124 void onGradientEndOperation(bool commit);
125 // void onGradientNormalizeRange();
126
128 // Event track editor events
129 void onEventTrackInsertCpAt(plInt64 tickX, QString value);
130 void onEventTrackCpMoved(plUInt32 cpIdx, plInt64 iTickX);
131 void onEventTrackCpDeleted(plUInt32 cpIdx);
132 void onEventTrackBeginOperation(QString name);
133 void onEventTrackEndOperation(bool commit);
134 void onEventTrackBeginCpChanges(QString name);
135 void onEventTrackEndCpChanges();
136
138
139private:
140 plPropertyAnimAssetDocument* GetPropertyAnimDocument();
141 // void PropertyEventHandler(const plDocumentObjectPropertyEvent& e);
142 void StructureEventHandler(const plDocumentObjectStructureEvent& e);
143 void SelectionEventHandler(const plSelectionManagerEvent& e);
144 void CommandHistoryEventHandler(const plCommandHistoryEvent& e);
145 void UpdateCurveEditor();
146 void UpdateGradientEditor();
147 void UpdateEventTrackEditor();
148 void UpdateSelectionData();
149
150 plQtQuadViewWidget* m_pQuadViewWidget;
151 plCurveGroupData m_CurvesToDisplay;
152 plColorGradientAssetData* m_pGradientToDisplay = nullptr;
153 plInt32 m_iMapGradientToTrack = -1;
154 plDynamicArray<plInt32> m_MapSelectionToTrack;
155 plQtPropertyAnimAssetTreeView* m_pPropertyTreeView = nullptr;
156 plQtPropertyAnimModel* m_pPropertiesModel;
157 QItemSelectionModel* m_pSelectionModel = nullptr;
158 plQtCurve1DEditorWidget* m_pCurveEditor = nullptr;
159 plQtEventTrackEditorWidget* m_pEventTrackEditor = nullptr;
160 plQtColorGradientEditorWidget* m_pGradientEditor = nullptr;
161 plQtTimeScrubberToolbar* m_pScrubberToolbar = nullptr;
162 plQtDocumentPanel* m_pCurvePanel = nullptr;
163 plQtDocumentPanel* m_pColorGradientPanel = nullptr;
164 plQtDocumentPanel* m_pEventTrackPanel = nullptr;
165 bool m_bAnimTimerInFlight = false;
166};
167
A 8bit per channel unsigned normalized (values interpreted as 0-1) color storage format that represen...
Definition Color8UNorm.h:99
Definition ColorGradientAsset.h:49
Definition CurveEditData.h:109
Definition DynamicArray.h:81
Definition EditTool.h:12
Definition ObjectAccessorBase.h:8
Definition PropertyAnimAsset.h:62
Definition ColorGradientEditorWidget.moc.h:13
Definition Curve1DEditorWidget.moc.h:11
Definition DocumentPanel.moc.h:10
Definition EventTrackEditorWidget.moc.h:9
Definition GameObjectDocumentWindow.moc.h:12
Definition PropertyAnimAssetWindow.moc.h:54
virtual const char * GetWindowLayoutGroupName() const override
The 'GroupName' is used for serializing window layouts. It should be unique among different window ty...
Definition PropertyAnimAssetWindow.moc.h:61
Definition PropertyAnimAssetWindow.moc.h:27
Definition PropertyAnimModel.moc.h:36
Definition QuadViewWidget.moc.h:18
Definition TimeScrubberWidget.moc.h:52
Definition CommandHistory.h:31
Used by plDocumentObjectManager::m_PropertyEvents.
Definition DocumentObjectManager.h:77
Used by plDocumentObjectManager::m_StructureEvents.
Definition DocumentObjectManager.h:45
Definition PropertyAnimAsset.h:49
Definition SelectionManager.h:10