////////////////////////////////////////////////////////////////////////////// //文件 CurveRedundant.h ///////////////////////////////////////////////////////////////////////////// #pragma once #ifndef AFX_EXT_CLASS #define AFX_EXT_CLASS Q_DECL_IMPORT #endif #include "mycurve.h" namespace NVoronoi { class AFX_EXT_CLASS CCurveRedundant { public: CCurveRedundant(void); CCurveRedundant(CMyCurve& curve); CCurveRedundant(double *x, double *y, double *z, double *l, int num); virtual ~CCurveRedundant(void); public: void Execute(double error); bool GetEqualIntervalCurve(double interval, CMyCurve& curDest); int GetRedundantCurve(CMyCurve& curve); int GetCount(); double x(int nIndex); double y(int nIndex); double z(int nIndex); double l(int nIndex); void SetCurve(CMyCurve& 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; CMyCurve *m_pCurve; }; };