#pragma once #include "CurveEditorBase.h" #include "HandleDrawer.h" /** * @brief 样条编辑器绘制器 * * 负责控制点、选中高亮、拖拽预览线及 Handle 区域计算。 */ class SplineEditorRenderer { public: SplineEditorRenderer(CSigmaDoc* pDoc, HandleDrawer* pHandleDrawer); /** * @brief 使用 CDC 绘制所有控制点 */ void DrawHandlesByCDC(CDC* pDC, CCurveEx* pCurve) const; /** * @brief 绘制单个 Handle 或高亮当前选中 */ void DrawHandle(CXyDC* pDC, CDC* pScreenDC, CCurveEx* pCurve, int currentHandleIndex) const; /** * @brief 绘制指定索引的选中态 Handle */ void DrawSelectHandle(CDC* pScreenDC, CXyDC* pXyDC, CCurveEx* pCurve, int nHandle, DWORD handleDrawMode) const; /** * @brief 绘制拖拽预览线(R2_NOTXORPEN 擦除) */ void DrawDragPreview(CDC* pScreenDC, CXyDC* pXyDC, const CPointList& newPointList) const; /** * @brief 获取指定 Handle 的刷新区域 */ CRect GetRangeWidthIndex(CCurveEx* pCurve, int nIndex, CXyDC* pDC, CSize handleSize) const; /** * @brief 首节点使用稍大命中区域 */ CRect GetFirstNodeHandleRectFocus(CPoint point) const; private: CSigmaDoc* m_pDoc; HandleDrawer* m_pHandleDrawer; };