⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cnsdftctl.h

📁 地理信息共享:读写中国地球空间数据交换格式源码2
💻 H
字号:
#if !defined(AFX_CNSDFTCTL_H__335940A5_39E4_11D5_B912_0000E86BCC9F__INCLUDED_)
#define AFX_CNSDFTCTL_H__335940A5_39E4_11D5_B912_0000E86BCC9F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// CNSDFTCtl.h : Declaration of the CCNSDFTCtrl ActiveX Control class.

/////////////////////////////////////////////////////////////////////////////
// CCNSDFTCtrl : See CNSDFTCtl.cpp for implementation.


////////////////////////////////////////


struct FileHead
{

      CString DataMark;
	   float VerSion;
		char Unit;
		int Dim;
		int Topo;
	    float MinX;
		float MinY;
		float MinZ;
		float MaxX;
		float MaxY;
		float MaxZ;
		float ScaleM;
		CString Projection;
		CString Spheroid;
		CString Parameters;
		CString Date;
	    char Separator;
		char Coordinate;
};
///////////////////////////////////////////////////

struct Feature
{
	CString Code;
	CString Name;
	CString Shape;
	int Color;
	CString ListName;
	Feature* pNext;
};
/////////////////////////////////////////////////////
   struct Item
	{
		CString Name;
        CString Type;
		int Width;
		int Pric;
		
	};

struct TableStructure
{
	CString ListName;
	int ItemNum;
    Item* pItem;
	TableStructure* pTblNext;
};
////////////////////////////////////////////////////////////////////

struct PointData
{
   	CString AimCode;
	CString FeatureCode;
	CString LayerName;
	int PointMark;
	float X;
	float Y;
	//float Z;
	//int LinkObjectNum;
    //CString* pHeadLkAimCode;
	PointData* pNext;
};

///////////////////////////////////////////////////////////////
struct Point
{
	float X;
	float Y;
	float Z;
};
struct LineData
{
	CString AimCode;
	CString FeatureCode;
	CString LayerName;
	int LineMark;
	int PointNum;
	int ChildNum;
	int* pMemberChild;
    Point* pMemberPoint;
	LineData *pNext;
};

//////////////////////////////////////////////////////////////////
struct PolygonData
{
  CString AimCode;
  CString FeatureCode;
  CString LayerName;
   float labX;
   float labY;
   int PointNum;
   int ChildNum;
   int* pMemberChild;
   Point* pMemberPoint;
   PolygonData *pNext;
};
/////////////////////////////////////////////////////////////
struct Annotation
{
  CString AimCode;
  CString FeatureCode;
  CString LayerName;
  CString Font;
  int Color;
  int Pound;
  int Shape;
  char Udline;
  float Size;
  float Width;
  float High;
  float Intevel;
  CString Content;
  int AntnNum;
  Point *pMemberPoint;
  Annotation *pNext;

};
//////////////////////////////////////////////////////////////////
struct RecordList
{
	CString* Record;
    RecordList* pNext;
};
struct Attribute
{
	CString ListName;
	int ItemNum;
    RecordList *pRecordList;
    Attribute* pNext;
};
////////////////////////////


class CCNSDFTCtrl : public COleControl 
{
	DECLARE_DYNCREATE(CCNSDFTCtrl)

// Constructor
public:
	CCNSDFTCtrl();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCNSDFTCtrl)
	public:
	virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
	virtual void DoPropExchange(CPropExchange* pPX);
	virtual void OnResetState();
	virtual DWORD GetControlFlags();
	//}}AFX_VIRTUAL

// Implementation
protected:
	void WriteVctAttribute(FILE* pfile);
	void WriteVctAnnotation(FILE* pfile);
	void WriteVctPolygon(FILE* pfile);
	void WriteVctLine(FILE* pfile);
	void WriteVctPoint(FILE* pfile);
	void WriteVctGraphy();
	void WriteVctTableStructure(FILE* pfile);
	void WriteVctFeature(FILE* pfile);
	void WriteVctFileHead(FILE* pfile);
	void ReadVctAttribute(FILE* pfile);
	void ReadVctAnnotation(FILE* pfile);
	void ReadVctPolygon(FILE* pfile);
	void ReadVctLine(FILE* pfile);
	void ReadVctPoint(FILE* pfile);
	void ReadVctGraphy();
	void ReadVctTableStruct(FILE* pfile);
	void ReadVctFeature(FILE* pfile);
	void ReadVctFileHead(FILE* file);
	long m_OutFormat;
	long m_InputFormat;
    FileHead m_filehead;
    Feature *pHeadFeature;
	TableStructure *pHeadTblStruct;
	PointData *pHeadPointData;
    LineData *pHeadLineData;
    PolygonData* pHeadPolygon;
	Annotation *pHeadAntation;
	Attribute *pHeadAbute;
	~CCNSDFTCtrl();

	DECLARE_OLECREATE_EX(CCNSDFTCtrl)    // Class factory and guid
	DECLARE_OLETYPELIB(CCNSDFTCtrl)      // GetTypeInfo
	DECLARE_PROPPAGEIDS(CCNSDFTCtrl)     // Property page IDs
	DECLARE_OLECTLTYPE(CCNSDFTCtrl)		// Type name and misc status

// Message maps
	//{{AFX_MSG(CCNSDFTCtrl)
		// NOTE - ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

// Dispatch maps
	//{{AFX_DISPATCH(CCNSDFTCtrl)
	CString m_InputFilename;
	afx_msg void OnInputFilenameChanged();
	CString m_OutFilename;
	afx_msg void OnOutFilenameChanged();
	afx_msg long GetInputFormat();
	afx_msg void SetInputFormat(long nNewValue);
	afx_msg long GetOutFormat();
	afx_msg void SetOutFormat(long nNewValue);
	afx_msg void ReadVctData();
	afx_msg void WriteVctData();
	//}}AFX_DISPATCH
	DECLARE_DISPATCH_MAP()

	afx_msg void AboutBox();

// Event maps
	//{{AFX_EVENT(CCNSDFTCtrl)
	//}}AFX_EVENT
	DECLARE_EVENT_MAP()

// Dispatch and event IDs
public:
	char* fgetNoEmpty(char* buffer,int n,FILE *stream);
	enum {
	//{{AFX_DISP_ID(CCNSDFTCtrl)
	dispidInputFilename = 1L,
	dispidOutFilename = 2L,
	dispidInputFormat = 3L,
	dispidOutFormat = 4L,
	dispidReadData = 5L,
	dispidWriteData = 6L,
	//}}AFX_DISP_ID
	};

	
private:
	int GetShang(int dividend,int divisor);
	FILE* pfile;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CNSDFTCTL_H__335940A5_39E4_11D5_B912_0000E86BCC9F__INCLUDED)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -