www.pudn.com > 20065291434354190.rar > XSpot.h


#pragma once 
 
#include  
using namespace Gdiplus; 
 
#include  
using namespace std; 
 
class XTube; 
enum SpotTypeEnum 
{ 
	STE_NULL, 
	STE_LEFT, 
	STE_RIGHT, 
	STE_CIRCLE, 
	STE_SMALL_CIRCLE, 
	STE_MEDIUM_CIRCLE, 
	STE_LARGE_CIRCLE,	//大圆 
	STE_START, 
	STE_END, 
	STE_INNER, // 
	STE_OUTER, // 
	STE_AUTO, 
}; 
 
enum IconTypeEnum 
{ 
	ITE_NULL,  
}; 
 
class XSpot 
{ 
	friend class XTube; 
 
private: 
	XTube* parent; 
 
protected: 
	PointF position; //位置 
 
	SpotTypeEnum type; 
 
	CString name; 
	CString title; 
	CString description; 
 
	IconTypeEnum icon; 
 
	Color color; 
 
	Color fontColor; 
	CString fontFace; 
	REAL fontHeight; 
	int fontStyle; 
 
protected: 
	//<< 
	PointF left; 
	PointF right; 
	PointF center; 
 
	REAL angle; 
	REAL startAngle; 
	REAL sweepAngle; 
	REAL radius; 
	//>> 
 
	//<< 
	REAL ANGLE; 
	PointF A; 
	PointF B1, B2; //方块的位置 
	PointF C1, C2; //label的位置 
	//>> 
 
public: 
	XSpot (PointF pt = PointF (0.0, 0.0), SpotTypeEnum vType = STE_LEFT, CString vName = ""); 
	XSpot (Point pt, SpotTypeEnum vType = STE_LEFT, CString vName = ""); 
 
	bool operator == (const XSpot& vSpot); 
 
	void SetParent (XTube* vParent); 
	XTube* GetParent () {return parent;} 
 
	void SetType (SpotTypeEnum vType); 
	SpotTypeEnum GetType () {return type;} 
 
	void SetName (CString vName) {name = vName;}; 
	CString GetName () {return name;} 
 
	void SetTitle (CString vTitle) {title = vTitle;}; 
	CString GetTitle () {return title;} 
 
	void SetDescription (CString vDescription) {description = vDescription;} 
	CString GetDescription () {return description;} 
 
	void SetPosition (PointF vPosition) {position = vPosition;} 
	PointF GetPosition () {return position;} 
 
	void SetColor (Color vColor) {color = vColor;} 
	Color GetColor () {return color;} 
 
	void SetFontColor (Color vFontColor) {fontColor = vFontColor;} 
	Color GetFontColor () {return fontColor;} 
 
	void SetFontFace (CString vFontFace) {fontFace = vFontFace;} 
	CString GetFontFace () {return fontFace;} 
 
	void SetFontHeight (REAL vFontHeight) {fontHeight = vFontHeight;} 
	REAL GetFontHeight () {return fontHeight;} 
 
	void SetFontStyle (int vFontStyle) {fontStyle = vFontStyle;} 
	int GetFontStyle () {return fontStyle;} 
 
public: 
	int Move (float x, float y); 
	int Draw (Graphics* g, map* spotMap = NULL); 
};