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.

71 lines
2.1 KiB
C++

#pragma once
#include "itemfocusrect.h"
#include ".\itemselectcurve.h"
#pragma pack(1)
struct DeletionCondition
{
int kind; //删除依据 0--曲线长度 1--曲线名称 2--点类名称
double threshold; //门限值
int method; //删除方法
//筛选条件 <门限值
int ConditionDeletion;
LPCTSTR layerName; //层位
};
#pragma pack()
namespace NItem
{
#define DELETE_DEFAULT 0 //删除矩形范围内元素
#define DELETE_IN 1 //删除区域内元素
#define DELETE_OUT 2 //删除区域外元素
#define DELETE_CONDITION 3 //有条件删除元素
class CItemDelete :
public CItemFocusRect
{
public:
CItemDelete(CSigmaDoc * ppDoc);
virtual ~CItemDelete(void);
public:
void OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point, int vk) override;
int OnMouseMove(CDC *pDC, UINT nFlags, CPoint point) override;
void DoLButtonUp(CDC *pDC) override;
void OnRButtonDown(UINT nFlags, CPoint point) override;
int GetSubMenu() override;
int SetProcessIdea(int nIdea);
int GetProcessIdea(void);
int GetSelectWidthRegion(CPositionList& SelectList, POSITION curvePostion, int nOutSelect);
int IsInside(CCurveEx* pRgn, CRect8& rgnRange, COne* pOne);
BOOL CurveInRegion(CCurveEx* pCurve, CPositionList& rgnList); //曲线是否在指定的元素内,只要有一个在就返回TRUE
BOOL ElementInRegion(COne* pOne, CPositionList& rgnList); //元素是否在指定的曲线内,只要有一个在就返回TRUE
int GetCountSelected();
bool IsRegionSelected();
public:
int Delete(void);
void DeleteIn(void);
void DeleteOut(void);
int DeleteCondition(DeletionCondition * condition);
int m_idea; //处理方式
CItemSelectCurve *m_pSelectCurve;
//for condition
double value;
int sel;
int mode;
int condition;
CString strLayer;
CList<POSITION, POSITION> m_selectionSet;
bool m_bIsRegionSelected;
////////////
int CurveInRegion(CCurveEx* pCurve, CCurveEx* pRgn);//0为全不在范围内,1为全在范围内,2为部分在部分不在范围内
void DeleteSelectWidthLength(CList<POSITION,POSITION> &list, double value, int flag);
void DeleteSelectWidthName(CList<POSITION,POSITION> &list, double value, int flag, int type);
BOOL DeleteQualification(double length, double value, int flag);
void DeleteSelection(CList<POSITION, POSITION>* pList);
};
}