QGISAlgorithmLib.h
资源名称:QGIS.rar [点击查看]
上传用户:oybseng
上传日期:2015-04-27
资源大小:7831k
文件大小:3k
源码类别:
GDI/图象编程
开发平台:
Visual C++
- // QGISAlgorithmLib.h: interface for the CQGISAlgorithmLib class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_QGISALGORITHMLIB_H__F7E0915B_63B3_49A4_8022_E92A2AC2EBDA__INCLUDED_)
- #define AFX_QGISALGORITHMLIB_H__F7E0915B_63B3_49A4_8022_E92A2AC2EBDA__INCLUDED_
- #include "....QObjectsincludeQBaseObj.h"
- #include "....QObjectsincludeQPointObj.h"
- #include "....QObjectsincludeQPointArray.h"
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- //GIS常用算法库
- //////////////////////////////////////////
- ///***************CQGIS****************///
- ///类 名:CQGISAlgorithmLib
- ///基 型:无
- ///说 明:GIS常用算法库
- ///***************CQGIS****************///
- //////////////////////////////////////////
- class AFX_EXT_CLASS CQGISAlgorithmLib
- {
- public:
- CQGISAlgorithmLib();
- virtual ~CQGISAlgorithmLib();
- public:
- // 判断两条直线是否相交
- static BOOL IsLineCross(CQPoint p1,CQPoint p2,CQPoint q1,CQPoint q2);
- //计算两条线段的交点
- static void CalLineCrossPoint(CQPoint pp1,CQPoint pp2,CQPoint qq1,CQPoint qq2,CQPointArray * pResult);
- static double RadianToDegree(double fRadian);
- static double DegreeToRadian(double fDegree);
- //线条光滑及线条数据压缩算法处理
- //1-插值曲线; 2-二次B样条; 3-三次B样条
- //1-插值曲线就是线性插值 两个 重载函数
- static void Interpolation_curve(double * FromX,double * FromY,double * ToX,double * ToY,int nBegin,int nEnd);
- static void Interpolation_curve(float * FromX,float * FromY,float * ToX,float * ToY,int nBeign,int nEnd);
- //二次B样条
- //(二次B样条曲线)
- static void B2_curves(float * x, float * y, float * tx, float * ty, int n, int m);
- static void B2_curves(double * x, double * y, double * tx, double * ty, int n, int m);
- //(三次B样条曲线)
- static void B3_curves(float * x, float * y, float * tx, float * ty, int n, int m);
- static void B3_curves(double * x, double * y, double * tx, double * ty, int n, int m);
- //三次样条函数插值(第二种边界条件)
- // 三次样条函数插值(第二种边界条件)
- static float Spline2D(float * x, float * y, float * tx, float * ty, int N, int k);
- static double Spline2D(double * x, double * y, double * tx, double * ty, int N, int k);
- static void SplineClean2D(float * x, float * y, float * tx, float * ty, int n, int m);
- static void SplineClean2D(double * x, double * y, double * tx, double * ty, int n, int m);
- //线条抽稀
- static BOOL PtListBeThin(CQPointArray & ptArray,double beThinElem = 0.0001f);
- //道格拉斯-普克法算法描述
- //首先,将一条曲线首、末点连一条直线,求出其余各点到该直线的距离
- //选其最大者与规定的临界值相比较,若大于临界值,则离该直线距离最
- //大的点保留,否则将直线两端间各点全部舍去
- static void PtListLess(CQPointArray & ptArray,double beThin = 0.0001f);
- static double ConvertFontPttoMM(double pt);
- protected:
- //限制内部使用
- static void CalSameLineCrossPoint(CQPoint pp1,CQPoint pp2,CQPoint qq1,CQPoint qq2,CQPointArray * pResult);
- };
- #endif // !defined(AFX_QGISALGORITHMLIB_H__F7E0915B_63B3_49A4_8022_E92A2AC2EBDA__INCLUDED_)