|
|
|
|
|
#pragma once
|
|
|
|
|
|
#include "CurveEditorBase.h"
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
|
|
namespace NItem {
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* ????????????????????????????
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
class CurveEditorSpline : public CurveEditorBase {
|
|
|
|
|
|
public:
|
|
|
|
|
|
CurveEditorSpline(CSigmaDoc *pDoc)
|
|
|
|
|
|
: CurveEditorBase(pDoc), m_pMarkCurve(nullptr)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virtual ~CurveEditorSpline(void);
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
// ????????????????????????
|
|
|
|
|
|
void OnDrawDragPreview() override;
|
|
|
|
|
|
|
|
|
|
|
|
// ????????????????????????
|
|
|
|
|
|
void OnCalculateDragEffect(CPointList *pList) override;
|
|
|
|
|
|
|
|
|
|
|
|
void OnModeInitialize() override; // ???? m_pMarkCurve
|
|
|
|
|
|
void OnDragMove(int nIndex,
|
|
|
|
|
|
CPoint2D pt) override; // ???? m_pControlCurve ?<3F><>????<3F><>??
|
|
|
|
|
|
|
|
|
|
|
|
void DrawAssistant(CDC *pDC, int mouseX, int mouseY) override;
|
|
|
|
|
|
|
|
|
|
|
|
CCurveEx *GetControlCurve(void) override;
|
|
|
|
|
|
|
|
|
|
|
|
// ??<3F><>???? virtual int AddHandle(double l0)
|
|
|
|
|
|
int AddHandle(double l0) override;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
// ?????????<3F><>?????????????
|
|
|
|
|
|
std::unique_ptr<CCurveEx> m_pMarkCurve;
|
|
|
|
|
|
std::unique_ptr<CCurveEx> m_pControlCurve;
|
|
|
|
|
|
|
|
|
|
|
|
// ???????????????
|
|
|
|
|
|
void GetMarkCurve(); // ????????????
|
|
|
|
|
|
void GetDragSplinePoint(CPoint2D &dp, CPointList &NewPointList, int &begin,
|
|
|
|
|
|
int &end);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* ??????????????????????
|
|
|
|
|
|
*
|
|
|
|
|
|
* \param handleInex ?????????
|
|
|
|
|
|
* \return ???????????????
|
|
|
|
|
|
*/
|
|
|
|
|
|
int GetOriginalIndex(int handleInex);
|
|
|
|
|
|
|
|
|
|
|
|
void BuildFirstHandlePoints(const CPoint2D &dp, double lEnd,
|
|
|
|
|
|
int nextHandleInex, CPointList &list);
|
|
|
|
|
|
void BuildLastHandlePoints(const CPoint2D &dp, double lBegin,
|
|
|
|
|
|
int prevHandleInex, CPointList &list);
|
|
|
|
|
|
void BuildMiddleHandlePoints(const CPoint2D &dp, double lBegin, double lEnd,
|
|
|
|
|
|
int prevHandleInex, int nextHandleIndex,
|
|
|
|
|
|
CPointList &list);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}; // namespace NItem
|