Plasma Engine  2.0
Loading...
Searching...
No Matches
Curve1DEditorWidget.moc.h
1#pragma once
2
3#include <Foundation/Math/CurveFunctions.h>
4#include <Foundation/Tracks/Curve1D.h>
5#include <GuiFoundation/GuiFoundationDLL.h>
6#include <GuiFoundation/ui_Curve1DEditorWidget.h>
7
8#include <QWidget>
9
10class PL_GUIFOUNDATION_DLL plQtCurve1DEditorWidget : public QWidget, public Ui_Curve1DEditorWidget
11{
12 Q_OBJECT
13
14public:
15 explicit plQtCurve1DEditorWidget(QWidget* pParent);
17
18 void SetCurveExtents(double fLowerBound, double fUpperBound, bool bLowerIsFixed, bool bUpperIsFixed);
19 void SetCurveRanges(double fLowerRange, double fUpperRange);
20
21 void SetCurves(const plCurveGroupData& curveData);
22 void SetScrubberPosition(plUInt64 uiTick);
23 void SetScrubberPosition(plTime time);
24 void ClearSelection();
25
26 void FrameCurve();
27 void FrameSelection();
28 void MakeRepeatable(bool bAdjustLastPoint);
29 void NormalizeCurveX(plUInt32 uiActiveCurve);
30 void NormalizeCurveY(plUInt32 uiActiveCurve);
31 void ClearAllPoints();
32 void MirrorHorizontally(plUInt32 uiActiveCurve);
33 void MirrorVertically(plUInt32 uiActiveCurve);
34
35Q_SIGNALS:
36 void CpMovedEvent(plUInt32 uiCurveIdx, plUInt32 uiIdx, plInt64 iTickX, double fNewPosY);
37 void CpDeletedEvent(plUInt32 uiCurveIdx, plUInt32 uiIdx);
38 void TangentMovedEvent(plUInt32 uiCurveIdx, plUInt32 uiIdx, float fNewPosX, float fNewPosY, bool bRightTangent);
39 void InsertCpEvent(plUInt32 uiCurveIdx, plInt64 iTickX, double value);
40 void TangentLinkEvent(plUInt32 uiCurveIdx, plUInt32 uiIdx, bool bLink);
41 void CpTangentModeEvent(plUInt32 uiCurveIdx, plUInt32 uiIdx, bool bRightTangent, int iMode); // plCurveTangentMode
42
43 void BeginCpChangesEvent(QString sName);
44 void EndCpChangesEvent();
45
46 void BeginOperationEvent(QString sName);
47 void EndOperationEvent(bool bCommit);
48
49private Q_SLOTS:
50 void on_LinePosition_editingFinished();
51 void on_LineValue_editingFinished();
52 void onDeleteControlPoints();
53 void onDoubleClick(const QPointF& scenePos, const QPointF& epsilon);
54 void onMoveControlPoints(double x, double y);
55 void onMoveTangents(float x, float y);
56 void onBeginOperation(QString name);
57 void onEndOperation(bool commit);
58 void onScaleControlPoints(QPointF refPt, double scaleX, double scaleY);
59 void onContextMenu(QPoint pos, QPointF scenePos);
60 void onAddPoint();
61 void onLinkTangents();
62 void onBreakTangents();
63 void onFlattenTangents();
64 void onSelectionChanged();
65 void onMoveCurve(plInt32 iCurve, double moveY);
66 void onGenerateCurve(plCurveFunction::Enum function, bool inverse);
67 void onSaveAsPreset();
68 void onLoadPreset();
69
70private:
71 void InsertCpAt(double posX, double value, plVec2d epsilon);
72 bool PickCurveAt(double x, double y, double fMaxDistanceY, plInt32& out_iCurveIdx, double& out_ValueY) const;
73 bool PickControlPointAt(double x, double y, plVec2d vMaxDistance, plInt32& out_iCurveIdx, plInt32& out_iCpIdx) const;
74 void UpdateSpinBoxes();
75 void SetTangentMode(plCurveTangentMode::Enum mode, bool bLeft, bool bRight);
76 void ClampPoint(double& x, double& y) const;
77 void SaveCurvePreset(const char* szFile) const;
78 plResult LoadCurvePreset(const char* szFile);
79 void FindAllPresets();
80
81 double m_fCurveDuration;
82 plVec2 m_vTangentMove;
83 plVec2d m_vControlPointMove;
84 plCurveGroupData m_Curves;
85 plCurveGroupData m_CurvesBackup;
86 QPointF m_ContextMenuScenePos;
87
88 static plDynamicArray<plString> s_CurvePresets;
89};
Definition CurveEditData.h:109
Definition DynamicArray.h:81
Definition Curve1DEditorWidget.moc.h:11
Enum
Definition CurveFunctions.h:19
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12