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.

48 lines
1.6 KiB
C++

#pragma once
#include "GlobalDefine.h"
#include "DataPoint.h"
#include "LabVecRang.h"
//管理一条连续线段的点
class CSequentialPoint
{
public:
CSequentialPoint(void);
~CSequentialPoint(void);
void WriteWorkFile(vector<CLab> &LabVec);
void ReadWorkFile(CLabVecRang &LabVecRang);
void Load(CSequentialPoint &rhs);
bool Empty();
void AddDataPoint(CDataPoint pt);
void DelAllPt();//删除所有数据点
void DelLastDataPoint();//删除最后一个节点
bool IsInRect(DbRect rect,bool bNeedAllIn);
DbRect GetRect();
void Draw(CDC* pDC,CPen&Pen);
void DrawLastLine(CDC* pDC,CPen &Pen);
void DrawNode(CDC* pDC);
void GetLineInRect(DbRect &rect,vector<DbLine> &DataPtLineVec);
void GetNodePtLineInRect(DbRect &rect,vector<DbLine> &DataPtLineVec);
void Operate(SObjOperatePar par);
vector<CDataPoint>& GetPtContainer(){return m_PtContainer;};
void SetLastPoint(CDataPoint &pt);
Dbxy GetFirstPt();
Dbxy GetLastPt();
int GetNodePtIdx(Dbxy pt);
void DelNodePtByIdx(int idx);
void SetNodePtByIdx(int idx,Dbxy pt);
void InsertNode(int idx,Dbxy pt);
int GetPtCnt(){return m_PtContainer.size();};
bool HasNodeInRect(DbRect rect);
void GetPtData(vector<vector<Dbxy>> &vec,int PenNum = -1);
bool IntersectWithLine(DbLine &line);
private:
void DrawDataPointVec(CDC* pDC,vector<CDataPoint> &vec);
void Reverse();
void OperateExt(SObjOperatePar par);
private:
vector<CDataPoint> m_PtContainer;//坐标数据的容器
};