GetDEMList.h
上传用户:xuczgm
上传日期:2022-04-25
资源大小:8601k
文件大小:3k
- // GetDEMList.h: interface for the CGetDEMList class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_GETDEMLIST_H__9DD769BE_7310_4EE9_98CD_C7D507C30CA4__INCLUDED_)
- #define AFX_GETDEMLIST_H__9DD769BE_7310_4EE9_98CD_C7D507C30CA4__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- ////////////////////////////////////////////////////////////////////////
- /*功能:得到某一图幅的某一范围的显示列表
- 操作方法:先调用函数OpenDEMFile获取DEM数据,然后反复调用函数GetList得到
- 所需范围的显示列表和经纬信息,需要接收的内容有显示列表和纹理对象号
- ////////////////////////////////////////////////////////////////////////
- */
- #include "Dib.h"
- struct GLTXTLOAD_DEM
- {
- GLint format;
- GLint perpixel;
- GLint Width;
- GLint Height;
- BYTE* bits;
- };
- class CGetDEMList : public CObject
- {
- public:
- CGetDEMList();
- virtual ~CGetDEMList();
- //*******************************************
- //////////********DEM***********/////////////
- bool OpenDEMFile(CString strFilePath,double dHeightScale);
- void GetList(int iRow,int iCol,int iGuadrantNum,int iDEMTextureObjectID,
- double *pGuadrantLeftBottomPointL,double *pGuadrantLeftBottomPointB,
- double *pGuadrantLSpace,double *pGuadrantBSpace);
- void LoadGridTexture(CString strTextureFilePath,GLuint *iDEMTextureObjectID);
- // GLuint m_iDEMTextureObjectID;//DEM纹理对象号
- //*******************************************
- //////////********天空***********/////////////
- GLuint GetSkyList(CString strFileName,GLfloat fCenterPointX,GLfloat fCenterPointY,
- GLfloat fCenterPointZ,GLfloat fSkySizeTop,GLfloat fSkySizeBottom);//纹理文件名、中心点、顶部与底部
- GLuint m_iSkyTextureObjectID;//天空纹理对象ID
- //*******************************************
- //////////********纹理物体**********/////////////
- GLuint GetTextureObjectList(CString strFilePath,GLfloat fXLong,GLfloat fYLong);//获取纹理物体显示列表
- GLuint m_iTextureObjectTextureObjectID;
- private:
- //*******************************************
- //DEM
- //属性
- double **m_pSimulantHeight;
- float **m_pRealHeight;
- double ***Nvs;
- double ***AverNvs;
- double **m_pGridL,**m_pGridB;
- double m_dSimulantHeightMin,m_dSimulantHeightMax;
- float m_fRealHeightMin,m_fRealHeightMax;
- double m_dLeftBottomPointL,m_dLeftBottomPointB;
- double m_dSpace;
- int m_iRow,m_iCol;
- bool m_bIsGetDEMData;
- //函数
- void MallocGrid(int iRow,int iCol);
- void MallocNormal(int iRow,int iCol);
- void FreeGrid(int iRow,int iCol);
- void FreeNormal(int iRow,int iCol);
- void GetNormal(int iRow,int iCol);
- void GetFacetNormal(int iRow,int iCol);
- void GetGridNormal(int iRow,int iCol);
- void ReduceToUnit(double *vector);
- void GetTriangNormal(double v[3][3],double out[3]);
- //*************************************************
- long ScanBytes(int pixWidth, int bitsPixel);
- BOOL ScaleImage(CDib &dib, GLTXTLOAD_DEM &p, int ifTrans);
- void LoadTexture(char *filename,int ifTrans);
- };
- #endif // !defined(AFX_GETDEMLIST_H__9DD769BE_7310_4EE9_98CD_C7D507C30CA4__INCLUDED_)