GetDEMList.h
上传用户:xuczgm
上传日期:2022-04-25
资源大小:8601k
文件大小:3k
源码类别:

图形图像处理

开发平台:

Visual C++

  1. // GetDEMList.h: interface for the CGetDEMList class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_GETDEMLIST_H__9DD769BE_7310_4EE9_98CD_C7D507C30CA4__INCLUDED_)
  5. #define AFX_GETDEMLIST_H__9DD769BE_7310_4EE9_98CD_C7D507C30CA4__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. ////////////////////////////////////////////////////////////////////////
  10. /*功能:得到某一图幅的某一范围的显示列表
  11. 操作方法:先调用函数OpenDEMFile获取DEM数据,然后反复调用函数GetList得到
  12. 所需范围的显示列表和经纬信息,需要接收的内容有显示列表和纹理对象号
  13. ////////////////////////////////////////////////////////////////////////
  14. */
  15. #include "Dib.h"
  16. struct GLTXTLOAD_DEM
  17. {
  18. GLint    format;
  19. GLint    perpixel;
  20. GLint    Width;
  21. GLint    Height;
  22. BYTE*    bits;
  23. };
  24. class CGetDEMList : public CObject  
  25. {
  26. public:
  27. CGetDEMList();
  28. virtual ~CGetDEMList();
  29. //*******************************************
  30. //////////********DEM***********/////////////
  31. bool   OpenDEMFile(CString strFilePath,double dHeightScale);
  32. void   GetList(int iRow,int iCol,int iGuadrantNum,int iDEMTextureObjectID,
  33. double *pGuadrantLeftBottomPointL,double *pGuadrantLeftBottomPointB,
  34. double *pGuadrantLSpace,double *pGuadrantBSpace);
  35. void   LoadGridTexture(CString strTextureFilePath,GLuint *iDEMTextureObjectID);
  36. // GLuint   m_iDEMTextureObjectID;//DEM纹理对象号
  37. //*******************************************
  38. //////////********天空***********/////////////
  39. GLuint   GetSkyList(CString strFileName,GLfloat fCenterPointX,GLfloat fCenterPointY,
  40. GLfloat fCenterPointZ,GLfloat fSkySizeTop,GLfloat fSkySizeBottom);//纹理文件名、中心点、顶部与底部
  41. GLuint   m_iSkyTextureObjectID;//天空纹理对象ID
  42. //*******************************************
  43. //////////********纹理物体**********/////////////
  44. GLuint   GetTextureObjectList(CString strFilePath,GLfloat fXLong,GLfloat fYLong);//获取纹理物体显示列表
  45. GLuint   m_iTextureObjectTextureObjectID;
  46. private:
  47. //*******************************************
  48. //DEM
  49. //属性
  50. double **m_pSimulantHeight;
  51. float  **m_pRealHeight;
  52. double ***Nvs;
  53. double ***AverNvs;
  54. double **m_pGridL,**m_pGridB;
  55. double m_dSimulantHeightMin,m_dSimulantHeightMax;
  56. float  m_fRealHeightMin,m_fRealHeightMax;
  57. double m_dLeftBottomPointL,m_dLeftBottomPointB;
  58. double m_dSpace;
  59. int    m_iRow,m_iCol;
  60. bool   m_bIsGetDEMData;
  61. //函数
  62. void   MallocGrid(int iRow,int iCol);
  63. void   MallocNormal(int iRow,int iCol);
  64. void   FreeGrid(int iRow,int iCol);
  65. void   FreeNormal(int iRow,int iCol);
  66. void   GetNormal(int iRow,int iCol);
  67. void   GetFacetNormal(int iRow,int iCol);
  68. void   GetGridNormal(int iRow,int iCol);
  69. void   ReduceToUnit(double *vector);
  70. void   GetTriangNormal(double v[3][3],double out[3]);
  71. //*************************************************
  72. long   ScanBytes(int pixWidth, int bitsPixel);
  73. BOOL   ScaleImage(CDib &dib, GLTXTLOAD_DEM &p, int ifTrans);
  74. void   LoadTexture(char *filename,int ifTrans);
  75. };
  76. #endif // !defined(AFX_GETDEMLIST_H__9DD769BE_7310_4EE9_98CD_C7D507C30CA4__INCLUDED_)