You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.1 KiB
C

1 month ago
#pragma once
#include "itemcurve.h"
1 month ago
#include "HandleDrawer.h"
#include <memory>
1 month ago
1 month ago
namespace NItem
{
#define DRAG_NODE_DEFAULT 0 //????????
#define DRAG_NODE_LINE 1 //??????
#define DRAG_NODE_COS 2 //??????
#define DRAG_NODE_SPLINE 3 //????????
#define DRAG_LINE_COLOR RGB(0,153,255)
#define TRACKER_SOLID 1
#define TRACKER_RECT 2
#define TRACKER_CIRCLE 4
#define TRACKER_NO_EDIT TRACKER_SOLID | TRACKER_CIRCLE
class CurveEditorBase : public CItemCurve
{
1 month ago
public:
1 month ago
CurveEditorBase(CSigmaDoc* pDoc);
virtual ~CurveEditorBase(void);
// Mouse event handlers
virtual void OnDraw(CXyDC* pDC) = 0;
virtual void OnLButtonDblClk(UINT nFlags, CPoint point) = 0;
virtual void OnLButtonDown(CDC* pDC, UINT nFlags, CPoint point, int vk) = 0;
virtual int OnMouseMove(CDC* pDC, UINT nFlags, CPoint point) = 0;
virtual void OnLButtonUp(CDC* pDC, UINT nFlags, CPoint point, int vk) = 0;
virtual BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) = 0;
virtual BOOL OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) = 0;
virtual BOOL OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) = 0;
virtual int GetSubMenu() = 0;
virtual void SetPos(POSITION pos) = 0;
virtual void Clear(void) = 0;
virtual void Draw(CDC* pDC) = 0;
virtual void DrawAssistant(CDC* pDC, int mouseX, int mouseY) = 0;
virtual int GetNumberOfNode() = 0;
virtual void EreaseHandles(CDC* pDC) = 0;
virtual void EndEdit(void) = 0;
virtual void CancelAll(void) = 0;
virtual BOOL IsCanCancelAll(void) = 0;
// Control point operations
virtual int HitTestHandle(CPoint point) = 0;
virtual void DeleteHandle(int nIndex) = 0;
virtual int AddHandle(CPoint point) = 0;
virtual BOOL IsCanAddHandle(CPoint point, double* pl0 = nullptr) = 0;
virtual CCurveEx* GetControlCurve(void) = 0; // ??????????????????
virtual void GetXY(CCurveEx* pValue, int nIndex, dfPoint& point) = 0;
virtual void AttachProcess(CPointList& oldPoints, CPointList& newPoints) = 0;
virtual void DrawMoveLine(void) = 0;
virtual void GetMarkCurve(void) = 0;
virtual CPoint2D GetCDown() const = 0;
virtual CPoint2D GetCLast() const = 0;
1 month ago
};
1 month ago
};