////////////////////////////////////////////////////////////////////////////// //文件 CurveRedundant.h //主要功能: // 基础类库 //程序编写: 2005-12-07 ///////////////////////////////////////////////////////////////////////////// #pragma once #include "curve.h" class AFX_EXT_CLASS CCurveRedundant { public: CCurveRedundant(void); CCurveRedundant(CCurve& curve); CCurveRedundant(double *x,double *y,double *z,double *l,int num); virtual ~CCurveRedundant(void); public: void Execute(double error); void Write(CFile &fw,int nPoint=2); int GetRedundantCurve(CCurve& curve); int GetCount(); double x(int nIndex); double y(int nIndex); double z(int nIndex); double l(int nIndex); void SetCurve(CCurve& curve); void Clear(void); BOOL IsRedundant(void); //曲线冗余是否成功 int GetRealIndex(int nIndex); //根据冗余后的索引号获得在曲线中的实际索引号 void SetRealIndex(int nIndex, int nReadIndex); //设置实际索引号 void AddRealIndex(int nRealIndex); //增加实际索引号 private: BOOL bNewCurve; double MinDistance; void GetNewPoint(int n1,int n2); void CloneData(double *newx,double *newy,double *newz,double *newl); protected: static int CompareInt(const void *e1,const void * e2); int mark_num; int *mark; CCurve *m_pCurve; };