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/SplineEditorRenderer.h

50 lines
1.2 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#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;
};