!I (1670414, 1670415, 1670416, 1670424, 1670431):
[CRYENGINE.git] / Code / Sandbox / EditorQt / Mannequin / Controls / TransitionEditorPage.h
bloba017a89fde247e3148f08495945d0b51ebec133c
1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #ifndef __MANN_TRANSITION_EDITOR_PAGE__H__
4 #define __MANN_TRANSITION_EDITOR_PAGE__H__
6 #include <ICryMannequin.h>
8 #include "MannequinEditorPage.h"
9 #include "../MannequinBase.h"
10 #include "../MannequinNodes.h"
11 #include "Controls/PropertiesPanel.h"
12 #include "../SequencerSplitter.h"
13 #include "Dialogs/ToolbarDialog.h"
14 #include "../MannKeyPropertiesDlgFE.h"
15 #include "../SequencerDopeSheetToolbar.h"
16 #include "QMfcApp/qmfcviewporthost.h"
18 #include "MannDopeSheet.h"
20 struct SMannequinContexts;
21 class CMannequinModelViewport;
22 class CSequencerSequence;
23 class CFragmentSequencePlayback;
25 class CTransitionEditorPage : public CMannequinEditorPage
27 DECLARE_DYNAMIC(CTransitionEditorPage)
29 public:
30 CTransitionEditorPage(CWnd* pParent = NULL);
31 ~CTransitionEditorPage();
33 enum { IDD = IDD_MANN_TRANSITION_EDITOR_PAGE };
35 virtual CMannequinModelViewport* ModelViewport() const { return m_modelViewport; }
36 virtual CMannDopeSheet* TrackPanel() { return &m_wndTrackPanel; }
37 virtual CMannNodesCtrl* Nodes() { return &m_wndNodes; }
38 CMannKeyPropertiesDlgFE* KeyProperties() { return &m_wndKeyProperties; }
40 CSequencerSequence* Sequence() const { return m_sequence.get(); }
41 SFragmentHistoryContext* FragmentHistory() const { return m_fragmentHistory.get(); }
43 void SaveLayout(const XmlNodeRef& xmlLayout);
44 void LoadLayout(const XmlNodeRef& xmlLayout);
46 virtual void ValidateToolbarButtonsState();
47 void Update();
48 void PopulateAllClipTracks();
49 void InsertContextHistoryItems(const SScopeData& scopeData, const float keyTime);
50 void SetUIFromHistory();
51 void SetHistoryFromUI();
52 void OnUpdateTV(bool forceUpdate = false);
53 void OnSequenceRestart(float newTime);
54 void InitialiseToPreviewFile(const XmlNodeRef& xmlSequenceRoot);
55 void SetTagState(const TagState& tagState);
57 void SetTime(float fTime);
59 float GetMarkerTimeStart() const;
60 float GetMarkerTimeEnd() const;
62 void LoadSequence(const int scopeContextIdx, const FragmentID fromID, const FragmentID toID, const SFragTagState fromFragTag, const SFragTagState toFragTag, const SFragmentBlendUid blendUid);
63 void ClearSequence();
65 protected:
66 virtual BOOL OnInitDialog();
68 afx_msg void OnGoToStart();
69 afx_msg void OnGoToEnd();
70 afx_msg void OnPlay();
71 afx_msg void OnLoop();
72 afx_msg void OnToggle1P();
73 afx_msg void OnShowDebugOptions();
74 afx_msg void OnToggleTimelineUnits();
75 afx_msg void OnReloadAnimations();
76 afx_msg void OnToggleLookat();
77 afx_msg void OnClickRotateLocator();
78 afx_msg void OnClickTranslateLocator();
79 afx_msg void OnToggleShowSceneRoots();
80 afx_msg void OnToggleAttachToEntity();
82 afx_msg void OnToolbarDropDown(NMHDR* pnhdr, LRESULT* plr);
84 afx_msg void OnUpdateGoToStart(CCmdUI* pCmdUI);
85 afx_msg void OnUpdateGoToEnd(CCmdUI* pCmdUI);
86 afx_msg void OnUpdatePlay(CCmdUI* pCmdUI);
87 afx_msg void OnUpdateLoop(CCmdUI* pCmdUI);
89 afx_msg void OnSetFocus(CWnd* pOldWnd);
91 DECLARE_MESSAGE_MAP()
93 void OnPlayMenu(CPoint pos);
94 float PopulateClipTracks(CSequencerNode* node, const int scopeID);
95 virtual BOOL PreTranslateMessage(MSG* pMsg);
97 private:
98 void InitToolbar();
100 void PopulateTagList();
101 void SetTagStateOnCtrl(const SFragTagState& tagState);
102 SFragTagState GetTagStateFromCtrl() const;
103 void OnInternalVariableChange(IVariable* pVar);
104 void ResetForcedBlend();
105 void SelectFirstKey();
107 CMannDopeSheet m_wndTrackPanel;
108 CMannNodesCtrl m_wndNodes;
109 CPropertiesPanel m_tagsPanel;
110 CMannKeyPropertiesDlgFE m_wndKeyProperties;
111 CSequencerSplitter m_wndSplitterTracks;
112 CClampedSplitterWnd m_wndSplitterHorz;
113 CClampedSplitterWnd m_wndSplitterVert;
114 CSequencerDopeSheetToolbar m_cDlgToolBar;
115 CMannequinModelViewport* m_modelViewport;
116 QMfcContainer m_viewportHost;
117 QMfcViewportHost* m_pViewportWidget;
118 SMannequinContexts* m_contexts;
119 CFragmentSequencePlayback* m_sequencePlayback;
121 std::unique_ptr<SFragmentHistoryContext> m_contextHistory;
122 std::unique_ptr<SFragmentHistoryContext> m_fragmentHistory;
123 _smart_ptr<CSequencerSequence> m_sequence;
125 float m_fTime;
126 float m_fMaxTime;
127 float m_playSpeed;
128 uint32 m_seed;
129 bool m_bPlay;
130 bool m_bLoop;
131 bool m_draggingTime;
132 bool m_bRestartingSequence;
134 SLastChange m_lastChange;
135 TagState m_tagState;
136 bool m_bRefreshingTagCtrl;
137 TSmartPtr<CVarBlock> m_tagVars;
138 CTagControl m_tagControls;
140 SFragmentBlendUid m_forcedBlendUid;
142 FragmentID m_fromID;
143 FragmentID m_toID;
144 SFragTagState m_fromFragTag;
145 SFragTagState m_toFragTag;
146 ActionScopes m_scopeMaskFrom;
147 ActionScopes m_scopeMaskTo;
149 HACCEL m_hAccelerators;
152 #endif