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

📄 mappershape.h

📁 vc 和mapobjects地理信息系统组件开发 很有启发意义和参考价值
💻 H
字号:
// MapperShape.h: interface for the CMapperShape class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MAPPERSHAPE_H__72FBD1E2_A9EC_4E72_B46E_8B0B52D86F32__INCLUDED_)
#define AFX_MAPPERSHAPE_H__72FBD1E2_A9EC_4E72_B46E_8B0B52D86F32__INCLUDED_

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

struct SMapperTextInfo
{
	CMoLine  *line;
	double	 height;
	COLORREF color;
	char	 text[64];
};

class	CMoPointArray : public CTypedPtrArray<CPtrArray, CMoPoint*> {};
class	CMoLineArray	: public CTypedPtrArray<CPtrArray, CMoLine*> {};
class	CMoRectArray : public CTypedPtrArray<CPtrArray, CMoRectangle*> {};
class	CMoEllipseArray : public CTypedPtrArray<CPtrArray, CMoEllipse*> {};
class	CMoTextArray : public CTypedPtrArray<CPtrArray, SMapperTextInfo*> {};

class CMapperShape : public CObject  
{
	struct SMsfHeadInfo
	{
		SMsfHeadInfo()
		{
			memset(this,0,sizeof(SMsfHeadInfo));
		}

		short		iPoints;
		short		iLines;
		short		iRects;		//保存使用rect
		short		iCircles;	//保存使用rect
		short		iEllipses;	//保存使用rect
		short		iPolys;
		short		iTexts;
		char		szB[256];		//预留
		long		mapper;	//20030701
	};

	struct SMsfShapeInfo
	{
		SMsfShapeInfo()
		{
			memset(this,0,sizeof(SMsfShapeInfo));
		}

		short	 shape;	//1,2,3,4,5,6 //在运行时候未使用
		short	 style;	//
		short	 size;
		double	 height;
		COLORREF color;
		BOOL	 bOutline;
		COLORREF outlineColor;
		char	 text[64];
		long	 pts;	//rect,circle,ellipse=4;Text=char count; //在运行时候未使用
	};

	struct SelectedInfo
	{
		short type;		//类型
		short index;	//序号,no selected=-1
	};

protected:
	SelectedInfo m_tSel;
	CMoPointArray	m_oaPoints;
	CMoLineArray	m_oaLines;
	CMoRectArray	m_oaRects;
	CMoEllipseArray m_oaCircles;
	CMoEllipseArray m_oaEllipses;
	CMoPolyArray	m_oaPolys;
	CMoTextArray	m_oaTexts;

	//使用统一显示参数,如果需要可以修改到shape结构内,使用自己的显示参数
	//使用统一的,可以不需要先选择对象
	SMsfShapeInfo	m_tPointInfo;
	SMsfShapeInfo	m_tLineInfo;
	SMsfShapeInfo	m_tRectInfo;
	SMsfShapeInfo	m_tCircleInfo;
	SMsfShapeInfo	m_tEllipseInfo;
	SMsfShapeInfo	m_tPolyInfo;

public:
	BOOL HadSel();
	BOOL QueryFromShape(CMap1 &map,CMoMapLayer &layer,CMoRecordset &rs);
	void Pan(double dx,double dy);
	BOOL AddFromQuery(CMoMapLayer &layer,CMoRecordset &rs);
	BOOL Read(CString sPathFile);
	BOOL Save(CString sPathFile);
	void SetSelNone();
	BOOL mo_ExportTexts(CString sPathFile);
	BOOL mo_ExportPolys(CString sPathFile);
	BOOL mo_ExportEllipses(CString sPathFile);
	BOOL mo_ExportCircles(CString sPathFile);
	BOOL mo_ExportRects(CString sPathFile);
	BOOL mo_ExportLines(CString sPathFile);
	BOOL mo_ExportPoints(CString sPathFile);
	void mo_ReleaseTexts();
	void mo_ReleasePolys();
	void mo_ReleaseEllipses();
	void mo_ReleaseCircles();
	void mo_ReleaseRects();
	void mo_ReleaseLines();
	void mo_ReleasePoints();
	BOOL Setup();
	void AddFromFile(CMap1 &map);
	void Edit();
	void DeleteShape();
	BOOL HitTest(CMap1 &map,long X,long Y);
	void mo_AddText(CMap1 &map);
	void mo_AddPoly(CMap1 &map);
	void mo_AddEllipse(CMap1 &map);
	void mo_AddCircle(CMap1 &map);
	void mo_AddRect(CMap1 &map);
	void mo_AddLine(CMap1 &map);
	void mo_AddPoint(CMap1 &map,long X,long Y);
	void Draw(CMap1 &map);
	CMapperShape();
	virtual ~CMapperShape();

};

#endif // !defined(AFX_MAPPERSHAPE_H__72FBD1E2_A9EC_4E72_B46E_8B0B52D86F32__INCLUDED_)

⌨️ 快捷键说明

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