forked from SwagSoftware/Kisak-Strike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurveeditorpanel.h
68 lines (50 loc) · 1.94 KB
/
curveeditorpanel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//====== Copyright © 1996-2003, Valve Corporation, All rights reserved. =======
//
// Purpose:
//
//=============================================================================
#ifndef CURVEEDITORPANEL_H
#define CURVEEDITORPANEL_H
#ifdef _WIN32
#pragma once
#endif
#include "vgui_controls/Panel.h"
//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
struct BGRA8888_t;
//-----------------------------------------------------------------------------
//
// Curve editor image panel
//
//-----------------------------------------------------------------------------
class CCurveEditorPanel : public vgui::Panel
{
DECLARE_CLASS_SIMPLE( CCurveEditorPanel, vgui::Panel );
public:
// constructor
CCurveEditorPanel( vgui::Panel *pParent, const char *pName );
~CCurveEditorPanel();
virtual void Paint( void );
virtual void PaintBackground( void );
virtual void OnCursorMoved( int x,int y );
virtual void OnMousePressed( vgui::MouseCode code );
virtual void OnMouseReleased( vgui::MouseCode code );
virtual void OnKeyCodePressed( vgui::KeyCode code );
protected:
// Control points + values...
virtual int FindOrAddControlPoint( float flIn, float flTolerance, float flOut ) = 0;
virtual int FindControlPoint( float flIn, float flTolerance ) = 0;
virtual int ModifyControlPoint( int nPoint, float flIn, float flOut ) = 0;
virtual void RemoveControlPoint( int nPoint ) = 0;
virtual float GetValue( float flIn ) = 0;
virtual int ControlPointCount() = 0;
virtual void GetControlPoint( int nPoint, float *pIn, float *pOut ) = 0;
// Converts screen location to normalized values and back
void ScreenToValue( int x, int y, float *pIn, float *pOut );
void ValueToScreen( float flIn, float flOut, int *x, int *y );
private:
int m_nSelectedPoint;
int m_nHighlightedPoint; // Used when not selecting
};
#endif // CURVEEDITORPANEL_H