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.
kev/Drawer/Module/GeoSigmaDraw/CurveEditorSpline.h

65 lines
1.7 KiB
C++

#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 ?§á????¦Ë??
void DrawAssistant(CDC *pDC, int mouseX, int mouseY) override;
CCurveEx *GetControlCurve(void) override;
// ??§Õ???? virtual int AddHandle(double l0)
int AddHandle(double l0) override;
private:
// ?????????§Ö?????????????
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